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,29 +83,41 @@ 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 [ $1 = 1 ]; then %if 0%{?systemd_post:1}
/bin/systemctl daemon-reload >/dev/null 2>&1 || : %systemd_post rwalld.service
fi %else
if [ $1 = 1 ]; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
# Package with native systemd unit file is installed for the first time # Package with native systemd unit file is installed for the first time
%triggerun -- rwall-server < 0.17-33 %triggerun -- rwall-server < 0.17-33
%{_bindir}/systemd-sysv-convert --save rwalld >/dev/null 2>&1 ||: %{_bindir}/systemd-sysv-convert --save rwalld >/dev/null 2>&1 ||:
# 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 [ $1 = 0 ]; then %if 0%{?systemd_preun:1}
/bin/systemctl --no-reload disable rwalld.service >/dev/null 2>&1 || : %systemd_preun rwalld.service
/bin/systemctl stop rwalld.service >/dev/null 2>&1 || : %else
fi if [ $1 = 0 ]; then
/bin/systemctl --no-reload disable rwalld.service >/dev/null 2>&1 || :
/bin/systemctl stop rwalld.service >/dev/null 2>&1 || :
fi
%endif
%postun server %postun server
/bin/systemctl daemon-reload >/dev/null 2>&1 || : %if 0%{?systemd_postun_with_restart:1}
if [ $1 -ge 1 ]; then %systemd_postun_with_restart rwalld.service
/bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || : %else
fi /bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ]; then
/bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || :
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