diff -Nu iperf/iperf.conf iperf-new/iperf.conf --- iperf/iperf.conf 1970-01-01 01:00:00.000000000 +0100 +++ iperf-new/iperf.conf 2012-05-15 19:03:11.591620988 +0200 @@ -0,0 +1,7 @@ +# vim:set ts=2 sw=2 ft=sh noet: + +# daemon pid file +#PIDFILE='/run/iperf.pid' + +# daemon options. treated as an array. +DAEMON_OPTS='--output /tmp/iperf.log' diff -Nu iperf/iperf.rc iperf-new/iperf.rc --- iperf/iperf.rc 1970-01-01 01:00:00.000000000 +0100 +++ iperf-new/iperf.rc 2012-05-15 19:24:41.074947057 +0200 @@ -0,0 +1,48 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +[[ -r /etc/conf.d/${0##*/} ]] && . /etc/conf.d/${0##*/} + +DAEMON=${DAEMON:-/usr/bin/iperf} +PIDFILE=${PIDFILE:-/run/${0##*/}.pid} +DAEMON_OPTS="--server $DAEMON_OPTS" + +# check pid +[[ -r "$PIDFILE" ]] && + read PID < "$PIDFILE" && [[ -n $PID ]] && kill -0 $PID &>/dev/null || unset PID + +case "$1" in + start) + stat_busy "Starting ${0##*/} daemon" + [[ -z $PID ]] && + { $DAEMON $DAEMON_OPTS &>/dev/null & } && + echo "$!" > "$PIDFILE" && + disown %% && + add_daemon ${0##*/} && + stat_done && + exit 0 + stat_fail + ;; + stop) + stat_busy "Stopping ${0##*/} daemon" + [[ -n $PID ]] && kill $PID &> /dev/null && + rm_daemon ${0##*/} && + rm -f "$PIDFILE" && + stat_done && + exit 0 + stat_fail + ;; + restart) + $0 stop + $0 start + exit 0 + ;; + *) + echo "usage: ${0##*/} {start|stop|restart}" >&2 + ;; +esac + +exit 1 + +# vim:set ts=2 sw=2 ft=sh noet: diff -Nu iperf/iperf-udp.conf iperf-new/iperf-udp.conf --- iperf/iperf-udp.conf 1970-01-01 01:00:00.000000000 +0100 +++ iperf-new/iperf-udp.conf 2012-05-15 19:06:15.778282162 +0200 @@ -0,0 +1,7 @@ +# vim:set ts=2 sw=2 ft=sh noet: + +# daemon pid file +#PIDFILE='/run/iperf-udp.pid' + +# daemon options +DAEMON_OPTS='-u --output /tmp/iperf-udp.log' diff -Nu iperf/PKGBUILD iperf-new/PKGBUILD --- iperf/PKGBUILD 2012-05-15 18:57:27.611622568 +0200 +++ iperf-new/PKGBUILD 2012-05-15 19:25:02.534947907 +0200 @@ -4,15 +4,21 @@ pkgname=iperf pkgver=2.0.5 -pkgrel=4 +pkgrel=4.1 pkgdesc="A tool to measure maximum TCP bandwidth" arch=('i686' 'x86_64') license=('custom') url="http://iperf.sourceforge.net" depends=('gcc-libs') source=("http://downloads.sourceforge.net/iperf/iperf-2.0.5.tar.gz" + 'iperf.rc' + 'iperf.conf' + 'iperf-udp.conf' 'client.cpp.patch') md5sums=('44b5536b67719f4250faed632a3cd016' + 'e5ec7e5d4389f8f3dfd9bc31a9763b3b' + 'b1ceff406ec6bf040c7917aa6b604aff' + '502b56e39fd61daeee6906a8e1d2c8a6' '82ce63c87cc8bb2f0f94069857ac14a9') build() { @@ -32,4 +38,10 @@ make DESTDIR="${pkgdir}" install install -Dm644 COPYING "${pkgdir}/usr/share/licenses/iperf/LICENSE" + install -Dm755 "$srcdir/iperf.rc" "${pkgdir}/etc/rc.d/iperf" + install -Dm755 "$srcdir/iperf.rc" "${pkgdir}/etc/rc.d/iperf-udp" + install -Dm644 "$srcdir/iperf.conf" "${pkgdir}/etc/conf.d/iperf" + install -Dm644 "$srcdir/iperf-udp.conf" "${pkgdir}/etc/conf.d/iperf-udp" } + +# vim:set ts=2 sw=2 ft=sh et: