blob: 8345c1e3d13eb8e137b13bbc564986c4f457b3e4 [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"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050013
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014DEPENDS += "base-passwd"
15
Patrick Williamsc0f7c042017-02-23 20:41:17 -060016# autotools-brokensep as this package doesn't use automake
Brad Bishopc342db32019-05-15 21:57:59 -040017inherit autotools-brokensep gettext systemd upstream-version-is-even
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018
Brad Bishop1d80a2e2019-11-15 16:35:03 -050019PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors"
Brad Bishop393846f2019-05-20 12:24:11 -040021PACKAGECONFIG[cron] = "--enable-install-cron --enable-copy-only,--disable-install-cron --disable-copy-only"
Brad Bishop96ff1982019-08-19 13:50:42 -040022PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050023
24EXTRA_OECONF += "--disable-stripping"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025
Andrew Geissler09036742021-06-25 14:25:14 -050026SYSTEMD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050027SYSTEMD_SERVICE:${PN} = "sysstat.service"
Andrew Geissler09036742021-06-25 14:25:14 -050028SYSTEMD_AUTO_ENABLE = "enable"
29
Patrick Williams213cb262021-08-07 19:21:33 -050030do_configure:prepend() {
Brad Bishop79641f22019-09-10 07:20:22 -040031 export sa_lib_dir=${libexecdir}/sa
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032}
33
34do_install() {
35 autotools_do_install
36
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 # Don't version the documentation
38 mv ${D}${docdir}/${BP} ${D}${docdir}/${BPN}
39
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040 # don't install /var/log/sa when populating rootfs. Do it through volatile
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041 rm -rf ${D}/var
Brad Bishopd7bf8c12018-02-25 22:55:05 -050042 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
43 install -d ${D}/etc/default/volatiles
44 install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
45 fi
46 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
47 install -d ${D}${sysconfdir}/tmpfiles.d
48 echo "d ${localstatedir}/log/sa - - - -" \
49 > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
Brad Bishop1d80a2e2019-11-15 16:35:03 -050051 # Unless both cron and systemd are enabled, install our own
52 # systemd unit file. Otherwise the package will install one.
53 if ${@bb.utils.contains('PACKAGECONFIG', 'cron systemd', 'false', 'true', d)}; then
Andrew Geissler5199d832021-09-24 16:47:35 -050054 install -d ${D}${systemd_system_unitdir}
55 install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_system_unitdir}
56 sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_system_unitdir}/sysstat.service
Brad Bishop96ff1982019-08-19 13:50:42 -040057 fi
58 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059}
60
Patrick Williams213cb262021-08-07 19:21:33 -050061pkg_postinst:${PN} () {
Brad Bishopf3fd2882019-06-21 08:06:37 -040062 if [ ! -n "$D" ]; then
63 if [ -e /etc/init.d/populate-volatile.sh ]; then
64 /etc/init.d/populate-volatile.sh update
65 fi
66 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050067}
68
Patrick Williams213cb262021-08-07 19:21:33 -050069FILES:${PN} += "${systemd_system_unitdir} ${nonarch_base_libdir}/systemd"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070
71TARGET_CC_ARCH += "${LDFLAGS}"