[cvs] Modernize systemd scriptlets

Petr Pisar ppisar at fedoraproject.org
Wed Aug 22 07:29:40 UTC 2012


commit eb972ae158357a23c71740894642ae6066af3ba0
Author: Petr Písař <ppisar at redhat.com>
Date:   Wed Aug 22 09:11:10 2012 +0200

    Modernize systemd scriptlets

 cvs.spec |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/cvs.spec b/cvs.spec
index b15ddf8..eb8b1d7 100644
--- a/cvs.spec
+++ b/cvs.spec
@@ -5,7 +5,7 @@
 
 Name: cvs
 Version: 1.11.23
-Release: 26%{?dist}
+Release: 27%{?dist}
 Summary: Concurrent Versions System
 Group: Development/Tools
 URL: http://cvs.nongnu.org/
@@ -206,10 +206,7 @@ install -p -m 644 -D %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/cvs.socket
 %post
 /sbin/install-info /%{_infodir}/cvs.info.gz /%{_infodir}/dir
 /sbin/install-info /%{_infodir}/cvsclient.info.gz /%{_infodir}/dir
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post cvs at .service
 exit 0
 
 %preun
@@ -217,17 +214,12 @@ if [ $1 -eq 0 ] ; then
     # Package removal, not upgrade
     /sbin/install-info --delete /%{_infodir}/cvs.info.gz /%{_infodir}/dir
     /sbin/install-info --delete /%{_infodir}/cvsclient.info.gz /%{_infodir}/dir
-    /bin/systemctl --no-reload disable cvs\@.service > /dev/null 2>&1 || :
-    /bin/systemctl stop cvs\@.service > /dev/null 2>&1 || :
 fi
+%systemd_preun cvs at .service
 exit 0
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart cvs\@.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart cvs at .service
 
 
 %files
@@ -256,6 +248,9 @@ fi
 
 
 %changelog
+* Wed Aug 22 2012 Petr Pisar <ppisar at redhat.com> - 1.11.23-27
+- Modernize systemd scriptlets (bug #850075)
+
 * Wed Jul 18 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.11.23-26
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list