[bandwidthd] new systemd-rpm macros

Ján ONDREJ ondrejj at fedoraproject.org
Fri Jan 10 18:27:09 UTC 2014


commit 92fdd5dbaf38a1825329194cc349b96d33c753de
Author: Jan ONDREJ (SAL) <ondrejj(at)salstar.sk>
Date:   Fri Jan 10 19:27:10 2014 +0100

    new systemd-rpm macros

 bandwidthd.spec |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/bandwidthd.spec b/bandwidthd.spec
index 6510188..bbc4ee6 100644
--- a/bandwidthd.spec
+++ b/bandwidthd.spec
@@ -3,7 +3,7 @@
 
 Name:           bandwidthd
 Version:        2.0.1
-Release:        24%{?dist}
+Release:        25%{?dist}
 Summary:        Tracks network usage and builds html and graphs
 
 Group:          System Environment/Daemons
@@ -93,24 +93,13 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %post
-if [ $1 -eq 1 ] ; then 
-    # Initial installation 
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post %{name}.service
 
 %preun
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
-    /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
-fi
+%systemd_preun %{name}.service
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart %{name}.service
 
 %files
 %defattr(-,root,root,-)
@@ -129,6 +118,10 @@ fi
 
 
 %changelog
+* Fri Jan 10 2014 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-25
+- Scriptlets replaced with new systemd macros (#850042)
+  Thanks to Václav Pavlín.
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.1-24
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 
@@ -165,7 +158,7 @@ fi
 * Mon Feb 23 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.1-12
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 
-* Sun Dec 13 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-11
+* Sat Dec 13 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-11
 - updated config.sub and config.guess to build on ppc64
 - added libpng-devel again (required for EPEL-4)
 


More information about the scm-commits mailing list