1eb8dc403SDave CobbleySUMMARY = "Tools for performance analysis" 2eb8dc403SDave CobbleyHOMEPAGE = "http://lmbench.sourceforge.net/" 3eb8dc403SDave CobbleySECTION = "console/utils" 4eb8dc403SDave CobbleyLICENSE = "GPLv2 & GPL-2.0-with-lmbench-restriction" 5eb8dc403SDave CobbleyLIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ 6eb8dc403SDave Cobbley file://COPYING-2;md5=8e9aee2ccc75d61d107e43794a25cdf9" 7eb8dc403SDave Cobbley 8*d688a01eSAndrew Geisslerinherit autotools-brokensep update-alternatives 9eb8dc403SDave Cobbley 101a4b7ee2SBrad BishopDEPENDS += "libtirpc" 111a4b7ee2SBrad BishopCFLAGS += "-I${STAGING_INCDIR}/tirpc" 121a4b7ee2SBrad BishopLDLIBS += " -ltirpc " 13eb8dc403SDave Cobbley 14eb8dc403SDave CobbleyPR = "r2" 15eb8dc403SDave Cobbley 16eb8dc403SDave CobbleySRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \ 17eb8dc403SDave Cobbley file://lmbench-run \ 18eb8dc403SDave Cobbley file://rename-line-binary.patch \ 19eb8dc403SDave Cobbley file://update-results-script.patch \ 20eb8dc403SDave Cobbley file://obey-ranlib.patch \ 21eb8dc403SDave Cobbley file://update-config-script.patch \ 22eb8dc403SDave Cobbley file://lmbench_result_html_report.patch \ 23eb8dc403SDave Cobbley file://fix-lmbench-memory-check-failure.patch \ 24eb8dc403SDave Cobbley file://0001-avoid-gcc-optimize-away-the-loops.patch \ 25eb8dc403SDave Cobbley file://0001-lat_http.c-Add-printf-format.patch \ 26eb8dc403SDave Cobbley file://0001-Check-for-musl-define-guard-before-redefining-sockle.patch \ 27eb8dc403SDave Cobbley file://0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch \ 281a4b7ee2SBrad Bishop file://0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch \ 29eb8dc403SDave Cobbley " 30eb8dc403SDave CobbleySRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf" 31eb8dc403SDave CobbleySRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551" 32eb8dc403SDave Cobbley 331a4b7ee2SBrad BishopUPSTREAM_CHECK_URI = "https://sourceforge.net/projects/lmbench/files/development/" 341a4b7ee2SBrad BishopUPSTREAM_CHECK_REGEX = "lmbench-(?P<pver>\d+(\.\d+)+-[a-z]+\d+)" 351a4b7ee2SBrad Bishop 36eb8dc403SDave CobbleyEXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \ 37eb8dc403SDave Cobbley LDFLAGS="${LDFLAGS}" LDLIBS="${LDLIBS}" LD="${LD}" OS="${TARGET_SYS}" \ 38eb8dc403SDave Cobbley TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"' 39eb8dc403SDave Cobbley 40eb8dc403SDave Cobbleydo_configure() { 41eb8dc403SDave Cobbley : 42eb8dc403SDave Cobbley} 43eb8dc403SDave Cobbley 44eb8dc403SDave Cobbleydo_compile () { 45eb8dc403SDave Cobbley for CONFIG_SITE_ITEM in $CONFIG_SITE; do 46eb8dc403SDave Cobbley . $CONFIG_SITE_ITEM 47eb8dc403SDave Cobbley done 48eb8dc403SDave Cobbley if [ X"$ac_cv_uint" = X"yes" ]; then 49eb8dc403SDave Cobbley CFLAGS="${CFLAGS} -DHAVE_uint" 50eb8dc403SDave Cobbley fi 51eb8dc403SDave Cobbley install -d ${S}/bin/${TARGET_SYS} 52eb8dc403SDave Cobbley oe_runmake -C src 53eb8dc403SDave Cobbley} 54eb8dc403SDave Cobbley 55eb8dc403SDave Cobbleydo_install () { 56eb8dc403SDave Cobbley install -d ${D}${sysconfdir}/default/volatiles \ 57c1d34338SBrad Bishop ${D}${bindir} ${D}${mandir} \ 58eb8dc403SDave Cobbley ${D}${datadir}/lmbench/scripts 59eb8dc403SDave Cobbley 60eb8dc403SDave Cobbley echo "d root root 0755 ${localstatedir}/run/${BPN} none" \ 61eb8dc403SDave Cobbley > ${D}${sysconfdir}/default/volatiles/99_lmbench 62eb8dc403SDave Cobbley if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 63eb8dc403SDave Cobbley install -d ${D}${sysconfdir}/tmpfiles.d 64eb8dc403SDave Cobbley echo "d /run/${BPN} - - - -" \ 65eb8dc403SDave Cobbley > ${D}${sysconfdir}/tmpfiles.d/lmbench.conf 66eb8dc403SDave Cobbley fi 67eb8dc403SDave Cobbley 68eb8dc403SDave Cobbley oe_runmake BASE="${D}${prefix}" MANDIR="${D}${mandir}" \ 691a4b7ee2SBrad Bishop DESTDIR="${D}" \ 70eb8dc403SDave Cobbley -C src install 71eb8dc403SDave Cobbley mv ${D}${bindir}/line ${D}${bindir}/lm_line 72eb8dc403SDave Cobbley install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/ 73eb8dc403SDave Cobbley sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${BPN},;' \ 74eb8dc403SDave Cobbley -e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \ 75eb8dc403SDave Cobbley ${D}${bindir}/lmbench-run 76eb8dc403SDave Cobbley install -m 0755 ${S}/scripts/lmbench ${D}${bindir} 77eb8dc403SDave Cobbley install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts 78eb8dc403SDave Cobbley} 79eb8dc403SDave Cobbley 80eb8dc403SDave Cobbleypkg_postinst_${PN} () { 81eb8dc403SDave Cobbley if [ -z "$D" ]; then 82eb8dc403SDave Cobbley if command -v systemd-tmpfiles >/dev/null; then 83eb8dc403SDave Cobbley systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf 84eb8dc403SDave Cobbley elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then 85eb8dc403SDave Cobbley ${sysconfdir}/init.d/populate-volatile.sh update 86eb8dc403SDave Cobbley fi 87eb8dc403SDave Cobbley fi 88eb8dc403SDave Cobbley} 89eb8dc403SDave Cobbley 90eb8dc403SDave CobbleyRDEPENDS_${PN} = "perl" 91c1d34338SBrad BishopFILES_${PN} += "${datadir}/lmbench" 92*d688a01eSAndrew Geissler 93*d688a01eSAndrew GeisslerALTERNATIVE_${PN} = "stream" 94*d688a01eSAndrew GeisslerALTERNATIVE_LINK_NAME[stream] = "${bindir}/stream" 95*d688a01eSAndrew Geissler 96