[smokeping] add missing scriptlets

Tom Callaway spot at fedoraproject.org
Fri Sep 9 16:31:38 UTC 2011


commit 4d6d25b50e7b8ac9df97d29b82301e564b94cdab
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Fri Sep 9 12:31:25 2011 -0400

    add missing scriptlets

 smokeping.spec |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)
---
diff --git a/smokeping.spec b/smokeping.spec
index c5609a5..06968de 100644
--- a/smokeping.spec
+++ b/smokeping.spec
@@ -7,7 +7,7 @@
 Summary:          Latency Logging and Graphing System
 Name:             smokeping
 Version:          2.4.2
-Release:          13%{?dist}
+Release:          14%{?dist}
 License:          GPLv2+
 Group:            Applications/Internet
 URL:              http://oss.oetiker.ch/smokeping/
@@ -35,6 +35,9 @@ Requires:         perl(Config::Grammar)
 Requires:         webserver
 Requires:         net-tools
 Requires(post):   systemd-sysv
+Requires(post):   systemd-units
+Requires(preun):  systemd-units
+Requires(postun): systemd-units
 BuildArch:        noarch
 
 %description
@@ -70,8 +73,6 @@ find doc -name *.[1-9] -delete
 # nothing to build
 
 %install
-%{__rm} -rf %{buildroot}
-
 %{__install} -d %{buildroot}%{_sysconfdir}/%{name} \
                 %{buildroot}%{_datadir}/%{name}/{lib,cgi,htdocs} \
                 %{buildroot}%{_localstatedir}/lib/%{name}/{rrd,images} \
@@ -103,6 +104,26 @@ done
 
 find %{buildroot}%{_datadir}/%{name} -name *.pm | xargs chmod 0644
 
+%post
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+
+%preun
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable smokeping.service > /dev/null 2>&1 || :
+    /bin/systemctl stop smokeping.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 smokeping.service >/dev/null 2>&1 || :
+fi
+
 %triggerun -- smokeping < 2.4.2-13
 # Save the current service runlevel info
 # User must manually run systemd-sysv-convert --apply smokeping
@@ -130,6 +151,9 @@ find %{buildroot}%{_datadir}/%{name} -name *.pm | xargs chmod 0644
 %attr(0755, apache, root) %{_localstatedir}/lib/%{name}/images
 
 %changelog
+* Fri Sep 9 2011 Tom Callaway <spot at fedoraproject.org> - 2.4.2-14
+- add missing systemd scriptlets
+
 * Fri Sep 9 2011 Tom Callaway <spot at fedoraproject.org> - 2.4.2-13
 - convert to systemd
 


More information about the scm-commits mailing list