commit:     4a76ced53d9c320bc67e08ed823105bc02818969
Author:     65278 <felix <AT> adjust <DOT> com>
AuthorDate: Wed Jan 31 20:38:52 2018 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Wed Jan 31 20:38:52 2018 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=4a76ced5

net-misc/iperf: iperf-3.1.3 ebuild and header patch

 net-misc/iperf/Manifest                      |   1 +
 net-misc/iperf/files/iperf-3.0.5-flags.patch |  31 +++++
 net-misc/iperf/files/iperf-3.1.3-musl.patch  | 184 +++++++++++++++++++++++++++
 net-misc/iperf/files/iperf.confd             |   5 +
 net-misc/iperf/files/iperf.initd-r1          |  14 ++
 net-misc/iperf/files/iperf3.initd            |  10 ++
 net-misc/iperf/iperf-3.1.3.ebuild            |  41 ++++++
 net-misc/iperf/metadata.xml                  |  12 ++
 8 files changed, 298 insertions(+)

diff --git a/net-misc/iperf/Manifest b/net-misc/iperf/Manifest
new file mode 100644
index 0000000..6aa5e8f
--- /dev/null
+++ b/net-misc/iperf/Manifest
@@ -0,0 +1 @@
+DIST iperf-3.1.3.tar.gz 549466 BLAKE2B 
645e9614ef8f4e4f7949d9aaa99631eba604754a7744d1a729408c5549beb4baf692cee99498dddd8150e1cf06adaa13213cf70510e8ab54418274cdcf145ecd
 SHA512 
67795d9d5b4fc719b3fbbc2683cbe2777412bb7212282a50a378f5bb3793c3c17e278d22816fd9d289b2606ce97624d496ba236e3686ce1a31b9f1d6e6f474e9

diff --git a/net-misc/iperf/files/iperf-3.0.5-flags.patch 
b/net-misc/iperf/files/iperf-3.0.5-flags.patch
new file mode 100644
index 0000000..9c11c28
--- /dev/null
+++ b/net-misc/iperf/files/iperf-3.0.5-flags.patch
@@ -0,0 +1,31 @@
+* Do not inject -g
+* Do not make a profiled build
+
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,6 +1,6 @@
+ lib_LTLIBRARIES         = libiperf.la                                   # 
Build and install an iperf library
+ bin_PROGRAMS            = iperf3                                        # 
Build and install an iperf binary
+-noinst_PROGRAMS         = t_timer t_units t_uuid iperf3_profile         # 
Build, but don't install the test programs and a profiled version of iperf3
++noinst_PROGRAMS         = t_timer t_units t_uuid         # Build, but don't 
install the test programs and a profiled version of iperf3
+ include_HEADERS         = iperf_api.h # Defines the headers that get 
installed with the program
+ 
+ 
+@@ -37,14 +37,13 @@
+ 
+ # Specify the sources and various flags for the iperf binary
+ iperf3_SOURCES          = main.c
+-iperf3_CFLAGS           = -g
++iperf3_CFLAGS           =
+ iperf3_LDADD            = libiperf.la
+-iperf3_LDFLAGS          = -g
++iperf3_LDFLAGS          =
+ 
+ # Specify the sources and various flags for the profiled iperf binary. This
+ # binary recompiles all the source files to make sure they are all profiled.
+-iperf3_profile_SOURCES  = main.c \
+-                                                $(libiperf_la_SOURCES)
++iperf3_profile_SOURCES  = main.c
+ 
+ iperf3_profile_CFLAGS   = -pg -g
+ iperf3_profile_LDADD    = libiperf.la

diff --git a/net-misc/iperf/files/iperf-3.1.3-musl.patch 
b/net-misc/iperf/files/iperf-3.1.3-musl.patch
new file mode 100644
index 0000000..16801a0
--- /dev/null
+++ b/net-misc/iperf/files/iperf-3.1.3-musl.patch
@@ -0,0 +1,184 @@
+Index: iperf-3.1.3/src/iperf.h
+===================================================================
+--- iperf-3.1.3.orig/src/iperf.h
++++ iperf-3.1.3/src/iperf.h
+@@ -36,7 +36,13 @@
+ #endif
+ #include <sys/select.h>
+ #include <sys/socket.h>
++
++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++      defined(TCP_INFO)
+ #include <netinet/tcp.h>
++#elif defined(linux)
++#include <linux/tcp.h>
++#endif
+ 
+ #if defined(HAVE_CPUSET_SETAFFINITY)
+ #include <sys/param.h>
+@@ -66,7 +72,7 @@ struct iperf_interval_results
+     int       cnt_error;
+ 
+     int omitted;
+-#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++#if (defined(__GLIBC__) || defined(linux) || defined(__FreeBSD__) || 
defined(__NetBSD__)) && \
+       defined(TCP_INFO)
+     struct tcp_info tcpInfo; /* getsockopt(TCP_INFO) for Linux, {Free,Net}BSD 
*/
+ #else
+Index: iperf-3.1.3/src/iperf_api.c
+===================================================================
+--- iperf-3.1.3.orig/src/iperf_api.c
++++ iperf-3.1.3/src/iperf_api.c
+@@ -47,7 +47,15 @@
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
++
++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++      defined(TCP_INFO)
+ #include <netinet/tcp.h>
++#elif defined(linux)
++#include <linux/tcp.h>
++#endif
++
++
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #include <sys/mman.h>
+Index: iperf-3.1.3/src/iperf_server_api.c
+===================================================================
+--- iperf-3.1.3.orig/src/iperf_server_api.c
++++ iperf-3.1.3/src/iperf_server_api.c
+@@ -44,7 +44,14 @@
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
++
++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++      defined(TCP_INFO)
+ #include <netinet/tcp.h>
++#elif defined(linux)
++#include <linux/tcp.h>
++#endif
++
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #include <sched.h>
+Index: iperf-3.1.3/src/iperf_tcp.c
+===================================================================
+--- iperf-3.1.3.orig/src/iperf_tcp.c
++++ iperf-3.1.3/src/iperf_tcp.c
+@@ -35,7 +35,14 @@
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
++
++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++      defined(TCP_INFO)
+ #include <netinet/tcp.h>
++#elif defined(linux)
++#include <linux/tcp.h>
++#endif
++
+ #include <sys/time.h>
+ #include <sys/select.h>
+ 
+Index: iperf-3.1.3/src/iperf_sctp.c
+===================================================================
+--- iperf-3.1.3.orig/src/iperf_sctp.c
++++ iperf-3.1.3/src/iperf_sctp.c
+@@ -35,7 +35,14 @@
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
++
++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++      defined(TCP_INFO)
+ #include <netinet/tcp.h>
++#elif defined(linux)
++#include <linux/tcp.h>
++#endif
++
+ #include <sys/time.h>
+ #include <sys/select.h>
+ 
+Index: iperf-3.1.3/src/tcp_info.c
+===================================================================
+--- iperf-3.1.3.orig/src/tcp_info.c
++++ iperf-3.1.3/src/tcp_info.c
+@@ -48,7 +48,14 @@
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
++
++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++      defined(TCP_INFO)
+ #include <netinet/tcp.h>
++#elif defined(linux)
++#include <linux/tcp.h>
++#endif
++
+ #include <string.h>
+ #include <netinet/in.h>
+ #include <errno.h>
+Index: iperf-3.1.3/src/units.c
+===================================================================
+--- iperf-3.1.3.orig/src/units.c
++++ iperf-3.1.3/src/units.c
+@@ -60,7 +60,13 @@
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
++
++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++      defined(TCP_INFO)
+ #include <netinet/tcp.h>
++#elif defined(linux)
++#include <linux/tcp.h>
++#endif
+ 
+ 
+ #include "iperf.h"
+Index: iperf-3.1.3/src/main.c
+===================================================================
+--- iperf-3.1.3.orig/src/main.c
++++ iperf-3.1.3/src/main.c
+@@ -44,7 +44,13 @@
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
++
++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
++      defined(TCP_INFO)
+ #include <netinet/tcp.h>
++#elif defined(linux)
++#include <linux/tcp.h>
++#endif
+ 
+ #include "iperf.h"
+ #include "iperf_api.h"
+Index: iperf-3.1.3/src/timer.h
+===================================================================
+--- iperf-3.1.3.orig/src/timer.h
++++ iperf-3.1.3/src/timer.h
+@@ -32,6 +32,8 @@
+ 
+ #include <sys/time.h>
+ 
++#include <stdint.h>
++
+ /* TimerClientData is an opaque value that tags along with a timer.  The
+ ** client can use it for whatever, and it gets passed to the callback when
+ ** the timer triggers.
+Index: iperf-3.1.3/src/t_uuid.c
+===================================================================
+--- iperf-3.1.3.orig/src/t_uuid.c
++++ iperf-3.1.3/src/t_uuid.c
+@@ -28,6 +28,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/time.h>
++#include <stdint.h>
+ 
+ #include "iperf_util.h"
+ 

diff --git a/net-misc/iperf/files/iperf.confd b/net-misc/iperf/files/iperf.confd
new file mode 100644
index 0000000..7d82492
--- /dev/null
+++ b/net-misc/iperf/files/iperf.confd
@@ -0,0 +1,5 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# extra options (run iperf -h for a list of supported options)
+IPERF_OPTS="--format Mbytes"

diff --git a/net-misc/iperf/files/iperf.initd-r1 
b/net-misc/iperf/files/iperf.initd-r1
new file mode 100644
index 0000000..cd17a7b
--- /dev/null
+++ b/net-misc/iperf/files/iperf.initd-r1
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="IP bandwidth measurement server"
+command="/usr/bin/iperf"
+
+command_background="yes"
+pidfile="/run/${SVCNAME}.pid"
+command_args="-s ${IPERF_OPTS}"
+
+# note: iperf has a -D/--daemon flag but we seem to hit a bug
+#       where it starts to eat all CPU after client disconnect,
+#       see bug #344875

diff --git a/net-misc/iperf/files/iperf3.initd 
b/net-misc/iperf/files/iperf3.initd
new file mode 100644
index 0000000..281ebf5
--- /dev/null
+++ b/net-misc/iperf/files/iperf3.initd
@@ -0,0 +1,10 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="IP bandwidth measurement server"
+command="/usr/bin/iperf3"
+
+command_background="yes"
+pidfile="/run/${SVCNAME}.pid"
+command_args="-s ${IPERF_OPTS}"

diff --git a/net-misc/iperf/iperf-3.1.3.ebuild 
b/net-misc/iperf/iperf-3.1.3.ebuild
new file mode 100644
index 0000000..fb2de2e
--- /dev/null
+++ b/net-misc/iperf/iperf-3.1.3.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils
+
+DESCRIPTION="A TCP, UDP, and SCTP network bandwidth measurement tool"
+HOMEPAGE="https://github.com/esnet/iperf/";
+SRC_URI="https://codeload.github.com/esnet/${PN}/tar.gz/${PV/_beta/b} -> 
${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="amd64 ~arm hppa ~mips ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux 
~x86-linux ~ppc-macos ~x86-macos ~m68k-mint"
+IUSE="sctp static-libs"
+
+DEPEND="sctp? ( net-misc/lksctp-tools )"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${P/_beta/b}
+
+PATCHES=( "${FILESDIR}"/${PN}-3.0.5-flags.patch
+       "${FILESDIR}/${PN}-3.1.3-musl.patch"
+)
+
+src_prepare() {
+       default
+
+       eautoreconf
+}
+
+src_configure() {
+       econf $(use_enable static-libs static)
+}
+
+src_install() {
+       default
+       newconfd "${FILESDIR}"/iperf.confd iperf3
+       newinitd "${FILESDIR}"/iperf3.initd iperf3
+       prune_libtool_files
+}

diff --git a/net-misc/iperf/metadata.xml b/net-misc/iperf/metadata.xml
new file mode 100644
index 0000000..c2391d4
--- /dev/null
+++ b/net-misc/iperf/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <name>Gentoo network monitoring and analysis project</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">esnet/iperf</remote-id>
+               <remote-id type="sourceforge">iperf</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to