Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2015 Gentoo Foundation |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/sys-auth/polkit/polkit-0.112-r2.ebuild,v 1.17 2015/02/11 03:45:06 patrick Exp $ |
4 |
|
5 |
EAPI=5 |
6 |
inherit eutils autotools multilib pam pax-utils systemd user |
7 |
|
8 |
DESCRIPTION="Policy framework for controlling privileges for system-wide services" |
9 |
HOMEPAGE="http://www.freedesktop.org/wiki/Software/polkit" |
10 |
SRC_URI="http://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz" |
11 |
|
12 |
LICENSE="LGPL-2" |
13 |
SLOT="0" |
14 |
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86" |
15 |
IUSE="examples gtk +introspection jit kde nls pam selinux systemd" |
16 |
|
17 |
CDEPEND=" |
18 |
ia64? ( =dev-lang/spidermonkey-1.8.5*[-debug] ) |
19 |
hppa? ( =dev-lang/spidermonkey-1.8.5*[-debug] ) |
20 |
mips? ( =dev-lang/spidermonkey-1.8.5*[-debug] ) |
21 |
!hppa? ( !ia64? ( !mips? ( dev-lang/spidermonkey:17[-debug,jit=] ) ) ) |
22 |
>=dev-libs/glib-2.32 |
23 |
>=dev-libs/expat-2:= |
24 |
introspection? ( >=dev-libs/gobject-introspection-1 ) |
25 |
pam? ( |
26 |
sys-auth/pambase |
27 |
virtual/pam |
28 |
) |
29 |
systemd? ( sys-apps/systemd:0= )" |
30 |
DEPEND="${CDEPEND} |
31 |
app-text/docbook-xml-dtd:4.1.2 |
32 |
app-text/docbook-xsl-stylesheets |
33 |
dev-libs/libxslt |
34 |
dev-util/intltool |
35 |
virtual/pkgconfig" |
36 |
RDEPEND="${CDEPEND} |
37 |
selinux? ( sec-policy/selinux-policykit ) |
38 |
" |
39 |
PDEPEND=" |
40 |
gtk? ( || ( |
41 |
>=gnome-extra/polkit-gnome-0.105 |
42 |
lxde-base/lxpolkit |
43 |
) ) |
44 |
kde? ( || ( |
45 |
kde-plasma/polkit-kde-agent |
46 |
sys-auth/polkit-kde-agent |
47 |
) ) |
48 |
!systemd? ( sys-auth/consolekit[policykit] )" |
49 |
|
50 |
QA_MULTILIB_PATHS=" |
51 |
usr/lib/polkit-1/polkit-agent-helper-1 |
52 |
usr/lib/polkit-1/polkitd" |
53 |
|
54 |
pkg_setup() { |
55 |
local u=polkitd |
56 |
local g=polkitd |
57 |
local h=/var/lib/polkit-1 |
58 |
|
59 |
enewgroup ${g} |
60 |
enewuser ${u} -1 -1 ${h} ${g} |
61 |
esethome ${u} ${h} |
62 |
} |
63 |
|
64 |
src_prepare() { |
65 |
sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die #401513 |
66 |
epatch "${FILESDIR}"/${PN}-make-netgroup-support-optional.patch |
67 |
eautoreconf || die |
68 |
} |
69 |
|
70 |
src_configure() { |
71 |
econf \ |
72 |
--localstatedir="${EPREFIX}"/var \ |
73 |
--disable-static \ |
74 |
--enable-man-pages \ |
75 |
--disable-gtk-doc \ |
76 |
$(use_enable systemd libsystemd-login) \ |
77 |
$(use_enable introspection) \ |
78 |
--disable-examples \ |
79 |
$(use_enable nls) \ |
80 |
$(if use hppa || use ia64 || use mips; then echo --with-mozjs=mozjs185; else echo --with-mozjs=mozjs-17.0; fi) \ |
81 |
"$(systemd_with_unitdir)" \ |
82 |
--with-authfw=$(usex pam pam shadow) \ |
83 |
$(use pam && echo --with-pam-module-dir="$(getpam_mod_dir)") \ |
84 |
--with-os-type=gentoo |
85 |
} |
86 |
|
87 |
src_compile() { |
88 |
default |
89 |
|
90 |
# Required for polkitd on hardened/PaX due to spidermonkey's JIT |
91 |
local f='src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest' |
92 |
local m='' |
93 |
# Only used when USE="jit" is enabled for 'dev-lang/spidermonkey:17' wrt #485910 |
94 |
has_version 'dev-lang/spidermonkey:17[jit]' && m='m' |
95 |
# hppa, ia64 and mips uses spidermonkey-1.8.5 which requires different pax-mark flags |
96 |
use hppa && m='mr' |
97 |
use ia64 && m='mr' |
98 |
use mips && m='mr' |
99 |
[ -n "$m" ] && pax-mark ${m} ${f} |
100 |
} |
101 |
|
102 |
src_install() { |
103 |
emake DESTDIR="${D}" install |
104 |
|
105 |
dodoc docs/TODO HACKING NEWS README |
106 |
|
107 |
fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d |
108 |
|
109 |
diropts -m0700 -o polkitd -g polkitd |
110 |
keepdir /var/lib/polkit-1 |
111 |
|
112 |
if use examples; then |
113 |
insinto /usr/share/doc/${PF}/examples |
114 |
doins src/examples/{*.c,*.policy*} |
115 |
fi |
116 |
|
117 |
prune_libtool_files |
118 |
} |
119 |
|
120 |
pkg_postinst() { |
121 |
chown -R polkitd:root "${EROOT}"/{etc,usr/share}/polkit-1/rules.d |
122 |
chown -R polkitd:polkitd "${EROOT}"/var/lib/polkit-1 |
123 |
} |