Use new systemd macros (Resolves: #850303)

This commit is contained in:
Honza Horák 2012-09-11 10:01:37 +02:00
parent be646a723a
commit 925b1a4f23

View File

@ -83,6 +83,9 @@ make INSTALLROOT=${RPM_BUILD_ROOT} install
install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_unitdir}/ install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_unitdir}/
%post server %post server
%if 0%{?systemd_post:1}
%systemd_post rwalld.service
%else
if [ $1 = 1 ]; then if [ $1 = 1 ]; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi fi
@ -94,18 +97,27 @@ fi
# Run these because the SysV package being removed won't do them # Run these because the SysV package being removed won't do them
/sbin/chkconfig --del rwalld >/dev/null 2>&1 || : /sbin/chkconfig --del rwalld >/dev/null 2>&1 || :
/bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || : /bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || :
%endif
%preun server %preun server
%if 0%{?systemd_preun:1}
%systemd_preun rwalld.service
%else
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
/bin/systemctl --no-reload disable rwalld.service >/dev/null 2>&1 || : /bin/systemctl --no-reload disable rwalld.service >/dev/null 2>&1 || :
/bin/systemctl stop rwalld.service >/dev/null 2>&1 || : /bin/systemctl stop rwalld.service >/dev/null 2>&1 || :
fi fi
%endif
%postun server %postun server
%if 0%{?systemd_postun_with_restart:1}
%systemd_postun_with_restart rwalld.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
/bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || : /bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || :
fi fi
%endif
%files %files
%{_bindir}/rwall %{_bindir}/rwall
@ -121,6 +133,7 @@ fi
* Tue Sep 11 2012 Honza Horak <hhorak@redhat.com> - 0.17-34 * Tue Sep 11 2012 Honza Horak <hhorak@redhat.com> - 0.17-34
- added ordering dependencies to rpcbind - added ordering dependencies to rpcbind
- Minor spec file changes - Minor spec file changes
- Use new systemd macros (Resolves: #850303)
* Mon Aug 01 2011 Honza Horak <hhorak@redhat.com> - 0.17-33 * Mon Aug 01 2011 Honza Horak <hhorak@redhat.com> - 0.17-33
- added systemd native unit file - added systemd native unit file