summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2003-11-04 03:23:48 +0000
committerMike Frysinger <vapier@gentoo.org>2003-11-04 03:23:48 +0000
commit63a38d0f0b253fc435611873d7f7c68ab6368fa8 (patch)
treeaed09f6bccdc72a5f0fe6d27cf0611423ac7d58e /net-misc/rarpd
parentSmall fix to install docs. (diff)
downloadgentoo-2-63a38d0f0b253fc435611873d7f7c68ab6368fa8.tar.gz
gentoo-2-63a38d0f0b253fc435611873d7f7c68ab6368fa8.tar.bz2
gentoo-2-63a38d0f0b253fc435611873d7f7c68ab6368fa8.zip
init scripts #32540
Diffstat (limited to 'net-misc/rarpd')
-rw-r--r--net-misc/rarpd/ChangeLog7
-rw-r--r--net-misc/rarpd/files/1.1-daemon.patch29
-rw-r--r--net-misc/rarpd/files/digest-rarpd-1.1-r21
-rw-r--r--net-misc/rarpd/files/rarpd.conf.d8
-rw-r--r--net-misc/rarpd/files/rarpd.init.d32
-rw-r--r--net-misc/rarpd/rarpd-1.1-r2.ebuild40
6 files changed, 116 insertions, 1 deletions
diff --git a/net-misc/rarpd/ChangeLog b/net-misc/rarpd/ChangeLog
index c397b22d97d2..4440a3a44f04 100644
--- a/net-misc/rarpd/ChangeLog
+++ b/net-misc/rarpd/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-misc/rarpd
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/rarpd/ChangeLog,v 1.6 2003/08/21 04:59:43 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/rarpd/ChangeLog,v 1.7 2003/11/04 03:23:48 vapier Exp $
+
+*rarpd-1.1-r2 (03 Nov 2003)
+
+ 03 Nov 2003; Mike Frysinger <vapier@gentoo.org> :
+ Add init.d scripts and a daemon patch #32540 to write a pid file.
*rarpd-1.1-r1 (21 Aug 2003)
diff --git a/net-misc/rarpd/files/1.1-daemon.patch b/net-misc/rarpd/files/1.1-daemon.patch
new file mode 100644
index 000000000000..7a2d68b856f8
--- /dev/null
+++ b/net-misc/rarpd/files/1.1-daemon.patch
@@ -0,0 +1,29 @@
+--- rarpd.c.orig 2003-11-03 22:10:41.000304928 -0500
++++ rarpd.c 2003-11-03 22:13:52.683164704 -0500
+@@ -429,12 +429,25 @@
+ openlog(program_name, syslogflags, LOG_LOCAL1);
+
+ if (!nofork) {
++ FILE *pidfile;
+ pid = fork();
+- if (pid > 0) exit(0);
+ if (pid < 0) {
+ syslog(LOG_ERR, "%s: fork failed: %s", program_name, strerror(errno));
+ exit(1);
+ }
++ if (pid) {
++ pidfile = fopen("/var/run/rarpd.pid", "w");
++ if (pidfile) {
++ fprintf(pidfile, "%i", pid);
++ fclose(pidfile);
++ } else
++ perror("Could not write pidfile");
++ exit(0);
++ }
++ chdir("/");
++ close(0);
++ close(1);
++ close(2);
+ }
+
+ if (ethers == NULL) ethers = _PATH_ETHERS;
diff --git a/net-misc/rarpd/files/digest-rarpd-1.1-r2 b/net-misc/rarpd/files/digest-rarpd-1.1-r2
new file mode 100644
index 000000000000..bd90889fe960
--- /dev/null
+++ b/net-misc/rarpd/files/digest-rarpd-1.1-r2
@@ -0,0 +1 @@
+MD5 04e2ca849e758d0b88c8281775ec3b58 rarpd-1.1.tar.gz 32053
diff --git a/net-misc/rarpd/files/rarpd.conf.d b/net-misc/rarpd/files/rarpd.conf.d
new file mode 100644
index 000000000000..9c432c8e1ee1
--- /dev/null
+++ b/net-misc/rarpd/files/rarpd.conf.d
@@ -0,0 +1,8 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/rarpd/files/rarpd.conf.d,v 1.1 2003/11/04 03:23:48 vapier Exp $
+
+# Config file for /etc/init.d/rarpd
+
+# see the rarpd(8) manpage for more info
+RARPD_OPTS=""
diff --git a/net-misc/rarpd/files/rarpd.init.d b/net-misc/rarpd/files/rarpd.init.d
new file mode 100644
index 000000000000..fb4f05d36816
--- /dev/null
+++ b/net-misc/rarpd/files/rarpd.init.d
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-misc/rarpd/files/rarpd.init.d,v 1.1 2003/11/04 03:23:48 vapier Exp $
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f /etc/ethers ] ; then
+ eerror "Please create /etc/ethers with the following content:"
+ eerror "[MAC address] [name or IP]"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting rarpd"
+ /usr/sbin/rarpd ${RARPD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping rarpd"
+ kill $(</var/run/rarpd.pid)
+ eend $?
+ rm -f /var/run/rarpd.pid
+}
diff --git a/net-misc/rarpd/rarpd-1.1-r2.ebuild b/net-misc/rarpd/rarpd-1.1-r2.ebuild
new file mode 100644
index 000000000000..3e59576a4bfb
--- /dev/null
+++ b/net-misc/rarpd/rarpd-1.1-r2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/rarpd/rarpd-1.1-r2.ebuild,v 1.1 2003/11/04 03:23:48 vapier Exp $
+
+inherit eutils
+
+DESCRIPTION="Reverse Address Resolution Protocol Daemon"
+HOMEPAGE="ftp://ftp.dementia.org/pub/net-tools"
+SRC_URI="ftp://ftp.dementia.org/pub/net-tools/${P}.tar.gz"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc"
+
+DEPEND=">=net-libs/libnet-1.0.2a-r3
+ <net-libs/libnet-1.1
+ >=net-libs/libpcap-0.7.1"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/${PV}-libnet-1.0.patch
+ epatch ${FILESDIR}/${PV}-daemon.patch
+}
+
+src_compile() {
+ econf || die
+ emake || die
+}
+
+src_install() {
+ #make install DESTDIR=${D} || die # only installs rarpd to /
+ dosbin rarpd
+ doman rarpd.8
+ dodoc AUTHORS COPYING README TODO VERSION INSTALL
+ insinto /etc/conf.d
+ newins ${FILESDIR}/rarpd.conf.d rarpd
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/rarpd.init.d rarpd
+}