Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "System and process monitoring utilities" |
| 2 | DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \ |
| 3 | the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill." |
| 4 | HOMEPAGE = "https://gitlab.com/procps-ng/procps" |
| 5 | SECTION = "base" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 6 | LICENSE = "GPL-2.0-or-later & LGPL-2.0-or-later" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 8 | file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \ |
| 9 | " |
| 10 | |
| 11 | DEPENDS = "ncurses" |
| 12 | |
| 13 | inherit autotools gettext pkgconfig update-alternatives |
| 14 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 15 | SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | file://sysctl.conf \ |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 17 | file://0001-src-w.c-use-utmp.h-only.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | " |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 19 | SRCREV = "806eb270f217ff7e1e745c7bda2b002b5be74be4" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | # Upstream has a custom autogen.sh which invokes po/update-potfiles as they |
| 24 | # don't ship a po/POTFILES.in (which is silly). Without that file gettext |
| 25 | # doesn't believe po/ is a gettext directory and won't generate po/Makefile. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 26 | do_configure:prepend() { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | ( cd ${S} && po/update-potfiles ) |
| 28 | } |
| 29 | |
| 30 | EXTRA_OECONF = "--enable-skill --disable-modern-top" |
| 31 | |
| 32 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" |
| 33 | PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" |
| 34 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 35 | do_install:append () { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 36 | install -d ${D}${base_bindir} |
| 37 | [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done |
| 38 | install -d ${D}${base_sbindir} |
| 39 | [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done |
| 40 | if [ "${base_sbindir}" != "${sbindir}" ]; then |
| 41 | rmdir ${D}${sbindir} |
| 42 | fi |
| 43 | |
| 44 | install -d ${D}${sysconfdir} |
| 45 | install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf |
| 46 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 47 | install -d ${D}${sysconfdir}/sysctl.d |
| 48 | ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf |
| 49 | fi |
| 50 | } |
| 51 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 52 | CONFFILES:${PN} = "${sysconfdir}/sysctl.conf" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 53 | |
| 54 | bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w" |
| 55 | base_bindir_progs += "kill pidof ps watch" |
| 56 | base_sbindir_progs += "sysctl" |
| 57 | |
| 58 | ALTERNATIVE_PRIORITY = "200" |
| 59 | ALTERNATIVE_PRIORITY[pidof] = "150" |
| 60 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 62 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 63 | ALTERNATIVE:${PN}-doc = "kill.1 uptime.1" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 64 | ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" |
| 65 | ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" |
| 66 | |
| 67 | python __anonymous() { |
| 68 | for prog in d.getVar('base_bindir_progs').split(): |
| 69 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) |
| 70 | |
| 71 | for prog in d.getVar('base_sbindir_progs').split(): |
| 72 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) |
| 73 | } |
| 74 | |
| 75 | # 'ps' isn't suitable for use as a security tool so whitelist this CVE. |
| 76 | # https://bugzilla.redhat.com/show_bug.cgi?id=1575473#c3 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 77 | CVE_CHECK_IGNORE += "CVE-2018-1121" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 78 | |
| 79 | PROCPS_PACKAGES = "${PN}-lib \ |
| 80 | ${PN}-ps \ |
| 81 | ${PN}-sysctl" |
| 82 | |
| 83 | PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 84 | RDEPENDS:${PN} += "${PROCPS_PACKAGES}" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 85 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 86 | RDEPENDS:${PN}-ps += "${PN}-lib" |
| 87 | RDEPENDS:${PN}-sysctl += "${PN}-lib" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 88 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 89 | FILES:${PN}-lib = "${libdir}" |
| 90 | FILES:${PN}-ps = "${base_bindir}/ps.${BPN}" |
| 91 | FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 92 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 93 | ALTERNATIVE:${PN}:remove = "ps" |
| 94 | ALTERNATIVE:${PN}:remove = "sysctl" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 95 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 96 | ALTERNATIVE:${PN}-ps = "ps" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 97 | ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps" |
| 98 | ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps" |
| 99 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 100 | ALTERNATIVE:${PN}-sysctl = "sysctl" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 101 | ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl" |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 102 | ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl" |