aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2021-08-21 15:56:48 +0200
committerJakub Jirutka <jakub@jirutka.cz>2021-08-21 17:01:24 +0200
commitfd0e522762796a182e2d1c1f6e5cf6ebf2b2a74f (patch)
treed537a3c6c071635555680fc9d1b7ee3a697e6bd9
parentad8dab00274d18feaba0b7eb7652cc154c83b615 (diff)
downloadaports-fd0e522762796a182e2d1c1f6e5cf6ebf2b2a74f.tar.gz
aports-fd0e522762796a182e2d1c1f6e5cf6ebf2b2a74f.tar.bz2
aports-fd0e522762796a182e2d1c1f6e5cf6ebf2b2a74f.tar.xz
community/polkit*: merge polkit-elogind into polkit aport
This should fix #12708 and other problems caused by this mess. See https://gitlab.alpinelinux.org/alpine/aports/-/issues/12708#note_176028
-rw-r--r--community/polkit-elogind/APKBUILD98
-rw-r--r--community/polkit-elogind/alpine-polkit.pam7
-rw-r--r--community/polkit-elogind/make-innetgr-optional.patch239
-rw-r--r--community/polkit-elogind/polkit-elogind.pre-install6
-rw-r--r--community/polkit-elogind/polkit.initd12
-rw-r--r--community/polkit/APKBUILD144
6 files changed, 126 insertions, 380 deletions
diff --git a/community/polkit-elogind/APKBUILD b/community/polkit-elogind/APKBUILD
deleted file mode 100644
index 6a88c3f76d..0000000000
--- a/community/polkit-elogind/APKBUILD
+++ /dev/null
@@ -1,98 +0,0 @@
-# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
-pkgname=polkit-elogind
-pkgver=0.119
-pkgrel=4
-pkgdesc="Application development toolkit for controlling system-wide privileges (elogind variant)"
-url="https://www.freedesktop.org/wiki/Software/polkit/"
-arch="all !mips64 !s390x !riscv64" # blocked by mozjs78 -> rust
-license="GPL-2.0-or-later"
-options="suid !check"
-# Make sure we don't get installations with polkit-elogind and polkit-libs
-depends="$pkgname-libs"
-depends_dev="dbus-glib-dev"
-makedepends="$depends_dev expat-dev glib-dev gtk-doc gobject-introspection-dev
- intltool autoconf automake libtool bash mozjs78-dev elogind-dev linux-pam-dev"
-subpackages="$pkgname-dev $pkgname-libs $pkgname-doc $pkgname-lang $pkgname-openrc"
-source="https://www.freedesktop.org/software/polkit/releases/polkit-$pkgver.tar.gz
- make-innetgr-optional.patch
- alpine-polkit.pam
- polkit.initd
- "
-install="polkit-elogind.pre-install"
-pkgusers="polkitd"
-pkggroups="polkitd"
-provides="polkit=$pkgver-r$pkgrel"
-
-builddir="$srcdir/polkit-$pkgver"
-
-build() {
- autoreconf -fi
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --libexecdir=/usr/lib/polkit-1 \
- --localstatedir=/var \
- --disable-static \
- --enable-introspection \
- --with-authfw=pam \
- --with-os-type=alpine \
- --disable-gtk-doc \
- --disable-gtk-doc-html \
- --disable-gtk-doc-pdf \
- --disable-libelogind \
- --disable-systemd \
- --enable-libsystemd-login
- make
-}
-
-check() {
- make check
-}
-
-package() {
- # Set SHELL as a workaround for #10081
- make SHELL=/bin/bash DESTDIR="$pkgdir" \
- dbusconfdir=/usr/share/dbus-1/system.d \
- rulesdir=/usr/share/polkit-1/rules.d \
- install
-
- # Use our own polkit rules, upstream may change them
- install -m644 "$srcdir"/alpine-polkit.pam "$pkgdir"/etc/pam.d/polkit-1
-
- # See polkit's configure script which tells us what permissions to set
- chown -R polkitd:polkitd "$pkgdir"/etc/polkit-1/rules.d "$pkgdir"/usr/share/polkit-1/rules.d
- chmod -R 700 "$pkgdir"/etc/polkit-1/rules.d "$pkgdir"/usr/share/polkit-1/rules.d
- chmod 4755 "$pkgdir"/usr/lib/polkit-1/polkit-agent-helper-1
- chmod 4755 "$pkgdir"/usr/bin/pkexec
-
- install -Dm755 "$srcdir"/polkit.initd "$pkgdir"/etc/init.d/polkit
-}
-
-dev() {
- provides="polkit-dev=$pkgver-r$pkgrel"
- replaces="polkit-dev"
- default_dev
-}
-
-libs() {
- provides="polkit-libs=$pkgver-r$pkgrel"
- replaces="polkit-libs"
- default_libs
-}
-
-openrc() {
- provides="polkit-openrc=$pkgver-r$pkgrel"
- replaces="polkit-openrc"
- default_openrc
-}
-
-sha512sums="
-0260fb15da1c4c1f429e8223260981e64e297f1be8ced42f6910f09ea6581b8205aca06c9c601eb4a128acba2f468de0223118f96862ba769f95721894cf1578 polkit-0.119.tar.gz
-0c47751e928a91ce3a477a330ef38b8f6f003b515c94e7fb9842e6f2043be43d749ab7390cc1dbcf1fa6128b62cf0eab353d4f8855d68e595bc53777512f4562 make-innetgr-optional.patch
-f5102dc00d390b3a3c957b62e1712db778c7ffb7378f3d8e816c0757c11a308c5d5303e42595b0d6add9839247c773880cd34e56afacc89eb6efaadf9aae7826 alpine-polkit.pam
-f6e5ac0ed41feb392dfd104979ec577c5936f3db2bd252b12b7b9b2609a0901dae38bebec1ea65ccf4f427860b520383ae4d2c66fb74ab986c715f6b0ad50473 polkit.initd
-"
diff --git a/community/polkit-elogind/alpine-polkit.pam b/community/polkit-elogind/alpine-polkit.pam
deleted file mode 100644
index e718f7ee15..0000000000
--- a/community/polkit-elogind/alpine-polkit.pam
+++ /dev/null
@@ -1,7 +0,0 @@
-auth requisite pam_nologin.so
-auth required pam_env.so
-auth required pam_unix.so
-account required pam_unix.so
-session required pam_unix.so
-session required pam_limits.so
-password required pam_unix.so
diff --git a/community/polkit-elogind/make-innetgr-optional.patch b/community/polkit-elogind/make-innetgr-optional.patch
deleted file mode 100644
index 8459c670ba..0000000000
--- a/community/polkit-elogind/make-innetgr-optional.patch
+++ /dev/null
@@ -1,239 +0,0 @@
-See https://gitlab.freedesktop.org/polkit/polkit/merge_requests/10
-
-From 778bb45e0e0cbabe2b04adf67a500af1dab09768 Mon Sep 17 00:00:00 2001
-From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
-Date: Wed, 11 Jul 2018 04:54:26 -0500
-Subject: [PATCH] make netgroup support optional
-
-On at least Linux/musl and Linux/uclibc, netgroup support is not
-available. PolKit fails to compile on these systems for that reason.
-
-This change makes netgroup support conditional on the presence of the
-setnetgrent(3) function which is required for the support to work. If
-that function is not available on the system, an error will be returned
-to the administrator if unix-netgroup: is specified in configuration.
-
-Fixes bug 50145.
-
-Closes polkit/polkit#14.
-
-Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
----
-diff --git a/configure.ac b/configure.ac
-index 4ac2219..ca478df 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -100,7 +100,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
- [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 setnetgrent)
-
- if test "x$GCC" = "xyes"; then
- LDFLAGS="-Wl,--as-needed $LDFLAGS"
-diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c
-index 3aa1f7f..10e9c17 100644
---- a/src/polkit/polkitidentity.c
-+++ b/src/polkit/polkitidentity.c
-@@ -182,7 +182,15 @@ polkit_identity_from_string (const gchar *str,
- }
- else if (g_str_has_prefix (str, "unix-netgroup:"))
- {
-+#ifndef HAVE_SETNETGRENT
-+ g_set_error (error,
-+ POLKIT_ERROR,
-+ POLKIT_ERROR_FAILED,
-+ "Netgroups are not available on this machine ('%s')",
-+ str);
-+#else
- identity = polkit_unix_netgroup_new (str + sizeof "unix-netgroup:" - 1);
-+#endif
- }
-
- if (identity == NULL && (error != NULL && *error == NULL))
-@@ -344,6 +352,13 @@ polkit_identity_new_for_gvariant (GVariant *variant,
- GVariant *v;
- const char *name;
-
-+#ifndef HAVE_SETNETGRENT
-+ g_set_error (error,
-+ POLKIT_ERROR,
-+ POLKIT_ERROR_FAILED,
-+ "Netgroups are not available on this machine");
-+ goto out;
-+#else
- v = lookup_asv (details_gvariant, "name", G_VARIANT_TYPE_STRING, error);
- if (v == NULL)
- {
-@@ -353,6 +368,7 @@ polkit_identity_new_for_gvariant (GVariant *variant,
- name = g_variant_get_string (v, NULL);
- ret = polkit_unix_netgroup_new (name);
- g_variant_unref (v);
-+#endif
- }
- else
- {
-diff --git a/src/polkit/polkitunixnetgroup.c b/src/polkit/polkitunixnetgroup.c
-index 8a2b369..83f8d4a 100644
---- a/src/polkit/polkitunixnetgroup.c
-+++ b/src/polkit/polkitunixnetgroup.c
-@@ -194,6 +194,9 @@ polkit_unix_netgroup_set_name (PolkitUnixNetgroup *group,
- PolkitIdentity *
- polkit_unix_netgroup_new (const gchar *name)
- {
-+#ifndef HAVE_SETNETGRENT
-+ g_assert_not_reached();
-+#endif
- g_return_val_if_fail (name != NULL, NULL);
- return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_NETGROUP,
- "name", name,
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index 056d9a8..36c2f3d 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -2233,25 +2233,26 @@ get_users_in_net_group (PolkitIdentity *group,
- GList *ret;
-
- ret = NULL;
-+#ifdef HAVE_SETNETGRENT
- name = polkit_unix_netgroup_get_name (POLKIT_UNIX_NETGROUP (group));
-
--#ifdef HAVE_SETNETGRENT_RETURN
-+# ifdef HAVE_SETNETGRENT_RETURN
- if (setnetgrent (name) == 0)
- {
- g_warning ("Error looking up net group with name %s: %s", name, g_strerror (errno));
- goto out;
- }
--#else
-+# else
- setnetgrent (name);
--#endif
-+# endif /* HAVE_SETNETGRENT_RETURN */
-
- for (;;)
- {
--#if defined(HAVE_NETBSD) || defined(HAVE_OPENBSD)
-+# if defined(HAVE_NETBSD) || defined(HAVE_OPENBSD)
- const char *hostname, *username, *domainname;
--#else
-+# else
- char *hostname, *username, *domainname;
--#endif
-+# endif /* defined(HAVE_NETBSD) || defined(HAVE_OPENBSD) */
- PolkitIdentity *user;
- GError *error = NULL;
-
-@@ -2282,6 +2283,7 @@ get_users_in_net_group (PolkitIdentity *group,
-
- out:
- endnetgrent ();
-+#endif /* HAVE_SETNETGRENT */
- return ret;
- }
-
-diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
-index ca17108..da95180 100644
---- a/src/polkitbackend/polkitbackendjsauthority.cpp
-+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
-@@ -1520,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
-
- JS::CallArgs args = JS::CallArgsFromVp (argc, vp);
-
-+#ifdef HAVE_SETNETGRENT
- JS::RootedString usrstr (authority->priv->cx);
- usrstr = args[0].toString();
- user = JS_EncodeStringToUTF8 (cx, usrstr);
-@@ -1534,6 +1535,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
- {
- is_in_netgroup = true;
- }
-+ #endif
-
- ret = true;
-
-diff --git a/test/polkit/polkitidentitytest.c b/test/polkit/polkitidentitytest.c
-index e91967b..e829aaa 100644
---- a/test/polkit/polkitidentitytest.c
-+++ b/test/polkit/polkitidentitytest.c
-@@ -19,6 +19,7 @@
- * Author: Nikki VonHollen <vonhollen@google.com>
- */
-
-+#include "config.h"
- #include "glib.h"
- #include <polkit/polkit.h>
- #include <polkit/polkitprivate.h>
-@@ -145,11 +146,15 @@ struct ComparisonTestData comparison_test_data [] = {
- {"unix-group:root", "unix-group:jane", FALSE},
- {"unix-group:jane", "unix-group:jane", TRUE},
-
-+#ifdef HAVE_SETNETGRENT
- {"unix-netgroup:foo", "unix-netgroup:foo", TRUE},
- {"unix-netgroup:foo", "unix-netgroup:bar", FALSE},
-+#endif
-
- {"unix-user:root", "unix-group:root", FALSE},
-+#ifdef HAVE_SETNETGRENT
- {"unix-user:jane", "unix-netgroup:foo", FALSE},
-+#endif
-
- {NULL},
- };
-@@ -181,11 +186,13 @@ main (int argc, char *argv[])
- g_test_add_data_func ("/PolkitIdentity/group_string_2", "unix-group:jane", test_string);
- g_test_add_data_func ("/PolkitIdentity/group_string_3", "unix-group:users", test_string);
-
-+#ifdef HAVE_SETNETGRENT
- g_test_add_data_func ("/PolkitIdentity/netgroup_string", "unix-netgroup:foo", test_string);
-+ g_test_add_data_func ("/PolkitIdentity/netgroup_gvariant", "unix-netgroup:foo", test_gvariant);
-+#endif
-
- g_test_add_data_func ("/PolkitIdentity/user_gvariant", "unix-user:root", test_gvariant);
- g_test_add_data_func ("/PolkitIdentity/group_gvariant", "unix-group:root", test_gvariant);
-- g_test_add_data_func ("/PolkitIdentity/netgroup_gvariant", "unix-netgroup:foo", test_gvariant);
-
- add_comparison_tests ();
-
-diff --git a/test/polkit/polkitunixnetgrouptest.c b/test/polkit/polkitunixnetgrouptest.c
-index 3701ba1..e3352eb 100644
---- a/test/polkit/polkitunixnetgrouptest.c
-+++ b/test/polkit/polkitunixnetgrouptest.c
-@@ -19,6 +19,7 @@
- * Author: Nikki VonHollen <vonhollen@google.com>
- */
-
-+#include "config.h"
- #include "glib.h"
- #include <polkit/polkit.h>
- #include <string.h>
-@@ -69,7 +70,9 @@ int
- main (int argc, char *argv[])
- {
- g_test_init (&argc, &argv, NULL);
-+#ifdef HAVE_SETNETGRENT
- g_test_add_func ("/PolkitUnixNetgroup/new", test_new);
- g_test_add_func ("/PolkitUnixNetgroup/set_name", test_set_name);
-+#endif
- return g_test_run ();
- }
-diff --git a/test/polkitbackend/test-polkitbackendjsauthority.c b/test/polkitbackend/test-polkitbackendjsauthority.c
-index f97e0e0..fc52149 100644
---- a/test/polkitbackend/test-polkitbackendjsauthority.c
-+++ b/test/polkitbackend/test-polkitbackendjsauthority.c
-@@ -137,12 +137,14 @@ test_get_admin_identities (void)
- "unix-group:users"
- }
- },
-+#ifdef HAVE_SETNETGRENT
- {
- "net.company.action3",
- {
- "unix-netgroup:foo"
- }
- },
-+#endif
- };
- guint n;
-
diff --git a/community/polkit-elogind/polkit-elogind.pre-install b/community/polkit-elogind/polkit-elogind.pre-install
deleted file mode 100644
index 7c4e3eff88..0000000000
--- a/community/polkit-elogind/polkit-elogind.pre-install
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-addgroup -S polkitd 2>/dev/null
-adduser -S -D -H -h /var/empty -s /sbin/nologin -G polkitd -g polkitd polkitd 2>/dev/null
-
-exit 0
diff --git a/community/polkit-elogind/polkit.initd b/community/polkit-elogind/polkit.initd
deleted file mode 100644
index 30d2387447..0000000000
--- a/community/polkit-elogind/polkit.initd
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/sbin/openrc-run
-supervisor=supervise-daemon
-
-name="Polkit System Daemon"
-description="Provide System authentication via PolicyKit1 D-Bus service"
-
-command=/usr/lib/polkit-1/polkitd
-command_args="${POLKIT_OPTS:---no-debug}"
-
-depend() {
- need dbus
-}
diff --git a/community/polkit/APKBUILD b/community/polkit/APKBUILD
index e77835740e..50dbf21804 100644
--- a/community/polkit/APKBUILD
+++ b/community/polkit/APKBUILD
@@ -1,19 +1,22 @@
# Contributor: Carlo Landmeter
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=polkit
pkgver=0.119
-pkgrel=2
+pkgrel=5
pkgdesc="Application development toolkit for controlling system-wide privileges"
url="https://www.freedesktop.org/wiki/Software/polkit/"
arch="all !mips !mips64 !s390x !riscv64" # Rust
license="GPL-2.0-or-later"
-options="suid !check" # Needs a functioning dbus daemon
-depends_dev="dbus-glib-dev"
-makedepends="$depends_dev
+options="suid !check" # Needs a functioning dbus daemon
+depends="$pkgname-common=$pkgver-r$pkgrel $pkgname-libs=$pkgver-r$pkgrel"
+makedepends="
autoconf
automake
bash
+ dbus-glib-dev
+ elogind-dev
expat-dev
glib-dev
gobject-introspection-dev
@@ -25,13 +28,17 @@ makedepends="$depends_dev
"
pkgusers="polkitd"
pkggroups="polkitd"
-install="polkit.pre-install polkit.pre-upgrade"
+install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname-elogind.pre-install"
subpackages="
$pkgname-dev
$pkgname-libs
$pkgname-doc
$pkgname-lang
$pkgname-openrc
+ $pkgname-common
+ $pkgname-elogind
+ $pkgname-elogind-dev:_elogind_dev
+ $pkgname-elogind-libs:_elogind_libs
"
source="https://www.freedesktop.org/software/polkit/releases/polkit-$pkgver.tar.gz
make-innetgr-optional.patch
@@ -46,9 +53,20 @@ source="https://www.freedesktop.org/software/polkit/releases/polkit-$pkgver.tar.
prepare() {
default_prepare
autoreconf -fi
+
+ cp -r "$builddir" "$builddir-elogind"
}
build() {
+ msg 'Building without elogind'
+ _build --disable-libsystemd-login
+
+ msg 'Building with elogind'
+ cd "$builddir-elogind"
+ _build --enable-libsystemd-login
+}
+
+_build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -67,8 +85,7 @@ build() {
--disable-gtk-doc-pdf \
--disable-libelogind \
--disable-systemd \
- --disable-libsystemd-login
-
+ "$@"
make
}
@@ -77,22 +94,113 @@ check() {
}
package() {
- # Set SHELL as a workaround for #10081
- make SHELL=/bin/bash DESTDIR="$pkgdir" \
- dbusconfdir=/usr/share/dbus-1/system.d \
- rulesdir=/usr/share/polkit-1/rules.d \
- install
+ provider_priority=100 # highest
+
+ _make_install "$builddir" "$pkgdir"
+ _make_install "$builddir-elogind" "$builddir-elogind/dest"
+
+ cd "$pkgdir"
# Use our own polkit rules, upstream may change them
- install -m644 "$srcdir"/alpine-polkit.pam "$pkgdir"/etc/pam.d/polkit-1
+ install -m644 "$srcdir"/alpine-polkit.pam etc/pam.d/polkit-1
# See polkit's configure script which tells us what permissions to set
- chown -R polkitd:polkitd "$pkgdir"/etc/polkit-1/rules.d "$pkgdir"/usr/share/polkit-1/rules.d
- chmod -R 700 "$pkgdir"/etc/polkit-1/rules.d "$pkgdir"/usr/share/polkit-1/rules.d
- chmod 4755 "$pkgdir"/usr/lib/polkit-1/polkit-agent-helper-1
- chmod 4755 "$pkgdir"/usr/bin/pkexec
+ chown -R polkitd:polkitd etc/polkit-1/rules.d usr/share/polkit-1/rules.d
+ chmod -R 700 etc/polkit-1/rules.d usr/share/polkit-1/rules.d
+ chmod 4755 usr/lib/polkit-1/polkit-agent-helper-1
+ chmod 4755 usr/bin/pkexec
+
+ install -Dm755 "$srcdir"/polkit.initd etc/init.d/polkit
+}
+
+_make_install() {
+ # Set SHELL as a workaround for #10081
+ make -C "$1" install \
+ SHELL=/bin/bash \
+ DESTDIR="$2" \
+ dbusconfdir=/usr/share/dbus-1/system.d \
+ rulesdir=/usr/share/polkit-1/rules.d
+}
+
+libs() {
+ provider_priority=100 # highest
+ depends=""
+
+ default_libs
+}
+
+dev() {
+ default_dev
+
+ # XXX: We have to disable tracedeps to avoid abuild adding both
+ # polkit-libs and polkit-elogind-libs to depends - they are autodetected
+ # via symlinks in /usr/lib.
+ options="!tracedeps"
+ # XXX: Since we disabled tracedeps, all depends and provides must be
+ # specified. This sucks, but I don't know of a better solution (@jirutka).
+ depends="$depends_dev
+ $pkgname-common=$pkgver-r$pkgrel
+ $pkgname-libs=$pkgver-r$pkgrel
+ dbus-glib-dev
+ pc:gio-2.0>=2.18
+ pc:glib-2.0>=2.18
+ pkgconfig
+ "
+ provides="pc:polkit-agent-1=$pkgver pc:polkit-gobject-1=$pkgver"
+}
+
+elogind() {
+ pkgdesc="Polkit with elogind session tracking"
+ depends="$pkgname-elogind-libs=$pkgver-r$pkgrel $pkgname-common=$pkgver-r$pkgrel"
+ provides="$pkgname=$pkgver-r$pkgrel"
+ provider_priority=10 # lowest
+ replaces="$pkgname" # for backward compatibility
+
+ cd "$builddir-elogind/dest"
+
+ mkdir -p "$subpkgdir"/usr/lib/polkit-1
+ mv usr/lib/polkit-1/polkitd "$subpkgdir"/usr/lib/polkit-1/
+}
+
+_elogind_dev() {
+ pkgdesc="Polkit with elogind session tracking (development files)"
+ depends="$pkgname-dev=$pkgver-r$pkgrel $pkgname-elogind-libs=$pkgver-r$pkgrel"
+ replaces="$pkgname-dev"
+
+ cd "$builddir-elogind/dest"
+
+ # *.gir files for the default and the elogind variant differ, the rest
+ # is the same.
+ mkdir -p "$subpkgdir"/usr/share
+ mv usr/share/gir-1.0 "$subpkgdir"/usr/share/
+}
+
+_elogind_libs() {
+ pkgdesc="Polkit with elogind session tracking (libraries)"
+ depends=""
+ provides="$pkgname-libs=$pkgver-r$pkgrel"
+ provider_priority=10 # lowest
+ replaces="$pkgname-libs" # for backward compatibility
+
+ cd "$builddir-elogind/dest"
+
+ mkdir -p "$subpkgdir"/usr/lib
+ mv usr/lib/lib*.so.* "$subpkgdir"/usr/lib/
+}
+
+common() {
+ pkgdesc="Common files for polkit and polkit-elogind"
+ depends=""
+ replaces="$pkgname $pkgname-elogind" # for backward compatibility
+
+ # Move all that left to subpackage.
+ amove etc/*
+ amove usr/*
- install -Dm755 "$srcdir"/polkit.initd "$pkgdir"/etc/init.d/polkit
+ # Move polkitd back to the base package (that's the only file from the
+ # polkit package that differs between default and elogind variant).
+ mkdir -p "$pkgdir"/usr/lib/polkit-1
+ mv "$subpkgdir"/usr/lib/polkit-1/polkitd "$pkgdir"/usr/lib/polkit-1/
}
sha512sums="