[ipwatchd/el5] Spec file updated for el5
Jaroslav Imrich
jariq at fedoraproject.org
Wed Oct 16 21:34:31 UTC 2013
commit 39d0a5bb1e656ee277bdb05e513149316a8073d4
Author: Jaroslav Imrich <jariq at jariq.sk>
Date: Wed Oct 16 23:34:09 2013 +0200
Spec file updated for el5
ipwatchd.spec | 78 +++++++++++++++++++++++++++++++++++---------------------
1 files changed, 49 insertions(+), 29 deletions(-)
---
diff --git a/ipwatchd.spec b/ipwatchd.spec
index 158b48d..9d0f712 100644
--- a/ipwatchd.spec
+++ b/ipwatchd.spec
@@ -1,18 +1,25 @@
-Name: ipwatchd
-Version: 1.2.1
-Release: 3%{?dist}
-Summary: IP conflict detection tool
+%if 0%{?rhel} < 6
+%global _initddir %{_initrddir}
+%endif
-License: GPLv2
-URL: http://ipwatchd.sf.net
-Source0: http://sourceforge.net/projects/ipwatchd/files/ipwatchd/%{version}/ipwatchd-%{version}.tar.gz
-Patch0: ipwatchd-systemd.patch
+Name: ipwatchd
+Version: 1.2.1
+Release: 3%{?dist}
+Summary: IP conflict detection tool
-BuildRequires: libpcap-devel, libnet-devel, systemd
+Group: System Environment/Daemons
+License: GPLv2
+URL: http://ipwatchd.sf.net
+Source0: http://sourceforge.net/projects/ipwatchd/files/ipwatchd/%{version}/ipwatchd-%{version}.tar.gz
+Patch0: ipwatchd-sysvinit.patch
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
+BuildRequires: libpcap-devel, libnet-devel
+
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+Requires(postun): initscripts
%description
IPwatchD is a simple daemon that analyses all incoming ARP packets in order
@@ -31,38 +38,51 @@ syslog interface.
make -C src %{?_smp_mflags} CFLAGS="%{optflags}"
%install
+rm -rf %{buildroot}
make -C src install DESTDIR=%{buildroot}
+# Move init script to /etc/rc.d/init.d
+mkdir -p %{buildroot}%{_initddir}
+mv %{buildroot}/etc/init.d/ipwatchd %{buildroot}%{_initddir}
%post
-%systemd_post ipwatchd.service
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /sbin/chkconfig --add ipwatchd
+fi
%preun
-%systemd_preun ipwatchd.service
+if [ $1 -eq 0 ] ; then
+ # Package is being removed (not upgraded)
+ /sbin/service ipwatchd stop > /dev/null 2>&1 || :
+ /sbin/chkconfig --del ipwatchd
+fi
%postun
-%systemd_postun_with_restart ipwatchd.service
+if [ $1 -ge 1 ] ; then
+ # Package is being upgraded (not removed)
+ /sbin/service ipwatchd condrestart > /dev/null 2>&1 || :
+fi
+
+%clean
+rm -rf %{buildroot}
%files
+%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/ipwatchd.conf
%{_sbindir}/ipwatchd
%{_sbindir}/ipwatchd-script
+%{_initddir}/ipwatchd
%{_mandir}/man8/ipwatchd.8*
%{_mandir}/man5/ipwatchd.conf.5*
%{_mandir}/man1/ipwatchd-script.1*
-%{_unitdir}/ipwatchd.service
%doc LICENSE
%changelog
-* Wed Oct 09 2013 Jaroslav Imrich <jariq at jariq.sk> 1.2.1-3
-- Passing optflags to compiler during build
-- Added LICENSE to the files section
-- Other minor spec improvements
-
-* Wed Oct 09 2013 Jaroslav Imrich <jariq at jariq.sk> 1.2.1-2
-- Removed Group tag as it is no longer required
-- Using version macro in URL tag
-- Requires systemd instead of systemd-units
-- Changed systemd service type to forking (ipwatchd-systemd.patch)
-
-* Sun Jul 31 2011 Jaroslav Imrich <jariq at jariq.sk> 1.2.1-1
-- Initial release
+* Wed Oct 16 2013 Jaroslav Imrich <jariq at jariq.sk> 1.2.1-3
+- Minor changes for EPEL5
+
+* Mon Oct 14 2013 Jaroslav Imrich <jariq at jariq.sk> 1.2.1-2
+- Updated for EPEL6
+
+* Sat Mar 02 2013 Jaroslav Imrich <jariq at jariq.sk> 1.2.1-1
+- Initial release for CentOS6
More information about the scm-commits
mailing list