blob: 62de36b44bf9c11050908ffc5e14ff8cdbc3d9b0 [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
Brad Bishop79641f22019-09-10 07:20:22 -04007SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/${BP}.tar.xz \
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008 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 Bishop1d80a2e2019-11-15 16:35:03 -050020PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050021PACKAGECONFIG[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 Bishop96ff1982019-08-19 13:50:42 -040023PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024
25EXTRA_OECONF += "--disable-stripping"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026
27SYSTEMD_PACKAGES = "${PN}"
28SYSTEMD_SERVICE_${PN} = "sysstat.service"
29SYSTEMD_AUTO_ENABLE = "enable"
30
31do_configure_prepend() {
Brad Bishop79641f22019-09-10 07:20:22 -040032 export sa_lib_dir=${libexecdir}/sa
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033}
34
35do_install() {
36 autotools_do_install
37
38 # don't install /var/log/sa when populating rootfs. Do it through volatile
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039 rm -rf ${D}/var
Brad Bishopd7bf8c12018-02-25 22:55:05 -050040 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
41 install -d ${D}/etc/default/volatiles
42 install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
43 fi
44 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
45 install -d ${D}${sysconfdir}/tmpfiles.d
46 echo "d ${localstatedir}/log/sa - - - -" \
47 > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048
Brad Bishop1d80a2e2019-11-15 16:35:03 -050049 # Unless both cron and systemd are enabled, install our own
50 # systemd unit file. Otherwise the package will install one.
51 if ${@bb.utils.contains('PACKAGECONFIG', 'cron systemd', 'false', 'true', d)}; then
Brad Bishop96ff1982019-08-19 13:50:42 -040052 install -d ${D}${systemd_unitdir}/system
53 install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system
Brad Bishop1d80a2e2019-11-15 16:35:03 -050054 sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
Brad Bishop96ff1982019-08-19 13:50:42 -040055 fi
56 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057}
58
59pkg_postinst_${PN} () {
Brad Bishopf3fd2882019-06-21 08:06:37 -040060 if [ ! -n "$D" ]; then
61 if [ -e /etc/init.d/populate-volatile.sh ]; then
62 /etc/init.d/populate-volatile.sh update
63 fi
64 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065}
66
Brad Bishop1d80a2e2019-11-15 16:35:03 -050067FILES_${PN} += "${systemd_system_unitdir}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068
69TARGET_CC_ARCH += "${LDFLAGS}"