diff --git a/ebtables.spec b/ebtables.spec index 56a8a98..2af4507 100644 --- a/ebtables.spec +++ b/ebtables.spec @@ -1,7 +1,7 @@ Name: ebtables Version: 2.0.11 -Release: 7 +Release: 8 Summary: A filtering tool for a Linux-based bridging firewall License: GPLv2+ URL: http://ebtables.sourceforge.net/ @@ -62,20 +62,21 @@ echo "%{_libdir}/ebtables" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf %post %systemd_post ebtables.service %?ldconfig -if [ "$(readlink -e %{_sbindir}/ebtables)" == %{_sbindir}/ebtables ] ; then - rm -f %{_sbindir}/ebtables +pfx=%{_sbindir}/ebtables +manpfx=%{_mandir}/man8/ebtables +for sfx in "" "-restore" "-save"; do + if [ "$(readlink -e $pfx$sfx)" == $pfx$sfx ]; then + rm -f $pfx$sfx + fi +done +if [ "$(readlink -e $manpfx.8.gz)" == $manpfx.8.gz ]; then + rm -f $manpfx.8.gz fi -%{_sbindir}/update-alternatives --install %{_sbindir}/ebtables ebtables %{_sbindir}/ebtables-legacy 10 - -if [ "$(readlink -e %{_sbindir}/ebtables-restore)" == %{_sbindir}/ebtables-restore ] ; then - rm -f %{_sbindir}/ebtables-restore -fi -%{_sbindir}/update-alternatives --install %{_sbindir}/ebtables-restore ebtables-restore %{_sbindir}/ebtables-legacy-restore 10 - -if [ "$(readlink -e %{_sbindir}/ebtables-save)" == %{_sbindir}/ebtables-save ] ; then - rm -f %{_sbindir}/ebtables-save -fi -%{_sbindir}/update-alternatives --install %{_sbindir}/ebtables-save ebtables-save %{_sbindir}/ebtables-legacy-save 10 +%{_sbindir}/update-alternatives --install \ + $pfx ebtables $pfx-legacy 10 \ + --slave $pfx-save ebtables-save $pfx-legacy-save \ + --slave $pfx-restore ebtables-restore $pfx-legacy-restore \ + --slave $manpfx.8.gz ebtables-man $manpfx-legacy.8.gz %preun %systemd_preun ebtables.service @@ -83,6 +84,10 @@ fi %postun %systemd_postun_with_restart ebtables.service %?ldconfig +if [ $1 -eq 0 ]; then + %{_sbindir}/update-alternatives --remove \ + ebtables %{_sbindir}/ebtables-legacy +fi %files %license COPYING @@ -105,6 +110,12 @@ fi %doc %{_mandir}/man8/ebtables-legacy.8* %changelog +* Fri Jun 30 2023 xinghe - 2.0.11-8 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix install error + * Mon Nov 28 2022 yanglu - 2.0.11-7 - Type:bugfix - CVE:NA