ConsoleKit: misc fixes from Gentoo; enable udev-acl.

This commit is contained in:
Juan RP 2014-07-28 10:08:47 +02:00
parent 75d8a3205b
commit 9f09c5e920
3 changed files with 61 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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 <eb@s01.de>"
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"