[arm4] add missing scriptlets

Tom Callaway spot at fedoraproject.org
Fri Sep 9 16:23:20 UTC 2011


commit c85482edd639a7113ed5c418fd5e3e156b9bb0bd
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Fri Sep 9 12:23:08 2011 -0400

    add missing scriptlets

 arm4.spec |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)
---
diff --git a/arm4.spec b/arm4.spec
index 8eac0f3..11a7d6e 100644
--- a/arm4.spec
+++ b/arm4.spec
@@ -2,7 +2,7 @@
 
 Name:		arm4
 Version:	0.8.2
-Release:	7%{?dist}
+Release:	8%{?dist}
 Summary:	Application Response Measurement V4.0
 
 Group:		Development/System
@@ -19,6 +19,9 @@ BuildRequires:	systemd-units
 Requires:	openssl db4 db4-cxx sqlite
 Requires(pre): shadow-utils	
 Requires(post): systemd-sysv
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
 
 %description
 An Open Source implementation of the Open Group's
@@ -105,13 +108,31 @@ getent passwd arm4 >/dev/null || \
 	-c "ARM 4 Daemon" arm4
 exit 0
 
-%post -p /sbin/ldconfig
+%post 
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
 
 %post devel -p /sbin/ldconfig
 
 %post java -p /sbin/ldconfig
 
-%postun -p /sbin/ldconfig
+%preun
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable arm4.service > /dev/null 2>&1 || :
+    /bin/systemctl stop arm4.service > /dev/null 2>&1 || :
+fi
+
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart arm4.service >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
 
 %postun devel -p /sbin/ldconfig
 
@@ -164,6 +185,9 @@ exit 0
 %{_libdir}/libArmNative.*
 
 %changelog
+* Fri Sep  9 2011 Tom Callaway <spot at fedoraproject.org> - 0.8.2-8
+- add missing systemd scriptlets
+
 * Thu Sep  8 2011 Tom Callaway <spot at fedoraproject.org> - 0.8.2-7
 - convert to systemd
 


More information about the scm-commits mailing list