Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -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/" |
| 5 | LICENSE = "netperf" |
| 6 | LICENSE_FLAGS = "non-commercial" |
| 7 | |
| 8 | |
| 9 | SRC_URI="ftp://ftp.netperf.org/netperf/archive/netperf-${PV}.tar.bz2 \ |
| 10 | file://cpu_set.patch \ |
| 11 | file://vfork.patch \ |
| 12 | file://init" |
| 13 | SRC_URI[md5sum] = "9654ffdfd4c4f2c93ce3733cd9ed9236" |
| 14 | SRC_URI[sha256sum] = "cd8dac710d4273d29f70e8dbd09353a6362ac58a11926e0822233c0cb230323a" |
| 15 | |
| 16 | LIC_FILES_CHKSUM = "file://COPYING;md5=a0ab17253e7a3f318da85382c7d5d5d6" |
| 17 | |
| 18 | inherit update-rc.d autotools |
| 19 | |
| 20 | S = "${WORKDIR}/netperf-${PV}" |
| 21 | |
| 22 | # cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros |
| 23 | CFLAGS_append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE" |
| 24 | |
| 25 | # set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files |
| 26 | # larger than 2GB |
| 27 | CFLAGS_append = "${@base_contains('DISTRO_FEATURES', 'largefile', \ |
| 28 | ' -D_FILE_OFFSET_BITS=64', '', d)}" |
| 29 | |
| 30 | PACKAGECONFIG ??= "" |
| 31 | PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools," |
| 32 | |
| 33 | # autotools.bbclass attends to include m4 files with path depth <= 2 by |
| 34 | # "find ${S} -maxdepth 2 -name \*.m4", so move m4 files from m4/m4. |
| 35 | do_configure_prepend() { |
| 36 | test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files |
| 37 | } |
| 38 | |
| 39 | do_install() { |
| 40 | sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init |
| 41 | |
| 42 | install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d |
| 43 | install -m 4755 src/netperf ${D}${bindir} |
| 44 | install -m 4755 src/netserver ${D}${sbindir} |
| 45 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf |
| 46 | |
| 47 | # man |
| 48 | install -d ${D}${mandir}/man1/ |
| 49 | install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1 |
| 50 | install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1 |
| 51 | |
| 52 | # move scripts to examples directory |
| 53 | install -d ${D}${docdir}/netperf/examples |
| 54 | install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/ |
| 55 | |
| 56 | # docs .. |
| 57 | install -m 0644 ${S}/COPYING ${D}${docdir}/netperf |
| 58 | install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf |
| 59 | install -m 0644 ${S}/README ${D}${docdir}/netperf |
| 60 | install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf |
| 61 | } |
| 62 | |
| 63 | RRECOMMENDS_${PN} += "${@base_contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}" |
| 64 | |
| 65 | INITSCRIPT_NAME="netperf" |
| 66 | INITSCRIPT_PARAMS="defaults" |