blob: 134fd5cf964ccef038bebc26798867801a714c5f [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."
Andrew Geissler220dafd2023-10-04 10:18:08 -05003HOMEPAGE = "https://sysstat.github.io/"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00004LICENSE = "GPL-2.0-or-later"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005SECTION = "console/utils"
6
Andrew Geissler220dafd2023-10-04 10:18:08 -05007SRC_URI = "git://github.com/sysstat/sysstat.git;protocol=https;branch=master \
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008 file://99_sysstat \
9 file://sysstat.service \
Andrew Geissler220dafd2023-10-04 10:18:08 -050010 file://0001-configure.in-remove-check-for-chkconfig.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011 "
12
Andrew Geissler220dafd2023-10-04 10:18:08 -050013LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb"
14
15SRCREV = "1df0d61306ae826c896a5cf6f665d58c671c0498"
16S = "${WORKDIR}/git"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050017
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018DEPENDS += "base-passwd"
19
Patrick Williamsc0f7c042017-02-23 20:41:17 -060020# autotools-brokensep as this package doesn't use automake
Andrew Geissler220dafd2023-10-04 10:18:08 -050021inherit autotools-brokensep gettext systemd
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022
Brad Bishop1d80a2e2019-11-15 16:35:03 -050023PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors"
Brad Bishop393846f2019-05-20 12:24:11 -040025PACKAGECONFIG[cron] = "--enable-install-cron --enable-copy-only,--disable-install-cron --disable-copy-only"
Brad Bishop96ff1982019-08-19 13:50:42 -040026PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027
28EXTRA_OECONF += "--disable-stripping"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029
Andrew Geissler09036742021-06-25 14:25:14 -050030SYSTEMD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050031SYSTEMD_SERVICE:${PN} = "sysstat.service"
Andrew Geissler09036742021-06-25 14:25:14 -050032SYSTEMD_AUTO_ENABLE = "enable"
33
Patrick Williams213cb262021-08-07 19:21:33 -050034do_configure:prepend() {
Brad Bishop79641f22019-09-10 07:20:22 -040035 export sa_lib_dir=${libexecdir}/sa
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036}
37
38do_install() {
39 autotools_do_install
40
Andrew Geissler82c905d2020-04-13 13:39:40 -050041 # Don't version the documentation
42 mv ${D}${docdir}/${BP} ${D}${docdir}/${BPN}
43
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044 # don't install /var/log/sa when populating rootfs. Do it through volatile
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 rm -rf ${D}/var
Brad Bishopd7bf8c12018-02-25 22:55:05 -050046 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
47 install -d ${D}/etc/default/volatiles
48 install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
49 fi
50 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
51 install -d ${D}${sysconfdir}/tmpfiles.d
52 echo "d ${localstatedir}/log/sa - - - -" \
53 > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054
Brad Bishop1d80a2e2019-11-15 16:35:03 -050055 # Unless both cron and systemd are enabled, install our own
56 # systemd unit file. Otherwise the package will install one.
57 if ${@bb.utils.contains('PACKAGECONFIG', 'cron systemd', 'false', 'true', d)}; then
Andrew Geissler5199d832021-09-24 16:47:35 -050058 install -d ${D}${systemd_system_unitdir}
59 install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_system_unitdir}
60 sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_system_unitdir}/sysstat.service
Brad Bishop96ff1982019-08-19 13:50:42 -040061 fi
62 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063}
64
Patrick Williams213cb262021-08-07 19:21:33 -050065pkg_postinst:${PN} () {
Brad Bishopf3fd2882019-06-21 08:06:37 -040066 if [ ! -n "$D" ]; then
67 if [ -e /etc/init.d/populate-volatile.sh ]; then
68 /etc/init.d/populate-volatile.sh update
69 fi
70 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071}
72
Patrick Williams213cb262021-08-07 19:21:33 -050073FILES:${PN} += "${systemd_system_unitdir} ${nonarch_base_libdir}/systemd"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074
75TARGET_CC_ARCH += "${LDFLAGS}"
Andrew Geissler220dafd2023-10-04 10:18:08 -050076