diff --git a/ebtables.changes b/ebtables.changes index 4d988f6..0c942a7 100644 --- a/ebtables.changes +++ b/ebtables.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Aug 20 18:06:09 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Wed Sep 2 14:23:48 UTC 2020 - Dominique Leuenberger diff --git a/ebtables.spec b/ebtables.spec index e2c14a8..b2003d2 100644 --- a/ebtables.spec +++ b/ebtables.spec @@ -1,7 +1,7 @@ # # spec file for package ebtables # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + #Compat macro for new _fillupdir macro introduced in Nov 2017 %if ! %{defined _fillupdir} %define _fillupdir /var/adm/fillup-templates @@ -41,8 +47,12 @@ BuildRequires: xz Requires: netcfg >= 11.6 Requires(pre): %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun): update-alternatives +%endif %{?systemd_ordering} %description @@ -99,20 +109,50 @@ rm -rfv %{buildroot}%{_initrddir} # not used rm -f "%{buildroot}/%{_sysconfdir}/ebtables-config" for i in ebtables ebtables-restore ebtables-save; do - ln -fsv "/etc/alternatives/$i" "%{buildroot}/%{_sbindir}/$i" +%if ! %{with libalternatives} + ln -fsv "/etc/alternatives/$i" "%{buildroot}/%{_sbindir}/$i" +%else + ln -fsv %{_bindir}/alts "%{buildroot}/%_sbindir/$i" +%endif done echo ".so ebtables-legacy.8" >"%buildroot/%_mandir/man8/ebtables.8" # no headers to make use of it rm -f "%buildroot/%_libdir/libebtc.la" "%buildroot/%_libdir/libebtc.so" +%if %{with libalternatives} +mkdir -p %{buildroot}%{_datadir}/libalternatives/ebtables +cat > %{buildroot}%{_datadir}/libalternatives/ebtables/1.conf < %{buildroot}%{_datadir}/libalternatives/ebtables-restore/1.conf < %{buildroot}%{_datadir}/libalternatives/ebtables-save/1.conf <