You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
2.9 KiB
117 lines
2.9 KiB
3 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
4 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
EAPI=7
|
||
|
|
||
3 years ago
|
inherit meson pam pax-utils systemd xdg-utils
|
||
4 years ago
|
|
||
|
DESCRIPTION="Policy framework for controlling privileges for system-wide services"
|
||
|
HOMEPAGE="https://www.freedesktop.org/wiki/Software/polkit https://gitlab.freedesktop.org/polkit/polkit"
|
||
|
SRC_URI="https://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
|
||
|
|
||
|
LICENSE="LGPL-2"
|
||
|
SLOT="0"
|
||
3 years ago
|
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc64 ~riscv ~s390 ~x86"
|
||
|
IUSE="examples gtk +introspection kde pam selinux systemd test"
|
||
|
#RESTRICT="!test? ( test )"
|
||
|
# Tests currently don't work with meson. See
|
||
|
# https://gitlab.freedesktop.org/polkit/polkit/-/issues/144
|
||
|
RESTRICT="test"
|
||
4 years ago
|
|
||
|
BDEPEND="
|
||
|
acct-user/polkitd
|
||
|
app-text/docbook-xml-dtd:4.1.2
|
||
|
app-text/docbook-xsl-stylesheets
|
||
3 years ago
|
dev-libs/glib
|
||
4 years ago
|
dev-libs/gobject-introspection-common
|
||
|
dev-libs/libxslt
|
||
|
dev-util/glib-utils
|
||
|
sys-devel/gettext
|
||
|
virtual/pkgconfig
|
||
|
introspection? ( dev-libs/gobject-introspection )
|
||
|
"
|
||
|
DEPEND="
|
||
|
dev-lang/spidermonkey:78[-debug]
|
||
|
dev-libs/glib:2
|
||
|
dev-libs/expat
|
||
|
pam? (
|
||
|
sys-auth/pambase
|
||
|
sys-libs/pam
|
||
|
)
|
||
3 years ago
|
!pam? ( virtual/libcrypt:= )
|
||
4 years ago
|
systemd? ( sys-apps/systemd:0=[policykit] )
|
||
3 years ago
|
!systemd? ( sys-auth/elogind )
|
||
4 years ago
|
"
|
||
|
RDEPEND="${DEPEND}
|
||
|
acct-user/polkitd
|
||
|
selinux? ( sec-policy/selinux-policykit )
|
||
|
"
|
||
|
PDEPEND="
|
||
|
gtk? ( || (
|
||
|
>=gnome-extra/polkit-gnome-0.105
|
||
|
>=lxde-base/lxsession-0.5.2
|
||
|
) )
|
||
|
kde? ( kde-plasma/polkit-kde-agent )
|
||
|
"
|
||
|
|
||
|
DOCS=( docs/TODO HACKING NEWS README )
|
||
|
|
||
|
QA_MULTILIB_PATHS="
|
||
|
usr/lib/polkit-1/polkit-agent-helper-1
|
||
|
usr/lib/polkit-1/polkitd"
|
||
|
|
||
|
src_prepare() {
|
||
|
default
|
||
|
|
||
|
sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die #401513
|
||
|
}
|
||
|
|
||
|
src_configure() {
|
||
|
xdg_environment_reset
|
||
|
|
||
3 years ago
|
local emesonargs=(
|
||
4 years ago
|
--localstatedir="${EPREFIX}"/var
|
||
3 years ago
|
-Dauthfw="$(usex pam pam shadow)"
|
||
|
-Dexamples=false
|
||
|
-Dgtk_doc=false
|
||
|
-Dman=true
|
||
|
-Dos_type=gentoo
|
||
|
-Dsession_tracking="$(usex systemd libsystemd-login libelogind)"
|
||
|
-Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
|
||
|
$(meson_use introspection)
|
||
|
$(meson_use test tests)
|
||
|
$(usex pam "-Dpam_module_dir=$(getpam_mod_dir)" '')
|
||
4 years ago
|
)
|
||
3 years ago
|
meson_src_configure
|
||
4 years ago
|
}
|
||
|
|
||
|
src_compile() {
|
||
3 years ago
|
meson_src_compile
|
||
4 years ago
|
|
||
|
# Required for polkitd on hardened/PaX due to spidermonkey's JIT
|
||
|
pax-mark mr src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
3 years ago
|
meson_src_install
|
||
4 years ago
|
|
||
3 years ago
|
if use examples ; then
|
||
4 years ago
|
docinto examples
|
||
|
dodoc src/examples/{*.c,*.policy*}
|
||
|
fi
|
||
|
|
||
|
diropts -m 0700 -o polkitd
|
||
|
keepdir /usr/share/polkit-1/rules.d
|
||
3 years ago
|
|
||
|
# meson does not install required files with SUID bit. See
|
||
|
# https://bugs.gentoo.org/816393
|
||
|
# Remove the following lines once this has been fixed by upstream
|
||
|
fperms u+s /usr/bin/pkexec
|
||
|
fperms u+s /usr/lib/polkit-1/polkit-agent-helper-1
|
||
4 years ago
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
|
||
|
chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
|
||
|
}
|