summaryrefslogtreecommitdiff
path: root/community/iperf
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-05-19 00:02:33 +0000
committerroot <root@rshg054.dnsready.net>2012-05-19 00:02:33 +0000
commit5d334c7470b5851fbacd4545c8ee0ea676a21ccc (patch)
tree9fd6a98989a409178f5db098aaf2ffa8a646dd48 /community/iperf
parent2f104ecf78d6a93ba8d67273b76364cb1365a6cf (diff)
Sat May 19 00:02:33 UTC 2012
Diffstat (limited to 'community/iperf')
-rw-r--r--community/iperf/PKGBUILD47
-rw-r--r--community/iperf/client.cpp.patch17
-rw-r--r--community/iperf/iperf.conf7
-rw-r--r--community/iperf/iperf.rc52
-rw-r--r--community/iperf/iperf.service8
5 files changed, 131 insertions, 0 deletions
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 <seblu@aur.archlinux.org>
+# Contributor: Giovanni Scafora <giovanni@archlinux.org>
+# Contributor: Dale Blount <dale@archlinux.org>
+
+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 &>/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