From f235696eec7f33a76edee52040aeaaad05d47884 Mon Sep 17 00:00:00 2001 From: Michael Weber Date: Sun, 4 Apr 2010 05:26:55 +0200 Subject: [PATCH] gnome-base/gdm-2.30.0: version bump ebuild is based on gdm-2.28.2-r1.ebuild from tree. - dependencies reviewed and checked. - keyboard layout selectin needs +xklavier - has nice power management features - user switching works. - files/gdm-2.29.92-... were from 2.26 patchset with line changes - files/gdm-2.30.0-include.patch is new. Michael Weber --- gnome-base/gdm/Manifest | 10 + gnome-base/gdm/files/49-keychain | 9 + gnome-base/gdm/files/50-ssh-agent | 10 + gnome-base/gdm/files/gdm-2.26.1-libxklavier4.patch | 50 +++++ .../gdm/files/gdm-2.29.92-custom-session.patch | 38 ++++ .../gdm-2.29.92-fix-daemonize-regression.patch | 117 ++++++++++++ gnome-base/gdm/files/gdm-2.30.0-include.patch | 20 ++ gnome-base/gdm/gdm-2.30.0.ebuild | 197 ++++++++++++++++++++ 8 files changed, 451 insertions(+), 0 deletions(-) create mode 100644 gnome-base/gdm/Manifest create mode 100644 gnome-base/gdm/files/49-keychain create mode 100644 gnome-base/gdm/files/50-ssh-agent create mode 100644 gnome-base/gdm/files/gdm-2.26.1-libxklavier4.patch create mode 100644 gnome-base/gdm/files/gdm-2.29.92-custom-session.patch create mode 100644 gnome-base/gdm/files/gdm-2.29.92-fix-daemonize-regression.patch create mode 100644 gnome-base/gdm/files/gdm-2.30.0-include.patch create mode 100644 gnome-base/gdm/gdm-2.30.0.ebuild diff --git a/gnome-base/gdm/Manifest b/gnome-base/gdm/Manifest new file mode 100644 index 0000000..cddc511 --- /dev/null +++ b/gnome-base/gdm/Manifest @@ -0,0 +1,10 @@ +AUX 49-keychain 181 RMD160 32ce131e93fc2d8640edee72ad42124537860156 SHA1 b4518f9d8ba65d0cf4d64ded844e59be343088d3 SHA256 d73e07847bfa6ac69938aa309f5c137d4c36248cedf9834db1315ba1b2b87140 +AUX 50-ssh-agent 243 RMD160 14327252dc1da75bdb49380960434a613b28cfa6 SHA1 e808be7a34324b269d493585990f134e82cc722a SHA256 f0790148b975ef1e7a37ffe8f5d90f943746f0a3bcf9d7fad8500219e2114042 +AUX gdm-2.26.1-libxklavier4.patch 1842 RMD160 cae9308944ff4118bd06e411b11e1df6b97fdf99 SHA1 0fbb97f83b980c9bfaab1e95108d9462640c9134 SHA256 7978417318e80628939cdbf62d59ba56cb15242748cb89b5a8b6c02b5265173a +AUX gdm-2.29.92-custom-session.patch 1092 RMD160 2e2cbf5610f8a3df6c04eb8b5c319146ad9d1a81 SHA1 f6f783016f36d4f61d9326e68800aa341f5a73b9 SHA256 bdde8eafaf8f44f90ba3b3d4e3cad5b53a74ed6f922b8dc894c33f7af8fdd2aa +AUX gdm-2.29.92-fix-daemonize-regression.patch 3938 RMD160 c6235babd7aeb6cbcf0e20c459da6f5b4322a0d9 SHA1 36dfa1acf5190c461a19270e284af3bc77c6b092 SHA256 c84196666794d56c9dadb4cb1aa8a3c23c5b7225e5c45ffb841cd2ecc2e6d96f +AUX gdm-2.30.0-include.patch 705 RMD160 3e56f7f1139bf5dd8660d4c7b5e4c7bd70aa3525 SHA1 d6f1910e685f4d9757495b0ecd5b4711e8949813 SHA256 b6dd686ce43f63c8e5b252350a39b32b8ab7999a64a7a7f1d8aeb5d8256aee09 +DIST gdm-2.20.9-gentoo-files-r1.tar.bz2 3494 RMD160 9d8f9954bd0d8b657a2faf2516b4548b9f1556d3 SHA1 28ceedb42440fdb50dffa7e69b18f213b00e3935 SHA256 666c0bf1ba28ccc257bf1235b5286e1eb9e15230c0036413ab428e09c54238f9 +DIST gdm-2.26-gentoo-patches.tar.bz2 4175 RMD160 356cd339b733e41c504bf2c951a322da205439be SHA1 a58adde0bb70b56d4b61cd5bf0ca81fbbfa44c69 SHA256 e6ad1a4995eb622cf74e5e897ac0588dff122446af5e1e52f165fd8bccb105d2 +DIST gdm-2.30.0.tar.bz2 2291133 RMD160 246d02fb64cfd4f77380722a0bbc1e3062a19a02 SHA1 0251222195d3558993e3144b78d5bc718986672b SHA256 ac2c367766b8fa20ebeb41033931fc4d91482ad3d377823f1c7ad84eee12dc15 +EBUILD gdm-2.30.0.ebuild 5491 RMD160 5eb081ee7da9896d6ea5df7ff6c96f8aa7a2bf9c SHA1 ac9cd1aebec0420676d46e417e08308ee37848cc SHA256 0394879979b674b4e313c958628e6923279eff9f4c29f9e667ea84a51140283c diff --git a/gnome-base/gdm/files/49-keychain b/gnome-base/gdm/files/49-keychain new file mode 100644 index 0000000..77310b2 --- /dev/null +++ b/gnome-base/gdm/files/49-keychain @@ -0,0 +1,9 @@ +#!/bin/bash + +# source keychain variables + +keychain="`which keychain`" +if [ -n "$keychain" ] && [ -x "$keychain" ] && [ -f "$HOME/.bash_profile" ] +then + . "${HOME}/.bash_profile" +fi diff --git a/gnome-base/gdm/files/50-ssh-agent b/gnome-base/gdm/files/50-ssh-agent new file mode 100644 index 0000000..28af267 --- /dev/null +++ b/gnome-base/gdm/files/50-ssh-agent @@ -0,0 +1,10 @@ +#!/bin/sh + +# add ssh-agent if found + +sshagent="`which ssh-agent`" +if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then + command="$sshagent -- $command" +elif [ -z "$sshagent" ] ; then + echo "$0: ssh-agent not found!" +fi diff --git a/gnome-base/gdm/files/gdm-2.26.1-libxklavier4.patch b/gnome-base/gdm/files/gdm-2.26.1-libxklavier4.patch new file mode 100644 index 0000000..6f665b7 --- /dev/null +++ b/gnome-base/gdm/files/gdm-2.26.1-libxklavier4.patch @@ -0,0 +1,50 @@ +From 90267c7f7afc73b27193632ec4af2c5360fab85a Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue +Date: Tue, 21 Jul 2009 00:56:37 +0200 +Subject: [PATCH] Add support for libxklavier-4 + +--- + configure.ac | 10 +++++++--- + gui/simple-greeter/gdm-layouts.c | 4 ++++ + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index d4a44d5..068e45c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -114,9 +114,13 @@ AC_ARG_ENABLE([libxklavier], + have_libxklavier=no + if test "x$enable_libxklavier" = "xyes"; then + PKG_CHECK_MODULES(LIBXKLAVIER, +- libxklavier >= $LIBXKLAVIER_REQUIRED_VERSION, +- have_libxklavier=yes, +- have_libxklavier=no) ++ libxklavier >= 4, ++ [AC_DEFINE(HAVE_XKL_4, [1], [lixklavier-4 support]) ++ have_libxklavier=yes], ++ [PKG_CHECK_MODULES(LIBXKLAVIER, ++ libxklavier >= $LIBXKLAVIER_REQUIRED_VERSION, ++ have_libxklavier=yes, ++ have_libxklavier=no)]) + if test "x$have_libxklavier" = "xyes" ; then + AC_DEFINE(HAVE_LIBXKLAVIER, [], [Define if we have libxklavier]) + fi +diff --git a/gui/simple-greeter/gdm-layouts.c b/gui/simple-greeter/gdm-layouts.c +index dc35094..97e1e08 100644 +--- a/gui/simple-greeter/gdm-layouts.c ++++ b/gui/simple-greeter/gdm-layouts.c +@@ -52,7 +52,11 @@ init_xkl (void) + engine = xkl_engine_get_instance (GDK_DISPLAY ()); + xkl_engine_backup_names_prop (engine); + config_registry = xkl_config_registry_get_instance (engine); ++#if HAVE_XKL_4 ++ xkl_config_registry_load (config_registry, FALSE); ++#else + xkl_config_registry_load (config_registry); ++#endif + + initial_config = xkl_config_rec_new (); + if (!xkl_config_rec_get_from_backup (initial_config, engine)) { +-- +1.6.3.3 + diff --git a/gnome-base/gdm/files/gdm-2.29.92-custom-session.patch b/gnome-base/gdm/files/gdm-2.29.92-custom-session.patch new file mode 100644 index 0000000..842d6b9 --- /dev/null +++ b/gnome-base/gdm/files/gdm-2.29.92-custom-session.patch @@ -0,0 +1,38 @@ +--- + fix custom sessions (see bug #216984, work done by Gilles, I'm just committing) + +diff -ru gdm-2.29.92.orig/work/gdm-2.29.92/data/Xsession.in gdm-2.29.92/work/gdm-2.29.92/data/Xsession.in +--- gdm-2.29.92.orig/work/gdm-2.29.92/data/Xsession.in 2010-03-30 02:15:18.000000000 +0200 ++++ gdm-2.29.92/work/gdm-2.29.92/data/Xsession.in 2010-03-30 02:17:37.000000000 +0200 +@@ -177,15 +177,6 @@ + fi + fi + +-# run all system xinitrc shell scripts. +-if [ -d /etc/X11/xinit/xinitrc.d ]; then +- for i in /etc/X11/xinit/xinitrc.d/* ; do +- if [ -x "$i" -a ! -d "$i" ]; then +- . "$i" +- fi +- done +-fi +- + if [ "x$command" = "xcustom" ] ; then + if [ -x "$HOME/.xsession" ]; then + command="$HOME/.xsession" +@@ -213,6 +204,15 @@ + fi + fi + ++# run all system xinitrc shell scripts. ++if [ -d /etc/X11/xinit/xinitrc.d ]; then ++ for i in /etc/X11/xinit/xinitrc.d/* ; do ++ if [ -x "$i" ]; then ++ . "$i" ++ fi ++ done ++fi ++ + # add ssh-agent if found + sshagent="`gdmwhich ssh-agent`" + if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then diff --git a/gnome-base/gdm/files/gdm-2.29.92-fix-daemonize-regression.patch b/gnome-base/gdm/files/gdm-2.29.92-fix-daemonize-regression.patch new file mode 100644 index 0000000..80af8fd --- /dev/null +++ b/gnome-base/gdm/files/gdm-2.29.92-fix-daemonize-regression.patch @@ -0,0 +1,117 @@ +From b9f261de75356be6e4ee94c0cc53f2edbd8fe4d2 Mon Sep 17 00:00:00 2001 +From: Dan Nicholson +Date: Tue, 14 Oct 2008 07:06:21 -0700 +Subject: [PATCH] Fork gdm-binary, except when -nodaemon is used + +gdm-binary now forks and the parent terminates, except when the +-nodaemon or --nodaemon options are used. This provides compatibility +with xdm. Fixes bug #550170. + +Updated for gdm-2.29.92 by Michael Weber gentoo at xmw dot de 20100330 + +diff -ru gdm-2.29.92.orig/work/gdm-2.29.92/daemon/main.c gdm-2.29.92/work/gdm-2.29.92/daemon/main.c +--- gdm-2.29.92.orig/work/gdm-2.29.92/daemon/main.c 2010-03-30 02:02:05.000000000 +0200 ++++ gdm-2.29.92/work/gdm-2.29.92/daemon/main.c 2010-03-30 02:07:27.000000000 +0200 +@@ -499,6 +499,57 @@ + return ret; + } + ++static void ++dup_dev_null (int fd, int flags) ++{ ++ int nullfd; ++ int dupfd; ++ ++ VE_IGNORE_EINTR (nullfd = open ("/dev/null", flags)); ++ if (G_UNLIKELY (nullfd < 0)) { ++ gdm_fail (_("Cannot open /dev/null: %s!"), ++ strerror (errno)); ++ exit (EXIT_FAILURE); ++ } ++ ++ VE_IGNORE_EINTR (dupfd = dup2 (nullfd, fd)); ++ if (G_UNLIKELY (dupfd < 0)) { ++ gdm_fail (_("Cannot duplicate /dev/null: %s!"), ++ strerror (errno)); ++ exit (EXIT_FAILURE); ++ } ++ ++ VE_IGNORE_EINTR (close (nullfd)); ++} ++ ++static void ++daemonify (void) ++{ ++ pid_t pid; ++ ++ pid = fork (); ++ ++ /* terminate the parent */ ++ if (pid > 0) ++ exit (EXIT_SUCCESS); ++ ++ if (G_UNLIKELY (pid < 0)) { ++ gdm_fail (_("fork () failed: %s!"), strerror (errno)); ++ exit (EXIT_FAILURE); ++ } ++ ++ if (G_UNLIKELY (setsid () < 0)) { ++ gdm_fail (_("setsid () failed: %s!"), strerror (errno)); ++ exit (EXIT_FAILURE); ++ } ++ ++ /* reopen stdin, stdout, stderr with /dev/null */ ++ dup_dev_null (STDIN_FILENO, O_RDONLY); ++ dup_dev_null (STDOUT_FILENO, O_RDWR); ++ dup_dev_null (STDERR_FILENO, O_RDWR); ++} ++ ++ + static gboolean + is_debug_set (void) + { +@@ -523,14 +574,17 @@ + DBusGConnection *connection; + GError *error; + int ret; ++ int i; + gboolean res; + gboolean xdmcp_enabled; + GdmSignalHandler *signal_handler; + static gboolean do_timed_exit = FALSE; + static gboolean print_version = FALSE; + static gboolean fatal_warnings = FALSE; ++ static gboolean no_daemon = FALSE; + static GOptionEntry entries [] = { + { "fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &fatal_warnings, N_("Make all warnings fatal"), NULL }, ++ { "nodaemon", 0, 0, G_OPTION_ARG_NONE, &no_daemon, N_("Do not fork into the background"), NULL }, + { "timed-exit", 0, 0, G_OPTION_ARG_NONE, &do_timed_exit, N_("Exit after a time - for debugging"), NULL }, + { "version", 0, 0, G_OPTION_ARG_NONE, &print_version, N_("Print GDM version"), NULL }, + +@@ -547,6 +601,14 @@ + + g_type_init (); + ++ /* preprocess the arguments to support the xdm style ++ * -nodaemon option ++ */ ++ for (i = 0; i < argc; i++) { ++ if (strcmp (argv[i], "-nodaemon") == 0) ++ argv[i] = "--nodaemon"; ++ } ++ + context = g_option_context_new (_("GNOME Display Manager")); + g_option_context_add_main_entries (context, entries, NULL); + g_option_context_set_ignore_unknown_options (context, TRUE); +@@ -612,7 +674,10 @@ + exit (-1); + } + +- /* pid file */ ++ if (no_daemon == FALSE) ++ daemonify (); ++ ++ /* pid file */ + delete_pid (); + write_pid (); + diff --git a/gnome-base/gdm/files/gdm-2.30.0-include.patch b/gnome-base/gdm/files/gdm-2.30.0-include.patch new file mode 100644 index 0000000..2412ef0 --- /dev/null +++ b/gnome-base/gdm/files/gdm-2.30.0-include.patch @@ -0,0 +1,20 @@ +--- gdm-2.30.0/daemon/simple-slave-main.c 2010-03-29 23:42:03.000000000 +0200 ++++ gdm-2.30.0/daemon/simple-slave-main.c 2010-04-04 04:13:12.000000000 +0200 +@@ -49,6 +49,7 @@ + #include "gdm-settings.h" + #include "gdm-settings-direct.h" + #include "gdm-settings-keys.h" ++#include "common/gdm-settings-client.h" + + static GdmSettings *settings = NULL; + static int gdm_return_code = 0; +--- gdm-2.30.0/gui/user-switch-applet/applet.c 2010-03-29 23:42:03.000000000 +0200 ++++ gdm-2.30.0/gui/user-switch-applet/applet.c 2010-04-04 04:16:41.000000000 +0200 +@@ -22,6 +22,7 @@ + + #include + #include ++#include + #include + + #include diff --git a/gnome-base/gdm/gdm-2.30.0.ebuild b/gnome-base/gdm/gdm-2.30.0.ebuild new file mode 100644 index 0000000..599b104 --- /dev/null +++ b/gnome-base/gdm/gdm-2.30.0.ebuild @@ -0,0 +1,197 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils pam gnome2 autotools + +DESCRIPTION="GNOME Display Manager" +HOMEPAGE="http://www.gnome.org/projects/gdm/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE_LIBC="elibc_glibc" +IUSE="accessibility +consolekit debug ipv6 gnome-keyring profile selinux tcpd test xinerama +xklavier $IUSE_LIBC" + +# Name of the tarball with gentoo specific files +GDM_EXTRA="${PN}-2.20.9-gentoo-files-r1" + +SRC_URI="${SRC_URI} + mirror://gentoo/${PN}-2.26-gentoo-patches.tar.bz2 + mirror://gentoo/${GDM_EXTRA}.tar.bz2" + +RDEPEND="app-text/iso-codes + >=dev-libs/dbus-glib-0.74 + >=dev-libs/glib-2.22.0 + >=gnome-base/libglade-2 + >=gnome-base/gconf-2.6.1 + >=gnome-base/gnome-panel-2 + >=media-libs/fontconfig-2.5.0 + >=media-libs/libcanberra-0.4[gtk] + >=sys-apps/devicekit-power-008 + virtual/pam + x11-apps/sessreg + >=x11-libs/gtk+-2.12.0 + x11-libs/libX11 + x11-libs/libXau + x11-libs/libXdmcp + x11-libs/libXi + >=x11-libs/pango-1.3 + consolekit? ( + sys-auth/consolekit + >=sys-apps/hal-0.5.12_rc1-r1[consolekit] ) + accessibility? ( x11-libs/libXevie ) + gnome-keyring? ( >=gnome-base/gnome-keyring-2.22[pam] ) + selinux? ( sys-libs/libselinux ) + tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) + xinerama? ( x11-libs/libXinerama ) + xklavier? ( >=x11-libs/libxklavier-4 ) + + !gnome-extra/fast-user-switch-applet" +DEPEND="${RDEPEND} + test? ( >=dev-libs/check-0.9.4 ) + xinerama? ( x11-proto/xineramaproto ) + sys-devel/gettext + x11-proto/inputproto + >=dev-util/intltool-0.40 + >=dev-util/pkgconfig-0.19 + >=app-text/scrollkeeper-0.1.4 + >=app-text/gnome-doc-utils-0.3.2" +PDEPEND=">=sys-auth/pambase-20090430[consolekit=,gnome-keyring=]" + +DOCS="AUTHORS ChangeLog NEWS README TODO" + +pkg_setup() { + G2CONF="${G2CONF} + --disable-schemas-install + --localstatedir=/var + --enable-console-helper + --enable-authentication-scheme=pam + --with-pam-prefix=/etc + SOUND_PROGRAM=/usr/bin/gdmplay + $(use_with accessibility xevie) + $(use_enable debug) + $(use_enable ipv6) + $(use_with consolekit console-kit) + $(use_enable profile profiling) + $(use_with selinux) + $(use_with tcpd tcp-wrappers) + --with-xdmcp + $(use_with xinerama) + $(use_enable xklavier libxklavier)" + + enewgroup gdm + enewuser gdm -1 -1 /var/lib/gdm gdm +} + +src_prepare() { + gnome2_src_prepare + + # remove unneeded linker directive for selinux (#41022) + epatch "${WORKDIR}/${PN}-2.26.1-selinux-remove-attr.patch" + + # Make it daemonize so that the boot process can continue (#236701) + epatch "${FILESDIR}/${PN}-2.29.92-fix-daemonize-regression.patch" + + ## Fix VT grab problem causing GDM to grab VT2 instead of 7 (#261339) + ## would destroy user switch funcionality see c19 on #261339 + #epatch "${WORKDIR}/${PN}-2.26.1-broken-VT-detection.patch" + + # Make custom session work, bug #. + epatch "${FILESDIR}/${PN}-2.29.92-custom-session.patch" + + # ssh-agent handling must be done at xinitrc.d + epatch "${WORKDIR}/${PN}-2.26.1-xinitrc-ssh-agent.patch" + + # Fix libxklavier automagic support + epatch "${WORKDIR}/${PN}-2.26.1-automagic-libxklavier-support.patch" + + # Fix 2 QA issues + epatch "${FILESDIR}/${PN}-2.30.0-include.patch" + + intltoolize --force --copy --automake || die "intltoolize failed" + eautoreconf +} + +src_install() { + gnome2_src_install + + local gentoodir="${WORKDIR}/${GDM_EXTRA}" + + # gdm-binary should be gdm to work with our init (#5598) + rm -f "${D}/usr/sbin/gdm" + dosym /usr/sbin/gdm-binary /usr/sbin/gdm + + # our x11's scripts point to /usr/bin/gdm + dosym /usr/sbin/gdm-binary /usr/bin/gdm + + # log, etc. + keepdir /var/log/gdm + keepdir /var/gdm + + fowners root:gdm /var/gdm + fperms 1770 /var/gdm + + # add a custom xsession .desktop by default (#44537) + exeinto /etc/X11/dm/Sessions + doexe "${gentoodir}/custom.desktop" || die "doexe 1 failed" + + # add xinitrc.d scripts + exeinto /etc/X11/xinit/xinitrc.d + doexe "${FILESDIR}/49-keychain" || die "doexe 2 failed" + doexe "${FILESDIR}/50-ssh-agent" || die "doexe 3 failed" + + # install XDG_DATA_DIRS gdm changes + echo 'XDG_DATA_DIRS="/usr/share/gdm"' > 99xdg-gdm + doenvd 99xdg-gdm || die "doenvd failed" + + # add a custom sound playing script (#248253) + dobin "${gentoodir}/gdmplay" + + # avoid file collision, bug #213118 + rm -f "${D}/usr/share/xsessions/gnome.desktop" + + # We replace the pam stuff by our own + rm -rf "${D}/etc/pam.d" + + use gnome-keyring && sed -i "s:#Keyring=::g" "${gentoodir}"/pam.d/* + + dopamd "${gentoodir}"/pam.d/* + dopamsecurity console.apps "${gentoodir}/security/console.apps/gdmsetup" +} + +pkg_postinst() { + gnome2_pkg_postinst + + ewarn + ewarn "This is an EXPERIMENTAL release, please bear with its bugs and" + ewarn "visit us on #gentoo-desktop if you have problems." + ewarn + + elog "To make GDM start at boot, edit /etc/conf.d/xdm" + elog "and then execute 'rc-update add xdm default'." + elog "If you already have GDM running, you will need to restart it." + + if use gnome-keyring; then + elog "For autologin to unlock your keyring, you need to set an empty" + elog "password on your keyring. Use app-crypt/seahorse for that." + fi + + if [ -f "/etc/X11/gdm/gdm.conf" ]; then + elog "You had /etc/X11/gdm/gdm.conf which is the old configuration" + elog "file. It has been moved to /etc/X11/gdm/gdm-pre-gnome-2.16" + mv /etc/X11/gdm/gdm.conf /etc/X11/gdm/gdm-pre-gnome-2.16 + fi +} + +pkg_postrm() { + gnome2_pkg_postrm + + if [[ "$(rc-config list default | grep xdm)" != "" ]] ; then + elog "To remove GDM from startup please execute" + elog "'rc-update del xdm default'" + fi +} -- 1.6.4.4