Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | SUMMARY = "Tools for performance analysis" |
| 2 | HOMEPAGE = "http://lmbench.sourceforge.net/" |
| 3 | SECTION = "console/utils" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 4 | LICENSE = "GPL-2.0-only & GPL-2.0-with-lmbench-restriction" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ |
| 6 | file://COPYING-2;md5=8e9aee2ccc75d61d107e43794a25cdf9" |
| 7 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 8 | inherit autotools-brokensep update-alternatives |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 9 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 10 | DEPENDS += "libtirpc" |
| 11 | CFLAGS += "-I${STAGING_INCDIR}/tirpc" |
| 12 | LDLIBS += " -ltirpc " |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 14 | PR = "r2" |
| 15 | |
| 16 | SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \ |
| 17 | file://lmbench-run \ |
| 18 | file://rename-line-binary.patch \ |
| 19 | file://update-results-script.patch \ |
| 20 | file://obey-ranlib.patch \ |
| 21 | file://update-config-script.patch \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 22 | file://lmbench_result_html_report.patch \ |
| 23 | file://fix-lmbench-memory-check-failure.patch \ |
| 24 | file://0001-avoid-gcc-optimize-away-the-loops.patch \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 25 | file://0001-lat_http.c-Add-printf-format.patch \ |
| 26 | file://0001-Check-for-musl-define-guard-before-redefining-sockle.patch \ |
| 27 | file://0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 28 | file://0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch \ |
Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 29 | file://0001-lmbench-Point-webpage-lm-to-target-directory.patch \ |
| 30 | file://0001-doc-Fix-typos-in-manual-pages.patch \ |
| 31 | file://0001-lat_fifo-Fix-cleanup-sequence.patch \ |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 32 | file://0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 33 | " |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 34 | SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf" |
| 35 | SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551" |
| 36 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 37 | UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/lmbench/files/development/" |
| 38 | UPSTREAM_CHECK_REGEX = "lmbench-(?P<pver>\d+(\.\d+)+-[a-z]+\d+)" |
| 39 | |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 40 | EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 41 | LDFLAGS="${LDFLAGS}" LDLIBS="${LDLIBS}" LD="${LD}" OS="${TARGET_SYS}" \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 42 | TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"' |
| 43 | |
| 44 | do_configure() { |
| 45 | : |
| 46 | } |
| 47 | |
| 48 | do_compile () { |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 49 | for CONFIG_SITE_ITEM in $CONFIG_SITE; do |
| 50 | . $CONFIG_SITE_ITEM |
| 51 | done |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 52 | if [ X"$ac_cv_uint" = X"yes" ]; then |
| 53 | CFLAGS="${CFLAGS} -DHAVE_uint" |
| 54 | fi |
| 55 | install -d ${S}/bin/${TARGET_SYS} |
| 56 | oe_runmake -C src |
| 57 | } |
| 58 | |
| 59 | do_install () { |
| 60 | install -d ${D}${sysconfdir}/default/volatiles \ |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 61 | ${D}${bindir} ${D}${mandir} \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 62 | ${D}${datadir}/lmbench/scripts |
| 63 | |
| 64 | echo "d root root 0755 ${localstatedir}/run/${BPN} none" \ |
| 65 | > ${D}${sysconfdir}/default/volatiles/99_lmbench |
| 66 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 67 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 68 | echo "d /run/${BPN} - - - -" \ |
| 69 | > ${D}${sysconfdir}/tmpfiles.d/lmbench.conf |
| 70 | fi |
| 71 | |
| 72 | oe_runmake BASE="${D}${prefix}" MANDIR="${D}${mandir}" \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 73 | DESTDIR="${D}" \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 74 | -C src install |
| 75 | mv ${D}${bindir}/line ${D}${bindir}/lm_line |
| 76 | install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/ |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 77 | install -m 0755 ${S}/bin/${TARGET_SYS}/cache ${D}${bindir}/ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 78 | sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${BPN},;' \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 79 | -e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \ |
| 80 | ${D}${bindir}/lmbench-run |
| 81 | install -m 0755 ${S}/scripts/lmbench ${D}${bindir} |
| 82 | install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts |
Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 83 | install -m 0644 ${S}/src/webpage-lm.tar ${D}${datadir}/lmbench |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 84 | } |
| 85 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 86 | pkg_postinst:${PN} () { |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 87 | if [ -z "$D" ]; then |
| 88 | if command -v systemd-tmpfiles >/dev/null; then |
| 89 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf |
| 90 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 91 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 92 | fi |
| 93 | fi |
| 94 | } |
| 95 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 96 | RDEPENDS:${PN} = "perl" |
| 97 | FILES:${PN} += "${datadir}/lmbench" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 98 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 99 | ALTERNATIVE:${PN} = "stream" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 100 | ALTERNATIVE_LINK_NAME[stream] = "${bindir}/stream" |
| 101 | |