blob: 21e81ecf2bc9dd8d665e78b75effaebc0f1eedca [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "Tools for performance analysis"
2HOMEPAGE = "http://lmbench.sourceforge.net/"
3SECTION = "console/utils"
4LICENSE = "GPLv2 & GPL-2.0-with-lmbench-restriction"
5LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
6 file://COPYING-2;md5=8e9aee2ccc75d61d107e43794a25cdf9"
7
Andrew Geisslerd688a012020-09-18 13:36:00 -05008inherit autotools-brokensep update-alternatives
Patrick Williamsb48b7b42016-08-17 15:04:38 -05009
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010DEPENDS += "libtirpc"
11CFLAGS += "-I${STAGING_INCDIR}/tirpc"
12LDLIBS += " -ltirpc "
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013
Patrick Williamsb48b7b42016-08-17 15:04:38 -050014PR = "r2"
15
16SRC_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 Williamsb48b7b42016-08-17 15:04:38 -050022 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 Bishop6e60e8b2018-02-01 10:27:11 -050025 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 Bishop1a4b7ee2018-12-16 17:11:34 -080028 file://0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch \
Andrew Geisslereef63862021-01-29 15:58:13 -060029 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 \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050032 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050033SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
34SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
35
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080036UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/lmbench/files/development/"
37UPSTREAM_CHECK_REGEX = "lmbench-(?P<pver>\d+(\.\d+)+-[a-z]+\d+)"
38
Patrick Williamsb48b7b42016-08-17 15:04:38 -050039EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040 LDFLAGS="${LDFLAGS}" LDLIBS="${LDLIBS}" LD="${LD}" OS="${TARGET_SYS}" \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050041 TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"'
42
43do_configure() {
44 :
45}
46
47do_compile () {
Patrick Williamsddad1a12017-02-23 20:36:32 -060048 for CONFIG_SITE_ITEM in $CONFIG_SITE; do
49 . $CONFIG_SITE_ITEM
50 done
Patrick Williamsb48b7b42016-08-17 15:04:38 -050051 if [ X"$ac_cv_uint" = X"yes" ]; then
52 CFLAGS="${CFLAGS} -DHAVE_uint"
53 fi
54 install -d ${S}/bin/${TARGET_SYS}
55 oe_runmake -C src
56}
57
58do_install () {
59 install -d ${D}${sysconfdir}/default/volatiles \
Brad Bishopc1d34332019-09-09 14:56:00 -040060 ${D}${bindir} ${D}${mandir} \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050061 ${D}${datadir}/lmbench/scripts
62
63 echo "d root root 0755 ${localstatedir}/run/${BPN} none" \
64 > ${D}${sysconfdir}/default/volatiles/99_lmbench
65 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
66 install -d ${D}${sysconfdir}/tmpfiles.d
67 echo "d /run/${BPN} - - - -" \
68 > ${D}${sysconfdir}/tmpfiles.d/lmbench.conf
69 fi
70
71 oe_runmake BASE="${D}${prefix}" MANDIR="${D}${mandir}" \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080072 DESTDIR="${D}" \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050073 -C src install
74 mv ${D}${bindir}/line ${D}${bindir}/lm_line
75 install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/
76 sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${BPN},;' \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050077 -e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \
78 ${D}${bindir}/lmbench-run
79 install -m 0755 ${S}/scripts/lmbench ${D}${bindir}
80 install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts
Andrew Geisslereef63862021-01-29 15:58:13 -060081 install -m 0644 ${S}/src/webpage-lm.tar ${D}${datadir}/lmbench
Patrick Williamsb48b7b42016-08-17 15:04:38 -050082}
83
84pkg_postinst_${PN} () {
85 if [ -z "$D" ]; then
86 if command -v systemd-tmpfiles >/dev/null; then
87 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf
88 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
89 ${sysconfdir}/init.d/populate-volatile.sh update
90 fi
91 fi
92}
93
94RDEPENDS_${PN} = "perl"
Brad Bishopc1d34332019-09-09 14:56:00 -040095FILES_${PN} += "${datadir}/lmbench"
Andrew Geisslerd688a012020-09-18 13:36:00 -050096
97ALTERNATIVE_${PN} = "stream"
98ALTERNATIVE_LINK_NAME[stream] = "${bindir}/stream"
99