[jetty] Convert systemd scriplets to macros, resolves #850176

Mikolaj Izdebski mizdebsk at fedoraproject.org
Tue Aug 21 14:25:38 UTC 2012


commit 18066639a2cf1d013a0190182a6cc7d6b6551d17
Author: Mikolaj Izdebski <mizdebsk at redhat.com>
Date:   Tue Aug 21 15:59:00 2012 +0200

    Convert systemd scriplets to macros, resolves #850176

 jetty.spec |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/jetty.spec b/jetty.spec
index 3ff3775..7282ce5 100644
--- a/jetty.spec
+++ b/jetty.spec
@@ -44,7 +44,7 @@
 
 Name:           jetty
 Version:        8.1.5
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Java Webserver and Servlet Container
 
 Group:          Applications/Internet
@@ -847,24 +847,13 @@ getent passwd %username &>/dev/null || useradd  -r -u %jtuid -g %username \
                              -d %homedir -M -s /sbin/nologin %username || :
 
 %post
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post jetty.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 jetty.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 jetty.service
 # Remove the user even during upgrade, it will be added later in %%post.
 # This is required to force incorrect UID to be replaced with the new one.
 userdel  %username &>/dev/null || :
@@ -1049,6 +1038,9 @@ groupdel %username &>/dev/null || :
 %doc %{_javadocdir}/%{name}
 
 %changelog
+* Tue Aug 21 2012 Mikolaj Izdebski <mizdebsk at redhat.com> - 8.1.5-4
+- Convert systemd scriplets to macros, resolves #850176
+
 * Tue Aug 21 2012 Mikolaj Izdebski <mizdebsk at redhat.com> - 8.1.5-3
 - Don't redirect useradd and groupadd output to the bit bucket
 


More information about the scm-commits mailing list