blob: 0bc7e14d365bf77342bd73974440d2c1ae15d1f7 [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"
13UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
14
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
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018inherit autotools-brokensep gettext systemd
19
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020PACKAGECONFIG ??= ""
21PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors"
22
23EXTRA_OECONF += "--disable-stripping"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050024
25SYSTEMD_PACKAGES = "${PN}"
26SYSTEMD_SERVICE_${PN} = "sysstat.service"
27SYSTEMD_AUTO_ENABLE = "enable"
28
29do_configure_prepend() {
30 export sa_lib_dir=${libdir}/sa
31}
32
33do_install() {
34 autotools_do_install
35
36 # don't install /var/log/sa when populating rootfs. Do it through volatile
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037 rm -rf ${D}/var
Brad Bishopd7bf8c12018-02-25 22:55:05 -050038 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
39 install -d ${D}/etc/default/volatiles
40 install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
41 fi
42 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
43 install -d ${D}${sysconfdir}/tmpfiles.d
44 echo "d ${localstatedir}/log/sa - - - -" \
45 > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf
46 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047
48 install -d ${D}${systemd_unitdir}/system
49 install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system
50 sed -i -e 's#@LIBDIR@#${libdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
51}
52
53pkg_postinst_${PN} () {
54 if [ -n "$D" ]; then
55 exit 0
56 fi
57 if [ -e /etc/init.d/populate-volatile.sh ]; then
58 /etc/init.d/populate-volatile.sh update
59 fi
60}
61
62
63FILES_${PN} += "${libdir}/sa"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050064
65TARGET_CC_ARCH += "${LDFLAGS}"