blob: cc3420df4e0e3b2f3f4b43fd17535fcaf5033729 [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 Geisslerfc113ea2023-03-31 09:59:46 -050017 file://0001-src-w.c-use-utmp.h-only.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050018 "
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050019SRCREV = "806eb270f217ff7e1e745c7bda2b002b5be74be4"
Andrew Geissler82c905d2020-04-13 13:39:40 -050020
21S = "${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 Williams213cb262021-08-07 19:21:33 -050026do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050027 ( cd ${S} && po/update-potfiles )
28}
29
30EXTRA_OECONF = "--enable-skill --disable-modern-top"
31
32PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
33PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
34
Patrick Williams213cb262021-08-07 19:21:33 -050035do_install:append () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050036 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 Williams213cb262021-08-07 19:21:33 -050052CONFFILES:${PN} = "${sysconfdir}/sysctl.conf"
Andrew Geissler82c905d2020-04-13 13:39:40 -050053
54bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w"
55base_bindir_progs += "kill pidof ps watch"
56base_sbindir_progs += "sysctl"
57
58ALTERNATIVE_PRIORITY = "200"
59ALTERNATIVE_PRIORITY[pidof] = "150"
60
Patrick Williams213cb262021-08-07 19:21:33 -050061ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050062
Patrick Williams213cb262021-08-07 19:21:33 -050063ALTERNATIVE:${PN}-doc = "kill.1 uptime.1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050064ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
65ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
66
67python __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 Geissler7e0e3c02022-02-25 20:34:39 +000077CVE_CHECK_IGNORE += "CVE-2018-1121"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060078
79PROCPS_PACKAGES = "${PN}-lib \
80 ${PN}-ps \
81 ${PN}-sysctl"
82
83PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}"
Patrick Williams213cb262021-08-07 19:21:33 -050084RDEPENDS:${PN} += "${PROCPS_PACKAGES}"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060085
Patrick Williams213cb262021-08-07 19:21:33 -050086RDEPENDS:${PN}-ps += "${PN}-lib"
87RDEPENDS:${PN}-sysctl += "${PN}-lib"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060088
Patrick Williams213cb262021-08-07 19:21:33 -050089FILES:${PN}-lib = "${libdir}"
90FILES:${PN}-ps = "${base_bindir}/ps.${BPN}"
91FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060092
Patrick Williams213cb262021-08-07 19:21:33 -050093ALTERNATIVE:${PN}:remove = "ps"
94ALTERNATIVE:${PN}:remove = "sysctl"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060095
Patrick Williams213cb262021-08-07 19:21:33 -050096ALTERNATIVE:${PN}-ps = "ps"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060097ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps"
98ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps"
99
Patrick Williams213cb262021-08-07 19:21:33 -0500100ALTERNATIVE:${PN}-sysctl = "sysctl"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600101ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl"
Andrew Geissler615f2f12022-07-15 14:00:58 -0500102ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl"