[arch-commits] Commit in kdebase-workspace/trunk (4 files)

Pierre Schmitz pierre at archlinux.org
Thu Dec 4 18:47:00 UTC 2008


    Date: Thursday, December 4, 2008 @ 13:47:00
  Author: pierre
Revision: 20470

adding consolekit support to kdm; see http://bugs.kde.org/show_bug.cgi?id=147790 and http://websvn.kde.org/?view=rev&revision=886022

Added:
  kdebase-workspace/trunk/consolekit.patch
Modified:
  kdebase-workspace/trunk/PKGBUILD
Deleted:
  kdebase-workspace/trunk/agent-shutdown.sh
  kdebase-workspace/trunk/agent-startup.sh

-------------------+
 PKGBUILD          |   13 -
 agent-shutdown.sh |   13 -
 agent-startup.sh  |   19 --
 consolekit.patch  |  341 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 346 insertions(+), 40 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2008-12-04 18:24:32 UTC (rev 20469)
+++ PKGBUILD	2008-12-04 18:47:00 UTC (rev 20470)
@@ -3,14 +3,14 @@
 
 pkgname=kdebase-workspace
 pkgver=4.1.3
-pkgrel=1
+pkgrel=2
 pkgdesc="KDE Base Workspace"
 arch=('i686' 'x86_64')
 url='http://www.kde.org'
 license=('GPL' 'LGPL' 'FDL')
 groups=('kde')
 depends=('kdelibs' 'kdebase-runtime' 'libcaptury' 'libxxf86misc' 'libxcomposite' 'libxres'
-	 'libxss' 'lm_sensors' 'libxklavier' 'qimageblitz' 'xdg-utils' 'libxdamage')
+	 'libxss' 'lm_sensors' 'libxklavier' 'qimageblitz' 'xdg-utils' 'libxdamage' 'consolekit')
 makedepends=('pkgconfig' 'cmake' 'automoc4' 'networkmanager' 'kdemultimedia' 'bluez-libs')
 optdepends=('kdemultimedia')
 replaces=('kdmtheme' 'kde-common')
@@ -20,19 +20,19 @@
 backup=('usr/share/config/kdm/kdmrc')
 source=("http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2"
         'kdm-zsh-profile.patch' 'kdm' 'kde.pam' 'kde-np.pam' 'kscreensaver.pam'
-        'agent-startup.sh' 'agent-shutdown.sh')
+        'consolekit.patch')
 md5sums=('42233b75ce73eaaacae61c0d5db8befa'
          '721e97031b62aee8914e8617e86f9235'
          '5d80164932e0d44d8b802d3929a004ab'
          '10a490653b002e6f9e7476ff9d37c011'
          '552337fd9a3982d809ea16c7f0033d42'
          '367a3538f54db71f108b34cfa31088ac'
-         'c963ef6e37c9051119972a58c67f05fb'
-         '18e8d01124b19f7df2937c06e177bf7f')
+         '37bc811c740cd321d63109fc296f7241')
 
 build() {
 	cd $srcdir/${pkgname}-${pkgver}
 	patch -p0 -i ${srcdir}/kdm-zsh-profile.patch || return 1
+	patch -p0 -i ${srcdir}/consolekit.patch || return 1
 	cd ../
 	mkdir build
 	cd build
@@ -49,7 +49,4 @@
 	install -D -m644 ${srcdir}/kscreensaver.pam ${pkgdir}/etc/pam.d/kscreensaver
 	install -d -m755 ${pkgdir}/etc/X11/sessions/
 	ln -sf /usr/share/apps/kdm/sessions/kde{,-safe}.desktop ${pkgdir}/etc/X11/sessions/
-
-	install -m755 -D ${srcdir}/agent-startup.sh ${pkgdir}/usr/env/agent-startup.sh
-	install -m755 -D ${srcdir}/agent-shutdown.sh ${pkgdir}/usr/shutdown/agent-shutdown.sh
 }

Deleted: agent-shutdown.sh
===================================================================
--- agent-shutdown.sh	2008-12-04 18:24:32 UTC (rev 20469)
+++ agent-shutdown.sh	2008-12-04 18:47:00 UTC (rev 20470)
@@ -1,13 +0,0 @@
-#!/bin/sh
-#
-# This file is executed at kde shutdown.
-# Uncomment the following lines to kill the agents
-# that were started at session startup.
-
-if [ "${GPG_AGENT_INFO}" ]; then
-  kill $(echo ${GPG_AGENT_INFO} | cut -d':' -f 2) >/dev/null 2>&1
-fi
-#
-if [ "${SSH_AGENT_PID}" ]; then
-  ssh-agent -k
-fi

Deleted: agent-startup.sh
===================================================================
--- agent-startup.sh	2008-12-04 18:24:32 UTC (rev 20469)
+++ agent-startup.sh	2008-12-04 18:47:00 UTC (rev 20470)
@@ -1,19 +0,0 @@
-# Agents startup file
-#
-# This file is sourced at kde startup, so that
-# the environment variables set here are available
-# throughout the session.
-
-# Uncomment the following lines to start gpg-agent
-# and/or ssh-agent at kde startup.
-# If you do so, do not forget to uncomment the respective
-# lines in KDEDIR/shutdown/agent-shutdown.sh to
-# properly kill the agents when the session ends.
-
-if [ -x /usr/bin/gpg-agent ]; then
-  eval "$(/usr/bin/gpg-agent --daemon)"
-fi 
-#
-if [ -x /usr/bin/ssh-agent ]; then
-  eval "$(/usr/bin/ssh-agent -s)"
-fi

Added: consolekit.patch
===================================================================
--- consolekit.patch	                        (rev 0)
+++ consolekit.patch	2008-12-04 18:47:00 UTC (rev 20470)
@@ -0,0 +1,341 @@
+Index: cmake/modules/FindCkConnector.cmake
+===================================================================
+--- cmake/modules/FindCkConnector.cmake	(Revision 0)
++++ cmake/modules/FindCkConnector.cmake	(Revision 886022)
+@@ -0,0 +1,59 @@
++# - Try to find the ConsoleKit connector library (libck-connector)
++# Once done this will define
++#
++#  CKCONNECTOR_FOUND - system has the CK Connector
++#  CKCONNECTOR_INCLUDE_DIR - the CK Connector include directory
++#  CKCONNECTOR_LIBRARIES - the libraries needed to use CK Connector
++
++# Copyright (c) 2008, Kevin Kofler, <kevin.kofler at chello.at>
++# modeled after FindLibArt.cmake:
++# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
++#
++# Redistribution and use is allowed according to the terms of the BSD license.
++# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
++
++
++if (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
++
++  # in cache already
++  SET(CKCONNECTOR_FOUND TRUE)
++
++else (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
++
++  IF (NOT WIN32)
++    FIND_PACKAGE(PkgConfig)
++    IF (PKG_CONFIG_FOUND)
++      # use pkg-config to get the directories and then use these values
++      # in the FIND_PATH() and FIND_LIBRARY() calls
++      pkg_check_modules(_CKCONNECTOR_PC ck-connector)
++    ENDIF (PKG_CONFIG_FOUND)
++  ENDIF (NOT WIN32)
++
++  FIND_PATH(CKCONNECTOR_INCLUDE_DIR ck-connector.h
++     ${_CKCONNECTOR_PC_INCLUDE_DIRS}
++  )
++
++  FIND_LIBRARY(CKCONNECTOR_LIBRARIES NAMES ck-connector
++     PATHS
++     ${_CKCONNECTOR_PC_LIBDIR}
++  )
++
++
++  if (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
++     set(CKCONNECTOR_FOUND TRUE)
++  endif (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
++
++
++  if (CKCONNECTOR_FOUND)
++     if (NOT CkConnector_FIND_QUIETLY)
++        message(STATUS "Found ck-connector: ${CKCONNECTOR_LIBRARIES}")
++     endif (NOT CkConnector_FIND_QUIETLY)
++  else (CKCONNECTOR_FOUND)
++     if (CkConnector_FIND_REQUIRED)
++        message(FATAL_ERROR "Could NOT find ck-connector")
++     endif (CkConnector_FIND_REQUIRED)
++  endif (CKCONNECTOR_FOUND)
++
++  MARK_AS_ADVANCED(CKCONNECTOR_INCLUDE_DIR CKCONNECTOR_LIBRARIES)
++
++endif (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
+Index: cmake/modules/FindDBus.cmake
+===================================================================
+--- cmake/modules/FindDBus.cmake	(Revision 0)
++++ cmake/modules/FindDBus.cmake	(Revision 886022)
+@@ -0,0 +1,72 @@
++# - Try to find the low-level D-Bus library
++# Once done this will define
++#
++#  DBUS_FOUND - system has D-Bus
++#  DBUS_INCLUDE_DIR - the D-Bus include directory
++#  DBUS_ARCH_INCLUDE_DIR - the D-Bus architecture-specific include directory
++#  DBUS_LIBRARIES - the libraries needed to use D-Bus
++
++# Copyright (c) 2008, Kevin Kofler, <kevin.kofler at chello.at>
++# modeled after FindLibArt.cmake:
++# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
++#
++# Redistribution and use is allowed according to the terms of the BSD license.
++# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
++
++if (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
++
++  # in cache already
++  SET(DBUS_FOUND TRUE)
++
++else (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
++
++  IF (NOT WIN32)
++    FIND_PACKAGE(PkgConfig)
++    IF (PKG_CONFIG_FOUND)
++      # use pkg-config to get the directories and then use these values
++      # in the FIND_PATH() and FIND_LIBRARY() calls
++      pkg_check_modules(_DBUS_PC dbus-1)
++    ENDIF (PKG_CONFIG_FOUND)
++  ENDIF (NOT WIN32)
++
++  FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h
++    ${_DBUS_PC_INCLUDE_DIRS}
++    /usr/include
++    /usr/include/dbus-1.0
++    /usr/local/include
++  )
++
++  FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h
++    ${_DBUS_PC_INCLUDE_DIRS}
++    /usr/lib${LIB_SUFFIX}/include
++    /usr/lib${LIB_SUFFIX}/dbus-1.0/include
++    /usr/lib64/include
++    /usr/lib64/dbus-1.0/include
++    /usr/lib/include
++    /usr/lib/dbus-1.0/include
++  )
++
++  FIND_LIBRARY(DBUS_LIBRARIES NAMES dbus-1 dbus
++    PATHS
++     ${_DBUS_PC_LIBDIR}
++  )
++
++
++  if (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
++     set(DBUS_FOUND TRUE)
++  endif (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
++
++
++  if (DBUS_FOUND)
++     if (NOT DBus_FIND_QUIETLY)
++        message(STATUS "Found D-Bus: ${DBUS_LIBRARIES}")
++     endif (NOT DBus_FIND_QUIETLY)
++  else (DBUS_FOUND)
++     if (DBus_FIND_REQUIRED)
++        message(FATAL_ERROR "Could NOT find D-Bus")
++     endif (DBus_FIND_REQUIRED)
++  endif (DBUS_FOUND)
++
++  MARK_AS_ADVANCED(DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR DBUS_LIBRARIES)
++
++endif (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
+Index: kdm/config-kdm.h.cmake
+===================================================================
+--- kdm/config-kdm.h.cmake	(Revision 886021)
++++ kdm/config-kdm.h.cmake	(Revision 886022)
+@@ -123,6 +123,9 @@
+ /* Define to 1 if you have the <termios.h> header file. */
+ #cmakedefine HAVE_TERMIOS_H 1
+ 
++/* Define to 1 if the ck-connector library is found */
++#cmakedefine HAVE_CKCONNECTOR 1
++
+ /* $PATH defaults set by KDM */
+ #cmakedefine KDM_DEF_USER_PATH "${KDM_DEF_USER_PATH}"
+ #cmakedefine KDM_DEF_SYSTEM_PATH "${KDM_DEF_SYSTEM_PATH}"
+Index: kdm/backend/client.c
+===================================================================
+--- kdm/backend/client.c	(Revision 886021)
++++ kdm/backend/client.c	(Revision 886022)
+@@ -77,6 +77,10 @@
+ /* for expiration */
+ # include <time.h>
+ #endif /* USE_PAM || _AIX */
++#ifdef HAVE_CKCONNECTOR
++# include <ck-connector.h>
++# include <dbus/dbus.h>
++#endif
+ #ifdef HAVE_GETSPNAM
+ # include <shadow.h>
+ #endif
+@@ -1149,6 +1153,9 @@
+ static int removeSession;
+ static int removeCreds;
+ #endif
++#ifdef HAVE_CKCONNECTOR
++static CkConnector *ckConnector;
++#endif
+ 
+ static GPipe ctlpipe;
+ static GTalk ctltalk;
+@@ -1198,6 +1205,17 @@
+ 	extern char **newenv; /* from libs.a, this is set up by setpenv */
+ # endif
+ #endif
++#ifdef HAVE_CKCONNECTOR
++	DBusError error;
++	int ckStatus;
++# ifdef XDMCP
++	char *remoteHostName = 0;
++	const char *spaceStr = "";
++# endif
++	char ckDeviceBuf[20] = "";
++	const char *ckDevice = ckDeviceBuf;
++	dbus_bool_t isLocal;
++#endif
+ 	char *failsafeArgv[2];
+ 	char *buf, *buf2;
+ 	int i;
+@@ -1218,6 +1236,61 @@
+ 
+ 	strcpy( curuser, p->pw_name ); /* Use normalized login name. */
+ 
++#ifdef HAVE_CKCONNECTOR
++	if (!(ckConnector = ck_connector_new())) {
++		logOutOfMem();
++		V_RET;
++	}
++	
++# ifdef HAVE_VTS
++	if (td->serverVT > 0)
++		sprintf( ckDeviceBuf, "/dev/tty%d", td->serverVT );
++# endif
++	isLocal = ((td->displayType & d_location) == dLocal);
++# ifdef XDMCP
++	if (!isLocal) {
++		int length, family;
++		CARD8 *data;
++		ARRAY8 addr;
++
++		family = convertAddr( (char *)td->peer.data, &length, &data );
++		addr.data = (unsigned char *)data;
++		addr.length = length;
++
++		/* We are not simply using the addr part of td->name as it might be
++		   numeric due to the SourceAddress settings */
++		remoteHostName = networkAddressToHostname(family, &addr);
++	}
++# endif
++
++	dbus_error_init( &error );
++	ckStatus = ck_connector_open_session_with_parameters( ckConnector, &error,
++			"unix-user", &p->pw_uid,
++			"x11-display-device", &ckDevice,
++			"x11-display", &td->name,
++			"is-local", &isLocal, /* meaning not entirely clear per doc */
++# ifdef XDMCP
++			"remote-host-name", remoteHostName ?
++			                       (const char **)&remoteHostName : &spaceStr,
++# endif
++			NULL );
++# ifdef XDMCP
++	if (remoteHostName)
++		free( remoteHostName );
++# endif
++	debug( "ck status: %d\n", ckStatus );
++	if (!ckStatus) {
++		if (dbus_error_is_set( &error )) {
++			logError( "Cannot open ConsoleKit session: %s\n", error.message );
++			dbus_error_free( &error );
++		} else {
++			logError( "Cannot open ConsoleKit session, likely OOM\n" );
++		}
++		ck_connector_unref( ckConnector );
++		V_RET;
++	}
++#endif
++
+ #ifndef USE_PAM
+ # ifdef _AIX
+ 	msg = NULL;
+@@ -1269,6 +1342,10 @@
+ 	if (krbtkfile[0] != '\0')
+ 		env = setEnv( env, "KRBTKFILE", krbtkfile );
+ #endif
++#ifdef HAVE_CKCONNECTOR
++	env = setEnv( env, "XDG_SESSION_COOKIE",
++	                   ck_connector_get_cookie( ckConnector ) );
++#endif
+ 	userEnviron = inheritEnv( env, envvars );
+ 	env = systemEnv( 0, curuser );
+ 	systemEnviron = setEnv( env, "HOME", p->pw_dir );
+@@ -1685,6 +1762,9 @@
+ #ifdef USE_PAM
+ 	int pretc;
+ #endif
++#ifdef HAVE_CKCONNECTOR
++	DBusError error;
++#endif
+ 
+ 	if (removeAuth) {
+ 		switch (source( systemEnviron, td->reset, td_setup )) {
+@@ -1759,6 +1839,22 @@
+ 		pamh = 0;
+ 	}
+ #endif
++
++#ifdef HAVE_CKCONNECTOR
++	if (ckConnector) {
++		dbus_error_init( &error );
++		if (!ck_connector_close_session( ckConnector, &error )) {
++			if (dbus_error_is_set( &error )) {
++				logError( "Cannot close ConsoleKit session: %s\n", error.message );
++				dbus_error_free( &error );
++			} else {
++				logError( "Cannot close ConsoleKit session, likely OOM\n" );
++			}
++		}
++		ck_connector_unref( ckConnector );
++		ckConnector = 0;
++	}
++#endif
+ }
+ 
+ void
+Index: kdm/backend/CMakeLists.txt
+===================================================================
+--- kdm/backend/CMakeLists.txt	(Revision 886021)
++++ kdm/backend/CMakeLists.txt	(Revision 886022)
+@@ -60,6 +60,10 @@
+ 	${SOCKET_LIBRARIES}
+ 	${RESOLV_LIBRARIES}
+ )
++if (CKCONNECTOR_FOUND)
++	include_directories(${CKCONNECTOR_INCLUDE_DIR} ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
++	target_link_libraries( kdm ${CKCONNECTOR_LIBRARIES} ${DBUS_LIBRARIES} )
++endif (CKCONNECTOR_FOUND)
+ if(UTIL_LIBRARIES)
+ 	target_link_libraries( kdm ${UTIL_LIBRARIES} )
+ endif(UTIL_LIBRARIES)
+Index: kdm/CMakeLists.txt
+===================================================================
+--- kdm/CMakeLists.txt	(Revision 886021)
++++ kdm/CMakeLists.txt	(Revision 886022)
+@@ -4,6 +4,17 @@
+ install_pam_service(KDM)
+ 
+ include(ConfigureChecks.cmake)
++
++macro_optional_find_package(CkConnector)
++if(CKCONNECTOR_FOUND)
++  # when building with libck-connector, we also need the low-level D-Bus API
++  find_package(DBus REQUIRED)
++endif(CKCONNECTOR_FOUND)
++
++macro_log_feature(CKCONNECTOR_FOUND "ck-connector" "The ConsoleKit connector library" "http://freedesktop.org/wiki/Software/ConsoleKit" FALSE "" "Provides ConsoleKit integration in KDM")
++
++macro_bool_to_01(CKCONNECTOR_FOUND HAVE_CKCONNECTOR)
++
+ configure_file(config-kdm.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdm.h)
+ 
+ install( FILES README DESTINATION ${DATA_INSTALL_DIR}/doc/kdm )




More information about the arch-commits mailing list