blob: 62906fd68f9725acc024ccbae6ccb6566a24fa69 [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
8inherit autotools-brokensep
9
10PR = "r2"
11
12SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
13 file://lmbench-run \
14 file://rename-line-binary.patch \
15 file://update-results-script.patch \
16 file://obey-ranlib.patch \
17 file://update-config-script.patch \
18 file://use-base_libdir-instead-of-hardcoded-lib.patch \
19 file://lmbench_result_html_report.patch \
20 file://fix-lmbench-memory-check-failure.patch \
21 file://0001-avoid-gcc-optimize-away-the-loops.patch \
22"
23SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
24SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
25
26EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
27 LDFLAGS="${LDFLAGS}" LD="${LD}" OS="${TARGET_SYS}" \
28 TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"'
29
30do_configure() {
31 :
32}
33
34do_compile () {
Patrick Williamsddad1a12017-02-23 20:36:32 -060035 for CONFIG_SITE_ITEM in $CONFIG_SITE; do
36 . $CONFIG_SITE_ITEM
37 done
Patrick Williamsb48b7b42016-08-17 15:04:38 -050038 if [ X"$ac_cv_uint" = X"yes" ]; then
39 CFLAGS="${CFLAGS} -DHAVE_uint"
40 fi
41 install -d ${S}/bin/${TARGET_SYS}
42 oe_runmake -C src
43}
44
45do_install () {
46 install -d ${D}${sysconfdir}/default/volatiles \
47 ${D}${bindir} ${D}${mandir} ${D}${libdir}/lmbench \
48 ${D}${datadir}/lmbench/scripts
49
50 echo "d root root 0755 ${localstatedir}/run/${BPN} none" \
51 > ${D}${sysconfdir}/default/volatiles/99_lmbench
52 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
53 install -d ${D}${sysconfdir}/tmpfiles.d
54 echo "d /run/${BPN} - - - -" \
55 > ${D}${sysconfdir}/tmpfiles.d/lmbench.conf
56 fi
57
58 oe_runmake BASE="${D}${prefix}" MANDIR="${D}${mandir}" \
59 -C src install
60 mv ${D}${bindir}/line ${D}${bindir}/lm_line
61 install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/
62 sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${BPN},;' \
63 -e 's,^BINDIR=.*$,BINDIR=${libdir}/${BPN},;' \
64 -e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \
65 ${D}${bindir}/lmbench-run
66 install -m 0755 ${S}/scripts/lmbench ${D}${bindir}
67 install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts
68}
69
70pkg_postinst_${PN} () {
71 if [ -z "$D" ]; then
72 if command -v systemd-tmpfiles >/dev/null; then
73 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf
74 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
75 ${sysconfdir}/init.d/populate-volatile.sh update
76 fi
77 fi
78}
79
80RDEPENDS_${PN} = "perl"
81FILES_${PN} += "${datadir}/lmbench ${libdir}/lmbench"