[libcgroup] - resolves: #850183 scriptlets replaced with new systemd macros (thanks to vpavlin)

pschiffe pschiffe at fedoraproject.org
Fri Nov 23 15:16:20 UTC 2012


commit 119e213981368b7f1ac60a37b20e554f51e81894
Author: Peter Schiffer <pschiffe at redhat.com>
Date:   Fri Nov 23 14:37:36 2012 +0100

    - resolves: #850183
      scriptlets replaced with new systemd macros (thanks to vpavlin)

 libcgroup.spec |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)
---
diff --git a/libcgroup.spec b/libcgroup.spec
index 7559fc8..2695c5c 100644
--- a/libcgroup.spec
+++ b/libcgroup.spec
@@ -5,7 +5,7 @@ Name: libcgroup
 Summary: Library to control and monitor control groups
 Group: Development/Libraries
 Version: 0.38
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: LGPLv2+
 URL: http://libcg.sourceforge.net/
 Source0: http://downloads.sourceforge.net/libcg/%{name}-%{version}.tar.bz2
@@ -18,13 +18,12 @@ BuildRequires: pam-devel
 BuildRequires: byacc
 BuildRequires: flex
 BuildRequires: coreutils
-BuildRequires: systemd-units
 Requires(pre): shadow-utils
 Requires(post): chkconfig, /sbin/service
 Requires(preun): /sbin/chkconfig
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
 
 %description
 Control groups infrastructure. The library helps manipulate, control,
@@ -102,27 +101,13 @@ rm -rf $RPM_BUILD_ROOT
 getent group cgred >/dev/null || groupadd -r cgred
 
 %post tools
-if [ $1 -eq 1 ] ; then 
-    # Initial installation 
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post cgconfig.service cgred.service
 
 %preun tools
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable cgconfig.service > /dev/null 2>&1 || :
-    /bin/systemctl stop cgconfig.service > /dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable cgred.service > /dev/null 2>&1 || :
-    /bin/systemctl stop cgred.service > /dev/null 2>&1 || :
-fi
+%systemd_preun cgconfig.service cgred.service
 
 %postun tools
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart cgconfig.service >/dev/null 2>&1 || :
-    /bin/systemctl try-restart cgred.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart cgconfig.service cgred.service
 
 %triggerun -- libcgroup < 0.38
 # Save the current service runlevel info
@@ -181,6 +166,10 @@ fi
 %doc COPYING INSTALL
 
 %changelog
+* Fri Nov 23 2012 Peter Schiffer <pschiffe at redhat.com> - 0.38-3
+- resolves: #850183
+  scriptlets replaced with new systemd macros (thanks to vpavlin)
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.38-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list