blob: a62389d0941e601e784beb0cc04774ad7c1ad381 [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 () {
35 . ${CONFIG_SITE}
36 if [ X"$ac_cv_uint" = X"yes" ]; then
37 CFLAGS="${CFLAGS} -DHAVE_uint"
38 fi
39 install -d ${S}/bin/${TARGET_SYS}
40 oe_runmake -C src
41}
42
43do_install () {
44 install -d ${D}${sysconfdir}/default/volatiles \
45 ${D}${bindir} ${D}${mandir} ${D}${libdir}/lmbench \
46 ${D}${datadir}/lmbench/scripts
47
48 echo "d root root 0755 ${localstatedir}/run/${BPN} none" \
49 > ${D}${sysconfdir}/default/volatiles/99_lmbench
50 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
51 install -d ${D}${sysconfdir}/tmpfiles.d
52 echo "d /run/${BPN} - - - -" \
53 > ${D}${sysconfdir}/tmpfiles.d/lmbench.conf
54 fi
55
56 oe_runmake BASE="${D}${prefix}" MANDIR="${D}${mandir}" \
57 -C src install
58 mv ${D}${bindir}/line ${D}${bindir}/lm_line
59 install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/
60 sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${BPN},;' \
61 -e 's,^BINDIR=.*$,BINDIR=${libdir}/${BPN},;' \
62 -e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \
63 ${D}${bindir}/lmbench-run
64 install -m 0755 ${S}/scripts/lmbench ${D}${bindir}
65 install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts
66}
67
68pkg_postinst_${PN} () {
69 if [ -z "$D" ]; then
70 if command -v systemd-tmpfiles >/dev/null; then
71 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf
72 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
73 ${sysconfdir}/init.d/populate-volatile.sh update
74 fi
75 fi
76}
77
78RDEPENDS_${PN} = "perl"
79FILES_${PN} += "${datadir}/lmbench ${libdir}/lmbench"