[gridengine] Use updated systemd scriptlets (bug #850136)

Orion Poplawski orion at fedoraproject.org
Thu Apr 25 02:47:59 UTC 2013


commit 13bd7814754ade20d0450cb7dc338c2c4cd6f054
Author: Orion Poplawski <orion at cora.nwra.com>
Date:   Wed Apr 24 20:47:50 2013 -0600

    Use updated systemd scriptlets (bug #850136)

 gridengine.spec |   83 +++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 69 insertions(+), 14 deletions(-)
---
diff --git a/gridengine.spec b/gridengine.spec
index 87a4b5f..4349485 100644
--- a/gridengine.spec
+++ b/gridengine.spec
@@ -12,7 +12,7 @@
 
 Name:    gridengine
 Version: 2011.11p1
-Release: 9%{?dist}
+Release: 10%{?dist}
 Summary: Grid Engine - Distributed Computing Management software
 
 Group:   Applications/System
@@ -79,8 +79,12 @@ BuildRequires: hostname
 %endif
 BuildRequires: hwloc-devel
 BuildRequires: jemalloc-devel
-%if 0%{?fedora} >= 15
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
 BuildRequires: systemd-units
+%else
+BuildRequires: systemd
+%endif
 %endif
 Requires: binutils
 Requires: ncurses
@@ -134,11 +138,17 @@ Summary: Gridengine execd program
 Group: Development/Libraries
 License: BSD and LGPLv2+ and MIT and SISSL
 Requires: %{name} = %{version}-%{release}
-%if 0%{?fedora} >= 15
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
+Requires(post): systemd
+Requires(postun): systemd
+Requires(preun): systemd
+%else
 Requires(post): systemd-units
 Requires(post): systemd-sysv
 Requires(postun): systemd-units
 Requires(preun): systemd-units
+%endif
 %else
 Requires(post): /sbin/chkconfig
 Requires(postun): /sbin/service
@@ -158,11 +168,17 @@ Group: Development/Libraries
 License: BSD and LGPLv2+ and MIT and SISSL
 Requires: %{name} = %{version}-%{release}
 Requires: db4-utils
-%if 0%{?fedora} >= 15
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
+Requires(post): systemd
+Requires(postun): systemd
+Requires(preun): systemd
+%else
 Requires(post): systemd-units
 Requires(post): systemd-sysv
 Requires(postun): systemd-units
 Requires(preun): systemd-units
+%endif
 %else
 Requires(post): /sbin/chkconfig
 Requires(postun): /sbin/service
@@ -463,38 +479,56 @@ fi
 
 
 %post execd
-%if 0%{?fedora} >= 15
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
+%systemd_post sge_execd.service
+%else
 if [ $1 -eq 1 ] ; then 
     # Initial installation 
     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 fi
+%endif
 %else
 /sbin/chkconfig --add sge_execd
 %endif
 
 
 %postun execd
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
+%systemd_postun_with_restart sge_execd.service
+%else
 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
-%if 0%{?fedora} >= 15
     /bin/systemctl try-restart sge_execd.service >/dev/null 2>&1 || :
+fi
+%endif
 %else
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
     /sbin/service sge_execd condrestart >/dev/null 2>&1 || :
-%endif
 fi
+%endif
 
 %preun execd
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
+%systemd_preun sge_execd.service
+%else
 if [ $1 -eq 0 ] ; then
     # Package removal, not upgrade
-%if 0%{?fedora} >= 15
     /bin/systemctl --no-reload disable sge_execd.service > /dev/null 2>&1 || :
     /bin/systemctl stop sge_execd.service > /dev/null 2>&1 || :
+fi
+%endif
 %else
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
     /sbin/service sge_execd stop
     /sbin/chkconfig --del sge_execd
-%endif
 fi
+%endif
 
 %if 0%{?fedora} >= 15
 %triggerun -- gridengine-execd < 6.2u5p2-2
@@ -504,37 +538,55 @@ fi
 %endif
 
 %post qmaster
-%if 0%{?fedora} >= 15
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
+%systemd_post sgemaster.service
+%else
 if [ $1 -eq 1 ] ; then 
     # Initial installation 
     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 fi
+%endif
 %else
 /sbin/chkconfig --add sgemaster
 %endif
 
 %postun qmaster
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
+%systemd_postun_with_restart sgemaster.service
+%else
 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
-%if 0%{?fedora} >= 15
     /bin/systemctl try-restart sgemaster.service >/dev/null 2>&1 || :
+fi
+%endif
 %else
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
     /sbin/service sgemaster condrestart >/dev/null 2>&1 || :
-%endif
 fi
+%endif
 
 %preun qmaster
+%if 0%{?fedora}
+%if 0%{?fedora} >= 18
+%systemd_preun sgemaster.service
+%else
 if [ $1 -eq 0 ] ; then
     # Package removal, not upgrade
-%if 0%{?fedora} >= 15
     /bin/systemctl --no-reload disable sgemaster.service > /dev/null 2>&1 || :
     /bin/systemctl stop sgemaster.service > /dev/null 2>&1 || :
+fi
+%endif
 %else
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
     /sbin/service sgemaster stop
     /sbin/chkconfig --del sgemaster
-%endif
 fi
+%endif
 
 %if 0%{?fedora} >= 15
 %triggerun -- gridengine-qmaster < 6.2u5p2-2
@@ -652,6 +704,9 @@ fi
 
 
 %changelog
+* Wed Apr 24 2013 Orion Poplawski <orion at cora.nwra.com> - 2011.11p1-10
+- Use updated systemd scriptlets (bug #850136)
+
 * Mon Apr 22 2013 Orion Poplawski <orion at cora.nwra.com> - 2011.11p1-9
 - Only BR ant-nodeps on RHEL
 


More information about the scm-commits mailing list