blob: 800384f22f7173a71c1b6392ef0cc5a87a19b3a2 [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 \
17 "
Andrew Geissler220dafd2023-10-04 10:18:08 -050018SRCREV = "4ddcef2fd843170c8e2d59a83042978f41037a2b"
Andrew Geissler82c905d2020-04-13 13:39:40 -050019
20S = "${WORKDIR}/git"
21
22# Upstream has a custom autogen.sh which invokes po/update-potfiles as they
23# don't ship a po/POTFILES.in (which is silly). Without that file gettext
24# doesn't believe po/ is a gettext directory and won't generate po/Makefile.
Patrick Williams213cb262021-08-07 19:21:33 -050025do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050026 ( cd ${S} && po/update-potfiles )
27}
28
29EXTRA_OECONF = "--enable-skill --disable-modern-top"
30
31PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
32PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
33
Patrick Williams213cb262021-08-07 19:21:33 -050034do_install:append () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050035 install -d ${D}${base_bindir}
36 [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
37 install -d ${D}${base_sbindir}
38 [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done
39 if [ "${base_sbindir}" != "${sbindir}" ]; then
40 rmdir ${D}${sbindir}
41 fi
42
43 install -d ${D}${sysconfdir}
44 install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf
45 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
46 install -d ${D}${sysconfdir}/sysctl.d
47 ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf
48 fi
49}
50
Patrick Williams213cb262021-08-07 19:21:33 -050051CONFFILES:${PN} = "${sysconfdir}/sysctl.conf"
Andrew Geissler82c905d2020-04-13 13:39:40 -050052
53bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w"
54base_bindir_progs += "kill pidof ps watch"
55base_sbindir_progs += "sysctl"
56
57ALTERNATIVE_PRIORITY = "200"
58ALTERNATIVE_PRIORITY[pidof] = "150"
59
Patrick Williams213cb262021-08-07 19:21:33 -050060ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050061
Patrick Williams213cb262021-08-07 19:21:33 -050062ALTERNATIVE:${PN}-doc = "kill.1 uptime.1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050063ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
64ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
65
66python __anonymous() {
67 for prog in d.getVar('base_bindir_progs').split():
68 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
69
70 for prog in d.getVar('base_sbindir_progs').split():
71 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
72}
73
Andrew Geisslerd1e89492021-02-12 15:35:20 -060074PROCPS_PACKAGES = "${PN}-lib \
75 ${PN}-ps \
76 ${PN}-sysctl"
77
78PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}"
Patrick Williams213cb262021-08-07 19:21:33 -050079RDEPENDS:${PN} += "${PROCPS_PACKAGES}"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060080
Patrick Williams213cb262021-08-07 19:21:33 -050081RDEPENDS:${PN}-ps += "${PN}-lib"
82RDEPENDS:${PN}-sysctl += "${PN}-lib"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060083
Patrick Williams213cb262021-08-07 19:21:33 -050084FILES:${PN}-lib = "${libdir}"
85FILES:${PN}-ps = "${base_bindir}/ps.${BPN}"
86FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060087
Patrick Williams213cb262021-08-07 19:21:33 -050088ALTERNATIVE:${PN}:remove = "ps"
89ALTERNATIVE:${PN}:remove = "sysctl"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060090
Patrick Williams213cb262021-08-07 19:21:33 -050091ALTERNATIVE:${PN}-ps = "ps"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060092ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps"
93ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps"
94
Patrick Williams213cb262021-08-07 19:21:33 -050095ALTERNATIVE:${PN}-sysctl = "sysctl"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060096ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl"
Andrew Geissler615f2f12022-07-15 14:00:58 -050097ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl"