diff options
Diffstat (limited to 'main/arpwatch')
-rw-r--r-- | main/arpwatch/APKBUILD | 36 | ||||
-rw-r--r-- | main/arpwatch/arpwatch.confd | 12 | ||||
-rw-r--r-- | main/arpwatch/arpwatch.initd | 37 |
3 files changed, 85 insertions, 0 deletions
diff --git a/main/arpwatch/APKBUILD b/main/arpwatch/APKBUILD new file mode 100644 index 000000000..ed18e5966 --- /dev/null +++ b/main/arpwatch/APKBUILD @@ -0,0 +1,36 @@ +# Contributor: Michael Mason <ms13sp@gmail.com> +# Maintainer: +pkgname=arpwatch +pkgver=2.1a15 +pkgrel=0 +pkgdesc="Ethernet monitoring program" +url="http://www-nrg.ee.lbl.gov/" +license="GPL" +depends="uclibc libpcap" +makedepends="libpcap-dev" +install= +subpackages="" +source="ftp://ftp.ee.lbl.gov/$pkgname.tar.gz + arpwatch.confd + arpwatch.initd" + +build() { + cd "$srcdir/$pkgname-$pkgver" + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make -j1 || return 1 + #install command wouldn't create directory ? + mkdir -p "$pkgdir"/usr/sbin/ + make -j1 DESTDIR="$pkgdir" install + + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname + +} + +md5sums="cebfeb99c4a7c2a6cee2564770415fe7 arpwatch.tar.gz +dc8300ce5f02d6be95899a2982397064 arpwatch.confd +404226ad0d10ce9b46b76f058e572426 arpwatch.initd" diff --git a/main/arpwatch/arpwatch.confd b/main/arpwatch/arpwatch.confd new file mode 100644 index 000000000..f44221aa3 --- /dev/null +++ b/main/arpwatch/arpwatch.confd @@ -0,0 +1,12 @@ +# Config file for /etc/init.d/arpwatch +# see arpwatch.8 for more information + +#IFACES="eth0 eth1" +IFACES="eth0" + +# Additional options to pass to arpwatch. +OPTIONS="-N -p" + +# Comment this line if you wish arpwatch to run as root user (not recommended) +ARPUSER="arpwatch" + diff --git a/main/arpwatch/arpwatch.initd b/main/arpwatch/arpwatch.initd new file mode 100644 index 000000000..e039e1db8 --- /dev/null +++ b/main/arpwatch/arpwatch.initd @@ -0,0 +1,37 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-analyzer/arpwatch/files/arpwatch.initd,v 1.1 2007/06/02 22:37:16 jokey Exp $ + +depend() { + need net +} + +start() { + for IFACE in ${IFACES} + do + ebegin "Starting arpwatch on ${IFACE}" + DATAFILE=/var/lib/arpwatch/${IFACE}.dat + [ ! -f ${DATAFILE} ] && touch ${DATAFILE} + + if [ -z ${ARPUSER} ]; then + start-stop-daemon --start --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \ + /usr/sbin/arpwatch -- -i ${IFACE} -f ${DATAFILE} -P /var/run/arpwatch.${IFACE}.pid ${OPTIONS} + else + chown ${ARPUSER} ${DATAFILE} + start-stop-daemon --start --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \ + /usr/sbin/arpwatch -- -i $IFACE -u ${ARPUSER} -f ${DATAFILE} -P /var/run/arpwatch.${IFACE}.pid ${OPTIONS} + fi + eend $? + done +} + +stop() { + for IFACE in ${IFACES} + do + ebegin "Stopping arpwatch on ${IFACE}" + start-stop-daemon --stop --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \ + /usr/sbin/arpwatch + eend $? + done +} |