Skip to content

Commit

Permalink
Merge pull request #2027 from flatcar/ader1990/netperf_upstream_mit_l…
Browse files Browse the repository at this point in the history
…icense

netperf: use the MIT licensed version
  • Loading branch information
ader1990 authored Jun 20, 2024
2 parents 58eb56b + 2d29eaa commit 7e1045b
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/workflows/portage-stable-packages-list
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ licenses

media-libs/libpng

net-analyzer/netperf
net-analyzer/nmap
net-analyzer/traceroute

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
=dev-python/lxml-5.2.1 ~arm64
=dev-util/pahole-1.26 ~arm64

# Needed for the MIT License
=net-analyzer/netperf-2.7.0_p20210121 ~amd64 ~arm64

# Needed for addressing CVE-2024-25629
=net-dns/c-ares-1.27.0 ~amd64 ~arm64

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
https://github.com/HewlettPackard/netperf/pull/46
https://bugs.gentoo.org/706694

From c6a2e17fe35f0e68823451fedfdf5b1dbecddbe3 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 12 Aug 2020 09:57:23 -0700
Subject: [PATCH] nettest_omni: Remove duplicate variable definitions

These defines are already defined in nettest_bsd.c and exported by
nettest_bsd.h this should fix build with -fno-common

Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/src/nettest_omni.c
+++ b/src/nettest_omni.c
@@ -458,14 +458,6 @@ static int client_port_max = 65535;

/* different options for the sockets */

-int
- loc_nodelay, /* don't/do use NODELAY locally */
- rem_nodelay, /* don't/do use NODELAY remotely */
- loc_sndavoid, /* avoid send copies locally */
- loc_rcvavoid, /* avoid recv copies locally */
- rem_sndavoid, /* avoid send copies remotely */
- rem_rcvavoid; /* avoid recv_copies remotely */
-
extern int
loc_tcpcork,
rem_tcpcork,

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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>netmon@gentoo.org</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>netmon@gentoo.org</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>
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
EAPI=8

inherit flag-o-matic

DESCRIPTION="Network performance benchmark"
HOMEPAGE="http://www.netperf.org/"
SRC_URI="ftp://ftp.netperf.org/${PN}/${P}.tar.bz2"
KEYWORDS="~alpha amd64 arm64 ~hppa ~ia64 ppc ppc64 sparc x86"

HOMEPAGE="http://www.netperf.org/"
LICENSE="netperf"
SLOT="0"
KEYWORDS="~alpha amd64 arm64 ~hppa ~ia64 ppc ppc64 ~riscv sparc x86"
IUSE="demo sctp"

DEPEND="
RDEPEND="
acct-group/netperf
acct-user/netperf
"
RDEPEND="${DEPEND}"
BDEPEND="
${RDEPEND}
sys-devel/gnuconfig
"

PATCHES=(
"${FILESDIR}"/${PN}-fix-scripts.patch
"${FILESDIR}"/${PN}-2.6.0-log-dir.patch
"${FILESDIR}"/${PN}-2.7.0-includes.patch
"${FILESDIR}"/${PN}-2.7.0-space.patch
"${FILESDIR}"/${PN}-2.7.0-inline.patch
"${FILESDIR}"/${PN}-2.7.0-fcommon.patch
)

src_prepare() {
Expand All @@ -44,10 +48,9 @@ src_prepare() {
}

src_configure() {
append-cflags -fcommon

# 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 \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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

# 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
}

0 comments on commit 7e1045b

Please sign in to comment.