Resolves: #850364 - scriptlets replaced with new systemd macros

This commit is contained in:
Josef Ridky 2017-03-06 10:54:40 +01:00
parent d649f38a1d
commit d426b88277

View File

@ -1,7 +1,7 @@
Summary: Software and/or Hardware watchdog daemon
Name: watchdog
Version: 5.13
Release: 15%{?dist}
Release: 16%{?dist}
License: GPLv2+
URL: http://sourceforge.net/projects/watchdog/
@ -21,9 +21,9 @@ Patch4: 0004-watchdog-5.13-rhseldoc.patch
BuildRequires: systemd-units
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
@ -76,29 +76,15 @@ install -Dd -m0755 ${RPM_BUILD_ROOT}%{_libexecdir}/watchdog/scripts
%post
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%systemd_post watchdog.service
%preun
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable watchdog.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable watchdog-ping.service > /dev/null 2>&1 || :
/bin/systemctl stop watchdog.service > /dev/null 2>&1 || :
/bin/systemctl stop watchdog-ping.service > /dev/null 2>&1 || :
fi
%systemd_preun watchdog.service
%systemd_preun watchdog.ping.service
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart watchdog.service >/dev/null 2>&1 || :
/bin/systemctl try-restart watchdog-ping.service >/dev/null 2>&1 || :
fi
%systemd_postun_with_restart watchdog.service
%systemd_postun_with_restart watchdog.ping.service
%triggerun -- watchdog < 5.9-4
# Save the current service runlevel info
@ -135,6 +121,9 @@ fi
%changelog
* Mon Mar 06 2017 Josef Ridky <jridky@redhat.com> - 5.13-16
- Scriptlets replaced with new systemd macros (#850364)
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.13-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild