sys-auth/polkit: Apply Flatcar modifications

- apply duktape patchset from
    https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
    (this should be re-fetched from the above MR when forward-porting
    to updated polkit versions.)
  - fix config install paths, use systemd-tmpfiles (All configs should
    be installed to /usr and tmpfiles should be used to create and fix
    directory permissions instead of the ebuild's postinst.)
This commit is contained in:
Krzesimir Nowak 2021-12-15 20:29:22 +01:00
parent f09c1fe20e
commit 32b5a0dee7
3 changed files with 1616 additions and 7 deletions

View File

@ -0,0 +1,3 @@
d /etc/polkit-1 - - - - -
d /etc/polkit-1/rules.d 0700 polkitd root - -
d /var/lib/polkit-1 0700 polkitd polkitd - -

View File

@ -3,7 +3,8 @@
EAPI=7
inherit autotools pam pax-utils systemd xdg-utils
TMPFILES_OPTIONAL=1
inherit autotools pam pax-utils systemd xdg-utils tmpfiles
DESCRIPTION="Policy framework for controlling privileges for system-wide services"
HOMEPAGE="https://www.freedesktop.org/wiki/Software/polkit https://gitlab.freedesktop.org/polkit/polkit"
@ -32,7 +33,7 @@ BDEPEND="
introspection? ( dev-libs/gobject-introspection )
"
DEPEND="
dev-lang/spidermonkey:78[-debug]
dev-lang/duktape
dev-libs/glib:2
dev-libs/expat
elogind? ( sys-auth/elogind )
@ -59,6 +60,9 @@ DOCS=( docs/TODO HACKING NEWS README )
PATCHES=(
"${FILESDIR}"/${PN}-0.115-elogind.patch # bug 660880
# from https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
"${FILESDIR}"/35_WIP_Add_duktape_as_javascript_engine.patch
)
QA_MULTILIB_PATHS="
@ -92,6 +96,7 @@ src_configure() {
--enable-man-pages
--disable-gtk-doc
--disable-examples
--with-duktape
$(use_enable elogind libelogind)
$(use_enable introspection)
$(use_enable nls)
@ -115,6 +120,16 @@ src_compile() {
src_install() {
default
dodir /usr/share/polkit-1/rules.d
dodir /usr/lib/pam.d
mv "${D}"/{etc,usr/share}/polkit-1/rules.d/50-default.rules || die
mv "${D}"/{etc,usr/lib}/pam.d/polkit-1 || die
rmdir "${D}"/etc/polkit-1/rules.d "${D}"/etc/polkit-1 || die
rmdir "${D}"/etc/pam.d || die
dotmpfiles "${FILESDIR}/polkit.conf"
if use examples; then
docinto examples
dodoc src/examples/{*.c,*.policy*}
@ -125,8 +140,3 @@ src_install() {
find "${ED}" -name '*.la' -delete || die
}
pkg_postinst() {
chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
}