Drop the alternatives system

We haven't made use of it in a long while and it is just making the spec
file more complicated than it needs be.
This commit is contained in:
Kalev Lember 2019-02-12 09:47:59 +01:00
parent 894bbe8987
commit 749bcb7507

View File

@ -3,7 +3,7 @@
Name: vala
Version: 0.43.90
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A modern programming language for GNOME
# Most files are LGPLv2.1+, curses.vapi is 2-clause BSD
@ -23,11 +23,10 @@ BuildRequires: libxslt
# for tests
BuildRequires: dbus-x11
# alternatives
# alternatives; remove in F32
%global vala_binaries vala valac vala-gen-introspect vapigen
%global vala_manpages valac vala-gen-introspect vapigen
Requires(posttrans): %{_sbindir}/alternatives
Requires(preun): %{_sbindir}/alternatives
Requires(pre): %{_sbindir}/alternatives
Requires: libvala%{?_isa} = %{version}-%{release}
@ -138,17 +137,7 @@ make %{?_smp_mflags}
%install
%make_install
# remove symlinks, using alternatives
for f in %{vala_binaries}
do
rm $RPM_BUILD_ROOT%{_bindir}/$f
touch $RPM_BUILD_ROOT%{_bindir}/$f
done
for f in %{vala_manpages}
do
rm $RPM_BUILD_ROOT%{_mandir}/man1/$f.1*
touch $RPM_BUILD_ROOT%{_mandir}/man1/$f.1.gz
done
# own this directory for third-party *.vapi files
mkdir -p $RPM_BUILD_ROOT%{_datadir}/vala/vapi
find %{buildroot} -name '*.la' -exec rm -f {} ';'
@ -158,40 +147,29 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
make check
%posttrans
for f in %{vala_binaries};
do
%{_sbindir}/alternatives --install %{_bindir}/$f \
$f %{_bindir}/$f-%{api_ver} %{priority} || :
done
for f in %{vala_manpages};
do
%{_sbindir}/alternatives --install %{_mandir}/man1/$f.1.gz \
$f.1.gz %{_mandir}/man1/$f-%{api_ver}.1.gz %{priority} || :
done
%preun
for f in %{vala_binaries};
do
%{_sbindir}/alternatives --remove $f \
%{_bindir}/$f-%{api_ver} || :
done
for f in %{vala_manpages};
do
%{_sbindir}/alternatives --remove $f.1.gz \
%{_mandir}/man1/$f-%{api_ver}.1.gz || :
done
# Drop the pre script in F32
%pre
if [ $1 -gt 1 ] ; then
for f in %{vala_binaries};
do
%{_sbindir}/alternatives --remove-all $f >& /dev/null || :
done
for f in %{vala_manpages};
do
%{_sbindir}/alternatives --remove-all $f.1.gz >& /dev/null || :
done
fi
%files
%license COPYING
%ghost %{_bindir}/vala
%ghost %{_bindir}/valac
%ghost %{_bindir}/vala-gen-introspect
%ghost %{_bindir}/vapigen
%{_bindir}/vala
%{_bindir}/vala-%{api_ver}
%{_bindir}/valac
%{_bindir}/valac-%{api_ver}
%{_bindir}/vala-gen-introspect
%{_bindir}/vala-gen-introspect-%{api_ver}
%{_bindir}/vapigen
%{_bindir}/vapigen-%{api_ver}
%{_libdir}/pkgconfig/vapigen*.pc
%{_libdir}/vala-%{api_ver}/
@ -199,11 +177,11 @@ done
%{_datadir}/aclocal/vapigen.m4
%{_datadir}/vala/
%{_datadir}/vala-%{api_ver}/
%ghost %{_mandir}/man1/valac.1.gz
%ghost %{_mandir}/man1/vala-gen-introspect.1.gz
%ghost %{_mandir}/man1/vapigen.1.gz
%{_mandir}/man1/valac.1.gz
%{_mandir}/man1/valac-%{api_ver}.1.gz
%{_mandir}/man1/vala-gen-introspect.1.gz
%{_mandir}/man1/vala-gen-introspect-%{api_ver}.1.gz
%{_mandir}/man1/vapigen.1.gz
%{_mandir}/man1/vapigen-%{api_ver}.1.gz
%files -n libvala
@ -234,6 +212,9 @@ done
%changelog
* Tue Feb 12 2019 Kalev Lember <klember@redhat.com> - 0.43.90-2
- Drop the alternatives system
* Mon Feb 04 2019 Kalev Lember <klember@redhat.com> - 0.43.90-1
- Update to 0.43.90