From 5d334c7470b5851fbacd4545c8ee0ea676a21ccc Mon Sep 17 00:00:00 2001 From: root Date: Sat, 19 May 2012 00:02:33 +0000 Subject: Sat May 19 00:02:33 UTC 2012 --- community/iperf/PKGBUILD | 47 ++++++++++++++++++++++++++++++++++++ community/iperf/client.cpp.patch | 17 +++++++++++++ community/iperf/iperf.conf | 7 ++++++ community/iperf/iperf.rc | 52 ++++++++++++++++++++++++++++++++++++++++ community/iperf/iperf.service | 8 +++++++ 5 files changed, 131 insertions(+) create mode 100644 community/iperf/PKGBUILD create mode 100644 community/iperf/client.cpp.patch create mode 100644 community/iperf/iperf.conf create mode 100644 community/iperf/iperf.rc create mode 100644 community/iperf/iperf.service (limited to 'community/iperf') diff --git a/community/iperf/PKGBUILD b/community/iperf/PKGBUILD new file mode 100644 index 000000000..71a359d8d --- /dev/null +++ b/community/iperf/PKGBUILD @@ -0,0 +1,47 @@ +# $Id: PKGBUILD 70860 2012-05-18 02:29:56Z seblu $ +# Maintainer: Sébastien Luttringer +# Contributor: Giovanni Scafora +# Contributor: Dale Blount + +pkgname=iperf +pkgver=2.0.5 +pkgrel=5 +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-$pkgver.tar.gz" + 'iperf.rc' + 'iperf.conf' + 'iperf.service' + 'client.cpp.patch') +md5sums=('44b5536b67719f4250faed632a3cd016' + 'e99dc0d41eb800970390dd149d70b544' + 'c75cb18434c6bf19fdc89b9caa766d7d' + 'b0c1165e21fb686e449c6bab9852be31' + '82ce63c87cc8bb2f0f94069857ac14a9') + +build() { + cd $pkgname-$pkgver + # fix FS#25159 + patch -Np1 -i "$srcdir/client.cpp.patch" + ./configure --prefix=/usr \ + --enable-ipv6 \ + --enable-multicast \ + --enable-threads + make +} + +package() { + pushd $pkgname-$pkgver + make DESTDIR="$pkgdir" install + install -Dm644 COPYING "$pkgdir/usr/share/licenses/iperf/LICENSE" + popd + # install initscripts + install -Dm755 iperf.rc "$pkgdir/etc/rc.d/iperf" + install -Dm644 iperf.conf "$pkgdir/etc/conf.d/iperf" + install -Dm644 iperf.service "$pkgdir/usr/lib/systemd/system/iperf.service" +} + +# vim:set ts=2 sw=2 ft=sh et: diff --git a/community/iperf/client.cpp.patch b/community/iperf/client.cpp.patch new file mode 100644 index 000000000..85f89e765 --- /dev/null +++ b/community/iperf/client.cpp.patch @@ -0,0 +1,17 @@ +--- a/src/Client.cpp 2010-04-01 22:23:17.000000000 +0200 ++++ b/src/Client.cpp 2011-07-19 11:03:42.000000000 +0200 +@@ -212,10 +212,10 @@ + char* readAt = mBuf; + + #if HAVE_THREAD +- if ( !isUDP( mSettings ) ) { +- RunTCP(); +- return; +- } ++// if ( !isUDP( mSettings ) ) { ++// RunTCP(); ++// return; ++// } + #endif + + // Indicates if the stream is readable diff --git a/community/iperf/iperf.conf b/community/iperf/iperf.conf new file mode 100644 index 000000000..0685ff011 --- /dev/null +++ b/community/iperf/iperf.conf @@ -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='--port 5001' diff --git a/community/iperf/iperf.rc b/community/iperf/iperf.rc new file mode 100644 index 000000000..617b666ad --- /dev/null +++ b/community/iperf/iperf.rc @@ -0,0 +1,52 @@ +#!/bin/bash + +# You can use this script to run iperf as tcp and udp. +# Copy and rename this script to /etc/rc.d/iperf-udp and copy config file to +# /etc/conf.d/iperf-udp and add -u to daemon options + +. /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 --git a/community/iperf/iperf.service b/community/iperf/iperf.service new file mode 100644 index 000000000..1bdcf86e9 --- /dev/null +++ b/community/iperf/iperf.service @@ -0,0 +1,8 @@ +[Unit] +Description=Iperf Server + +[Service] +ExecStart=/usr/bin/iperf -s + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3-54-g00ecf