From 9f09c5e9208d66e849464c8dcca0c7d0cb77b471 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 28 Jul 2014 10:08:47 +0200 Subject: [PATCH] ConsoleKit: misc fixes from Gentoo; enable udev-acl. --- srcpkgs/ConsoleKit/files/90-consolekit-3 | 32 +++++++++++++++++++ .../ConsoleKit/files/pam-foreground-compat.ck | 16 ++++++++++ srcpkgs/ConsoleKit/template | 16 ++++++++-- 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/ConsoleKit/files/90-consolekit-3 create mode 100755 srcpkgs/ConsoleKit/files/pam-foreground-compat.ck diff --git a/srcpkgs/ConsoleKit/files/90-consolekit-3 b/srcpkgs/ConsoleKit/files/90-consolekit-3 new file mode 100644 index 00000000000..358fc24f1a7 --- /dev/null +++ b/srcpkgs/ConsoleKit/files/90-consolekit-3 @@ -0,0 +1,32 @@ +# -*- sh -*- +# Xsession.d script for ck-launch-session. +# +# +# This file is sourced by Xsession(5), not executed. + +CK_LAUNCH_SESSION=/usr/bin/ck-launch-session + +is_on_console() { + session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \ + --type=method_call --print-reply --reply-timeout=2000 \ + /org/freedesktop/ConsoleKit/Manager \ + org.freedesktop.ConsoleKit.Manager.GetCurrentSession \ + | grep path | awk '{print $3}' | sed s/\"//g) + x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \ + --type=method_call --print-reply --reply-timeout=2000 \ + $session org.freedesktop.ConsoleKit.Session.GetX11Display \ + | grep string | awk '{print $2}' | sed s/\"//g) + + if [ -z "$x11_display" ] ; then + return 0 + else + return 1 + fi +} + +# gdm already creates a CK session for us, so do not run the expensive D-Bus +# calls if we have $GDMSESSION +if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \ + ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then + command="$CK_LAUNCH_SESSION $command" +fi diff --git a/srcpkgs/ConsoleKit/files/pam-foreground-compat.ck b/srcpkgs/ConsoleKit/files/pam-foreground-compat.ck new file mode 100755 index 00000000000..7f6b122d5fc --- /dev/null +++ b/srcpkgs/ConsoleKit/files/pam-foreground-compat.ck @@ -0,0 +1,16 @@ +#!/bin/sh +TAGDIR=/var/run/console + +[ -n "$CK_SESSION_USER_UID" ] || exit 1 + +TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`" + +if [ "$1" = "session_added" ]; then + mkdir -p "$TAGDIR" + echo "$CK_SESSION_ID" >> "$TAGFILE" +fi + +if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then + sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE" + [ -s "$TAGFILE" ] || rm -f "$TAGFILE" +fi diff --git a/srcpkgs/ConsoleKit/template b/srcpkgs/ConsoleKit/template index 0a232b38007..e4c995a0d71 100644 --- a/srcpkgs/ConsoleKit/template +++ b/srcpkgs/ConsoleKit/template @@ -1,21 +1,31 @@ # Template file for 'gnome-calculator' pkgname=ConsoleKit version=0.4.6 -revision=2 +revision=3 build_style=gnu-configure hostmakedepends="automake libtool pkg-config glib-devel" -makedepends="polkit-devel dbus-glib-devel glib-devel libX11-devel pam-devel" +makedepends="acl-devel eudev-libudev-devel polkit-devel dbus-glib-devel glib-devel libX11-devel pam-devel" short_desc="A framework for defining and tracking users, login sessions, and seats" maintainer="Enno Boland " homepage="http://www.freedesktop.org/wiki/Software/ConsoleKit" license="GPL" distfiles="http://www.freedesktop.org/software/ConsoleKit/dist/${pkgname}-${version}.tar.xz" checksum=b41d17e06f80059589fbeefe96ad07bcc564c49e65516da1caf975146475565c -configure_args="--with-pam-module-dir=/usr/lib/security --enable-pam-module" +configure_args="--enable-udev-acl --with-pam-module-dir=/usr/lib/security --enable-pam-module" + +make_dirs=" + /etc/${pkgname}/run-session.d 0755 root root + /usr/lib/${pkgname}/run-session.d 0755 root root + /usr/lib/${pkgname}/run-seat.d 0755 root root + /var/log/${pkgname} 0755 root root" pre_configure() { autoreconf -fi } +post_install() { + vinstall ${FILESDIR}/90-consolekit-3 755 etc/X11/xinit/xinitrc.d 90-consolekit + vinstall ${FILESDIR}/pam-foreground-compat.ck 755 usr/lib/${pkgname}/run-session.d +} ConsoleKit-devel_package() { short_desc+=" - development files"