From 2dd901f8a9838a269dfb187e93f1a02ba8c1e995610639f36d8a42890cb2b942 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 16 Sep 2021 08:52:43 +0000 Subject: [PATCH 1/5] Accepting request 919462 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/919462 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iptables?expand=0&rev=144 --- iptables.changes | 5 ++ iptables.spec | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/iptables.changes b/iptables.changes index 2a6e4c4..6518b77 100644 --- a/iptables.changes +++ b/iptables.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 3 07:13:19 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Fri Jan 15 22:34:25 UTC 2021 - Jan Engelhardt diff --git a/iptables.spec b/iptables.spec index d250b5a..a3bb209 100644 --- a/iptables.spec +++ b/iptables.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + Name: iptables Version: 1.8.7 Release: 0 @@ -43,8 +49,14 @@ BuildRequires: pkgconfig(libnfnetlink) >= 1.0.0 BuildRequires: pkgconfig(libnftnl) >= 1.1.6 Requires: netcfg >= 11.6 Requires: xtables-plugins = %version-%release +%if %{with libalternatives} +Requires: alts +Requires: libalternatives >= 1.2 +Requires(pre): update-alternatives +%else Requires(post): update-alternatives Requires(postun): update-alternatives +%endif # During the update to iptables 1.8, ip6tables-restore-translate, ip6tables-translate, # iptables-restore-translate and iptables-translate were moved from iptables-nft subpackage # (now iptables-backend-nft) to the main package so we need to add a conflict here otherwise @@ -181,12 +193,74 @@ rm -f "$b/%_sysconfdir/ethertypes" # -> netcfg for i in iptables iptables-restore iptables-save ip6tables ip6tables-restore \ ip6tables-save arptables arptables-restore arptables-save ebtables \ ebtables-restore ebtables-save; do +%if ! %{with libalternatives} ln -fsv "/etc/alternatives/$i" "$b/%_sbindir/$i" +%else + ln -fsv %{_bindir}/alts "$b/%_sbindir/$i" +%endif done + %if 0%{?suse_version} %fdupes %buildroot/%_prefix %endif +%if %{with libalternatives} +mkdir -p %{buildroot}%{_datadir}/libalternatives/iptables +cat > %{buildroot}%{_datadir}/libalternatives/iptables/1.conf < %{buildroot}%{_datadir}/libalternatives/iptables/2.conf < %{buildroot}%{_datadir}/libalternatives/arptables/2.conf < %{buildroot}%{_datadir}/libalternatives/ebtables/2.conf < 0 ] ; then + update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" +fi +%else %post update-alternatives \ --install "%_sbindir/iptables" iptables "%_sbindir/xtables-legacy-multi" 1 \ @@ -200,7 +274,17 @@ update-alternatives \ if test "$1" = 0; then update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" fi +%endif +%if %{with libalternatives} +%pre backend-nft +# removing old update-alternatives entries +if test "$1" = 0; then + update-alternatives --remove iptables "%_sbindir/xtables-nft-multi" + update-alternatives --remove arptables "%_sbindir/xtables-nft-multi" + update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" +fi +%else %post backend-nft update-alternatives \ --install "%_sbindir/iptables" iptables "%_sbindir/xtables-nft-multi" 2 \ @@ -222,6 +306,7 @@ if test "$1" = 0; then update-alternatives --remove arptables "%_sbindir/xtables-nft-multi" update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" fi +%endif %post -n libipq0 -p /sbin/ldconfig %postun -n libipq0 -p /sbin/ldconfig @@ -249,12 +334,28 @@ fi %_mandir/man1/*tables* %_mandir/man8/*tables* # backend-legacy (implicit) +%if ! %{with libalternatives} %ghost %_sysconfdir/alternatives/iptables %ghost %_sysconfdir/alternatives/iptables-restore %ghost %_sysconfdir/alternatives/iptables-save %ghost %_sysconfdir/alternatives/ip6tables %ghost %_sysconfdir/alternatives/ip6tables-restore %ghost %_sysconfdir/alternatives/ip6tables-save +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/iptables +%dir %{_datadir}/libalternatives/iptables-restore +%dir %{_datadir}/libalternatives/iptables-save +%dir %{_datadir}/libalternatives/ip6tables +%dir %{_datadir}/libalternatives/ip6tables-restore +%dir %{_datadir}/libalternatives/ip6tables-save +%{_datadir}/libalternatives/iptables/1.conf +%{_datadir}/libalternatives/iptables-restore/1.conf +%{_datadir}/libalternatives/iptables-save/1.conf +%{_datadir}/libalternatives/ip6tables/1.conf +%{_datadir}/libalternatives/ip6tables-restore/1.conf +%{_datadir}/libalternatives/ip6tables-save/1.conf +%endif %_sbindir/iptables %_sbindir/iptables-restore %_sbindir/iptables-save @@ -263,6 +364,7 @@ fi %_sbindir/ip6tables-save %files backend-nft +%if ! %{with libalternatives} %ghost %_sysconfdir/alternatives/iptables %ghost %_sysconfdir/alternatives/iptables-restore %ghost %_sysconfdir/alternatives/iptables-save @@ -275,6 +377,33 @@ fi %ghost %_sysconfdir/alternatives/ebtables %ghost %_sysconfdir/alternatives/ebtables-restore %ghost %_sysconfdir/alternatives/ebtables-save +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/iptables +%dir %{_datadir}/libalternatives/iptables-restore +%dir %{_datadir}/libalternatives/iptables-save +%dir %{_datadir}/libalternatives/ip6tables +%dir %{_datadir}/libalternatives/ip6tables-restore +%dir %{_datadir}/libalternatives/ip6tables-save +%dir %{_datadir}/libalternatives/arptables +%dir %{_datadir}/libalternatives/arptables-restore +%dir %{_datadir}/libalternatives/arptables-save +%dir %{_datadir}/libalternatives/ebtables +%dir %{_datadir}/libalternatives/ebtables-restore +%dir %{_datadir}/libalternatives/ebtables-save +%{_datadir}/libalternatives/iptables/2.conf +%{_datadir}/libalternatives/iptables-restore/2.conf +%{_datadir}/libalternatives/iptables-save/2.conf +%{_datadir}/libalternatives/ip6tables/2.conf +%{_datadir}/libalternatives/ip6tables-restore/2.conf +%{_datadir}/libalternatives/ip6tables-save/2.conf +%{_datadir}/libalternatives/arptables/2.conf +%{_datadir}/libalternatives/arptables-restore/2.conf +%{_datadir}/libalternatives/arptables-save/2.conf +%{_datadir}/libalternatives/ebtables/2.conf +%{_datadir}/libalternatives/ebtables-restore/2.conf +%{_datadir}/libalternatives/ebtables-save/2.conf +%endif %_sbindir/iptables %_sbindir/iptables-restore %_sbindir/iptables-save From 0685558a3a52a740d8983635fad95e07f52b7fa8b23cfb5b69e9688994a33875 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 16 Sep 2021 09:51:41 +0000 Subject: [PATCH 2/5] compact all the alternative command lines OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iptables?expand=0&rev=145 --- iptables.spec | 127 ++++++++++++++++---------------------------------- 1 file changed, 41 insertions(+), 86 deletions(-) diff --git a/iptables.spec b/iptables.spec index a3bb209..60ce34c 100644 --- a/iptables.spec +++ b/iptables.spec @@ -26,7 +26,7 @@ Name: iptables Version: 1.8.7 Release: 0 Summary: IP packet filter administration utilities -License: GPL-2.0-only AND Artistic-2.0 +License: Artistic-2.0 AND GPL-2.0-only Group: Productivity/Networking/Security URL: https://netfilter.org/projects/iptables/ #Git-Clone: git://git.netfilter.org/iptables @@ -55,7 +55,7 @@ Requires: libalternatives >= 1.2 Requires(pre): update-alternatives %else Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives %endif # During the update to iptables 1.8, ip6tables-restore-translate, ip6tables-translate, # iptables-restore-translate and iptables-translate were moved from iptables-nft subpackage @@ -72,9 +72,9 @@ Summary: Metapackage to make nft the default backend for iptables/arptabl Group: Productivity/Networking/Security Requires: iptables >= 1.8.0 Requires(post): update-alternatives -Requires(postun): update-alternatives -Provides: iptables-nft = %{version}-%{release} -Obsoletes: iptables-nft < %{version}-%{release} +Requires(postun):update-alternatives +Provides: iptables-nft = %version-%release +Obsoletes: iptables-nft < %version-%release %description backend-nft Installation of this package adds higher priority alternatives (cf. @@ -194,9 +194,9 @@ for i in iptables iptables-restore iptables-save ip6tables ip6tables-restore \ ip6tables-save arptables arptables-restore arptables-save ebtables \ ebtables-restore ebtables-save; do %if ! %{with libalternatives} - ln -fsv "/etc/alternatives/$i" "$b/%_sbindir/$i" + ln -fsv "%_sysconfdir/alternatives/$i" "$b/%_sbindir/$i" %else - ln -fsv %{_bindir}/alts "$b/%_sbindir/$i" + ln -fsv %_bindir/alts "$b/%_sbindir/$i" %endif done @@ -205,52 +205,41 @@ done %endif %if %{with libalternatives} -mkdir -p %{buildroot}%{_datadir}/libalternatives/iptables -cat > %{buildroot}%{_datadir}/libalternatives/iptables/1.conf <"$b/%_datadir/libalternatives/iptables/1.conf" <<-EOF + binary=%_sbindir/xtables-legacy-multi + group=iptables, ip6tables, ip6tables-restore, ip6tables-save, iptables-restore, iptables-save + options=KeepArgv0 EOF -cat > %{buildroot}%{_datadir}/libalternatives/iptables/2.conf <"$b/%_datadir/libalternatives/iptables/2.conf" <<-EOF + binary=%_sbindir/xtables-nft-multi + group=iptables, ip6tables, ip6tables-restore, ip6tables-save, iptables-restore, iptables-save + options=KeepArgv0 EOF -mkdir -p %{buildroot}%{_datadir}/libalternatives/ip6tables -cp %{buildroot}%{_datadir}/libalternatives/iptables/1.conf %{buildroot}%{_datadir}/libalternatives/ip6tables/1.conf -cp %{buildroot}%{_datadir}/libalternatives/iptables/2.conf %{buildroot}%{_datadir}/libalternatives/ip6tables/2.conf -mkdir -p %{buildroot}%{_datadir}/libalternatives/ip6tables-restore -cp %{buildroot}%{_datadir}/libalternatives/iptables/1.conf %{buildroot}%{_datadir}/libalternatives/ip6tables-restore/1.conf -cp %{buildroot}%{_datadir}/libalternatives/iptables/2.conf %{buildroot}%{_datadir}/libalternatives/ip6tables-restore/2.conf -mkdir -p %{buildroot}%{_datadir}/libalternatives/ip6tables-save -cp %{buildroot}%{_datadir}/libalternatives/iptables/1.conf %{buildroot}%{_datadir}/libalternatives/ip6tables-save/1.conf -cp %{buildroot}%{_datadir}/libalternatives/iptables/2.conf %{buildroot}%{_datadir}/libalternatives/ip6tables-save/2.conf -mkdir -p %{buildroot}%{_datadir}/libalternatives/iptables-restore -cp %{buildroot}%{_datadir}/libalternatives/iptables/1.conf %{buildroot}%{_datadir}/libalternatives/iptables-restore/1.conf -cp %{buildroot}%{_datadir}/libalternatives/iptables/2.conf %{buildroot}%{_datadir}/libalternatives/iptables-restore/2.conf -mkdir -p %{buildroot}%{_datadir}/libalternatives/iptables-save -cp %{buildroot}%{_datadir}/libalternatives/iptables/1.conf %{buildroot}%{_datadir}/libalternatives/iptables-save/1.conf -cp %{buildroot}%{_datadir}/libalternatives/iptables/2.conf %{buildroot}%{_datadir}/libalternatives/iptables-save/2.conf +for i in ip6tables ip6tables-restore ip6tables-save iptables-restore iptables-save; do + mkdir -pv "$b/%_datadir/libalternatives/$i" + cp -av "$b/%_datadir/libalternatives/iptables/"*.conf "$b/%_datadir/libalternatives/$i/" +done -mkdir -p %{buildroot}%{_datadir}/libalternatives/arptables -cat > %{buildroot}%{_datadir}/libalternatives/arptables/2.conf <"$b/%_datadir/libalternatives/arptables/2.conf" <<-EOF + binary=%_sbindir/xtables-nft-multi + group=arptables, arptables-restore, arptables-save EOF -mkdir -p %{buildroot}%{_datadir}/libalternatives/arptables-restore -cp %{buildroot}%{_datadir}/libalternatives/arptables/2.conf %{buildroot}%{_datadir}/libalternatives/arptables-restore/2.conf -mkdir -p %{buildroot}%{_datadir}/libalternatives/arptables-save -cp %{buildroot}%{_datadir}/libalternatives/arptables/2.conf %{buildroot}%{_datadir}/libalternatives/arptables-save/2.conf +for i in arptables-restore arptables-save; do + mkdir -pv "$b/%_datadir/libalternatives/$i" + cp -av "$b/%_datadir/libalternatives/arptables/2.conf" "$b/%_datadir/libalternatives/$i/" +done -mkdir -p %{buildroot}%{_datadir}/libalternatives/ebtables -cat > %{buildroot}%{_datadir}/libalternatives/ebtables/2.conf <"$b/%_datadir/libalternatives/ebtables/2.conf" <<-EOF + binary=%_sbindir/xtables-nft-multi + group=ebtables, ebtables-restore, ebtables-save EOF -mkdir -p %{buildroot}%{_datadir}/libalternatives/ebtables-restore -cp %{buildroot}%{_datadir}/libalternatives/ebtables/2.conf %{buildroot}%{_datadir}/libalternatives/ebtables-restore/2.conf -mkdir -p %{buildroot}%{_datadir}/libalternatives/ebtables-save -cp %{buildroot}%{_datadir}/libalternatives/ebtables/2.conf %{buildroot}%{_datadir}/libalternatives/ebtables-save/2.conf +for i in ebtables-restore ebtables-save; do + mkdir -pv "$b/%_datadir/libalternatives/$i" + cp -av "$b/%_datadir/libalternatives/ebtables/2.conf" "$b/%_datadir/libalternatives/$i/" +done %endif @@ -259,8 +248,9 @@ cp %{buildroot}%{_datadir}/libalternatives/ebtables/2.conf %{buildroot}%{_datadi # removing old update-alternatives entries if [ "$1" > 0 ] ; then update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" -fi +fi %else + %post update-alternatives \ --install "%_sbindir/iptables" iptables "%_sbindir/xtables-legacy-multi" 1 \ @@ -285,6 +275,7 @@ if test "$1" = 0; then update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" fi %else + %post backend-nft update-alternatives \ --install "%_sbindir/iptables" iptables "%_sbindir/xtables-nft-multi" 2 \ @@ -342,19 +333,7 @@ fi %ghost %_sysconfdir/alternatives/ip6tables-restore %ghost %_sysconfdir/alternatives/ip6tables-save %else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/iptables -%dir %{_datadir}/libalternatives/iptables-restore -%dir %{_datadir}/libalternatives/iptables-save -%dir %{_datadir}/libalternatives/ip6tables -%dir %{_datadir}/libalternatives/ip6tables-restore -%dir %{_datadir}/libalternatives/ip6tables-save -%{_datadir}/libalternatives/iptables/1.conf -%{_datadir}/libalternatives/iptables-restore/1.conf -%{_datadir}/libalternatives/iptables-save/1.conf -%{_datadir}/libalternatives/ip6tables/1.conf -%{_datadir}/libalternatives/ip6tables-restore/1.conf -%{_datadir}/libalternatives/ip6tables-save/1.conf +%_datadir/libalternatives/ %endif %_sbindir/iptables %_sbindir/iptables-restore @@ -378,31 +357,7 @@ fi %ghost %_sysconfdir/alternatives/ebtables-restore %ghost %_sysconfdir/alternatives/ebtables-save %else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/iptables -%dir %{_datadir}/libalternatives/iptables-restore -%dir %{_datadir}/libalternatives/iptables-save -%dir %{_datadir}/libalternatives/ip6tables -%dir %{_datadir}/libalternatives/ip6tables-restore -%dir %{_datadir}/libalternatives/ip6tables-save -%dir %{_datadir}/libalternatives/arptables -%dir %{_datadir}/libalternatives/arptables-restore -%dir %{_datadir}/libalternatives/arptables-save -%dir %{_datadir}/libalternatives/ebtables -%dir %{_datadir}/libalternatives/ebtables-restore -%dir %{_datadir}/libalternatives/ebtables-save -%{_datadir}/libalternatives/iptables/2.conf -%{_datadir}/libalternatives/iptables-restore/2.conf -%{_datadir}/libalternatives/iptables-save/2.conf -%{_datadir}/libalternatives/ip6tables/2.conf -%{_datadir}/libalternatives/ip6tables-restore/2.conf -%{_datadir}/libalternatives/ip6tables-save/2.conf -%{_datadir}/libalternatives/arptables/2.conf -%{_datadir}/libalternatives/arptables-restore/2.conf -%{_datadir}/libalternatives/arptables-save/2.conf -%{_datadir}/libalternatives/ebtables/2.conf -%{_datadir}/libalternatives/ebtables-restore/2.conf -%{_datadir}/libalternatives/ebtables-save/2.conf +%_datadir/libalternatives/ %endif %_sbindir/iptables %_sbindir/iptables-restore From e4ea90ef14d499238540cc892501382406bf612aca38f6b89e4156240c727c2f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 20 Sep 2021 10:09:59 +0000 Subject: [PATCH 3/5] Accepting request 919774 from home:schubi2 - Removed update-alternatives dependency in libalternatives mode. OBS-URL: https://build.opensuse.org/request/show/919774 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iptables?expand=0&rev=146 --- iptables.changes | 5 +++++ iptables.spec | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/iptables.changes b/iptables.changes index 6518b77..94ac68f 100644 --- a/iptables.changes +++ b/iptables.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 16 11:40:45 UTC 2021 - Stefan Schubert + +- Removed update-alternatives dependency in libalternatives mode. + ------------------------------------------------------------------- Tue Aug 3 07:13:19 UTC 2021 - Stefan Schubert diff --git a/iptables.spec b/iptables.spec index 60ce34c..17fb13b 100644 --- a/iptables.spec +++ b/iptables.spec @@ -51,8 +51,6 @@ Requires: netcfg >= 11.6 Requires: xtables-plugins = %version-%release %if %{with libalternatives} Requires: alts -Requires: libalternatives >= 1.2 -Requires(pre): update-alternatives %else Requires(post): update-alternatives Requires(postun):update-alternatives @@ -246,7 +244,7 @@ done %if %{with libalternatives} %pre # removing old update-alternatives entries -if [ "$1" > 0 ] ; then +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" fi %else @@ -269,7 +267,7 @@ fi %if %{with libalternatives} %pre backend-nft # removing old update-alternatives entries -if test "$1" = 0; then +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then update-alternatives --remove iptables "%_sbindir/xtables-nft-multi" update-alternatives --remove arptables "%_sbindir/xtables-nft-multi" update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" From 5df98ca110d320b8d87cec3cd2fc0a6acff6a4ef258b61697939363589d4e859 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 20 Sep 2021 10:12:42 +0000 Subject: [PATCH 4/5] update macros OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iptables?expand=0&rev=147 --- iptables.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iptables.spec b/iptables.spec index 17fb13b..558014c 100644 --- a/iptables.spec +++ b/iptables.spec @@ -176,7 +176,7 @@ rm -f extensions/libipt_unclean.man # includedir is overriden on purpose to detect projects that # fail to include libxtables_CFLAGS %configure --includedir="%_includedir/%name" --enable-libipq -make %{?_smp_mflags} V=1 +%make_build V=1 %install %make_install @@ -186,7 +186,7 @@ rm -f "$b/%_libdir/"libiptc.so* # iptables-apply is not installed by upstream Makefile install -m0755 iptables/iptables-apply "$b/%_sbindir/" rm -f "$b/%_libdir"/*.la -rm -f "$b/%_sysconfdir/ethertypes" # -> netcfg +rm -f "$b/%_sysconfdir/ethertypes" # provided by netcfg for i in iptables iptables-restore iptables-save ip6tables ip6tables-restore \ ip6tables-save arptables arptables-restore arptables-save ebtables \ @@ -244,7 +244,7 @@ done %if %{with libalternatives} %pre # removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then +if [ "$1" -gt 0 ] && [ -f "%_sbindir/update-alternatives" ]; then update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" fi %else @@ -267,7 +267,7 @@ fi %if %{with libalternatives} %pre backend-nft # removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then +if [ "$1" -gt 0 ] && [ -f "%_sbindir/update-alternatives" ]; then update-alternatives --remove iptables "%_sbindir/xtables-nft-multi" update-alternatives --remove arptables "%_sbindir/xtables-nft-multi" update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" From 627d854142308ab3be3d2de82f671159acf8139087435326c99bebc05a6fd85b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 20 Oct 2021 11:28:19 +0000 Subject: [PATCH 5/5] Accepting request 926538 from home:schubi2 - Added alts requirements for iptables-backend-nft package. OBS-URL: https://build.opensuse.org/request/show/926538 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iptables?expand=0&rev=148 --- iptables.changes | 5 +++++ iptables.spec | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/iptables.changes b/iptables.changes index 94ac68f..daa6cea 100644 --- a/iptables.changes +++ b/iptables.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 20 11:15:19 UTC 2021 - Stefan Schubert + +- Added alts requirements for iptables-backend-nft package. + ------------------------------------------------------------------- Thu Sep 16 11:40:45 UTC 2021 - Stefan Schubert diff --git a/iptables.spec b/iptables.spec index 558014c..94e5b63 100644 --- a/iptables.spec +++ b/iptables.spec @@ -51,6 +51,7 @@ Requires: netcfg >= 11.6 Requires: xtables-plugins = %version-%release %if %{with libalternatives} Requires: alts +BuildRequires: alts %else Requires(post): update-alternatives Requires(postun):update-alternatives @@ -69,8 +70,13 @@ the various Netfilter packet filter engines inside the Linux kernel. Summary: Metapackage to make nft the default backend for iptables/arptables/ebtables Group: Productivity/Networking/Security Requires: iptables >= 1.8.0 +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif Provides: iptables-nft = %version-%release Obsoletes: iptables-nft < %version-%release