From 9b53ab709d0c0fef4638f8bf8fb66f6a02d739d0 Mon Sep 17 00:00:00 2001 From: eaglegai Date: Sat, 25 Jun 2022 11:54:10 +0800 Subject: [PATCH] fix post error when update versions --- arptables.spec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/arptables.spec b/arptables.spec index 4417515..dbb66de 100644 --- a/arptables.spec +++ b/arptables.spec @@ -1,6 +1,6 @@ Name: arptables Version: 0.0.5 -Release: 4 +Release: 5 Summary: Administration tool for arp packet filtering License: GPLv2+ @@ -40,17 +40,24 @@ install -p -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_libexecdir}/ install -p -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/arptables.service mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig echo '# Configure prior to use' > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} +ln -s arptables-legacy $RPM_BUILD_ROOT/%{_sbindir}/arptables %post %systemd_post %{name}.service -update-alternatives --install /usr/sbin/arptables arptables /usr/sbin/arptables-legacy 10 %preun %systemd_preun %{name}.service %postun +if [ $1 -eq 1 ] && [ -x /usr/sbin/arptables-legacy ] && [ ! -h /usr/sbin/arptables ];then +ln -s /usr/sbin/arptables-legacy /usr/sbin/arptables +fi %systemd_postun_with_restart %{name}.service -update-alternatives --remove arptables /usr/sbin/arptables-legacy + +%posttrans +if [ -x /usr/sbin/arptables-legacy ] && [ ! -h /usr/sbin/arptables ];then +ln -s /usr/sbin/arptables-legacy /usr/sbin/arptables +fi %files %license COPYING @@ -64,6 +71,12 @@ update-alternatives --remove arptables /usr/sbin/arptables-legacy %{_mandir}/man8/*.gz %changelog +* Sat Jun 25 2022 gaihuiying - 0.0.5-5 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:fix post error when update versions + * Sat Aug 28 2021 gaihuiying - 0.0.5-4 - Type:bugfix - Id:NA