blob: 3eb0d52806c68a86799f2163f38038c5fb295f1c [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "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"
4LICENSE = "LGPL-2.0-or-later"
5LIC_FILES_CHKSUM = "file://COPYING;md5=155db86cdbafa7532b41f390409283eb"
6
Patrick Williams169d7bc2024-01-05 11:33:25 -06007SRC_URI = "git://gitlab.freedesktop.org/polkit/polkit.git;protocol=https;branch=master \
8 file://0001-polkit.service.in-disable-MemoryDenyWriteExecute.patch \
Patrick Williams169d7bc2024-01-05 11:33:25 -06009 "
Andrew Geissler517393d2023-01-13 08:55:19 -060010
11S = "${WORKDIR}/git"
Patrick Williamsb58112e2024-03-07 11:16:36 -060012SRCREV = "82f0924dc0eb23b9df68e88dbaf9e07c81940a5a"
Andrew Geissler517393d2023-01-13 08:55:19 -060013
14DEPENDS = "expat glib-2.0"
15
16inherit meson pkgconfig useradd systemd gettext gobject-introspection features_check
17
18REQUIRED_DISTRO_FEATURES = "polkit"
19
20PACKAGECONFIG = " \
21 ${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
22 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', 'consolekit', d)} \
23 dbus \
24 mozjs \
25"
26PACKAGECONFIG[dbus] = ",,dbus"
27PACKAGECONFIG[gtk-doc] = "-Dgtk_doc=true,-Dgtk_doc=false,gtk-doc-native"
28PACKAGECONFIG[pam] = "-Dauthfw=pam,-Dauthfw=shadow,libpam,libpam"
29PACKAGECONFIG[systemd] = "-Dsession_tracking=libsystemd-login,-Dsession_tracking=ConsoleKit,systemd"
30PACKAGECONFIG[consolekit] = ",,,consolekit"
31
32# Default to mozjs javascript library
Patrick Williams169d7bc2024-01-05 11:33:25 -060033PACKAGECONFIG[mozjs] = "-Djs_engine=mozjs,,mozjs-115,,,duktape"
Andrew Geissler517393d2023-01-13 08:55:19 -060034# duktape javascript engine is much smaller and faster but is not compatible with
35# same javascript standards as mozjs. For example array.includes() function is not
36# supported. Test rule compatibility when switching to duktape.
37PACKAGECONFIG[duktape] = "-Djs_engine=duktape,,duktape,,,mozjs"
38
39USERADD_PACKAGES = "${PN}"
40USERADD_PARAM:${PN} = "--system --no-create-home --user-group --home-dir ${sysconfdir}/${BPN}-1 --shell /bin/nologin polkitd"
41
42SYSTEMD_SERVICE:${PN} = "${BPN}.service"
43SYSTEMD_AUTO_ENABLE = "disable"
44
45do_install:append() {
46 #Fix up permissions on polkit rules.d to work with rpm4 constraints
47 chmod 700 ${D}/${datadir}/polkit-1/rules.d
Patrick Williams73bd93f2024-02-20 08:07:48 -060048 chmod 700 ${D}/${sysconfdir}/polkit-1/rules.d
Andrew Geissler517393d2023-01-13 08:55:19 -060049 chown polkitd:root ${D}/${datadir}/polkit-1/rules.d
Patrick Williams73bd93f2024-02-20 08:07:48 -060050 chown polkitd:root ${D}/${sysconfdir}/polkit-1/rules.d
Andrew Geissler517393d2023-01-13 08:55:19 -060051}
52
Patrick Williamsb58112e2024-03-07 11:16:36 -060053FILES:${PN} += " \
54 ${libdir}/pam.d/polkit-1 \
55 ${libdir}/sysusers.d \
56 ${libdir}/polkit-1 \
57 ${nonarch_libdir}/pam.d/polkit-1 \
58 ${nonarch_libdir}/sysusers.d \
59 ${nonarch_libdir}/polkit-1 \
60 ${datadir} \
61"