blob: 8921ea7460f2ab635a0ec269d6ab3d01a4ba469c [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 \
16 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050017
18SRCREV = "f482bab49fcedee46fc5b755da127f608325cd13"
19
20S = "${WORKDIR}/git"
21
22inherit update-rc.d autotools
23
24# cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros
25CFLAGS_append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE"
26
27# set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files
28# larger than 2GB
29CFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', \
30 ' -D_FILE_OFFSET_BITS=64', '', d)}"
31
32PACKAGECONFIG ??= ""
33PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools,"
34
35# autotools.bbclass attends to include m4 files with path depth <= 2 by
36# "find ${S} -maxdepth 2 -name \*.m4", so move m4 files from m4/m4.
37do_configure_prepend() {
38 test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files
39}
40
41do_install() {
42 sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init
43
44 install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d
45 install -m 4755 src/netperf ${D}${bindir}
46 install -m 4755 src/netserver ${D}${sbindir}
47 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf
48
49 # man
50 install -d ${D}${mandir}/man1/
51 install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1
52 install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1
53
54 # move scripts to examples directory
55 install -d ${D}${docdir}/netperf/examples
56 install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/
57
58 # docs ..
59 install -m 0644 ${S}/COPYING ${D}${docdir}/netperf
60 install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf
61 install -m 0644 ${S}/README ${D}${docdir}/netperf
62 install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf
63}
64
65RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}"
66
67INITSCRIPT_NAME="netperf"
68INITSCRIPT_PARAMS="defaults"