blob: 71efb80207d64ca06548ef5d7c396414c2f05793 [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 \
Patrick Williams2a254922023-08-11 09:48:11 -050018 file://0001-po-fr.po-address-failures-with-gettext-0.22.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 "
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050020SRCREV = "806eb270f217ff7e1e745c7bda2b002b5be74be4"
Andrew Geissler82c905d2020-04-13 13:39:40 -050021
22S = "${WORKDIR}/git"
23
24# Upstream has a custom autogen.sh which invokes po/update-potfiles as they
25# don't ship a po/POTFILES.in (which is silly). Without that file gettext
26# doesn't believe po/ is a gettext directory and won't generate po/Makefile.
Patrick Williams213cb262021-08-07 19:21:33 -050027do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050028 ( cd ${S} && po/update-potfiles )
29}
30
31EXTRA_OECONF = "--enable-skill --disable-modern-top"
32
33PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
34PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
35
Patrick Williams213cb262021-08-07 19:21:33 -050036do_install:append () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 install -d ${D}${base_bindir}
38 [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
39 install -d ${D}${base_sbindir}
40 [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done
41 if [ "${base_sbindir}" != "${sbindir}" ]; then
42 rmdir ${D}${sbindir}
43 fi
44
45 install -d ${D}${sysconfdir}
46 install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf
47 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
48 install -d ${D}${sysconfdir}/sysctl.d
49 ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf
50 fi
51}
52
Patrick Williams213cb262021-08-07 19:21:33 -050053CONFFILES:${PN} = "${sysconfdir}/sysctl.conf"
Andrew Geissler82c905d2020-04-13 13:39:40 -050054
55bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w"
56base_bindir_progs += "kill pidof ps watch"
57base_sbindir_progs += "sysctl"
58
59ALTERNATIVE_PRIORITY = "200"
60ALTERNATIVE_PRIORITY[pidof] = "150"
61
Patrick Williams213cb262021-08-07 19:21:33 -050062ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050063
Patrick Williams213cb262021-08-07 19:21:33 -050064ALTERNATIVE:${PN}-doc = "kill.1 uptime.1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050065ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
66ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
67
68python __anonymous() {
69 for prog in d.getVar('base_bindir_progs').split():
70 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
71
72 for prog in d.getVar('base_sbindir_progs').split():
73 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
74}
75
Andrew Geisslerd1e89492021-02-12 15:35:20 -060076PROCPS_PACKAGES = "${PN}-lib \
77 ${PN}-ps \
78 ${PN}-sysctl"
79
80PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}"
Patrick Williams213cb262021-08-07 19:21:33 -050081RDEPENDS:${PN} += "${PROCPS_PACKAGES}"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060082
Patrick Williams213cb262021-08-07 19:21:33 -050083RDEPENDS:${PN}-ps += "${PN}-lib"
84RDEPENDS:${PN}-sysctl += "${PN}-lib"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060085
Patrick Williams213cb262021-08-07 19:21:33 -050086FILES:${PN}-lib = "${libdir}"
87FILES:${PN}-ps = "${base_bindir}/ps.${BPN}"
88FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060089
Patrick Williams213cb262021-08-07 19:21:33 -050090ALTERNATIVE:${PN}:remove = "ps"
91ALTERNATIVE:${PN}:remove = "sysctl"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060092
Patrick Williams213cb262021-08-07 19:21:33 -050093ALTERNATIVE:${PN}-ps = "ps"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060094ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps"
95ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps"
96
Patrick Williams213cb262021-08-07 19:21:33 -050097ALTERNATIVE:${PN}-sysctl = "sysctl"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060098ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl"
Andrew Geissler615f2f12022-07-15 14:00:58 -050099ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl"