Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | SUMMARY = "A networking benchmarking tool" |
| 2 | DESCRIPTION = "Network performance benchmark including tests for TCP, UDP, sockets, ATM and more." |
| 3 | SECTION = "net" |
| 4 | HOMEPAGE = "http://www.netperf.org/" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 5 | LICENSE = "MIT" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=e661ab33a2a71ad6652c178dedf8aaa2" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 7 | |
| 8 | PV = "2.7.0+git${SRCPV}" |
| 9 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 10 | SRC_URI = "git://github.com/HewlettPackard/netperf.git;branch=master;protocol=https \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 11 | file://cpu_set.patch \ |
| 12 | file://vfork.patch \ |
| 13 | file://init \ |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 14 | file://netserver.service \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 15 | file://0001-netlib.c-Move-including-sched.h-out-og-function.patch \ |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 16 | file://0001-nettest_omni-Remove-duplicate-variable-definitions.patch \ |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 17 | file://netserver_permissions.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 18 | " |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 20 | SRCREV = "3bc455b23f901dae377ca0a558e1e32aa56b31c4" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 21 | |
| 22 | S = "${WORKDIR}/git" |
| 23 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 24 | inherit update-rc.d autotools texinfo systemd |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 25 | |
| 26 | # cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 27 | CFLAGS:append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 28 | |
| 29 | # set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files |
| 30 | # larger than 2GB |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 31 | CFLAGS:append = " -D_FILE_OFFSET_BITS=64" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 32 | |
| 33 | PACKAGECONFIG ??= "" |
| 34 | PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools," |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 35 | PACKAGECONFIG[intervals] = "--enable-intervals,--disable-intervals,," |
| 36 | PACKAGECONFIG[histogram] = "--enable-histogram,--disable-histogram,," |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 37 | |
| 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 40 | do_configure:prepend() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 41 | test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files |
| 42 | } |
| 43 | |
| 44 | do_install() { |
| 45 | sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 46 | 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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 50 | 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 70 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 71 | |
| 72 | INITSCRIPT_NAME="netperf" |
| 73 | INITSCRIPT_PARAMS="defaults" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 74 | SYSTEMD_SERVICE:${PN} = "netserver.service" |