diff options
Diffstat (limited to 'meta/recipes-extended/procps/procps_3.3.17.bb')
-rw-r--r-- | meta/recipes-extended/procps/procps_3.3.17.bb | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/meta/recipes-extended/procps/procps_3.3.17.bb b/meta/recipes-extended/procps/procps_3.3.17.bb new file mode 100644 index 0000000000..c74a901d9a --- /dev/null +++ b/meta/recipes-extended/procps/procps_3.3.17.bb | |||
@@ -0,0 +1,103 @@ | |||
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" | ||
6 | LICENSE = "GPLv2+ & LGPLv2+" | ||
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 | |||
15 | SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https \ | ||
16 | file://sysctl.conf \ | ||
17 | file://0001-w.c-correct-musl-builds.patch \ | ||
18 | file://0002-proc-escape.c-add-missing-include.patch \ | ||
19 | " | ||
20 | SRCREV = "19a508ea121c0c4ac6d0224575a036de745eaaf8" | ||
21 | |||
22 | S = "${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. | ||
27 | do_configure_prepend() { | ||
28 | ( cd ${S} && po/update-potfiles ) | ||
29 | } | ||
30 | |||
31 | EXTRA_OECONF = "--enable-skill --disable-modern-top" | ||
32 | |||
33 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" | ||
34 | PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" | ||
35 | |||
36 | do_install_append () { | ||
37 | 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 | |||
53 | CONFFILES_${PN} = "${sysconfdir}/sysctl.conf" | ||
54 | |||
55 | bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w" | ||
56 | base_bindir_progs += "kill pidof ps watch" | ||
57 | base_sbindir_progs += "sysctl" | ||
58 | |||
59 | ALTERNATIVE_PRIORITY = "200" | ||
60 | ALTERNATIVE_PRIORITY[pidof] = "150" | ||
61 | |||
62 | ALTERNATIVE_${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}" | ||
63 | |||
64 | ALTERNATIVE_${PN}-doc = "kill.1 uptime.1" | ||
65 | ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" | ||
66 | ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" | ||
67 | |||
68 | python __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 | |||
76 | # 'ps' isn't suitable for use as a security tool so whitelist this CVE. | ||
77 | # https://bugzilla.redhat.com/show_bug.cgi?id=1575473#c3 | ||
78 | CVE_CHECK_WHITELIST += "CVE-2018-1121" | ||
79 | |||
80 | PROCPS_PACKAGES = "${PN}-lib \ | ||
81 | ${PN}-ps \ | ||
82 | ${PN}-sysctl" | ||
83 | |||
84 | PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}" | ||
85 | RDEPENDS_${PN} += "${PROCPS_PACKAGES}" | ||
86 | |||
87 | RDEPENDS_${PN}-ps += "${PN}-lib" | ||
88 | RDEPENDS_${PN}-sysctl += "${PN}-lib" | ||
89 | |||
90 | FILES_${PN}-lib = "${libdir}" | ||
91 | FILES_${PN}-ps = "${base_bindir}/ps.${BPN}" | ||
92 | FILES_${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d" | ||
93 | |||
94 | ALTERNATIVE_${PN}_remove = "ps" | ||
95 | ALTERNATIVE_${PN}_remove = "sysctl" | ||
96 | |||
97 | ALTERNATIVE_${PN}-ps = "ps" | ||
98 | ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps" | ||
99 | ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps" | ||
100 | |||
101 | ALTERNATIVE_${PN}-sysctl = "sysctl" | ||
102 | ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl" | ||
103 | ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl" \ No newline at end of file | ||