blob: bf160053d9ce35e4d2e6e82f29ca96517122a359 [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001SUMMARY = "PolicyKit Authorization Framework"
2DESCRIPTION = "The polkit package is an application-level toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes."
3HOMEPAGE = "http://www.freedesktop.org/wiki/Software/polkit"
Andrew Geissler9aee5002022-03-30 16:27:02 +00004LICENSE = "LGPL-2.0-or-later"
Andrew Geisslereff27472021-10-29 15:35:00 -05005LIC_FILES_CHKSUM = "file://COPYING;md5=155db86cdbafa7532b41f390409283eb \
6 file://src/polkit/polkit.h;beginline=1;endline=20;md5=0a8630b0133176d0504c87a0ded39db4"
7
Andrew Geissler615f2f12022-07-15 14:00:58 -05008DEPENDS = "expat glib-2.0 intltool-native"
Andrew Geisslereff27472021-10-29 15:35:00 -05009
10inherit autotools gtk-doc pkgconfig useradd systemd gobject-introspection features_check
11
12REQUIRED_DISTRO_FEATURES = "polkit"
13
14PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
15 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', \
16 bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
Andrew Geissler615f2f12022-07-15 14:00:58 -050017 mozjs \
Andrew Geisslereff27472021-10-29 15:35:00 -050018 "
19
20PACKAGECONFIG[pam] = "--with-authfw=pam,--with-authfw=shadow,libpam,libpam"
21PACKAGECONFIG[systemd] = "--enable-libsystemd-login=yes --with-systemdsystemunitdir=${systemd_unitdir}/system/,--enable-libsystemd-login=no --with-systemdsystemunitdir=,systemd"
22# there is no --enable/--disable option for consolekit and it's not picked by shlibs, so add it to RDEPENDS
23PACKAGECONFIG[consolekit] = ",,,consolekit"
24
Andrew Geissler615f2f12022-07-15 14:00:58 -050025# Default to mozjs javascript library
26PACKAGECONFIG[mozjs] = ",,mozjs-91,,,duktape"
27# duktape javascript engine is much smaller and faster but is not compatible with
28# same javascript standards as mozjs. For example array.includes() function is not
29# supported. Test rule compatibility when switching to duktape.
30PACKAGECONFIG[duktape] = "--with-duktape,,duktape,,,mozjs"
31
32MOZJS_PATCHES = "\
33 file://0002-jsauthority-port-to-mozjs-91.patch \
34 file://0003-jsauthority-ensure-to-call-JS_Init-and-JS_ShutDown-e.patch \
35"
36DUKTAPE_PATCHES = "file://0003-Added-support-for-duktape-as-JS-engine.patch"
Andrew Geisslereff27472021-10-29 15:35:00 -050037PAM_SRC_URI = "file://polkit-1_pam.patch"
38SRC_URI = "http://www.freedesktop.org/software/polkit/releases/polkit-${PV}.tar.gz \
39 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
Andrew Geissler615f2f12022-07-15 14:00:58 -050040 ${@bb.utils.contains('PACKAGECONFIG', 'mozjs', '${MOZJS_PATCHES}', '', d)} \
41 ${@bb.utils.contains('PACKAGECONFIG', 'duktape', '${DUKTAPE_PATCHES}', '', d)} \
Andrew Geisslereff27472021-10-29 15:35:00 -050042 file://0003-make-netgroup-support-optional.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000043 file://0001-pkexec-local-privilege-escalation-CVE-2021-4034.patch \
44 file://0002-CVE-2021-4115-GHSL-2021-077-fix.patch \
Andrew Geisslereff27472021-10-29 15:35:00 -050045 "
46SRC_URI[sha256sum] = "c8579fdb86e94295404211285fee0722ad04893f0213e571bd75c00972fd1f5c"
47
48EXTRA_OECONF = "--with-os-type=moblin \
49 --disable-man-pages \
50 --disable-libelogind \
51 "
52
Andrew Geissler9aee5002022-03-30 16:27:02 +000053do_configure:prepend () {
54 rm -f ${S}/buildutil/lt*.m4 ${S}/buildutil/libtool.m4
55}
56
Andrew Geisslereff27472021-10-29 15:35:00 -050057do_compile:prepend () {
58 export GIR_EXTRA_LIBS_PATH="${B}/src/polkit/.libs"
59}
60
61PACKAGES =+ "${PN}-examples"
62
63FILES:${PN}:append = " \
64 ${libdir}/${BPN}-1 \
65 ${nonarch_libdir}/${BPN}-1 \
66 ${datadir}/dbus-1 \
67 ${datadir}/${BPN}-1 \
68 ${datadir}/gettext \
69"
70
71FILES:${PN}-examples = "${bindir}/*example*"
72
73USERADD_PACKAGES = "${PN}"
74USERADD_PARAM:${PN} = "--system --no-create-home --user-group --home-dir ${sysconfdir}/${BPN}-1 polkitd"
75
76SYSTEMD_SERVICE:${PN} = "${BPN}.service"
77SYSTEMD_AUTO_ENABLE = "disable"