[haproxy] Scriptlets replaced with new systemd macros (#850143)

cheeselee cheeselee at fedoraproject.org
Fri Oct 12 06:50:48 UTC 2012


commit 4c57edc83e10b1fe27919f986ea8b29dd66afb11
Author: Robin Lee <cheeselee at fedoraproject.org>
Date:   Fri Oct 12 14:49:05 2012 +0800

    Scriptlets replaced with new systemd macros (#850143)

 haproxy.spec |   27 ++++++++++-----------------
 1 files changed, 10 insertions(+), 17 deletions(-)
---
diff --git a/haproxy.spec b/haproxy.spec
index 8bcea99..eb1c563 100644
--- a/haproxy.spec
+++ b/haproxy.spec
@@ -6,7 +6,7 @@
 
 Name:           haproxy
 Version:        1.4.20
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        HA-Proxy is a TCP/HTTP reverse proxy for high availability environments
 
 Group:          System Environment/Daemons
@@ -24,9 +24,9 @@ BuildRequires:  systemd-units
 
 
 Requires(pre):      shadow-utils
-Requires(post):     systemd-units
-Requires(preun):    systemd-units
-Requires(postun):   systemd-units
+Requires(post):     systemd
+Requires(preun):    systemd
+Requires(postun):   systemd
 
 %description
 HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high
@@ -110,24 +110,14 @@ exit 0
 
 
 %post
-if [ $1 -eq 1 ]; then
-    /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
 
 
 %files
@@ -153,6 +143,9 @@ fi
 
 
 %changelog
+* Mon Sep 17 2012 Václav Pavlín <vpavlin at redhat.com> - 1.4.20-3
+- Scriptlets replaced with new systemd macros (#850143)
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4.20-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list