aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/iperf/APKBUILD21
-rw-r--r--main/iperf/iperf.confd3
-rw-r--r--main/iperf/iperf.initd18
3 files changed, 37 insertions, 5 deletions
diff --git a/main/iperf/APKBUILD b/main/iperf/APKBUILD
index 064f34a0cc..cbb87f972f 100644
--- a/main/iperf/APKBUILD
+++ b/main/iperf/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=iperf
pkgver=2.0.5
-pkgrel=2
+pkgrel=3
pkgdesc="A tool to measure IP bandwidth using UDP or TCP"
url="http://iperf.sourceforge.net/"
arch="all"
@@ -11,7 +11,10 @@ depends=""
makedepends=""
install=""
subpackages="$pkgname-doc"
-source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
+ iperf.initd
+ iperf.confd
+ "
_builddir="$srcdir/$pkgname-$pkgver"
prepare() {
@@ -35,8 +38,16 @@ build() {
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
+ install -D -m0755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -D -m0644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}
-md5sums="44b5536b67719f4250faed632a3cd016 iperf-2.0.5.tar.gz"
-sha256sums="636b4eff0431cea80667ea85a67ce4c68698760a9837e1e9d13096d20362265b iperf-2.0.5.tar.gz"
-sha512sums="da9a0c01dea2a9dd33aa130b11d938d5f44dd6c3ab27526b0a43df5bf2550fede04238a00b7d54037426afe90ac6d8c4f4ae6861aa170ca7835b6664c9d6537f iperf-2.0.5.tar.gz"
+md5sums="44b5536b67719f4250faed632a3cd016 iperf-2.0.5.tar.gz
+291084a99bc42217bf20a3f9f479e4d0 iperf.initd
+baf349898c6d08eaa3883d7e6802745c iperf.confd"
+sha256sums="636b4eff0431cea80667ea85a67ce4c68698760a9837e1e9d13096d20362265b iperf-2.0.5.tar.gz
+b109c524d71a9da0db18c271b74238ef5f85b270d2f60dc6ae8f097a3342d00d iperf.initd
+2063bd3defe0e58d43741ed6067f3f5552e579385620d0e0f5aa2b8e96b21151 iperf.confd"
+sha512sums="da9a0c01dea2a9dd33aa130b11d938d5f44dd6c3ab27526b0a43df5bf2550fede04238a00b7d54037426afe90ac6d8c4f4ae6861aa170ca7835b6664c9d6537f iperf-2.0.5.tar.gz
+339fb04b41cce11e8ea8694d95c13af9c88e0d1143356d913ec810c9b11efa27212d585b5dcc49cc2eb860a6d8bc557092c8659d7d5cfe532c5afdb36f8eedf8 iperf.initd
+fb5e155fff568a72488cc1511d30358835a48bcce309f8f46d040160932b4a4ccb85040c27c60dee477900a25bd34c50eac21d1d0bea984b40faa401be2ba7e8 iperf.confd"
diff --git a/main/iperf/iperf.confd b/main/iperf/iperf.confd
new file mode 100644
index 0000000000..1f425faa67
--- /dev/null
+++ b/main/iperf/iperf.confd
@@ -0,0 +1,3 @@
+# Default option for iperf: --server (runs in TCP/5001 mode)
+# For further server options check --help flag
+command_args=""
diff --git a/main/iperf/iperf.initd b/main/iperf/iperf.initd
new file mode 100644
index 0000000000..a135bafc92
--- /dev/null
+++ b/main/iperf/iperf.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+command="/usr/bin/iperf"
+pidfile="/var/run/$SVCNAME/$SVCNAME.pid"
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ ebegin "Starting $SVCNAME"
+ start-stop-daemon --start --make-pid --user ${exec_user:-nobody} \
+ --pidfile ${pidfile} --background --exec $command \
+ -- --server ${command_args}
+ eend
+}
+