[rpld] .

Paul Komkoff stingray at fedoraproject.org
Mon Nov 28 18:16:11 UTC 2011


commit 39b2bcae238a791552c86b600ed4aaed05654723
Author: Paul P. Komkoff <i at stingr.net>
Date:   Mon Nov 28 21:28:04 2011 +0400

    .

 rpld.spec |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 51 insertions(+), 4 deletions(-)
---
diff --git a/rpld.spec b/rpld.spec
index d7b77ce..f34c291 100644
--- a/rpld.spec
+++ b/rpld.spec
@@ -1,6 +1,6 @@
 Name:           rpld
 Version:        1.8
-Release:        0.11.beta1%{?dist}
+Release:        0.12.beta1%{?dist}
 Summary:        RPL/RIPL remote boot daemon
 Group:          System Environment/Daemons
 # No version specified.
@@ -14,15 +14,53 @@ Patch0:         rpld_1.8beta1-6.diff.gz
 Patch1:         rpld-1.8-makefile.patch
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 BuildRequires:  byacc flex
+%if 0%{?fedora} >= 15
+BuildRequires: systemd-units
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%else
 Requires(post): initscripts chkconfig
 Requires(preun): initscripts chkconfig
 Requires(postun): initscripts
+%endif
 
 %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).
 
+%if 0%{?fedora} >= 15
+%package sysvinit
+Summary: SysV init script for %{name}.
+
+%description sysvinit
+SysV init script for %{name}.
+
+%triggerpostun -n rpld-sysvinit -- packagename < 1.8-0.12.beta1
+/sbin/chkconfig --add httpd >/dev/null 2>&1 || :
+
+%post
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+    echo foo1
+fi
+
+%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
+
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart rpld.service >/dev/null 2>&1 || :
+fi
+%else
 %post
 /sbin/chkconfig --add %{name}
 
@@ -36,6 +74,7 @@ fi
 if [ "$1" -ge "1" ]; then
         /sbin/service %{name} condrestart >/dev/null 2>&1 || :
 fi
+%endif
 
 %prep
 %setup -q
@@ -65,8 +104,10 @@ install -d $RPM_BUILD_ROOT%{_initrddir}
 install -m 0755 %SOURCE1 $RPM_BUILD_ROOT%{_initrddir}/%{name}
 install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
 install -m 0644 %SOURCE2 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
-install -d $RPM_BUILD_ROOT/lib/systemd/system
-install -m 0644 %SOURCE3 $RPM_BUILD_ROOT/lib/systemd/system/%{name}.service
+%if 0%{?fedora} >= 15
+install -d $RPM_BUILD_ROOT%{_unitdir}
+install -m 0644 %SOURCE3 $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -76,11 +117,17 @@ rm -rf $RPM_BUILD_ROOT
 %doc README LICENSE INSTALL rpld.conf.sample
 %{_sbindir}/*
 %{_mandir}/man[^3]/*
-%{_initrddir}/%{name}
 %{_sysconfdir}/sysconfig/%{name}
+%if 0%{?fedora} >= 15
 /lib/systemd/system/%{name}.service
+%files sysvinit
+%endif
+%{_initrddir}/%{name}
 
 %changelog
+* Mon Nov 28 2011 Paul P. Komkoff Jr <i at stingr.net> - 1.8-0.12.beta1
+- fixing the systemd/initscript
+
 * Mon Oct 31 2011 Paul P. Komkoff Jr <i at stingr.net> - 1.8-0.11.beta1
 - fixes for specfile and init script
 


More information about the scm-commits mailing list