blob: a084fb4c159161acd808648ace5994d18012fde9 [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/"
5LICENSE = "netperf"
6LICENSE_FLAGS = "non-commercial"
7LIC_FILES_CHKSUM = "file://COPYING;md5=a0ab17253e7a3f318da85382c7d5d5d6"
8
9PV = "2.7.0+git${SRCPV}"
10
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011SRC_URI = "git://github.com/HewlettPackard/netperf.git \
12 file://cpu_set.patch \
13 file://vfork.patch \
14 file://init \
15 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 \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018
19SRCREV = "f482bab49fcedee46fc5b755da127f608325cd13"
20
21S = "${WORKDIR}/git"
22
Andrew Geissler82c905d2020-04-13 13:39:40 -050023inherit update-rc.d autotools texinfo
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024
25# cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros
26CFLAGS_append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE"
27
28# set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files
29# larger than 2GB
30CFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', \
31 ' -D_FILE_OFFSET_BITS=64', '', d)}"
32
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.
40do_configure_prepend() {
41 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
46
47 install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d
48 install -m 4755 src/netperf ${D}${bindir}
49 install -m 4755 src/netserver ${D}${sbindir}
50 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf
51
52 # man
53 install -d ${D}${mandir}/man1/
54 install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1
55 install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1
56
57 # move scripts to examples directory
58 install -d ${D}${docdir}/netperf/examples
59 install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/
60
61 # docs ..
62 install -m 0644 ${S}/COPYING ${D}${docdir}/netperf
63 install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf
64 install -m 0644 ${S}/README ${D}${docdir}/netperf
65 install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf
66}
67
68RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}"
69
70INITSCRIPT_NAME="netperf"
71INITSCRIPT_PARAMS="defaults"