[gogoc] Add systemd macros. Fix #850133

jorti jorti at fedoraproject.org
Tue Aug 21 15:10:36 UTC 2012


commit 184f99819bc8830e3e36fdff2fd45839bf21df43
Author: Juan Orti Alcaine <j.orti.alcaine at gmail.com>
Date:   Tue Aug 21 17:10:07 2012 +0200

    Add systemd macros. Fix #850133

 gogoc.spec |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/gogoc.spec b/gogoc.spec
index 23b0840..a6a6d42 100644
--- a/gogoc.spec
+++ b/gogoc.spec
@@ -3,7 +3,7 @@
 
 Name:           gogoc
 Version:        1.2
-Release:        19%{?dist}
+Release:        20%{?dist}
 Summary:        IPv6 TSP client for gogo6
 
 Group:          System Environment/Daemons
@@ -86,24 +86,13 @@ install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf
 
 %post
 semanage fcontext -a -t radvd_etc_t '%{_localstatedir}/run/%{name}/%{name}-rtadvd.conf' 2>/dev/null || :
-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
 if [ $1 -eq 0 ] ; then  # final removal
     semanage fcontext -d -t radvd_etc_t '%{_localstatedir}/run/%{name}/%{name}-rtadvd.conf' 2>/dev/null || :
 fi
@@ -126,6 +115,9 @@ fi
 %{_unitdir}/%{name}.service
 
 %changelog
+* Tue Aug 21 2012 Juan Orti Alcaine <j.orti.alcaine at gmail.com> - 1.2-20
+- Add systemd macros. Fix #850133
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2-19
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list