[ice] use macroized systemd directives (closes RHBZ #850152)

Haïkel Guémar hguemar at fedoraproject.org
Wed Oct 17 21:40:06 UTC 2012


commit cfb8c8a899b687700dc09046ad5e9e5a268d9a17
Author: Haïkel Guémar <hguemar at fedoraproject.org>
Date:   Wed Oct 17 20:48:27 2012 +0200

    use macroized systemd directives (closes RHBZ #850152)

 ice.spec |   73 +++++++++++++++++++++++---------------------------------------
 1 files changed, 27 insertions(+), 46 deletions(-)
---
diff --git a/ice.spec b/ice.spec
index 617e136..4c74aac 100644
--- a/ice.spec
+++ b/ice.spec
@@ -7,7 +7,7 @@
 
 Name:           ice
 Version:        3.4.2
-Release:        17%{?dist}
+Release:        18%{?dist}
 Summary:        ZeroC Object-Oriented middleware
 
 Group:          System Environment/Libraries
@@ -92,17 +92,16 @@ firewall solution, and much more.
 # All of the other Ice packages also get built by this SRPM.
 
 %package servers
-Summary: ICE SysV style services
+Summary: ICE systemd services
 Group: Development/Tools
 Requires: ice%{?_isa} = %{version}-%{release}
 # Requirements for the users
 Requires(pre): shadow-utils%{?isa}
 # Requirements for the systemd services
-BuildRequires: systemd-units
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
-Requires(post): systemd-sysv
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+
 %description servers
 Ice services (systemd)
 
@@ -411,6 +410,24 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/icegrid
 LD_LIBRARY_PATH=%{buildroot}%{_libdir} php -n -d extension_dir=%{buildroot}%{php_extdir} -d extension=IcePHP.so -m | grep ice
 
 
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%post servers
+%systemd_post icegridregistry.service
+%systemd_post icegridnode.service
+%systemd_post glacier2router.service
+
+%preun servers
+%systemd_preun icegridregistry.service
+%systemd_preun icegridnode.service
+%systemd_preun glacier2router.service
+
+%postun servers
+%systemd_postun icegridregistry.service
+%systemd_postun icegridnode.service
+%systemd_postun glacier2router.service
+
 %files
 %defattr(-,root,root,-)
 %{_defaultdocdir}/Ice-%{version}
@@ -450,9 +467,6 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} php -n -d extension_dir=%{buildroot}%{php
 %exclude %{_defaultdocdir}/Ice-%{version}/IceGridAdmin
 %exclude %{_datadir}/Ice-%{version}/IceGridGUI.jar
 
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
-
 %files servers
 %defattr(-,root,root,-)
 %{systemddir}/icegridregistry.service
@@ -463,42 +477,6 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} php -n -d extension_dir=%{buildroot}%{php
 %config(noreplace) %{_sysconfdir}/glacier2router.conf
 %dir %{_localstatedir}/lib/icegrid
 
-%pre servers
-# Following the Wiki instructions ...
-getent group iceuser > /dev/null || groupadd -r iceuser
-getent passwd iceuser > /dev/null || \
-        useradd -r -g iceuser -d %{_localstatedir}/lib/icegrid \
-        -s /sbin/nologin -c "IceGrid server user" iceuser
-exit 0
-
-%post servers
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
-
-%preun servers
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable icegridregistry.service \
-                   > /dev/null 2>&1 || :
-    /bin/systemctl stop icegridregistry.service > /dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable icegridnode.service > /dev/null 2>&1 || :
-    /bin/systemctl stop icegridnode.service > /dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable glacier2router.service \
-                   > /dev/null 2>&1 || :
-    /bin/systemctl stop glacier2router.service > /dev/null 2>&1 || :
-fi
-
-%postun servers
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart icegridregistry.service >/dev/null 2>&1 || :
-    /bin/systemctl try-restart icegridnode.service >/dev/null 2>&1 || :
-    /bin/systemctl try-restart glacier2router.service >/dev/null 2>&1 || :
-fi
-
 %files devel
 %defattr(-,root,root,-)
 %doc %{_mandir}/man1/slice2cpp.1.gz
@@ -603,6 +581,9 @@ fi
 
 
 %changelog
+* Wed Oct 17 2012 Haïkel Guémar <hguemar at fedoraproject.org> - 3.4.2-18
+- use macroized systemd directives (closes RHBZ #850152)
+
 * Sat Aug 04 2012 Haïkel Guémar <hguemar at fedoraproject.org> - 3.4.2-17
 - fix package requirements to follow the db4 -> libdb4 rename
 


More information about the scm-commits mailing list