[bird] spec: use macroized systemd scriptlets

Michal Sekletar msekleta at fedoraproject.org
Thu Oct 17 13:46:16 UTC 2013


commit caadc2027318064a43dab13b6948b3f1329b0254
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Thu Oct 17 14:29:39 2013 +0200

    spec: use macroized systemd scriptlets
    
    Since Fedora 18 is using macros prefered way to be used when writing rpm
    scriptlets instead of calling systemctl command directly.

 bird.spec |   33 +++++++--------------------------
 1 files changed, 7 insertions(+), 26 deletions(-)
---
diff --git a/bird.spec b/bird.spec
index c8373c7..9dd55f6 100644
--- a/bird.spec
+++ b/bird.spec
@@ -90,42 +90,22 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %post
-if [ $1 -eq 1 ]; then
-  /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
-
+%systemd_post bird.service
 
 %preun
-if [ $1 -eq 0 ] ; then
-  /bin/systemctl --no-reload disable bird.service > /dev/null 2>&1 || :
-  /bin/systemctl stop bird.service > /dev/null 2>&1 || :
-fi
-
+%systemd_preun bird.service
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-  /bin/systemctl reload-or-try-restart bird.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart bird.service
 
 %post -n bird6
-if [ $1 -eq 1 ]; then
-  /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
-
+%systemd_post bird6.service
 
 %preun -n bird6
-if [ $1 -eq 0 ] ; then
-  /bin/systemctl --no-reload disable bird6.service > /dev/null 2>&1 || :
-  /bin/systemctl stop bird6.service > /dev/null 2>&1 || :
-fi
-
+%systemd_preun bird6.service
 
 %postun -n bird6
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-  /bin/systemctl reload-or-try-restart bird6.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart bird6.service
 
 %files
 %defattr(-,root,root,-)
@@ -157,6 +137,7 @@ fi
 - change scriptlet Requires to systemd
 - drop rpm triggers used for migration from sysv to systemd
 - drop sysvinit subpackages
+- use macroized systemd scriptlets
 
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.3.10-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild


More information about the scm-commits mailing list