[phrel/el6: 2/2] Add support for EPEL6

Christopher Meng cicku at fedoraproject.org
Wed May 29 06:20:18 UTC 2013


commit ffcce39f4d9af834d91c5432ad6dccbfee6b3732
Author: Christopher Meng <rpm at cicku.me>
Date:   Wed May 29 14:19:50 2013 +0800

    Add support for EPEL6

 phrel.spec     |   25 ++++++++++++++-----------
 phreld.service |   11 -----------
 2 files changed, 14 insertions(+), 22 deletions(-)
---
diff --git a/phrel.spec b/phrel.spec
index 6370e6e..62daf36 100644
--- a/phrel.spec
+++ b/phrel.spec
@@ -8,16 +8,15 @@ Summary:           Per Host RatE Limiter
 License:           GPLv2
 URL:               http://www.digitalgenesis.com/software/phrel
 Source0:           ftp://ftp.digitalgenesis.com/pub/%{name}/%{name}-%{version}.tar.bz2
-Source1:           %{dname}.service
 
 Buildrequires:     libpcap-devel
 Buildrequires:     mysql-devel
 Buildrequires:     net-snmp-devel
-BuildRequires:     systemd
 Requires:          iptables
-Requires(post):    systemd
-Requires(preun):   systemd
-Requires(postun):  systemd
+Requires(post):    chkconfig
+Requires(preun):   chkconfig
+Requires(preun):   initscripts
+BuildRoot:         %{_tmppath}/%{name}-%{version}-%{release}-root
 
 %description
 PHREL is a Per Host RatE Limiter written in C to efficiently track the rate 
@@ -43,21 +42,25 @@ export LDFLAGS="$LDFLAGS -pie -Wl,-z,relro"
 make CFLAGS="%{optflags}" %{?_smp_mflags}
 
 %install
+rm -rf %{buildroot}
 make install DESTDIR=%{buildroot}
 install -p -D -m 644 contrib/%{dname}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{dname}
+install -p -D -m 755 contrib/%{dname}.init %{buildroot}%{_initrddir}/%{dname}
 install -p -D -m 644 %{dname}.conf %{buildroot}%{_sysconfdir}/%{dname}.conf
 install -d %{buildroot}%{_localstatedir}/%{dname}
-install -p -D -m 644 %{S:1} %{buildroot}%{_unitdir}/%{dname}.service
 find %{buildroot} -name '*.a' -exec rm -f {} ';'
 
 %post
-%systemd_post %{S:1}
+/sbin/chkconfig --add %{dname}
 
 %preun
-%systemd_preun %{S:1}
+if [ $1 -eq 0 ] ; then
+    /sbin/service %{dname} stop >/dev/null 2>&1
+    /sbin/chkconfig --del %{dname}
+fi
 
-%postun
-%systemd_postun_with_restart %{S:1}
+%clean
+rm -rf %{buildroot}
 
 %files
 %doc AUTHORS ChangeLog COPYING README 
@@ -69,7 +72,7 @@ find %{buildroot} -name '*.a' -exec rm -f {} ';'
 %{_mandir}/man1/*.1*
 %{_mandir}/man5/*.conf.5*
 %{_localstatedir}/%{dname}
-%{_unitdir}/%{dname}.service
+%{_initrddir}/%{dname}
 
 %changelog
 * Wed May 08 2013 Christopher Meng <rpm at cicku.me> - 1.0.1-1


More information about the scm-commits mailing list