[iputils] fixes #697532 - The SysV initscript should be packaged into subpackage

Jiri Skala jskala at fedoraproject.org
Mon Jun 27 13:07:48 UTC 2011


commit d883edb30032069cb643a5d0b4e9934b7156f385
Author: Jiri Skala <jskala at redhat.com>
Date:   Mon Jun 27 15:07:34 2011 +0200

    fixes #697532 - The SysV initscript should be packaged into subpackage

 iputils.spec |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/iputils.spec b/iputils.spec
index 297bf0d..34a0b04 100644
--- a/iputils.spec
+++ b/iputils.spec
@@ -1,7 +1,7 @@
 Summary: Network monitoring tools including ping
 Name: iputils
 Version: 20101006
-Release: 8%{?dist}
+Release: 9%{?dist}
 License: BSD
 URL: http://www.skbuff.net/iputils
 Group: System Environment/Daemons
@@ -37,11 +37,9 @@ BuildRequires: libidn-devel
 BuildRequires: openssl-devel
 BuildRequires: libcap-devel
 Requires(post): /sbin/chkconfig
-Requires(post): systemd-units
 Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
+Requires(post): systemd-units
 Requires(preun): systemd-units
-Requires(postun): /sbin/service
 Requires(postun): systemd-units
 
 %description
@@ -50,6 +48,16 @@ including ping. The ping command sends a series of ICMP protocol
 ECHO_REQUEST packets to a specified network host to discover whether
 the target machine is alive and receiving network traffic.
 
+%package sysvinit
+Group: System Environment/Daemons
+Summary: SysV initscript for rdisc daemon
+Requires: %{name} = %{version}-%{release}
+Requires(preun): /sbin/service
+Requires(postun): /sbin/service
+
+%description sysvinit
+The iputils-sysvinit contains SysV initscritps support.
+
 %prep
 %setup -q -a 1 -n %{name}-s%{version}
 
@@ -126,14 +134,10 @@ touch -r RELNOTES RELNOTES.tmp
 mv -f RELNOTES.tmp RELNOTES
 
 %post
-/sbin/chkconfig --add rdisc
 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 
 %preun
 if [ $1 = 0 ]; then
-	service rdisc stop >/dev/null 2>&1
-	/sbin/chkconfig --del rdisc
-
 	/bin/systemctl disable rdisc.service > /dev/null 2>&1 || :
 	/bin/systemctl stop rdisc.service > /dev/null 2>&1 || :
 fi 
@@ -142,13 +146,15 @@ fi
 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 
 if [ "$1" -ge "1" ]; then
-	service rdisc status 2>&1 > /dev/null
-	if [ $? -eq 0 ]; then
-		service rdisc restart >/dev/null 2>&1 || :
-	fi
 	/bin/systemctl try-restart rdisc.service >/dev/null 2>&1 || :
 fi
 
+%triggerun --  %{name} < 20101006-9
+	/sbin/chkconfig --del rdisc >/dev/null 2>&1 || :
+	/bin/systemctl try-restart rdisc.service >/dev/null 2>&1 || :
+
+%triggerpostun -n %{name}-sysvinit -- %{name} < 20101006-9
+	/sbin/chkconfig --add rdisc >/dev/null 2>&1 || :
 
 %clean
 rm -rf ${RPM_BUILD_ROOT}
@@ -170,10 +176,15 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_sbindir}/tracepath
 %{_sbindir}/tracepath6
 %attr(644,root,root) %{_mandir}/man8/*
-%{_sysconfdir}/rc.d/init.d/rdisc
 %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/rdisc
 
+%files sysvinit
+%{_sysconfdir}/rc.d/init.d/rdisc
+
 %changelog
+* Mon Jun 27 2011 Jiri Skala <jskala at redhat.com> - 20101006-9
+- fixes #697532 - The SysV initscript should be packaged into subpackage
+
 * Tue Mar 29 2011 Jiri Skala <jskala at redhat.com> - 20101006-8
 - fixes #663734 - ping/ping6 man page fixes
 - fixes #673831 - tracepath/tracepath6 manpage fixes


More information about the scm-commits mailing list