fix post error when update versions
This commit is contained in:
parent
f210bcd7f4
commit
9b53ab709d
@ -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 <eaglegai@163.com> - 0.0.5-5
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:fix post error when update versions
|
||||
|
||||
* Sat Aug 28 2021 gaihuiying <gaihuiying1@huawei.com> - 0.0.5-4
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user