blob: 6b21c6b8c194f328a49f7433e681fc8426a97f5d [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "System performance tools"
2DESCRIPTION = "The sysstat utilities are a collection of performance monitoring tools for Linux."
3HOMEPAGE = "http://sebastien.godard.pagesperso-orange.fr/"
4LICENSE = "GPLv2+"
5SECTION = "console/utils"
6
7SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${PV}.tar.xz \
8 file://99_sysstat \
9 file://sysstat.service \
10 "
11
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050012UPSTREAM_CHECK_URI = "http://sebastien.godard.pagesperso-orange.fr/download.html"
Brad Bishop15ae2502019-06-18 21:44:24 -040013UPSTREAM_VERSION_UNKNOWN = "1"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050014
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015DEPENDS += "base-passwd"
16
Patrick Williamsc0f7c042017-02-23 20:41:17 -060017# autotools-brokensep as this package doesn't use automake
Brad Bishopc342db32019-05-15 21:57:59 -040018inherit autotools-brokensep gettext systemd upstream-version-is-even
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020PACKAGECONFIG ??= ""
21PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors"
Brad Bishop393846f2019-05-20 12:24:11 -040022PACKAGECONFIG[cron] = "--enable-install-cron --enable-copy-only,--disable-install-cron --disable-copy-only"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050023
24EXTRA_OECONF += "--disable-stripping"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025
26SYSTEMD_PACKAGES = "${PN}"
27SYSTEMD_SERVICE_${PN} = "sysstat.service"
28SYSTEMD_AUTO_ENABLE = "enable"
29
30do_configure_prepend() {
31 export sa_lib_dir=${libdir}/sa
32}
33
34do_install() {
35 autotools_do_install
36
37 # don't install /var/log/sa when populating rootfs. Do it through volatile
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038 rm -rf ${D}/var
Brad Bishopd7bf8c12018-02-25 22:55:05 -050039 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
40 install -d ${D}/etc/default/volatiles
41 install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
42 fi
43 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
44 install -d ${D}${sysconfdir}/tmpfiles.d
45 echo "d ${localstatedir}/log/sa - - - -" \
46 > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf
47 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048
49 install -d ${D}${systemd_unitdir}/system
50 install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system
51 sed -i -e 's#@LIBDIR@#${libdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
52}
53
54pkg_postinst_${PN} () {
55 if [ -n "$D" ]; then
56 exit 0
57 fi
58 if [ -e /etc/init.d/populate-volatile.sh ]; then
59 /etc/init.d/populate-volatile.sh update
60 fi
61}
62
Brad Bishop393846f2019-05-20 12:24:11 -040063FILES_${PN} += "${libdir}/sa ${systemd_system_unitdir}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050064
65TARGET_CC_ARCH += "${LDFLAGS}"