From f59fc0dd7bbc2469ada752fe6edc96dea3da8c04 Mon Sep 17 00:00:00 2001 From: Michael Mason Date: Wed, 18 Mar 2009 16:48:22 +0000 Subject: Tested arpwatch build. Moving to extra --- extra/arpwatch/APKBUILD | 36 ++++++++++++++++++++++++++++++++++++ extra/arpwatch/arpwatch.confd | 12 ++++++++++++ extra/arpwatch/arpwatch.initd | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 extra/arpwatch/APKBUILD create mode 100644 extra/arpwatch/arpwatch.confd create mode 100644 extra/arpwatch/arpwatch.initd (limited to 'extra/arpwatch') diff --git a/extra/arpwatch/APKBUILD b/extra/arpwatch/APKBUILD new file mode 100644 index 000000000..ed18e5966 --- /dev/null +++ b/extra/arpwatch/APKBUILD @@ -0,0 +1,36 @@ +# Contributor: Michael Mason +# 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/extra/arpwatch/arpwatch.confd b/extra/arpwatch/arpwatch.confd new file mode 100644 index 000000000..f44221aa3 --- /dev/null +++ b/extra/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/extra/arpwatch/arpwatch.initd b/extra/arpwatch/arpwatch.initd new file mode 100644 index 000000000..e039e1db8 --- /dev/null +++ b/extra/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 +} -- cgit v1.2.3