/[gentoo-x86]/sys-auth/polkit/polkit-0.106-r3.ebuild
Gentoo

Contents of /sys-auth/polkit/polkit-0.106-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Jun 25 09:32:04 2012 UTC (2 years, 2 months ago) by tetromino
Branch: MAIN
pax-mark polkitd to fix crashes on hardened/PaX systems.

(Portage version: 2.2.0_alpha112/cvs/Linux x86_64)

1 # Copyright 1999-2012 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.106-r2.ebuild,v 1.4 2012/06/23 04:01:20 ssuominen Exp $
4
5 EAPI=4
6 inherit eutils 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 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
15 IUSE="debug examples gtk +introspection kde nls pam systemd"
16
17 RDEPEND=">=dev-lang/spidermonkey-1.8.5
18 >=dev-libs/glib-2.32
19 >=dev-libs/expat-2
20 introspection? ( >=dev-libs/gobject-introspection-1 )
21 pam? (
22 sys-auth/pambase
23 virtual/pam
24 )
25 systemd? ( sys-apps/systemd )"
26 DEPEND="${RDEPEND}
27 app-text/docbook-xml-dtd:4.1.2
28 app-text/docbook-xsl-stylesheets
29 dev-libs/libxslt
30 dev-util/intltool
31 virtual/pkgconfig"
32 PDEPEND="
33 gtk? ( || (
34 >=gnome-extra/polkit-gnome-0.105
35 lxde-base/lxpolkit
36 ) )
37 kde? ( sys-auth/polkit-kde-agent )
38 pam? (
39 systemd? ( sys-auth/pambase[systemd] )
40 !systemd? ( sys-auth/pambase[consolekit] )
41 )
42 !systemd? ( >=sys-auth/consolekit-0.4.5_p2012[policykit] )"
43
44 DOCS="docs/TODO HACKING NEWS README"
45
46 pkg_setup() {
47 local u=polkitd
48 local g=polkitd
49 local h=/var/lib/polkit-1
50
51 enewgroup ${g}
52 enewuser ${u} -1 -1 ${h} ${g}
53 esethome ${u} ${h}
54 }
55
56 src_prepare() {
57 sed -i -e '/unix-group/s:wheel:adm:' src/polkitbackend/*-default.rules || die #401513
58
59 has_version ">=dev-lang/spidermonkey-1.8.7" && { sed -i -e '/mozjs/s:185:187:g' configure || die; }
60 }
61
62 src_configure() {
63 local myconf="--with-authfw=shadow"
64 use pam && \
65 myconf="--with-authfw=pam --with-pam-module-dir=$(getpam_mod_dir) --with-pam-include=system-local-login"
66
67 econf \
68 --localstatedir="${EPREFIX}"/var \
69 --disable-static \
70 $(use_enable debug verbose-mode) \
71 --enable-man-pages \
72 --disable-gtk-doc \
73 $(use_enable systemd libsystemd-login) \
74 $(use_enable introspection) \
75 --disable-examples \
76 $(use_enable nls) \
77 --with-os-type=gentoo \
78 "$(systemd_with_unitdir)" \
79 ${myconf}
80 }
81
82 src_install() {
83 default
84
85 fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d
86
87 prune_libtool_files
88
89 diropts -m0700 -o polkitd -g polkitd
90 keepdir /var/lib/polkit-1
91
92 if use examples; then
93 insinto /usr/share/doc/${PF}/examples
94 doins src/examples/{*.c,*.policy*}
95 fi
96
97 # Required for polkitd on hardened/PaX due to spidermonkey's JIT
98 pax-mark mr "${ED}usr/lib/polkit-1/polkitd"
99 }
100
101 pkg_postinst() {
102 chown -R polkitd:root "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
103 chown -R polkitd:polkitd "${EROOT}"/var/lib/polkit-1
104
105 echo
106 ewarn "The default administrator unix-group was changed from \"wheel\" to"
107 ewarn "\"adm\", see *-default.rules in /etc/polkit-1/rules.d"
108 ewarn "Users of unix-group \"adm\" can run, for example, \"pkexec /bin/sh\""
109 ewarn "to gain root shell without root password."
110 ewarn "For more information, see http://bugs.gentoo.org/401513"
111 }

  ViewVC Help
Powered by ViewVC 1.1.20