blob: 06b2eddbb6e134975202eef6f839526b875d9d0b [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 Williams213cb262021-08-07 19:21:33 -050031CFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032 ' -D_FILE_OFFSET_BITS=64', '', d)}"
33
34PACKAGECONFIG ??= ""
35PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools,"
Brad Bishope42b3e32020-01-15 22:08:42 -050036PACKAGECONFIG[intervals] = "--enable-intervals,--disable-intervals,,"
37PACKAGECONFIG[histogram] = "--enable-histogram,--disable-histogram,,"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050038
39# autotools.bbclass attends to include m4 files with path depth <= 2 by
40# "find ${S} -maxdepth 2 -name \*.m4", so move m4 files from m4/m4.
Patrick Williams213cb262021-08-07 19:21:33 -050041do_configure:prepend() {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050042 test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files
43}
44
45do_install() {
46 sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init
Patrick Williams213cb262021-08-07 19:21:33 -050047 install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d ${D}${systemd_system_unitdir}
48 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
49 sed -e 's#/usr/sbin/#${sbindir}/#g' ${WORKDIR}/netserver.service > ${D}${systemd_system_unitdir}/netserver.service
50 fi
Brad Bishopd7bf8c12018-02-25 22:55:05 -050051 install -m 4755 src/netperf ${D}${bindir}
52 install -m 4755 src/netserver ${D}${sbindir}
53 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf
54
55 # man
56 install -d ${D}${mandir}/man1/
57 install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1
58 install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1
59
60 # move scripts to examples directory
61 install -d ${D}${docdir}/netperf/examples
62 install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/
63
64 # docs ..
65 install -m 0644 ${S}/COPYING ${D}${docdir}/netperf
66 install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf
67 install -m 0644 ${S}/README ${D}${docdir}/netperf
68 install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf
69}
70
Patrick Williams213cb262021-08-07 19:21:33 -050071RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050072
73INITSCRIPT_NAME="netperf"
74INITSCRIPT_PARAMS="defaults"
Patrick Williams213cb262021-08-07 19:21:33 -050075SYSTEMD_SERVICE:${PN} = "netserver.service"