summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2011-12-14 20:23:55 +0000
committerIan Stakenvicius <axs@gentoo.org>2011-12-14 20:23:55 +0000
commit1c382f50d4fa5cce0219d6bfa4bcabd29b0444a2 (patch)
tree4d4a69f749fc539046fa64fa9e3c699c2eb14258 /x11-misc
parentremove old versions (diff)
downloadgentoo-2-1c382f50d4fa5cce0219d6bfa4bcabd29b0444a2.tar.gz
gentoo-2-1c382f50d4fa5cce0219d6bfa4bcabd29b0444a2.tar.bz2
gentoo-2-1c382f50d4fa5cce0219d6bfa4bcabd29b0444a2.zip
Added experimental native consolekit support via -r7, and removed old -r5 ebuild as -r6 is stable on some archs
(Portage version: 2.1.10.11/cvs/Linux i686)
Diffstat (limited to 'x11-misc')
-rw-r--r--x11-misc/slim/ChangeLog10
-rw-r--r--x11-misc/slim/files/Xsession-r3158
-rw-r--r--x11-misc/slim/files/slim-1.3.2-ck.patch186
-rw-r--r--x11-misc/slim/metadata.xml3
-rw-r--r--x11-misc/slim/slim-1.3.2-r7.ebuild (renamed from x11-misc/slim/slim-1.3.2-r5.ebuild)46
5 files changed, 383 insertions, 20 deletions
diff --git a/x11-misc/slim/ChangeLog b/x11-misc/slim/ChangeLog
index 78a17a254c07..92a9748f1082 100644
--- a/x11-misc/slim/ChangeLog
+++ b/x11-misc/slim/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for x11-misc/slim
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/ChangeLog,v 1.73 2011/10/13 21:49:05 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/ChangeLog,v 1.74 2011/12/14 20:23:55 axs Exp $
+
+*slim-1.3.2-r7 (14 Dec 2011)
+
+ 14 Dec 2011; Ian Stakenvicius <axs@gentoo.org> -slim-1.3.2-r5.ebuild,
+ +slim-1.3.2-r7.ebuild, +files/slim-1.3.2-ck.patch, +files/Xsession-r3,
+ metadata.xml:
+ Added experimental native consolekit support via -r7, and removed old -r5
+ ebuild as -r6 is stable on some archs
13 Oct 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org> slim-1.3.2-r6.ebuild:
x86 stable wrt bug #386813
diff --git a/x11-misc/slim/files/Xsession-r3 b/x11-misc/slim/files/Xsession-r3
new file mode 100644
index 000000000000..237fb3630661
--- /dev/null
+++ b/x11-misc/slim/files/Xsession-r3
@@ -0,0 +1,158 @@
+#!/bin/sh
+#
+# Slim login manager Xsession script
+#
+
+command="$@"
+
+# this will go into slim.log along with all other echo's
+# good for debugging where things go wrong
+echo "$0: Beginning session setup..."
+
+# First read /etc/profile and .profile
+test -f /etc/profile && . /etc/profile
+test -f "$HOME/.profile" && . "$HOME/.profile"
+# Second read /etc/xprofile and .xprofile for X specific setup
+test -f /etc/xprofile && . /etc/xprofile
+test -f "$HOME/.xprofile" && . "$HOME/.xprofile"
+
+# wrap possible arguments to determine whether to treat special or not
+if [ "x$command" = "xcustom" ] || [ "x$command" = "xCustom" ] || [ "x$command" = "xdefault" ] || [ "x$command" = "xDefault" ]; then
+ command="Xsession"
+fi
+if [ "x$command" = "x" ]; then
+ # no default specified, check if Xsession will complete
+ # and if not then assign XSESSION to command
+ if [ -x "$HOME/.xsession" ] || [ -x "$HOME/.Xclients" ] || [ -x /etc/X11/xinit/Xclients ] || [ -x /etc/X11/Xclients ]; then
+ command="Xsession"
+ else
+ command=$XSESSION
+ fi
+fi
+
+# most of this is from /etc/X11/chooser.sh
+sessionscript=""
+if [ -n "${command}" ]; then
+ # find a match for $command in /etc/X11/Sessions
+ for x in /etc/X11/Sessions/* ; do
+ if [ "`echo ${x##*/} | awk '{ print toupper($1) }'`" = "`echo ${command} | awk '{ print toupper($1) }'`" ]; then
+ sessionscript=${x}
+ break
+ fi
+ done
+ if [ -n "${sessionscript}" ]; then
+ if [ -x "${sessionscript}" ]; then
+ command="${sessionscript}"
+ else
+ command="/bin/sh ${sessionscript}"
+ fi
+ else
+
+ # find an executable for $command
+ x=""
+ y=""
+
+ for x in "${command}" "`echo ${command} | awk '{ print toupper($1) }'`" "`echo ${command} | awk '{ print tolower($1) }'`"
+ do
+ # Fall through ...
+ if [ -x "`which ${x} 2>/dev/null`" ]; then
+ y="`which ${x} 2>/dev/null`"
+ break
+ fi
+ done
+ # note , if the command could not be found then $command will be empty
+ command="$y"
+ unset x
+ unset y
+ fi
+fi
+
+# call xrdb and xmodmap and such, since $command is not a session script
+if [ -z "${sessionscript}" ]; then
+ userresources="$HOME/.Xresources"
+ usermodmap="$HOME/.Xmodmap"
+ userxkbmap="$HOME/.Xkbmap"
+
+ sysresources=/etc/X11/Xresources
+ sysmodmap=/etc/X11/Xmodmap
+ sysxkbmap=/etc/X11/Xkbmap
+
+ rh6sysresources=/etc/X11/xinit/Xresources
+ rh6sysmodmap=/etc/X11/xinit/Xmodmap
+
+ # merge in defaults
+ if [ -f "$rh6sysresources" ]; then
+ xrdb -merge "$rh6sysresources"
+ fi
+
+ if [ -f "$sysresources" ]; then
+ xrdb -merge "$sysresources"
+ fi
+
+ if [ -f "$userresources" ]; then
+ xrdb -merge "$userresources"
+ fi
+
+ # merge in keymaps
+ if [ -f "$sysxkbmap" ]; then
+ setxkbmap `cat "$sysxkbmap"`
+ XKB_IN_USE=yes
+ fi
+
+ if [ -f "$userxkbmap" ]; then
+ setxkbmap `cat "$userxkbmap"`
+ XKB_IN_USE=yes
+ fi
+
+ #
+ # Eeek, this seems like too much magic here
+ #
+ if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
+ if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
+ xkbsymbols=`sed -n -e 's/^[ ]*XkbSymbols[ ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
+ if [ -n "$xkbsymbols" ]; then
+ setxkbmap -symbols "$xkbsymbols"
+ XKB_IN_USE=yes
+ fi
+ fi
+ fi
+
+ # xkb and xmodmap don't play nice together
+ if [ -z "$XKB_IN_USE" ]; then
+ if [ -f "$rh6sysmodmap" ]; then
+ xmodmap "$rh6sysmodmap"
+ fi
+
+ if [ -f "$sysmodmap" ]; then
+ xmodmap "$sysmodmap"
+ fi
+
+ if [ -f "$usermodmap" ]; then
+ xmodmap "$usermodmap"
+ fi
+ fi
+
+ unset XKB_IN_USE
+fi
+unset sessionscript
+
+# start failsafe session
+if [ -z "${command}" ]; then
+ echo "$0: Failed to find a command to start the session, so starting a failsafe xterm."
+ exec xterm -geometry 80x24+0+0
+fi
+
+# run all system xinitrc shell scripts which will update command
+if [ -d /etc/X11/xinit/xinitrc.d ]; then
+ for i in /etc/X11/xinit/xinitrc.d/* ; do
+ if [ -x "$i" ]; then
+ . "$i"
+ fi
+ done
+ unset i
+fi
+
+echo "$0: Setup done, will execute: $command"
+exec $command
+
+# vim:ts=4
diff --git a/x11-misc/slim/files/slim-1.3.2-ck.patch b/x11-misc/slim/files/slim-1.3.2-ck.patch
new file mode 100644
index 000000000000..b5f4aa517ff2
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.2-ck.patch
@@ -0,0 +1,186 @@
+diff -Naur slim-1.3.2/app.cpp slim-1.3.2.new/app.cpp
+--- slim-1.3.2/app.cpp 2011-12-14 14:33:45.000000000 -0500
++++ slim-1.3.2.new/app.cpp 2011-12-14 13:25:19.000000000 -0500
+@@ -536,6 +536,60 @@
+ string xauthority = pw->pw_dir;
+ xauthority.append("/.Xauthority");
+
++#ifdef USE_CONSOLEKIT
++ cerr << APPNAME << ": consolekit support enabled" << endl;
++ int ret;
++ DBusError error;
++ char *remote_host_name = "";
++ dbus_bool_t is_local;
++ char *display_device = "";
++ //char devtmp[16];
++
++ // if (!use_consolekit) return 1;
++ cerr << APPNAME << ": initializing a consolekit session" << endl;
++
++ is_local = TRUE; //is_local = Dpy->displayType.location == Local;
++ //if (Dpy->peerlen > 0 && Dpy->peer)
++ //remote_host_name = Dpy->peer;
++ /* how can we get the corresponding tty at best...? */
++// if (Dpy->windowPath) {
++// display_device = strchr(Dpy->windowPath, ':');
++// if (display_device && display_device[1])
++// display_device++;
++// else
++// display_device = Dpy->windowPath;
++// snprintf(devtmp, sizeof(devtmp), "/dev/tty%s", display_device);
++// display_device = devtmp;
++display_device = dpy_tty; // }
++
++ ckconnector = ck_connector_new();
++ if (!ckconnector) {
++ cerr << APPNAME << ": ck_connector not initialized" << endl;
++ //return 0;
++ }
++
++ dbus_error_init(&error);
++ ret = ck_connector_open_session_with_parameters(
++ ckconnector, &error,
++ "unix-user", &pw->pw_uid,
++ "x11-display", &DisplayName,
++ "x11-display-device", &display_device,
++ "remote-host-name", &remote_host_name,
++ "is-local", &is_local,
++ NULL);
++ if (!ret) {
++ if (dbus_error_is_set(&error)) {
++ cerr << APPNAME << ": Dbus error: " << error.message << endl;
++ dbus_error_free(&error);
++ } else {
++ cerr << APPNAME << ": ConsoleKit error" << endl;
++ }
++ cerr << APPNAME << ": console-kit-daemon not running?" << endl;
++ ck_connector_unref(ckconnector);
++ ckconnector = NULL;
++ }
++#endif
++
+ #ifdef USE_PAM
+ // Setup the PAM environment
+ try{
+@@ -548,6 +602,8 @@
+ pam.setenv("DISPLAY", DisplayName);
+ pam.setenv("MAIL", maildir.c_str());
+ pam.setenv("XAUTHORITY", xauthority.c_str());
++ pam.setenv("XDG_SESSION_COOKIE", ck_connector_get_cookie(ckconnector));
++ cerr << APPNAME << ": ck_connector has XDG_SESSION_COOKIE of " << ck_connector_get_cookie(ckconnector) << endl;
+ }
+ catch(PAM::Exception& e){
+ cerr << APPNAME << ": " << e << endl;
+@@ -564,7 +620,11 @@
+ char** child_env = pam.getenvlist();
+ pam.end();
+ #else
++#if USE_CONSOLEKIT
++ const int Num_Of_Variables = 11; // Number of env. variables + 1
++#else
+ const int Num_Of_Variables = 10; // Number of env. variables + 1
++#endif
+ char** child_env = static_cast<char**>(malloc(sizeof(char*)*Num_Of_Variables));
+ int n = 0;
+ if(term) child_env[n++]=StrConcat("TERM=", term);
+@@ -576,6 +636,10 @@
+ child_env[n++]=StrConcat("DISPLAY=", DisplayName);
+ child_env[n++]=StrConcat("MAIL=", maildir.c_str());
+ child_env[n++]=StrConcat("XAUTHORITY=", xauthority.c_str());
++#if USE_CONSOLEKIT
++ child_env[n++]=StrConcat("XDG_SESSION_COOKIE=", ck_connector_get_cookie(ckconnector));
++ cerr << APPNAME << ": ck_connector has XDG_SESSION_COOKIE of " << ck_connector_get_cookie(ckconnector) << endl;
++#endif
+ child_env[n++]=0;
+ #endif
+
+@@ -617,6 +681,28 @@
+ }
+ }
+
++#ifdef USE_CONSOLEKIT
++
++ //DBusError error;
++
++ // if (!ckconnector)
++ //return;
++
++ //dbus_error_init(&error);
++ if (!ck_connector_close_session(ckconnector, &error)) {
++ if (dbus_error_is_set(&error)) {
++ cerr << APPNAME << ": Dbus error: " << error.message << endl;
++ dbus_error_free(&error);
++ } else {
++ cerr << APPNAME << ": ConsoleKit close error" << endl;
++ }
++ cerr << APPNAME << ": console-kit-daemon not running?" << endl;
++ }
++ ck_connector_unref(ckconnector);
++ ckconnector = NULL;
++ //}
++#endif
++
+ #ifdef USE_PAM
+ try{
+ pam.close_session();
+@@ -881,12 +967,18 @@
+ bool ok = false;
+ Cfg::string2int(server[i]+2, &ok);
+ if (ok) {
++#ifdef USE_CONSOLEKIT
++ sprintf(dpy_tty,"/dev/tty%d",atoi(server[i]+2));
++#endif
+ hasVtSet = true;
+ }
+ }
+ }
+
+ if (!hasVtSet && daemonmode) {
++#ifdef USE_CONSOLEKIT
++ sprintf(dpy_tty,"/dev/tty7");
++#endif
+ server[argc++] = (char*)"vt07";
+ }
+ server[argc] = NULL;
+diff -Naur slim-1.3.2/app.h slim-1.3.2.new/app.h
+--- slim-1.3.2/app.h 2011-12-14 14:33:45.000000000 -0500
++++ slim-1.3.2.new/app.h 2011-12-14 11:51:39.000000000 -0500
+@@ -27,6 +27,10 @@
+ #ifdef USE_PAM
+ #include "PAM.h"
+ #endif
++#ifdef USE_CONSOLEKIT
++#include <ck-connector.h>
++#include <dbus/dbus.h>
++#endif
+
+ class App {
+ public:
+@@ -81,6 +85,12 @@
+ #ifdef USE_PAM
+ PAM::Authenticator pam;
+ #endif
++#ifdef USE_CONSOLEKIT
++ CkConnector *ckconnector;
++ int use_consolekit;
++ char dpy_tty[16];
++#endif
++
+
+ // Options
+ char* DispName;
+diff -Naur slim-1.3.2/Makefile slim-1.3.2.new/Makefile
+--- slim-1.3.2/Makefile 2011-12-14 14:33:45.000000000 -0500
++++ slim-1.3.2.new/Makefile 2011-12-14 11:43:02.000000000 -0500
+@@ -13,6 +13,11 @@
+ LDFLAGS+= -lpam
+ CUSTOM+= -DUSE_PAM
+ endif
++ifdef USE_CONSOLEKIT
++LDFLAGS+= `pkg-config --libs ck-connector`
++CFLAGS+= `pkg-config --cflags ck-connector`
++CUSTOM+= -DUSE_CONSOLEKIT
++endif
+ PREFIX=/usr
+ CFGDIR=/etc
+ MANDIR=/usr/share/man
diff --git a/x11-misc/slim/metadata.xml b/x11-misc/slim/metadata.xml
index c805ac6fd3dc..f6d2292aaaba 100644
--- a/x11-misc/slim/metadata.xml
+++ b/x11-misc/slim/metadata.xml
@@ -5,5 +5,8 @@
<maintainer>
<email>axs@gentoo.org</email>
</maintainer>
+ <use>
+ <flag name='consolekit'>Enable native consolekit support</flag>
+ </use>
</pkgmetadata>
diff --git a/x11-misc/slim/slim-1.3.2-r5.ebuild b/x11-misc/slim/slim-1.3.2-r7.ebuild
index 6b54291f1ca7..26048a6a6be3 100644
--- a/x11-misc/slim/slim-1.3.2-r5.ebuild
+++ b/x11-misc/slim/slim-1.3.2-r7.ebuild
@@ -1,8 +1,8 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/slim-1.3.2-r5.ebuild,v 1.1 2011/08/19 19:55:10 darkside Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/slim-1.3.2-r7.ebuild,v 1.1 2011/12/14 20:23:55 axs Exp $
-EAPI=2
+EAPI=4
inherit toolchain-funcs pam eutils
@@ -13,7 +13,8 @@ SRC_URI="mirror://berlios/${PN}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
-IUSE="branding pam"
+IUSE="branding pam consolekit"
+REQUIRED_USE="consolekit? ( pam )"
RDEPEND="x11-libs/libXmu
x11-libs/libX11
@@ -22,6 +23,8 @@ RDEPEND="x11-libs/libXmu
>=media-libs/libpng-1.4
virtual/jpeg
x11-apps/sessreg
+ consolekit? ( sys-auth/consolekit
+ sys-apps/dbus )
pam? ( virtual/pam )"
DEPEND="${RDEPEND}
dev-util/pkgconfig
@@ -29,6 +32,7 @@ DEPEND="${RDEPEND}
PDEPEND="branding? ( >=x11-themes/slim-themes-1.2.3a-r3 )"
src_prepare() {
+
# respect C[XX]FLAGS, fix crosscompile,
# fix linking order for --as-needed"
sed -i -e "s:^CXX=.*:CXX=$(tc-getCXX) ${CXXFLAGS}:" \
@@ -40,7 +44,7 @@ src_prepare() {
-r -e "s:^LDFLAGS=(.*):LDFLAGS=\1 ${LDFLAGS}:" \
Makefile || die "sed failed in Makefile"
# Our Gentoo-specific config changes
- epatch "${FILESDIR}"/${PN}-1.3.2-r2-config.diff
+ epatch "${FILESDIR}"/${PN}-1.3.2-r3-config.diff
if use elibc_FreeBSD; then
sed -i -e "s/CUSTOM=-DHAVE_SHADOW/CUSTOM=-DNEEDS_BASENAME/" Makefile \
@@ -64,29 +68,39 @@ src_prepare() {
epatch "${FILESDIR}"/346037-stop_setting_host_for_pam_ck_connector_so.patch
# Gentoo bug 378505
epatch "${FILESDIR}"/${P}-libpng15.patch
+ # Gentoo bug 252280
+ epatch "${FILESDIR}"/252280-fix-default_user-focus_passwd.patch
+ # Native consolekit support
+ epatch "${FILESDIR}"/${P}-ck.patch
}
src_compile() {
- if use pam ; then
- emake USE_PAM=1 || die "emake failed."
+ if use consolekit && use pam ; then
+ emake USE_PAM=1 USE_CONSOLEKIT=1
+ elif use pam ; then
+ emake USE_PAM=1
else
- emake || die "emake failed."
+ emake
fi
}
src_install() {
if use pam ; then
- emake USE_PAM=1 DESTDIR="${D}" install || die "emake install failed."
+ if use consolekit ; then
+ emake USE_PAM=1 USE_CONSOLEKIT=1 DESTDIR="${D}" install
+ else
+ emake USE_PAM=1 DESTDIR="${D}" install
+ fi
pamd_mimic system-local-login slim auth account session
else
- emake DESTDIR="${D}" install || die "emake install failed."
+ emake DESTDIR="${D}" install
fi
insinto /usr/share/slim
- newins "${FILESDIR}/Xsession-r2" Xsession || die "newins failed"
+ newins "${FILESDIR}/Xsession-r3" Xsession
insinto /etc/logrotate.d
- newins "${FILESDIR}/slim.logrotate" slim || die "newins failed"
+ newins "${FILESDIR}/slim.logrotate" slim
dodoc xinitrc.sample ChangeLog README TODO THEMES
}
@@ -111,14 +125,8 @@ pkg_postinst() {
elog "accordingly."
elog
ewarn "Please note that the slim session start script now supports consolekit"
- ewarn "directly, via xinitrc.d scripts. Please remove any existing work-arounds to"
- ewarn "avoid multiple calls to ck-launch-session."
- if has_version "<=sys-auth/pambase-20101024[consolekit]" ; then
- ewarn
- ewarn "You should also remove the 'nox11' flag from the pam_ck_connector.so module "
- ewarn "in /etc/pam.d/system-login if you have not already done so."
- ewarn "(this is safe, it will be default in the next version of pambase)"
- fi
+ ewarn "directly. Please remove any existing work-arounds to avoid multiple calls "
+ ewarn "to ck-launch-session, and enable USE=\"consolekit\""
elog
if ! use pam; then
elog "You have merged ${PN} without USE=pam, this will cause ${PN} to fall back to"