Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: net-misc/iperf/files/, net-misc/iperf/
Date: Thu, 01 Feb 2018 00:04:50
Message-Id: 1517431132.4a76ced53d9c320bc67e08ed823105bc02818969.lluixhi@gentoo
1 commit: 4a76ced53d9c320bc67e08ed823105bc02818969
2 Author: 65278 <felix <AT> adjust <DOT> com>
3 AuthorDate: Wed Jan 31 20:38:52 2018 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Wed Jan 31 20:38:52 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=4a76ced5
7
8 net-misc/iperf: iperf-3.1.3 ebuild and header patch
9
10 net-misc/iperf/Manifest | 1 +
11 net-misc/iperf/files/iperf-3.0.5-flags.patch | 31 +++++
12 net-misc/iperf/files/iperf-3.1.3-musl.patch | 184 +++++++++++++++++++++++++++
13 net-misc/iperf/files/iperf.confd | 5 +
14 net-misc/iperf/files/iperf.initd-r1 | 14 ++
15 net-misc/iperf/files/iperf3.initd | 10 ++
16 net-misc/iperf/iperf-3.1.3.ebuild | 41 ++++++
17 net-misc/iperf/metadata.xml | 12 ++
18 8 files changed, 298 insertions(+)
19
20 diff --git a/net-misc/iperf/Manifest b/net-misc/iperf/Manifest
21 new file mode 100644
22 index 0000000..6aa5e8f
23 --- /dev/null
24 +++ b/net-misc/iperf/Manifest
25 @@ -0,0 +1 @@
26 +DIST iperf-3.1.3.tar.gz 549466 BLAKE2B 645e9614ef8f4e4f7949d9aaa99631eba604754a7744d1a729408c5549beb4baf692cee99498dddd8150e1cf06adaa13213cf70510e8ab54418274cdcf145ecd SHA512 67795d9d5b4fc719b3fbbc2683cbe2777412bb7212282a50a378f5bb3793c3c17e278d22816fd9d289b2606ce97624d496ba236e3686ce1a31b9f1d6e6f474e9
27
28 diff --git a/net-misc/iperf/files/iperf-3.0.5-flags.patch b/net-misc/iperf/files/iperf-3.0.5-flags.patch
29 new file mode 100644
30 index 0000000..9c11c28
31 --- /dev/null
32 +++ b/net-misc/iperf/files/iperf-3.0.5-flags.patch
33 @@ -0,0 +1,31 @@
34 +* Do not inject -g
35 +* Do not make a profiled build
36 +
37 +--- a/src/Makefile.am
38 ++++ b/src/Makefile.am
39 +@@ -1,6 +1,6 @@
40 + lib_LTLIBRARIES = libiperf.la # Build and install an iperf library
41 + bin_PROGRAMS = iperf3 # Build and install an iperf binary
42 +-noinst_PROGRAMS = t_timer t_units t_uuid iperf3_profile # Build, but don't install the test programs and a profiled version of iperf3
43 ++noinst_PROGRAMS = t_timer t_units t_uuid # Build, but don't install the test programs and a profiled version of iperf3
44 + include_HEADERS = iperf_api.h # Defines the headers that get installed with the program
45 +
46 +
47 +@@ -37,14 +37,13 @@
48 +
49 + # Specify the sources and various flags for the iperf binary
50 + iperf3_SOURCES = main.c
51 +-iperf3_CFLAGS = -g
52 ++iperf3_CFLAGS =
53 + iperf3_LDADD = libiperf.la
54 +-iperf3_LDFLAGS = -g
55 ++iperf3_LDFLAGS =
56 +
57 + # Specify the sources and various flags for the profiled iperf binary. This
58 + # binary recompiles all the source files to make sure they are all profiled.
59 +-iperf3_profile_SOURCES = main.c \
60 +- $(libiperf_la_SOURCES)
61 ++iperf3_profile_SOURCES = main.c
62 +
63 + iperf3_profile_CFLAGS = -pg -g
64 + iperf3_profile_LDADD = libiperf.la
65
66 diff --git a/net-misc/iperf/files/iperf-3.1.3-musl.patch b/net-misc/iperf/files/iperf-3.1.3-musl.patch
67 new file mode 100644
68 index 0000000..16801a0
69 --- /dev/null
70 +++ b/net-misc/iperf/files/iperf-3.1.3-musl.patch
71 @@ -0,0 +1,184 @@
72 +Index: iperf-3.1.3/src/iperf.h
73 +===================================================================
74 +--- iperf-3.1.3.orig/src/iperf.h
75 ++++ iperf-3.1.3/src/iperf.h
76 +@@ -36,7 +36,13 @@
77 + #endif
78 + #include <sys/select.h>
79 + #include <sys/socket.h>
80 ++
81 ++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
82 ++ defined(TCP_INFO)
83 + #include <netinet/tcp.h>
84 ++#elif defined(linux)
85 ++#include <linux/tcp.h>
86 ++#endif
87 +
88 + #if defined(HAVE_CPUSET_SETAFFINITY)
89 + #include <sys/param.h>
90 +@@ -66,7 +72,7 @@ struct iperf_interval_results
91 + int cnt_error;
92 +
93 + int omitted;
94 +-#if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
95 ++#if (defined(__GLIBC__) || defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
96 + defined(TCP_INFO)
97 + struct tcp_info tcpInfo; /* getsockopt(TCP_INFO) for Linux, {Free,Net}BSD */
98 + #else
99 +Index: iperf-3.1.3/src/iperf_api.c
100 +===================================================================
101 +--- iperf-3.1.3.orig/src/iperf_api.c
102 ++++ iperf-3.1.3/src/iperf_api.c
103 +@@ -47,7 +47,15 @@
104 + #ifdef HAVE_STDINT_H
105 + #include <stdint.h>
106 + #endif
107 ++
108 ++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
109 ++ defined(TCP_INFO)
110 + #include <netinet/tcp.h>
111 ++#elif defined(linux)
112 ++#include <linux/tcp.h>
113 ++#endif
114 ++
115 ++
116 + #include <sys/time.h>
117 + #include <sys/resource.h>
118 + #include <sys/mman.h>
119 +Index: iperf-3.1.3/src/iperf_server_api.c
120 +===================================================================
121 +--- iperf-3.1.3.orig/src/iperf_server_api.c
122 ++++ iperf-3.1.3/src/iperf_server_api.c
123 +@@ -44,7 +44,14 @@
124 + #ifdef HAVE_STDINT_H
125 + #include <stdint.h>
126 + #endif
127 ++
128 ++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
129 ++ defined(TCP_INFO)
130 + #include <netinet/tcp.h>
131 ++#elif defined(linux)
132 ++#include <linux/tcp.h>
133 ++#endif
134 ++
135 + #include <sys/time.h>
136 + #include <sys/resource.h>
137 + #include <sched.h>
138 +Index: iperf-3.1.3/src/iperf_tcp.c
139 +===================================================================
140 +--- iperf-3.1.3.orig/src/iperf_tcp.c
141 ++++ iperf-3.1.3/src/iperf_tcp.c
142 +@@ -35,7 +35,14 @@
143 + #include <sys/types.h>
144 + #include <netinet/in.h>
145 + #include <netdb.h>
146 ++
147 ++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
148 ++ defined(TCP_INFO)
149 + #include <netinet/tcp.h>
150 ++#elif defined(linux)
151 ++#include <linux/tcp.h>
152 ++#endif
153 ++
154 + #include <sys/time.h>
155 + #include <sys/select.h>
156 +
157 +Index: iperf-3.1.3/src/iperf_sctp.c
158 +===================================================================
159 +--- iperf-3.1.3.orig/src/iperf_sctp.c
160 ++++ iperf-3.1.3/src/iperf_sctp.c
161 +@@ -35,7 +35,14 @@
162 + #include <sys/types.h>
163 + #include <netinet/in.h>
164 + #include <netdb.h>
165 ++
166 ++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
167 ++ defined(TCP_INFO)
168 + #include <netinet/tcp.h>
169 ++#elif defined(linux)
170 ++#include <linux/tcp.h>
171 ++#endif
172 ++
173 + #include <sys/time.h>
174 + #include <sys/select.h>
175 +
176 +Index: iperf-3.1.3/src/tcp_info.c
177 +===================================================================
178 +--- iperf-3.1.3.orig/src/tcp_info.c
179 ++++ iperf-3.1.3/src/tcp_info.c
180 +@@ -48,7 +48,14 @@
181 + #include <sys/param.h>
182 + #include <sys/types.h>
183 + #include <sys/socket.h>
184 ++
185 ++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
186 ++ defined(TCP_INFO)
187 + #include <netinet/tcp.h>
188 ++#elif defined(linux)
189 ++#include <linux/tcp.h>
190 ++#endif
191 ++
192 + #include <string.h>
193 + #include <netinet/in.h>
194 + #include <errno.h>
195 +Index: iperf-3.1.3/src/units.c
196 +===================================================================
197 +--- iperf-3.1.3.orig/src/units.c
198 ++++ iperf-3.1.3/src/units.c
199 +@@ -60,7 +60,13 @@
200 + #include <sys/socket.h>
201 + #include <sys/types.h>
202 + #include <sys/time.h>
203 ++
204 ++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
205 ++ defined(TCP_INFO)
206 + #include <netinet/tcp.h>
207 ++#elif defined(linux)
208 ++#include <linux/tcp.h>
209 ++#endif
210 +
211 +
212 + #include "iperf.h"
213 +Index: iperf-3.1.3/src/main.c
214 +===================================================================
215 +--- iperf-3.1.3.orig/src/main.c
216 ++++ iperf-3.1.3/src/main.c
217 +@@ -44,7 +44,13 @@
218 + #ifdef HAVE_STDINT_H
219 + #include <stdint.h>
220 + #endif
221 ++
222 ++#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)) && \
223 ++ defined(TCP_INFO)
224 + #include <netinet/tcp.h>
225 ++#elif defined(linux)
226 ++#include <linux/tcp.h>
227 ++#endif
228 +
229 + #include "iperf.h"
230 + #include "iperf_api.h"
231 +Index: iperf-3.1.3/src/timer.h
232 +===================================================================
233 +--- iperf-3.1.3.orig/src/timer.h
234 ++++ iperf-3.1.3/src/timer.h
235 +@@ -32,6 +32,8 @@
236 +
237 + #include <sys/time.h>
238 +
239 ++#include <stdint.h>
240 ++
241 + /* TimerClientData is an opaque value that tags along with a timer. The
242 + ** client can use it for whatever, and it gets passed to the callback when
243 + ** the timer triggers.
244 +Index: iperf-3.1.3/src/t_uuid.c
245 +===================================================================
246 +--- iperf-3.1.3.orig/src/t_uuid.c
247 ++++ iperf-3.1.3/src/t_uuid.c
248 +@@ -28,6 +28,7 @@
249 + #include <stdlib.h>
250 + #include <string.h>
251 + #include <sys/time.h>
252 ++#include <stdint.h>
253 +
254 + #include "iperf_util.h"
255 +
256
257 diff --git a/net-misc/iperf/files/iperf.confd b/net-misc/iperf/files/iperf.confd
258 new file mode 100644
259 index 0000000..7d82492
260 --- /dev/null
261 +++ b/net-misc/iperf/files/iperf.confd
262 @@ -0,0 +1,5 @@
263 +# Copyright 1999-2005 Gentoo Foundation
264 +# Distributed under the terms of the GNU General Public License v2
265 +
266 +# extra options (run iperf -h for a list of supported options)
267 +IPERF_OPTS="--format Mbytes"
268
269 diff --git a/net-misc/iperf/files/iperf.initd-r1 b/net-misc/iperf/files/iperf.initd-r1
270 new file mode 100644
271 index 0000000..cd17a7b
272 --- /dev/null
273 +++ b/net-misc/iperf/files/iperf.initd-r1
274 @@ -0,0 +1,14 @@
275 +#!/sbin/openrc-run
276 +# Copyright 1999-2014 Gentoo Foundation
277 +# Distributed under the terms of the GNU General Public License v2
278 +
279 +description="IP bandwidth measurement server"
280 +command="/usr/bin/iperf"
281 +
282 +command_background="yes"
283 +pidfile="/run/${SVCNAME}.pid"
284 +command_args="-s ${IPERF_OPTS}"
285 +
286 +# note: iperf has a -D/--daemon flag but we seem to hit a bug
287 +# where it starts to eat all CPU after client disconnect,
288 +# see bug #344875
289
290 diff --git a/net-misc/iperf/files/iperf3.initd b/net-misc/iperf/files/iperf3.initd
291 new file mode 100644
292 index 0000000..281ebf5
293 --- /dev/null
294 +++ b/net-misc/iperf/files/iperf3.initd
295 @@ -0,0 +1,10 @@
296 +#!/sbin/openrc-run
297 +# Copyright 1999-2014 Gentoo Foundation
298 +# Distributed under the terms of the GNU General Public License v2
299 +
300 +description="IP bandwidth measurement server"
301 +command="/usr/bin/iperf3"
302 +
303 +command_background="yes"
304 +pidfile="/run/${SVCNAME}.pid"
305 +command_args="-s ${IPERF_OPTS}"
306
307 diff --git a/net-misc/iperf/iperf-3.1.3.ebuild b/net-misc/iperf/iperf-3.1.3.ebuild
308 new file mode 100644
309 index 0000000..fb2de2e
310 --- /dev/null
311 +++ b/net-misc/iperf/iperf-3.1.3.ebuild
312 @@ -0,0 +1,41 @@
313 +# Copyright 1999-2017 Gentoo Foundation
314 +# Distributed under the terms of the GNU General Public License v2
315 +
316 +EAPI=6
317 +
318 +inherit autotools eutils
319 +
320 +DESCRIPTION="A TCP, UDP, and SCTP network bandwidth measurement tool"
321 +HOMEPAGE="https://github.com/esnet/iperf/"
322 +SRC_URI="https://codeload.github.com/esnet/${PN}/tar.gz/${PV/_beta/b} -> ${P}.tar.gz"
323 +
324 +LICENSE="BSD"
325 +SLOT="3"
326 +KEYWORDS="amd64 ~arm hppa ~mips ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~m68k-mint"
327 +IUSE="sctp static-libs"
328 +
329 +DEPEND="sctp? ( net-misc/lksctp-tools )"
330 +RDEPEND="${DEPEND}"
331 +
332 +S=${WORKDIR}/${P/_beta/b}
333 +
334 +PATCHES=( "${FILESDIR}"/${PN}-3.0.5-flags.patch
335 + "${FILESDIR}/${PN}-3.1.3-musl.patch"
336 +)
337 +
338 +src_prepare() {
339 + default
340 +
341 + eautoreconf
342 +}
343 +
344 +src_configure() {
345 + econf $(use_enable static-libs static)
346 +}
347 +
348 +src_install() {
349 + default
350 + newconfd "${FILESDIR}"/iperf.confd iperf3
351 + newinitd "${FILESDIR}"/iperf3.initd iperf3
352 + prune_libtool_files
353 +}
354
355 diff --git a/net-misc/iperf/metadata.xml b/net-misc/iperf/metadata.xml
356 new file mode 100644
357 index 0000000..c2391d4
358 --- /dev/null
359 +++ b/net-misc/iperf/metadata.xml
360 @@ -0,0 +1,12 @@
361 +<?xml version="1.0" encoding="UTF-8"?>
362 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
363 +<pkgmetadata>
364 + <maintainer type="project">
365 + <email>netmon@g.o</email>
366 + <name>Gentoo network monitoring and analysis project</name>
367 + </maintainer>
368 + <upstream>
369 + <remote-id type="github">esnet/iperf</remote-id>
370 + <remote-id type="sourceforge">iperf</remote-id>
371 + </upstream>
372 +</pkgmetadata>