commit:     01006f554aa646ac1ef275753c3d28123d217b68
Author:     S. Lockwood-Childs <sjl <AT> vctlabs <DOT> com>
AuthorDate: Mon Nov 26 10:33:01 2018 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Dec  2 18:03:14 2018 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=01006f55

sys-auth/polkit: bump version to 0.115

Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

 sys-auth/polkit/Manifest                           |   1 +
 sys-auth/polkit/files/polkit-0.115-elogind.patch   |  28 ++++
 ...lkit-0.115-make-netgroup-support-optional.patch | 129 +++++++++++++++++++
 sys-auth/polkit/polkit-0.115-r1.ebuild             | 141 +++++++++++++++++++++
 4 files changed, 299 insertions(+)

diff --git a/sys-auth/polkit/Manifest b/sys-auth/polkit/Manifest
index 39836f8..3883c90 100644
--- a/sys-auth/polkit/Manifest
+++ b/sys-auth/polkit/Manifest
@@ -1 +1,2 @@
 DIST polkit-0.113.tar.gz 1448865 BLAKE2B 
93cb6abf03d0de193e9f64b953bee40faf3bd07cf6f86beb4f84edd740dedc0bcf7a1ffd6b3a1a816e5adad0ee59536dacae3d991add4c4965cc6a98566b7470
 SHA512 
ab177c89a20eeb2978ddbe28afb205d3619f9c5defe833eb68a85e71a0f2c905367f1295cbbfb85da5eafdd661bce474d5d84aca9195cd425a18c9b4170eb5f9
+DIST polkit-0.115.tar.gz 1550932 BLAKE2B 
3185ebed46209f88a9ffccbbcaf1bf180d1ae6d5ec53cf3c66d867ad43910b47a1123a3db190991ebb382a0d28fc5a119ea4bab942db324e9af5663056cf6ee1
 SHA512 
1153011fa93145b2c184e6b3446d3ca21b38918641aeccd8fac3985ac3e30ec6bc75be6973985fde90f2a24236592f1595be259155061c2d33358dd17c4ee4fc

diff --git a/sys-auth/polkit/files/polkit-0.115-elogind.patch 
b/sys-auth/polkit/files/polkit-0.115-elogind.patch
new file mode 100644
index 0000000..93d6720
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.115-elogind.patch
@@ -0,0 +1,28 @@
+From 08bb656496cd3d6213bbe9473f63f2d4a110da6e Mon Sep 17 00:00:00 2001
+From: Rasmus Thomsen <cogi...@exherbo.org>
+Date: Wed, 11 Apr 2018 13:14:14 +0200
+Subject: [PATCH] configure: fix elogind support
+
+HAVE_LIBSYSTEMD is used to determine which source files to use.
+We have to check if either have_libsystemd or have_libelogind is
+true, as both of these need the source files which are used when
+HAVE_LIBSYSTEMD is true.
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 36df239..da47ecb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -221,7 +221,7 @@ AS_IF([test "x$cross_compiling" != "xyes" ], [
+ 
+ AC_SUBST(LIBSYSTEMD_CFLAGS)
+ AC_SUBST(LIBSYSTEMD_LIBS)
+-AM_CONDITIONAL(HAVE_LIBSYSTEMD, [test "$have_libsystemd" = "yes"], [Using 
libsystemd])
++AM_CONDITIONAL(HAVE_LIBSYSTEMD, [test "$have_libsystemd" = "yes" || test 
"$have_libelogind" = "yes" ], [Using libsystemd])
+ 
+ dnl 
---------------------------------------------------------------------------
+ dnl - systemd unit / service files
+-- 
+2.17.0

diff --git 
a/sys-auth/polkit/files/polkit-0.115-make-netgroup-support-optional.patch 
b/sys-auth/polkit/files/polkit-0.115-make-netgroup-support-optional.patch
new file mode 100644
index 0000000..0a8f886
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.115-make-netgroup-support-optional.patch
@@ -0,0 +1,129 @@
+--- polkit-0.115/configure.ac
++++ polkit-0.115-optional-netgroup/configure.ac
+@@ -158,7 +158,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXP
+            [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
+ AC_SUBST(EXPAT_LIBS)
+ 
+-AC_CHECK_FUNCS(clearenv fdatasync)
++AC_CHECK_FUNCS(clearenv fdatasync getnetgrent)
+ 
+ if test "x$GCC" = "xyes"; then
+   LDFLAGS="-Wl,--as-needed $LDFLAGS"
+--- polkit-0.115/src/polkitbackend/init.js
++++ polkit-0.115-optional-netgroup/src/polkitbackend/init.js
+@@ -29,7 +29,10 @@ function Subject() {
+     };
+ 
+     this.isInNetGroup = function(netGroup) {
+-        return polkit._userIsInNetGroup(this.user, netGroup);
++        if (polkit._userIsInNetGroup)
++            return polkit._userIsInNetGroup(this.user, netGroup);
++        else
++            return false;
+     };
+ 
+     this.toString = function() {
+--- polkit-0.115/src/polkitbackend/polkitbackendinteractiveauthority.c
++++ 
polkit-0.115-optional-netgroup/src/polkitbackend/polkitbackendinteractiveauthority.c
+@@ -2214,6 +2214,7 @@ get_users_in_group (PolkitIdentity
+   return ret;
+ }
+ 
++#ifdef HAVE_GETNETGRENT
+ static GList *
+ get_users_in_net_group (PolkitIdentity                    *group,
+                         gboolean                           include_root)
+@@ -2269,6 +2270,7 @@ get_users_in_net_group (PolkitIdentity
+   endnetgrent ();
+   return ret;
+ }
++#endif
+ 
+ /* 
----------------------------------------------------------------------------------------------------
 */
+ 
+@@ -2355,10 +2357,12 @@ authentication_agent_initiate_challenge
+         {
+           user_identities = g_list_concat (user_identities, 
get_users_in_group (identity, FALSE));
+         }
++#ifdef HAVE_GETNETGRENT
+       else if (POLKIT_IS_UNIX_NETGROUP (identity))
+         {
+           user_identities =  g_list_concat (user_identities, 
get_users_in_net_group (identity, FALSE));
+         }
++#endif
+       else
+         {
+           g_warning ("Unsupported identity");
+--- polkit-0.115/src/polkitbackend/polkitbackendjsauthority.cpp
++++ 
polkit-0.115-optional-netgroup/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -194,13 +194,16 @@
+ 
+ static bool js_polkit_log (JSContext *cx, unsigned argc, JS::Value *vp);
+ static bool js_polkit_spawn (JSContext *cx, unsigned argc, JS::Value *vp);
++#ifdef HAVE_GETNETGRENT
+ static bool js_polkit_user_is_in_netgroup (JSContext *cx, unsigned argc, 
JS::Value *vp);
+-
++#endif
+ static JSFunctionSpec js_polkit_functions[] =
+ {
+   JS_FN("log",            js_polkit_log,            0, 0),
+   JS_FN("spawn",          js_polkit_spawn,          0, 0),
++#ifdef HAVE_GETNETGRENT
+   JS_FN("_userIsInNetGroup", js_polkit_user_is_in_netgroup,          0, 0),
++#endif
+   JS_FS_END
+ };
+ 
+@@ -1486,6 +1489,7 @@
+ /* 
----------------------------------------------------------------------------------------------------
 */
+ 
+ 
++#ifdef HAVE_GETNETGRENT
+ static bool
+ js_polkit_user_is_in_netgroup (JSContext  *cx,
+                                unsigned    argc,
+@@ -1523,7 +1523,7 @@
+ 
+   return ret;
+ }
+-
++#endif
+ 
+ 
+ /* 
----------------------------------------------------------------------------------------------------
 */
+--- polkit-0.115/test/polkitbackend/test-polkitbackendjsauthority.c
++++ 
polkit-0.115-optional-netgroup/test/polkitbackend/test-polkitbackendjsauthority.c
+@@ -137,12 +137,14 @@ test_get_admin_identities (void)
+         "unix-group:users"
+       }
+     },
++#ifdef HAVE_GETNETGRENT
+     {
+       "net.company.action3",
+       {
+         "unix-netgroup:foo"
+       }
+     },
++#endif
+   };
+   guint n;
+ 
+@@ -258,7 +260,7 @@ static const RulesTestCase rules_test_ca
+     NULL,
+     POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
+   },
+-
++#if HAVE_GETNETGRENT
+   /* check netgroup membership */
+   {
+     /* john is a member of netgroup 'foo', see test/etc/netgroup */
+@@ -276,7 +278,7 @@ static const RulesTestCase rules_test_ca
+     NULL,
+     POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
+   },
+-
++#endif
+   /* spawning */
+   {
+     "spawning_non_existing_helper",
+

diff --git a/sys-auth/polkit/polkit-0.115-r1.ebuild 
b/sys-auth/polkit/polkit-0.115-r1.ebuild
new file mode 100644
index 0000000..1aaaf77
--- /dev/null
+++ b/sys-auth/polkit/polkit-0.115-r1.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools pam pax-utils systemd user xdg-utils
+
+DESCRIPTION="Policy framework for controlling privileges for system-wide 
services"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/polkit";
+SRC_URI="https://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz";
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh 
~sparc x86"
+IUSE="elogind examples gtk +introspection jit kde nls pam selinux systemd test"
+
+REQUIRED_USE="?? ( elogind systemd )"
+
+CDEPEND="
+       dev-lang/spidermonkey:52[-debug]
+       dev-libs/glib:2
+       dev-libs/expat
+       elogind? ( sys-auth/elogind )
+       introspection? ( dev-libs/gobject-introspection )
+       pam? (
+               sys-auth/pambase
+               virtual/pam
+       )
+       systemd? ( sys-apps/systemd:0= )
+"
+DEPEND="${CDEPEND}
+       app-text/docbook-xml-dtd:4.1.2
+       app-text/docbook-xsl-stylesheets
+       dev-libs/gobject-introspection-common
+       dev-libs/libxslt
+       dev-util/glib-utils
+       dev-util/gtk-doc-am
+       dev-util/intltool
+       sys-devel/gettext
+       virtual/pkgconfig
+"
+RDEPEND="${CDEPEND}
+       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 )
+       !systemd? ( !elogind? ( sys-auth/consolekit[policykit] ) )
+"
+
+DOCS=( docs/TODO HACKING NEWS README )
+
+PATCHES=(
+       "${FILESDIR}"/${P}-elogind.patch  # bug 660880
+       "${FILESDIR}"/${P}-make-netgroup-support-optional.patch
+)
+
+QA_MULTILIB_PATHS="
+       usr/lib/polkit-1/polkit-agent-helper-1
+       usr/lib/polkit-1/polkitd"
+
+pkg_setup() {
+       local u=polkitd
+       local g=polkitd
+       local h=/var/lib/polkit-1
+
+       enewgroup ${g}
+       enewuser ${u} -1 -1 ${h} ${g}
+       esethome ${u} ${h}
+}
+
+src_prepare() {
+       default
+
+       sed -i -e 's|unix-group:wheel|unix-user:0|' 
src/polkitbackend/*-default.rules || die #401513
+
+       # Workaround upstream hack around standard gtk-doc behavior, bug #552170
+       sed -i -e 's/@ENABLE_GTK_DOC_TRUE@\(TARGET_DIR\)/\1/' \
+               -e '/install-data-local:/,/uninstall-local:/ 
s/@ENABLE_GTK_DOC_TRUE@//' \
+               -e 's/@ENABLE_GTK_DOC_FALSE@install-data-local://' \
+               docs/polkit/Makefile.in || die
+
+       # disable broken test - bug #624022
+       sed -i -e "/^SUBDIRS/s/polkitbackend//" test/Makefile.am || die
+
+       # Fix cross-building, bug #590764, elogind patch, bug #598615
+       eautoreconf
+}
+
+src_configure() {
+       xdg_environment_reset
+
+       local myeconfargs=(
+               --localstatedir="${EPREFIX}"/var
+               --disable-static
+               --enable-man-pages
+               --disable-gtk-doc
+               --disable-examples
+               $(use_enable elogind libelogind)
+               $(use_enable introspection)
+               $(use_enable nls)
+               $(usex pam "--with-pam-module-dir=$(getpam_mod_dir)" '')
+               --with-authfw=$(usex pam pam shadow)
+               $(use_enable systemd libsystemd-login)
+               --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+               $(use_enable test)
+               --with-os-type=gentoo
+       )
+       econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+       default
+
+       # Required for polkitd on hardened/PaX due to spidermonkey's JIT
+       pax-mark mr src/polkitbackend/.libs/polkitd 
test/polkitbackend/.libs/polkitbackendjsauthoritytest
+}
+
+src_install() {
+       default
+
+       fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d
+
+       diropts -m0700 -o polkitd -g polkitd
+       keepdir /var/lib/polkit-1
+
+       if use examples; then
+               insinto /usr/share/doc/${PF}/examples
+               doins src/examples/{*.c,*.policy*}
+       fi
+
+       find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+       chown -R polkitd:root "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
+       chown -R polkitd:polkitd "${EROOT}"/var/lib/polkit-1
+}

Reply via email to