[lm_sensors] Migration to new systemd scriptlet macros

Jaromír Cápík jcapik at fedoraproject.org
Mon Aug 27 16:57:14 UTC 2012


commit 4834b6aee2fb6e3f85ad1f758295f474390cec8a
Author: Jaromir Capik <jcapik at redhat.com>
Date:   Mon Aug 27 18:56:36 2012 +0200

    Migration to new systemd scriptlet macros

 lm_sensors.spec |   46 ++++++++++++++++++++++++----------------------
 1 files changed, 24 insertions(+), 22 deletions(-)
---
diff --git a/lm_sensors.spec b/lm_sensors.spec
index a647434..a6ff54c 100644
--- a/lm_sensors.spec
+++ b/lm_sensors.spec
@@ -1,6 +1,6 @@
 Name: lm_sensors
 Version: 3.3.2
-Release: 3%{?dist}
+Release: 4%{?dist}
 URL: http://www.lm-sensors.org/
 Source: http://dl.lm-sensors.org/lm-sensors/releases/%{name}-%{version}.tar.bz2
 Source1: lm_sensors.sysconfig
@@ -94,34 +94,33 @@ if [ -L /etc/rc3.d/S26lm_sensors ]; then
 fi
 /sbin/chkconfig --del lm_sensors
 
+# ===== main =====
+
+%post
+%systemd_post lm_sensors.service
+
 %preun
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable lm_sensors.service > /dev/null 2>&1 || :
-fi
+%systemd_preun lm_sensors.service
 
-%post libs -p /sbin/ldconfig
-%postun libs -p /sbin/ldconfig
+%postun
+%systemd_postun_with_restart lm_sensors.service
+
+# ==== sensord ===
 
 %post sensord
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post sensord.service
 
 %preun sensord
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable sensord.service > /dev/null 2>&1 || :
-    /bin/systemctl stop sensord.service > /dev/null 2>&1 || :
-fi
+%systemd_preun sensord.service
+
+%postun sensord
+%systemd_postun_with_restart sensord.service
+
+# ===== libs =====
+
+%post libs -p /sbin/ldconfig
+%postun libs -p /sbin/ldconfig
 
-%postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart sensord.service >/dev/null 2>&1 || :
-fi
 
 %files
 %defattr(-,root,root,-)
@@ -158,6 +157,9 @@ fi
 
 
 %changelog
+* Mon Aug 27 2012 Jaromir Capik <jcapik at redhat.com> - 3.3.2-4
+- Migration to new systemd scriptlet macros
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.3.2-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list