blob: 4074f0cd0750eee932de39645f52f07df36930f6 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SUMMARY = "A networking benchmarking tool"
2DESCRIPTION = "Network performance benchmark including tests for TCP, UDP, sockets, ATM and more."
3SECTION = "net"
4HOMEPAGE = "http://www.netperf.org/"
Patrick Williams213cb262021-08-07 19:21:33 -05005LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://COPYING;md5=e661ab33a2a71ad6652c178dedf8aaa2"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05007
8PV = "2.7.0+git${SRCPV}"
9
Andrew Geissler595f6302022-01-24 19:11:47 +000010SRC_URI = "git://github.com/HewlettPackard/netperf.git;branch=master;protocol=https \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011 file://cpu_set.patch \
12 file://vfork.patch \
13 file://init \
Patrick Williams213cb262021-08-07 19:21:33 -050014 file://netserver.service \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015 file://0001-netlib.c-Move-including-sched.h-out-og-function.patch \
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050016 file://0001-nettest_omni-Remove-duplicate-variable-definitions.patch \
Andrew Geissler615f2f12022-07-15 14:00:58 -050017 file://netserver_permissions.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080018 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050019
Patrick Williams213cb262021-08-07 19:21:33 -050020SRCREV = "3bc455b23f901dae377ca0a558e1e32aa56b31c4"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050021
22S = "${WORKDIR}/git"
23
Patrick Williams213cb262021-08-07 19:21:33 -050024inherit update-rc.d autotools texinfo systemd
Brad Bishopd7bf8c12018-02-25 22:55:05 -050025
26# cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros
Patrick Williams213cb262021-08-07 19:21:33 -050027CFLAGS:append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050028
29# set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files
30# larger than 2GB
Patrick Williams92b42cb2022-09-03 06:53:57 -050031CFLAGS:append = " -D_FILE_OFFSET_BITS=64"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032
33PACKAGECONFIG ??= ""
34PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools,"
Brad Bishope42b3e32020-01-15 22:08:42 -050035PACKAGECONFIG[intervals] = "--enable-intervals,--disable-intervals,,"
36PACKAGECONFIG[histogram] = "--enable-histogram,--disable-histogram,,"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050037
38# autotools.bbclass attends to include m4 files with path depth <= 2 by
39# "find ${S} -maxdepth 2 -name \*.m4", so move m4 files from m4/m4.
Patrick Williams213cb262021-08-07 19:21:33 -050040do_configure:prepend() {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050041 test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files
42}
43
44do_install() {
45 sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init
Patrick Williams213cb262021-08-07 19:21:33 -050046 install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d ${D}${systemd_system_unitdir}
47 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
48 sed -e 's#/usr/sbin/#${sbindir}/#g' ${WORKDIR}/netserver.service > ${D}${systemd_system_unitdir}/netserver.service
49 fi
Brad Bishopd7bf8c12018-02-25 22:55:05 -050050 install -m 4755 src/netperf ${D}${bindir}
51 install -m 4755 src/netserver ${D}${sbindir}
52 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf
53
54 # man
55 install -d ${D}${mandir}/man1/
56 install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1
57 install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1
58
59 # move scripts to examples directory
60 install -d ${D}${docdir}/netperf/examples
61 install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/
62
63 # docs ..
64 install -m 0644 ${S}/COPYING ${D}${docdir}/netperf
65 install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf
66 install -m 0644 ${S}/README ${D}${docdir}/netperf
67 install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf
68}
69
Patrick Williams213cb262021-08-07 19:21:33 -050070RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050071
72INITSCRIPT_NAME="netperf"
73INITSCRIPT_PARAMS="defaults"
Patrick Williams213cb262021-08-07 19:21:33 -050074SYSTEMD_SERVICE:${PN} = "netserver.service"