blob: 59ad89d32697ff11046c17cb1d16ad98ff4fea58 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "System and process monitoring utilities"
2DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \
3the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill."
4HOMEPAGE = "https://gitlab.com/procps-ng/procps"
5SECTION = "base"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00006LICENSE = "GPL-2.0-or-later & LGPL-2.0-or-later"
Andrew Geissler82c905d2020-04-13 13:39:40 -05007LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
8 file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \
9 "
10
11DEPENDS = "ncurses"
12
13inherit autotools gettext pkgconfig update-alternatives
14
Andrew Geissler595f6302022-01-24 19:11:47 +000015SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \
Andrew Geissler82c905d2020-04-13 13:39:40 -050016 file://sysctl.conf \
Andrew Geissler95ac1b82021-03-31 14:34:31 -050017 file://0001-w.c-correct-musl-builds.patch \
18 file://0002-proc-escape.c-add-missing-include.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 "
Andrew Geissler95ac1b82021-03-31 14:34:31 -050020SRCREV = "19a508ea121c0c4ac6d0224575a036de745eaaf8"
Andrew Geissler615f2f12022-07-15 14:00:58 -050021# 4.x version is an API incompatible rewrite
22# until procps consumers are transitioned to it we need to stick with 3.x
23# https://gitlab.com/procps-ng/procps/-/issues/239
24UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>3(\.\d+)+)"
Andrew Geissler82c905d2020-04-13 13:39:40 -050025
26S = "${WORKDIR}/git"
27
28# Upstream has a custom autogen.sh which invokes po/update-potfiles as they
29# don't ship a po/POTFILES.in (which is silly). Without that file gettext
30# doesn't believe po/ is a gettext directory and won't generate po/Makefile.
Patrick Williams213cb262021-08-07 19:21:33 -050031do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050032 ( cd ${S} && po/update-potfiles )
33}
34
35EXTRA_OECONF = "--enable-skill --disable-modern-top"
36
37PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
38PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
39
Patrick Williams213cb262021-08-07 19:21:33 -050040do_install:append () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050041 install -d ${D}${base_bindir}
42 [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
43 install -d ${D}${base_sbindir}
44 [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done
45 if [ "${base_sbindir}" != "${sbindir}" ]; then
46 rmdir ${D}${sbindir}
47 fi
48
49 install -d ${D}${sysconfdir}
50 install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf
51 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
52 install -d ${D}${sysconfdir}/sysctl.d
53 ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf
54 fi
55}
56
Patrick Williams213cb262021-08-07 19:21:33 -050057CONFFILES:${PN} = "${sysconfdir}/sysctl.conf"
Andrew Geissler82c905d2020-04-13 13:39:40 -050058
59bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w"
60base_bindir_progs += "kill pidof ps watch"
61base_sbindir_progs += "sysctl"
62
63ALTERNATIVE_PRIORITY = "200"
64ALTERNATIVE_PRIORITY[pidof] = "150"
65
Patrick Williams213cb262021-08-07 19:21:33 -050066ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050067
Patrick Williams213cb262021-08-07 19:21:33 -050068ALTERNATIVE:${PN}-doc = "kill.1 uptime.1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050069ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
70ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
71
72python __anonymous() {
73 for prog in d.getVar('base_bindir_progs').split():
74 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
75
76 for prog in d.getVar('base_sbindir_progs').split():
77 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
78}
79
80# 'ps' isn't suitable for use as a security tool so whitelist this CVE.
81# https://bugzilla.redhat.com/show_bug.cgi?id=1575473#c3
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000082CVE_CHECK_IGNORE += "CVE-2018-1121"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060083
84PROCPS_PACKAGES = "${PN}-lib \
85 ${PN}-ps \
86 ${PN}-sysctl"
87
88PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}"
Patrick Williams213cb262021-08-07 19:21:33 -050089RDEPENDS:${PN} += "${PROCPS_PACKAGES}"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060090
Patrick Williams213cb262021-08-07 19:21:33 -050091RDEPENDS:${PN}-ps += "${PN}-lib"
92RDEPENDS:${PN}-sysctl += "${PN}-lib"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060093
Patrick Williams213cb262021-08-07 19:21:33 -050094FILES:${PN}-lib = "${libdir}"
95FILES:${PN}-ps = "${base_bindir}/ps.${BPN}"
96FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060097
Patrick Williams213cb262021-08-07 19:21:33 -050098ALTERNATIVE:${PN}:remove = "ps"
99ALTERNATIVE:${PN}:remove = "sysctl"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600100
Patrick Williams213cb262021-08-07 19:21:33 -0500101ALTERNATIVE:${PN}-ps = "ps"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600102ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps"
103ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps"
104
Patrick Williams213cb262021-08-07 19:21:33 -0500105ALTERNATIVE:${PN}-sysctl = "sysctl"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600106ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl"
Andrew Geissler615f2f12022-07-15 14:00:58 -0500107ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl"