Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "System performance tools" |
| 2 | DESCRIPTION = "The sysstat utilities are a collection of performance monitoring tools for Linux." |
| 3 | HOMEPAGE = "http://sebastien.godard.pagesperso-orange.fr/" |
| 4 | LICENSE = "GPLv2+" |
| 5 | SECTION = "console/utils" |
| 6 | |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 7 | SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/${BP}.tar.xz \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | file://99_sysstat \ |
| 9 | file://sysstat.service \ |
| 10 | " |
| 11 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 12 | UPSTREAM_CHECK_URI = "http://sebastien.godard.pagesperso-orange.fr/download.html" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 13 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | DEPENDS += "base-passwd" |
| 15 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 16 | # autotools-brokensep as this package doesn't use automake |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 17 | inherit autotools-brokensep gettext systemd upstream-version-is-even |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | |
Brad Bishop | 1d80a2e | 2019-11-15 16:35:03 -0500 | [diff] [blame] | 19 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors" |
Brad Bishop | 393846f | 2019-05-20 12:24:11 -0400 | [diff] [blame] | 21 | PACKAGECONFIG[cron] = "--enable-install-cron --enable-copy-only,--disable-install-cron --disable-copy-only" |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 22 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 23 | |
| 24 | EXTRA_OECONF += "--disable-stripping" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 26 | SYSTEMD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 27 | SYSTEMD_SERVICE:${PN} = "sysstat.service" |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 28 | SYSTEMD_AUTO_ENABLE = "enable" |
| 29 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 30 | do_configure:prepend() { |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 31 | export sa_lib_dir=${libexecdir}/sa |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | do_install() { |
| 35 | autotools_do_install |
| 36 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 37 | # Don't version the documentation |
| 38 | mv ${D}${docdir}/${BP} ${D}${docdir}/${BPN} |
| 39 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | # don't install /var/log/sa when populating rootfs. Do it through volatile |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | rm -rf ${D}/var |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 42 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | |
Brad Bishop | 1d80a2e | 2019-11-15 16:35:03 -0500 | [diff] [blame] | 51 | # 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 |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 54 | install -d ${D}${systemd_unitdir}/system |
| 55 | install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system |
Brad Bishop | 1d80a2e | 2019-11-15 16:35:03 -0500 | [diff] [blame] | 56 | sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_unitdir}/system/sysstat.service |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 57 | fi |
| 58 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 59 | } |
| 60 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 61 | pkg_postinst:${PN} () { |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 62 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 67 | } |
| 68 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 69 | FILES:${PN} += "${systemd_system_unitdir} ${nonarch_base_libdir}/systemd" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 70 | |
| 71 | TARGET_CC_ARCH += "${LDFLAGS}" |