scriptlets replaced with new systemd macros (thanks to vpavlin)
This commit is contained in:
Peter Schiffer 2012-11-23 14:37:36 +01:00
parent efab0f5851
commit 119e213981

View File

@ -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@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@lists.fedoraproject.org> - 0.38-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild