[rpld] Add pre/post stuff

Paul Komkoff stingray at fedoraproject.org
Tue Jul 5 12:58:08 UTC 2011


commit d1de2e58077c3f2aba398b1f2d8fee276fa10759
Author: Paul P. Komkoff Jr <i at stingr.net>
Date:   Tue Jul 5 16:57:44 2011 +0400

    Add pre/post stuff

 rpld.spec |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/rpld.spec b/rpld.spec
index 494da09..266e51a 100644
--- a/rpld.spec
+++ b/rpld.spec
@@ -1,6 +1,6 @@
 Name:           rpld
 Version:        1.8
-Release:        0.9.beta1%{?dist}
+Release:        0.10.beta1%{?dist}
 Summary:        RPL/RIPL remote boot daemon
 Group:          System Environment/Daemons
 # No version specified.
@@ -14,12 +14,28 @@ Patch0:         rpld_1.8beta1-6.diff.gz
 Patch1:         rpld-1.8-makefile.patch
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 BuildRequires:  byacc flex
+Requires(post): initscripts chkconfig
+Requires(preun): initscripts chkconfig
+Requires(postun): initscripts
 
 %description
 Daemon to net-boot IBM style RPL boot ROMs (this is not the
 same as the Novell IPX-style RPL protocol, despite the
 name).
 
+%post
+/sbin/chkconfig --add %{name}
+
+%preun
+if [ $1 = 0 ]; then
+        /sbin/service %{name} stop >/dev/null 2>&1
+fi
+
+%postun
+if [ "$1" -ge "1" ]; then
+        /sbin/service %{name} condrestart >/dev/null 2>&1 || :
+fi
+
 %prep
 %setup -q
 %patch0 -p1
@@ -64,6 +80,9 @@ rm -rf $RPM_BUILD_ROOT
 /lib/systemd/system/%{name}.service
 
 %changelog
+* Tue Jul 5 2011 Paul P. Komkoff Jr <i at stingr.net> - 1.8-0.10.beta1
+- add pre/postinstall stuff
+
 * Thu Jun 2 2011 Paul P. Komkoff Jr <i at stingr.net> - 1.8-0.9.beta1
 - add systemd service file
 


More information about the scm-commits mailing list