summaryrefslogtreecommitdiff
path: root/pcr/polkit-elogind
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2017-03-15 16:49:43 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2017-03-15 16:49:43 -0500
commit1e482884b394c60821e52eaa954a99c0e3e8c14d (patch)
treec62f369d4dae18a88914b21696678275cb7ca6ed /pcr/polkit-elogind
parent8c36410a24fbf6c50df189df3e6d2a5e6fb08014 (diff)
polkit-elogind: add new package to [pcr]
Diffstat (limited to 'pcr/polkit-elogind')
-rw-r--r--pcr/polkit-elogind/PKGBUILD70
-rw-r--r--pcr/polkit-elogind/polkit-0.114-elogind.patch165
-rw-r--r--pcr/polkit-elogind/polkit.install9
3 files changed, 244 insertions, 0 deletions
diff --git a/pcr/polkit-elogind/PKGBUILD b/pcr/polkit-elogind/PKGBUILD
new file mode 100644
index 000000000..053e06600
--- /dev/null
+++ b/pcr/polkit-elogind/PKGBUILD
@@ -0,0 +1,70 @@
+# Maintainer (Manjaro): artoo <artoo@manjaro.org>
+# Contributor (Manjaro): kozec <kozec at kozec.com>
+# Contributor (Manjaro): Lukas Jirkovsky <l.jirkovsky@gmail.com>
+# Contributor (Manjaro): Jan de Groot <jgc@archlinux.org>
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+_pkgname=polkit
+
+pkgname=polkit-elogind
+pkgver=0.113+29+g3272a98
+pkgrel=3
+pkgdesc="PolyciKit with elogind support for non-systemd systems"
+arch=('i686' 'x86_64' 'armv7h')
+url="http://www.freedesktop.org/wiki/Software/polkit"
+license=('LGPL')
+provides=("polkit=$pkgver")
+depends=('glib2' 'pam' 'expat' 'js' 'elogind')
+makedepends=('intltool' 'gtk-doc' 'gobject-introspection' 'git' 'autoconf-archive')
+conflicts=('polkit' 'polkit-consolekit')
+# replaces=('polkit-consolekit')
+options=('!libtool')
+install=polkit.install
+_commit=3272a988655c3236b55bad70e9a3af20857f384b
+#source=("http://www.freedesktop.org/software/polkit/releases/$_pkgname-$pkgver.tar.gz")
+source=("git+https://anongit.freedesktop.org/git/polkit#commit=$_commit"
+ 'polkit-0.114-elogind.patch')
+sha256sums=('SKIP'
+ 'e5eb83a8922f1540309ce5884c4bd40b2972aa75778da945e2392501961a860b')
+
+pkgver() {
+ cd $_pkgname
+ git describe --tags | sed 's/-/+/g'
+}
+
+prepare() {
+ cd $_pkgname #-$pkgver
+ patch -Np 1 -i ${srcdir}/polkit-0.114-elogind.patch
+ NOCONFIGURE=1 ./autogen.sh
+}
+
+build() {
+ cd $_pkgname #-$pkgver
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --sbindir=/usr/bin \
+ --localstatedir=/var \
+ --libexecdir=/usr/lib/polkit-1 \
+ --enable-libsystemd-login=no \
+ --enable-libelogind=yes \
+ --disable-static \
+ --enable-gtk-doc \
+ --with-os-type=gentoo
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+ make
+}
+
+check() {
+ cd $_pkgname #-$pkgver
+ make -k check || :
+}
+
+package() {
+ cd $_pkgname #-$pkgver
+ make DESTDIR="$pkgdir" install
+
+ chown root:102 "$pkgdir"/{etc,usr/share}/polkit-1/rules.d
+ chmod 750 "$pkgdir"/{etc,usr/share}/polkit-1/rules.d
+}
diff --git a/pcr/polkit-elogind/polkit-0.114-elogind.patch b/pcr/polkit-elogind/polkit-0.114-elogind.patch
new file mode 100644
index 000000000..b08f412ed
--- /dev/null
+++ b/pcr/polkit-elogind/polkit-0.114-elogind.patch
@@ -0,0 +1,165 @@
+--- a/configure.ac 2016-11-03 20:16:02.842071344 +0100
++++ b/configure.ac 2016-11-03 20:15:34.612071850 +0100
+@@ -183,11 +183,12 @@
+
+ AM_CONDITIONAL(BUILD_TEST, [test "x$enable_test" = "xyes"])
+
+-dnl ---------------------------------------------------------------------------
+-dnl - Select wether to use libsystemd-login or ConsoleKit for session tracking
+-dnl ---------------------------------------------------------------------------
++dnl -----------------------------------------------------------------------------------
++dnl - Select wether to use libsystemd-login, elogind or ConsoleKit for session tracking
++dnl -----------------------------------------------------------------------------------
+
+ have_libsystemd=no
++have_elogind=no
+ SESSION_TRACKING=ConsoleKit
+
+ AC_ARG_ENABLE([libsystemd-login],
+@@ -220,6 +221,29 @@
+ fi
+ fi
+ fi
++
++AC_ARG_ENABLE([libelogind],
++ [AS_HELP_STRING([--enable-libelogind[=@<:@auto/yes/no@:>@]], [Use libelogind (auto/yes/no)])],
++ [enable_libelogind=$enableval],
++ [enable_libelogind=auto])
++if test "$enable_libelogind" != "no"; then
++ PKG_CHECK_MODULES([LIBELOGIND],
++ [libelogind],
++ [have_libelogind=yes],
++ [have_libelogind=no])
++ if test "$have_libelogind" = "yes"; then
++ SESSION_TRACKING=libelogind
++ AC_DEFINE([HAVE_LIBELOGIND], 1, [Define to 1 if libelogind is available])
++ save_LIBS=$LIBS
++ LIBS=$LIBELOGIND_LIBS
++ AC_CHECK_FUNCS(sd_uid_get_display)
++ LIBS=$save_LIBS
++ else
++ if test "$enable_libelogind" = "yes"; then
++ AC_MSG_ERROR([libelogind support requested but libelogind not found])
++ fi
++ fi
++fi
+
+ AS_IF([test "x$cross_compiling" != "xyes" ], [
+ AS_IF([test "$have_libsystemd" = "yes"], [
+@@ -245,6 +245,10 @@
+ AC_SUBST(LIBSYSTEMD_LIBS)
+ AM_CONDITIONAL(HAVE_LIBSYSTEMD, [test "$have_libsystemd" = "yes"], [Using libsystemd])
+
++AC_SUBST(LIBELOGIND_CFLAGS)
++AC_SUBST(LIBELOGIND_LIBS)
++AM_CONDITIONAL(HAVE_LIBELOGIND, [test "$have_libelogind" = "yes"], [Using libelogind])
++
+ dnl ---------------------------------------------------------------------------
+ dnl - systemd unit / service files
+ dnl ---------------------------------------------------------------------------
+diff --git a/src/polkit/Makefile.am b/src/polkit/Makefile.am
+index ca36355..b8090c4 100644
+--- a/src/polkit/Makefile.am
++++ b/src/polkit/Makefile.am
+@@ -86,19 +86,26 @@ if HAVE_LIBSYSTEMD
+ libpolkit_gobject_1_la_SOURCES += \
+ polkitunixsession-systemd.c polkitunixsession.h
+ else
++if HAVE_LIBELOGIND
++libpolkit_gobject_1_la_SOURCES += \
++ polkitunixsession-systemd.c polkitunixsession.h
++else
+ libpolkit_gobject_1_la_SOURCES += \
+ polkitunixsession.c polkitunixsession.h
+ endif
++endif
+
+ libpolkit_gobject_1_la_CFLAGS = \
+ -D_POLKIT_COMPILATION \
+ $(GLIB_CFLAGS) \
+ $(LIBSYSTEMD_CFLAGS) \
++ $(LIBELOGIND_CFLAGS) \
+ $(NULL)
+
+ libpolkit_gobject_1_la_LIBADD = \
+ $(GLIB_LIBS) \
+ $(LIBSYSTEMD_LIBS) \
++ $(LIBELOGIND_LIBS) \
+ $(NULL)
+
+ libpolkit_gobject_1_la_LDFLAGS = -export-symbols-regex '(^polkit_.*)'
+diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
+index e48b739..c2b1695 100644
+--- a/src/polkitbackend/Makefile.am
++++ b/src/polkitbackend/Makefile.am
+@@ -42,15 +42,21 @@ if HAVE_LIBSYSTEMD
+ libpolkit_backend_1_la_SOURCES += \
+ polkitbackendsessionmonitor.h polkitbackendsessionmonitor-systemd.c
+ else
++if HAVE_LIBELOGIND
++libpolkit_backend_1_la_SOURCES += \
++ polkitbackendsessionmonitor.h polkitbackendsessionmonitor-systemd.c
++else
+ libpolkit_backend_1_la_SOURCES += \
+ polkitbackendsessionmonitor.h polkitbackendsessionmonitor.c
+ endif
++endif
+
+ libpolkit_backend_1_la_CFLAGS = \
+ -D_POLKIT_COMPILATION \
+ -D_POLKIT_BACKEND_COMPILATION \
+ $(GLIB_CFLAGS) \
+ $(LIBSYSTEMD_CFLAGS) \
++ $(LIBELOGIND_CFLAGS) \
+ $(LIBJS_CFLAGS) \
+ $(NULL)
+
+@@ -59,6 +65,7 @@ libpolkit_backend_1_la_CXXFLAGS = $(libpolkit_backend_1_la_CFLAGS)
+ libpolkit_backend_1_la_LIBADD = \
+ $(GLIB_LIBS) \
+ $(LIBSYSTEMD_LIBS) \
++ $(LIBELOGIND_LIBS) \
+ $(top_builddir)/src/polkit/libpolkit-gobject-1.la \
+ $(EXPAT_LIBS) \
+ $(LIBJS_LIBS) \
+--- a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c 2016-11-04 04:44:29.650112018 +0100
++++ b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c 2016-11-04 04:46:52.718109455 +0100
+@@ -25,7 +25,11 @@
+ #include <grp.h>
+ #include <string.h>
+ #include <glib/gstdio.h>
++#ifdef HAVE_LIBSYSTEMD
+ #include <systemd/sd-login.h>
++#else
++#include <elogind/sd-login.h>
++#endif /* HAVE_LIBSYSTEMD versus HAVE_LIBELOGIND */
+ #include <stdlib.h>
+
+ #include <polkit/polkit.h>
+--- a/src/polkit/polkitunixsession-systemd.c 2016-11-04 04:44:29.651112017 +0100
++++ b/src/polkit/polkitunixsession-systemd.c 2016-11-04 04:47:07.160109197 +0100
+@@ -30,7 +30,11 @@
+ #include "polkiterror.h"
+ #include "polkitprivate.h"
+
++#ifdef HAVE_LIBSYSTEMD
+ #include <systemd/sd-login.h>
++#else
++#include <elogind/sd-login.h>
++#endif /* HAVE_LIBSYSTEMD versus HAVE_ELOGIND */
+
+ /**
+ * SECTION:polkitunixsession
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp
++++ b/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -43,6 +43,10 @@
+ #include <systemd/sd-login.h>
+ #endif /* HAVE_LIBSYSTEMD */
+
++#ifdef HAVE_LIBELOGIND
++#include <elogind/sd-login.h>
++#endif /* HAVE_LIBELOGIND */
++
+ #include <jsapi.h>
+
+ #include "initjs.h" /* init.js */
diff --git a/pcr/polkit-elogind/polkit.install b/pcr/polkit-elogind/polkit.install
new file mode 100644
index 000000000..bb5a0c657
--- /dev/null
+++ b/pcr/polkit-elogind/polkit.install
@@ -0,0 +1,9 @@
+post_install() {
+ getent group polkitd >/dev/null || groupadd -g 102 polkitd
+ getent passwd polkitd >/dev/null || useradd -c 'Policy Kit Daemon' -u 102 -g polkitd -G proc -d '/' -s /usr/bin/nologin polkitd
+ passwd -l polkitd &>/dev/null
+}
+
+post_upgrade() {
+ post_install
+}