[freeipmi] Reworked RPM scriptlets to use systemd-rpm macros Resolves: #850117
Jan Šafránek
jsafrane at fedoraproject.org
Mon Aug 27 08:59:32 UTC 2012
commit ba1e66b08dc9c483cce78ff669d50b7b218979d0
Author: Jan Safranek <jsafrane at redhat.com>
Date: Mon Aug 27 10:52:26 2012 +0200
Reworked RPM scriptlets to use systemd-rpm macros
Resolves: #850117
freeipmi.spec | 52 ++++++++++------------------------------------------
1 files changed, 10 insertions(+), 42 deletions(-)
---
diff --git a/freeipmi.spec b/freeipmi.spec
index 54fc8a6..63b05ad 100644
--- a/freeipmi.spec
+++ b/freeipmi.spec
@@ -96,64 +96,31 @@ fi
%postun -p /sbin/ldconfig
%post bmc-watchdog
-if [ $1 -eq 1 ] ; then
- # Initial installation
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post bmc-watchdog.service
%preun bmc-watchdog
-if [ $1 -eq 0 ] ; then
- # Package removal, not upgrade
- /bin/systemctl --no-reload disable bmc-watchdog.service > /dev/null 2>&1 || :
- /bin/systemctl stop bmc-watchdog.service > /dev/null 2>&1 || :
-fi
+%systemd_preun bmc-watchdog.service
%postun bmc-watchdog
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
- # Package upgrade, not uninstall
- /bin/systemctl try-restart bmc-watchdog.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart bmc-watchdog.service
%post ipmiseld
-if [ $1 -eq 1 ] ; then
- # Initial installation
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post ipmiseld.service
%preun ipmiseld
-if [ $1 -eq 0 ] ; then
- # Package removal, not upgrade
- /bin/systemctl --no-reload disable ipmiseld.service > /dev/null 2>&1 || :
- /bin/systemctl stop ipmiseld.service > /dev/null 2>&1 || :
-fi
+%systemd_preun ipmiseld.service
%postun ipmiseld
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
- # Package upgrade, not uninstall
- /bin/systemctl try-restart ipmiseld.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart ipmiseld.service
%post ipmidetectd
-if [ $1 -eq 1 ] ; then
- # Initial installation
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post ipmidetectd.service
%preun ipmidetectd
-if [ $1 -eq 0 ] ; then
- # Package removal, not upgrade
- /bin/systemctl --no-reload disable ipmidetectd.service > /dev/null 2>&1 || :
- /bin/systemctl stop ipmidetectd.service > /dev/null 2>&1 || :
-fi
+%systemd_preun ipmidetectd.service
%postun ipmidetectd
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
- # Package upgrade, not uninstall
- /bin/systemctl try-restart ipmidetectd.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart ipmidetectd.service
%triggerun -- freeipmi-bmc-watchdog < 1.1.1-2
# Save the current service runlevel info
@@ -390,6 +357,7 @@ fi
%changelog
* Mon Aug 27 2012 Jan Safranek <jsafrane at redhat.com> - 1.2.1-1
+- Reworked RPM scriptlets to use systemd-rpm macros (#850117).
- Updated to freeipmi-1.2.1:
- Support new ipmiseld daemon, a daemon that regularly polls the SEL
and stores the events to the local syslog.
More information about the scm-commits
mailing list