[ipwatchd/f19] Initial import (#726989).

Jaroslav Imrich jariq at fedoraproject.org
Sat Oct 12 19:32:00 UTC 2013


commit a7486110956fd2a8bd1944b88f8ed4245ed72e7d
Author: Jaroslav Imrich <jariq at jariq.sk>
Date:   Sat Oct 12 21:31:18 2013 +0200

    Initial import (#726989).

 .gitignore             |    1 +
 ipwatchd-systemd.patch |   67 +++++++++++++++++++++++++++++++++++++++++++++++
 ipwatchd.spec          |   68 ++++++++++++++++++++++++++++++++++++++++++++++++
 sources                |    1 +
 4 files changed, 137 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..8c3a7e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ipwatchd-1.2.1.tar.gz
diff --git a/ipwatchd-systemd.patch b/ipwatchd-systemd.patch
new file mode 100644
index 0000000..1ec156e
--- /dev/null
+++ b/ipwatchd-systemd.patch
@@ -0,0 +1,67 @@
+diff -uNr ipwatchd-1.2.1/src/daemonize.c ipwatchd-1.2.1-systemd/src/daemonize.c
+--- ipwatchd-1.2.1/src/daemonize.c	2011-07-24 16:39:03.000000000 +0200
++++ ipwatchd-1.2.1-systemd/src/daemonize.c	2013-10-09 14:17:19.381133164 +0200
+@@ -41,12 +41,13 @@
+ 		return (IPWD_RV_ERROR);
+ 	}
+ 
+-	/* If parent of this process is init we are already in daemon mode */
+-	if (getppid () == 1)
+-	{
+-		ipwd_message (IPWD_MSG_TYPE_INFO, "Already running as daemon");
+-		return (IPWD_RV_SUCCESS);
+-	}
++	// Commented out so systemd can treat ipwatchd as "forking" service
++	///* If parent of this process is init we are already in daemon mode */
++	//if (getppid () == 1)
++	//{
++	//	ipwd_message (IPWD_MSG_TYPE_INFO, "Already running as daemon");
++	//	return (IPWD_RV_SUCCESS);
++	//}
+ 
+ 	/* Fork child process */
+ 	pid_t pid = fork ();
+diff -uNr ipwatchd-1.2.1/src/ipwatchd.service ipwatchd-1.2.1-systemd/src/ipwatchd.service
+--- ipwatchd-1.2.1/src/ipwatchd.service	1970-01-01 01:00:00.000000000 +0100
++++ ipwatchd-1.2.1-systemd/src/ipwatchd.service	2013-10-09 14:17:41.919028973 +0200
+@@ -0,0 +1,10 @@
++[Unit]
++Description=IP conflict detection daemon
++After=syslog.target network.target
++
++[Service]
++Type=forking
++ExecStart=/usr/sbin/ipwatchd -c /etc/ipwatchd.conf
++
++[Install]
++WantedBy=multi-user.target
+diff -uNr ipwatchd-1.2.1/src/Makefile ipwatchd-1.2.1-systemd/src/Makefile
+--- ipwatchd-1.2.1/src/Makefile	2011-07-24 16:39:03.000000000 +0200
++++ ipwatchd-1.2.1-systemd/src/Makefile	2013-10-09 14:12:29.492616767 +0200
+@@ -43,14 +43,15 @@
+ 
+ 
+ install:
+-	mkdir -p $(DESTDIR)/etc/init.d
++	mkdir -p $(DESTDIR)/etc
++	mkdir -p $(DESTDIR)/usr/lib/systemd/system
+ 	mkdir -p $(DESTDIR)/usr/sbin
+ 	mkdir -p $(DESTDIR)/usr/share/man/man8
+ 	mkdir -p $(DESTDIR)/usr/share/man/man5
+ 	mkdir -p $(DESTDIR)/usr/share/man/man1
+ 	cp ipwatchd $(DESTDIR)/usr/sbin
+ 	cp scripts/ipwatchd-script $(DESTDIR)/usr/sbin
+-	cp scripts/ipwatchd $(DESTDIR)/etc/init.d
++	cp ipwatchd.service $(DESTDIR)/usr/lib/systemd/system/
+ 	cp ipwatchd.conf $(DESTDIR)/etc
+ 	cp ../doc/ipwatchd.8.gz $(DESTDIR)/usr/share/man/man8
+ 	cp ../doc/ipwatchd.conf.5.gz $(DESTDIR)/usr/share/man/man5
+@@ -59,7 +60,7 @@
+ uninstall:
+ 	rm $(DESTDIR)/usr/sbin/ipwatchd
+ 	rm $(DESTDIR)/usr/sbin/ipwatchd-script
+-	rm $(DESTDIR)/etc/init.d/ipwatchd
++	rm $(DESTDIR)/usr/lib/systemd/system/ipwatchd.service
+ 	rm $(DESTDIR)/etc/ipwatchd.conf
+ 	rm $(DESTDIR)/usr/share/man/man8/ipwatchd.8.gz
+ 	rm $(DESTDIR)/usr/share/man/man5/ipwatchd.conf.5.gz
diff --git a/ipwatchd.spec b/ipwatchd.spec
new file mode 100644
index 0000000..158b48d
--- /dev/null
+++ b/ipwatchd.spec
@@ -0,0 +1,68 @@
+Name:              ipwatchd
+Version:           1.2.1
+Release:           3%{?dist}
+Summary:           IP conflict detection tool
+
+License:           GPLv2
+URL:               http://ipwatchd.sf.net
+Source0:           http://sourceforge.net/projects/ipwatchd/files/ipwatchd/%{version}/ipwatchd-%{version}.tar.gz
+Patch0:            ipwatchd-systemd.patch
+
+BuildRequires:     libpcap-devel, libnet-devel, systemd
+
+Requires(post):    systemd
+Requires(preun):   systemd
+Requires(postun):  systemd
+
+%description
+IPwatchD is a simple daemon that analyses all incoming ARP packets in order 
+to detect IP conflicts on Linux. It can be configured to listen on one or 
+more interfaces (alias interfaces are also supported) in active or passive 
+mode. In active mode IPwatchD protects your host before IP takeover by 
+answering Gratuitous ARP requests received from conflicting system. 
+In passive mode it just records information about conflict through standard 
+syslog interface.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+make -C src %{?_smp_mflags} CFLAGS="%{optflags}"
+
+%install
+make -C src install DESTDIR=%{buildroot}
+
+%post
+%systemd_post ipwatchd.service
+
+%preun
+%systemd_preun ipwatchd.service
+
+%postun
+%systemd_postun_with_restart ipwatchd.service
+
+%files
+%config(noreplace) %{_sysconfdir}/ipwatchd.conf
+%{_sbindir}/ipwatchd
+%{_sbindir}/ipwatchd-script
+%{_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
diff --git a/sources b/sources
index e69de29..f2efa09 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+a54f5b815cb98d4e17770cad7ff42679  ipwatchd-1.2.1.tar.gz


More information about the scm-commits mailing list