sysstat.inc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/${BP}.tar.xz \
  7. file://99_sysstat \
  8. file://sysstat.service \
  9. "
  10. UPSTREAM_CHECK_URI = "http://sebastien.godard.pagesperso-orange.fr/download.html"
  11. DEPENDS += "base-passwd"
  12. # autotools-brokensep as this package doesn't use automake
  13. inherit autotools-brokensep gettext systemd upstream-version-is-even
  14. PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
  15. PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors"
  16. PACKAGECONFIG[cron] = "--enable-install-cron --enable-copy-only,--disable-install-cron --disable-copy-only"
  17. PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}"
  18. EXTRA_OECONF += "--disable-stripping"
  19. do_configure_prepend() {
  20. export sa_lib_dir=${libexecdir}/sa
  21. }
  22. do_install() {
  23. autotools_do_install
  24. # Don't version the documentation
  25. mv ${D}${docdir}/${BP} ${D}${docdir}/${BPN}
  26. # don't install /var/log/sa when populating rootfs. Do it through volatile
  27. rm -rf ${D}/var
  28. if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
  29. install -d ${D}/etc/default/volatiles
  30. install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
  31. fi
  32. if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
  33. install -d ${D}${sysconfdir}/tmpfiles.d
  34. echo "d ${localstatedir}/log/sa - - - -" \
  35. > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf
  36. # Unless both cron and systemd are enabled, install our own
  37. # systemd unit file. Otherwise the package will install one.
  38. if ${@bb.utils.contains('PACKAGECONFIG', 'cron systemd', 'false', 'true', d)}; then
  39. install -d ${D}${systemd_unitdir}/system
  40. install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system
  41. sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
  42. fi
  43. fi
  44. }
  45. pkg_postinst_${PN} () {
  46. if [ ! -n "$D" ]; then
  47. if [ -e /etc/init.d/populate-volatile.sh ]; then
  48. /etc/init.d/populate-volatile.sh update
  49. fi
  50. fi
  51. }
  52. FILES_${PN} += "${systemd_system_unitdir} ${nonarch_base_libdir}/systemd"
  53. TARGET_CC_ARCH += "${LDFLAGS}"