commit: 83af425887161b94bace866e5a054cf6ac05f0a7 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> AuthorDate: Fri May 31 12:53:41 2024 +0000 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> CommitDate: Fri Jun 7 10:24:29 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83af4258
net-analyzer/netperf: Bump to 2.7.0_p20210121 to avoid license issue The last release, 2.7.0, had an awkward non-commercial use clause in its license. The license was changed to straight MIT three years ago, but there still hasn't been a new release since. Upstream is effectively dead. There have been relatively few other changes, but we can now drop some of the patches we were carrying. Closes: https://github.com/gentoo/gentoo/pull/36917 Co-authored-by: Jeremi Piotrowski <jpiotrowski <AT> microsoft.com> Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org> net-analyzer/netperf/Manifest | 1 + net-analyzer/netperf/files/netperf-log-dir.patch | 12 ++++ net-analyzer/netperf/metadata.xml | 41 +++++------ .../netperf/netperf-2.7.0_p20210121.ebuild | 84 ++++++++++++++++++++++ 4 files changed, 118 insertions(+), 20 deletions(-) diff --git a/net-analyzer/netperf/Manifest b/net-analyzer/netperf/Manifest index f378f80376d4..96ec2d577205 100644 --- a/net-analyzer/netperf/Manifest +++ b/net-analyzer/netperf/Manifest @@ -1 +1,2 @@ DIST netperf-2.7.0.tar.bz2 1024430 BLAKE2B 1263a2b3cee0790e4526245e522d29f8692a5a3e9d3b41468d1010bbee4d606a06904d9e0c4ac0af457bde562a476434be4c62a41e3c0dbf0e5c3aeb2ae5652a SHA512 5fb37945bead831247de9c8ba86b33f134ba39e753b483df72de97f536d0846538dadf61acc2dee57f04ab5d16a92afab4890e79a5d7ffa863afd526267fffad +DIST netperf-2.7.0_p20210121.tar.gz 1914186 BLAKE2B 14d3a769a049443d8bf62b58c93c2b9563a16b69bb151d35926aa8831167b8a31bdd7d820c80a0c0511a78e519742005bdfa2079d403a514e2ec17f41a1b8e7c SHA512 8d9908fe2cd778eae719265b67938ab44e18de960c845f976e80d6b419c08b11ae47d8b4b906c6ccaf280f9f66bcdcb0be2ab379b0dca8d62d86671d57057e20 diff --git a/net-analyzer/netperf/files/netperf-log-dir.patch b/net-analyzer/netperf/files/netperf-log-dir.patch new file mode 100644 index 000000000000..f1d11e7163e0 --- /dev/null +++ b/net-analyzer/netperf/files/netperf-log-dir.patch @@ -0,0 +1,12 @@ +diff -Naur a/src/netserver.c b/src/netserver.c +--- a/src/netserver.c 2021-01-21 16:02:24.000000000 +0000 ++++ b/src/netserver.c 2024-05-31 12:48:38.770331476 +0100 +@@ -153,7 +153,7 @@ + #define FILE_SEP "/" + #else + /* comply with FHS: http://www.pathname.com/fhs/pub/fhs-2.3.html */ +-#define DEBUG_LOG_FILE_DIR "/var/log/" ++#define DEBUG_LOG_FILE_DIR "/var/log/netperf/" + #define NETPERF_NULL "/dev/null" + #define FILE_SEP "/" + #endif diff --git a/net-analyzer/netperf/metadata.xml b/net-analyzer/netperf/metadata.xml index 3e35e2cbd3a3..38f0fed98332 100644 --- a/net-analyzer/netperf/metadata.xml +++ b/net-analyzer/netperf/metadata.xml @@ -1,25 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> -<maintainer type="project"> -<email>[email protected]</email> -<name>Gentoo network monitoring and analysis project</name> -</maintainer> -<longdescription lang="en"> -Netperf is a benchmark that can be used to measure the performance of many -different types of networking. It provides tests for both unidirectional -throughput, and end-to-end latency. The environments currently measureable by -netperf include: + <maintainer type="project"> + <email>[email protected]</email> + <name>Gentoo network monitoring and analysis project</name> + </maintainer> + <longdescription lang="en"> + Netperf is a benchmark that can be used to measure the performance of many + different types of networking. It provides tests for both unidirectional + throughput, and end-to-end latency. The environments currently measureable by + netperf include: - - TCP and UDP via BSD Sockets for both IPv4 and IPv6 - - DLPI - - Unix Domain Sockets - - SCTP for both IPv4 and IPv6 -</longdescription> -<use> -<flag name="demo">Emit interim results during the run. May affect results</flag> -</use> -<upstream> -<remote-id type="cpe">cpe:/a:netperf:netperf</remote-id> -</upstream> + - TCP and UDP via BSD Sockets for both IPv4 and IPv6 + - DLPI + - Unix Domain Sockets + - SCTP for both IPv4 and IPv6 + </longdescription> + <use> + <flag name="demo">Emit interim results during the run. May affect results</flag> + </use> + <upstream> + <remote-id type="cpe">cpe:/a:netperf:netperf</remote-id> + <remote-id type="github">HewlettPackard/netperf</remote-id> + </upstream> </pkgmetadata> diff --git a/net-analyzer/netperf/netperf-2.7.0_p20210121.ebuild b/net-analyzer/netperf/netperf-2.7.0_p20210121.ebuild new file mode 100644 index 000000000000..cc84bc361fc4 --- /dev/null +++ b/net-analyzer/netperf/netperf-2.7.0_p20210121.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic + +COMMIT="3bc455b23f901dae377ca0a558e1e32aa56b31c4" +DESCRIPTION="Network performance benchmark" +HOMEPAGE="https://github.com/HewlettPackard/netperf" +SRC_URI="https://github.com/HewlettPackard/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${COMMIT}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="demo sctp" + +RDEPEND=" + acct-group/netperf + acct-user/netperf +" +BDEPEND=" + ${RDEPEND} + sys-devel/gnuconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-fix-scripts.patch + "${FILESDIR}"/${PN}-log-dir.patch + "${FILESDIR}"/${PN}-2.7.0-includes.patch + "${FILESDIR}"/${PN}-2.7.0-fcommon.patch +) + +src_prepare() { + # Fixing paths in scripts + sed -i \ + -e "s:^\(NETHOME=\).*:\1\"${EPREFIX}/usr/bin\":" \ + doc/examples/sctp_stream_script \ + doc/examples/tcp_range_script \ + doc/examples/tcp_rr_script \ + doc/examples/tcp_stream_script \ + doc/examples/udp_rr_script \ + doc/examples/udp_stream_script \ + || die + + default + AT_M4DIR=src/missing/m4 eautoreconf +} + +src_configure() { + # netlib.c:2292:5: warning: implicit declaration of function ‘sched_setaffinity’ + # nettest_omni.c:2943:5: warning: implicit declaration of function ‘splice’ + # TODO: drop once https://github.com/HewlettPackard/netperf/pull/73 merged + append-cppflags -D_GNU_SOURCE + + econf \ + $(use_enable demo) \ + $(use_enable sctp) +} + +src_install() { + default + + # Move netserver into sbin as we had it before 2.4 was released with its + # autoconf goodness + dodir /usr/sbin + mv "${ED}"/usr/{bin,sbin}/netserver || die + + # init.d / conf.d + newinitd "${FILESDIR}"/${PN}-2.7.0-init netperf + newconfd "${FILESDIR}"/${PN}-2.2-conf netperf + + keepdir /var/log/${PN} + fowners netperf:netperf /var/log/${PN} + fperms 0755 /var/log/${PN} + + # documentation and example scripts + dodoc AUTHORS ChangeLog NEWS README Release_Notes doc/${PN}.txt + docinto html + dodoc doc/${PN}.html + exeinto /usr/share/${PN}/examples + doexe doc/examples/*_script +}
