From b1a6eabbae6254aa301adc64bc367ab333a5f073 Mon Sep 17 00:00:00 2001 From: Francesco Colista Date: Fri, 24 Aug 2012 16:16:20 +0000 Subject: testing/dhcp-probe: added initd and confd files --- testing/dhcp-probe/APKBUILD | 17 ++++++++++++++--- testing/dhcp-probe/dhcp-probe.confd | 14 ++++++++++++++ testing/dhcp-probe/dhcp-probe.initd | 21 +++++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 testing/dhcp-probe/dhcp-probe.confd create mode 100644 testing/dhcp-probe/dhcp-probe.initd diff --git a/testing/dhcp-probe/APKBUILD b/testing/dhcp-probe/APKBUILD index 6e1d12c7a0..58ded1a2bd 100644 --- a/testing/dhcp-probe/APKBUILD +++ b/testing/dhcp-probe/APKBUILD @@ -3,7 +3,7 @@ pkgname=dhcp-probe _pkgname=dhcp_probe pkgver=1.3.0 -pkgrel=0 +pkgrel=1 pkgdesc="Allows network administrators to make calculations that will assist in subnetting a network" url="http://www.net.princeton.edu/software/dhcp_probe/" arch="all" @@ -13,7 +13,9 @@ depends_dev="libnet-dev libpcap-dev" makedepends="$depends_dev" install="" subpackages="$pkgname-doc" -source="http://www.net.princeton.edu/software/$_pkgname/$_pkgname-$pkgver.tar.gz" +source="http://www.net.princeton.edu/software/$_pkgname/$_pkgname-$pkgver.tar.gz + $pkgname.initd + $pkgname.confd" _builddir="$srcdir"/$_pkgname-$pkgver prepare() { local i @@ -32,5 +34,14 @@ build() { package() { cd "$_builddir" make DESTDIR="$pkgdir" install + mkdir -p "$srcdir"/etc/dhcp-probe + install -Dm755 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname || return 1 + install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname || return 1 + install -Dm755 "$_builddir"/extras/dhcp_probe.cf.sample "$pkgdir"/etc/dhcp-probe/dhcp_probe.cf || return 1 + for f in dhcp_probe_notify dhcp_probe_notify2 mail-throttled; do + install -Dm755 "$_builddir"/extras/$f "$pkgdir"/etc/dhcp-probe/$f || return 1 + done } -md5sums="8067e696fbd88120bdcc2ffef4b64da2 dhcp_probe-1.3.0.tar.gz" +md5sums="8067e696fbd88120bdcc2ffef4b64da2 dhcp_probe-1.3.0.tar.gz +d69a227cd436b60f918633a7f7ac7034 dhcp-probe.initd +1ffbda883f84af0daf5a2992370de643 dhcp-probe.confd" diff --git a/testing/dhcp-probe/dhcp-probe.confd b/testing/dhcp-probe/dhcp-probe.confd new file mode 100644 index 0000000000..0dee6058cd --- /dev/null +++ b/testing/dhcp-probe/dhcp-probe.confd @@ -0,0 +1,14 @@ +#-d debuglevel enable debugging at specified level +#-f don't fork (only use for debugging) +#-l log_file log to file instead of syslog +#-o capture_file enable capturing of unexpected answers +#-p pid_file override default pid file [/var/run/dhcp_probe.pid] +#-Q vlan_id tag outgoing frames with an 802.1Q VLAN ID +#-s capture_bufsize override default capture bufsize [30280] +#-T enable the socket receive timeout feature +#-w cwd override default working directory [/] + +INTERFACE=eth0 +CONFIGFILE="/etc/dhcp-probe/dhcp_probe.cf" +PID="/var/run/dhcp_probe.pid" +PARAMS="-c $CONFIGFILE -p $PID $INTERFACE" diff --git a/testing/dhcp-probe/dhcp-probe.initd b/testing/dhcp-probe/dhcp-probe.initd new file mode 100644 index 0000000000..ba08560b38 --- /dev/null +++ b/testing/dhcp-probe/dhcp-probe.initd @@ -0,0 +1,21 @@ +#!/sbin/runscript + +depend() { + need net + use syslog + +} + +start() { + ebegin "Starting DHCP Probe" + start-stop-daemon --start --quiet --background --make-pidfile \ + --pidfile /var/run/dhcp_probe.pid --exec /usr/sbin/dhcp_probe \ + -- $PARAMS + eend $? +} + +stop() { + ebegin "Stopping DHCP Probe" + start-stop-daemon --stop --quiet --pidfile /var/run/dhcp_probe.pid + eend $? +} -- cgit v1.2.3