--- /dev/null
+From 09153c6825e5b5157fba7600cefabb762d887891 Mon Sep 17 00:00:00 2001
+From: Robert Ancell <robert.ancell@ubuntu.com>
+Date: Thu, 6 Aug 2009 15:57:15 +0100
+Subject: [PATCH 1/2] Add PolicyKit support to GDM settings D-Bus interface
+Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/395299
+Upstream: http://bugzilla.gnome.org/show_bug.cgi?id=587750
+
+--- gdm-3.1.90/data/Makefile.am.wiget 2011-08-31 02:04:37.000000000 +0200
++++ gdm-3.1.90/data/Makefile.am 2011-09-05 21:46:13.070224232 +0200
+@@ -45,6 +45,8 @@ schemasdir = $(pkgdatadir)
+ schemas_in_files = gdm.schemas.in
+ schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
+
++@INTLTOOL_POLICY_RULE@
++
+ gdm.schemas.in: $(srcdir)/gdm.schemas.in.in
+ sed -e 's,[@]GDMPREFETCHCMD[@],$(GDMPREFETCHCMD),g' \
+ -e 's,[@]GDM_CUSTOM_CONF[@],$(GDM_CUSTOM_CONF),g' \
+@@ -84,11 +86,18 @@ localealias_DATA = locale.alias
+ sessiondir = $(datadir)/gnome-session/sessions
+ session_DATA = gdm-fallback.session gdm-shell.session
+
++polkitdir = $(datadir)/polkit-1/actions
++polkit_in_files = gdm.policy.in
++polkit_DATA = $(polkit_in_files:.policy.in=.policy)
++check:
++ $(POLKIT_POLICY_FILE_VALIDATE) $(polkit_DATA)
++
+ EXTRA_DIST = \
+ $(schemas_in_files) \
+ $(schemas_DATA) \
+ $(dbusconf_in_files) \
+ $(localealias_DATA) \
++ $(polkit_in_files) \
+ gdm.schemas.in.in \
+ gdm.conf-custom.in \
+ Xsession.in \
+@@ -118,6 +127,7 @@ CLEANFILES = \
+
+ DISTCLEANFILES = \
+ $(dbusconf_DATA) \
++ $(polkit_DATA) \
+ gdm-shell.session \
+ gdm.schemas \
+ dconf-override-db \
+--- gdm-3.1.90/data/gdm.conf.in.wiget 2011-08-09 22:08:42.000000000 +0200
++++ gdm-3.1.90/data/gdm.conf.in 2011-09-05 21:44:39.831640332 +0200
+@@ -34,8 +34,6 @@
+ <deny send_destination="org.gnome.DisplayManager"
+ send_interface="org.gnome.DisplayManager.LocalDisplayFactory"/>
+ <deny send_destination="org.gnome.DisplayManager"
+- send_interface="org.gnome.DisplayManager.Settings"/>
+- <deny send_destination="org.gnome.DisplayManager"
+ send_interface="org.gnome.DisplayManager.Slave"/>
+ <deny send_destination="org.gnome.DisplayManager"
+ send_interface="org.gnome.DisplayManager.Session"/>
+@@ -44,6 +42,10 @@
+ <allow send_destination="org.gnome.DisplayManager"
+ send_interface="org.freedesktop.DBus.Introspectable"/>
+
++ <!-- Controlled by PolicyKit -->
++ <allow send_destination="org.gnome.DisplayManager"
++ send_interface="org.gnome.DisplayManager.Settings"/>
++
+ <allow send_destination="org.gnome.DisplayManager"
+ send_interface="org.gnome.DisplayManager.Display"
+ send_member="GetId"/>
+--- gdm-3.1.90/data/gdm.policy.in.wiget 2011-09-05 21:44:39.831640332 +0200
++++ gdm-3.1.90/data/gdm.policy.in 2011-09-05 21:44:39.831640332 +0200
+@@ -0,0 +1,18 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE policyconfig PUBLIC
++ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
++ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
++<policyconfig>
++ <vendor>The GNOME Project</vendor>
++ <vendor_url>http://www.gnome.org/</vendor_url>
++ <icon_name>gdm</icon_name>
++
++ <action id="org.gnome.displaymanager.settings.write">
++ <description>Change login screen configuration</description>
++ <message>Privileges are required to change the login screen configuration.</message>
++ <defaults>
++ <allow_inactive>no</allow_inactive>
++ <allow_active>auth_admin_keep</allow_active>
++ </defaults>
++ </action>
++</policyconfig>
+--- gdm-3.1.90/common/Makefile.am.wiget 2011-08-09 22:08:42.000000000 +0200
++++ gdm-3.1.90/common/Makefile.am 2011-09-05 21:44:39.831640332 +0200
+@@ -99,6 +99,7 @@ libgdmcommon_la_CFLAGS = \
+ $(NULL)
+
+ libgdmcommon_la_LIBADD = \
++ $(COMMON_LIBS) \
+ $(NULL)
+
+ libgdmcommon_la_LDFLAGS = \
+--- gdm-3.1.90/common/gdm-settings.c.wiget 2011-08-09 22:08:42.000000000 +0200
++++ gdm-3.1.90/common/gdm-settings.c 2011-09-05 21:44:39.831640332 +0200
+@@ -36,6 +36,7 @@
+ #define DBUS_API_SUBJECT_TO_CHANGE
+ #include <dbus/dbus-glib.h>
+ #include <dbus/dbus-glib-lowlevel.h>
++#include <polkit/polkit.h>
+
+ #include "gdm-settings.h"
+ #include "gdm-settings-glue.h"
+@@ -108,6 +109,90 @@ gdm_settings_get_value (GdmSettings *set
+ return res;
+ }
+
++static void
++unlock_auth_cb (PolkitAuthority *authority,
++ GAsyncResult *result,
++ DBusGMethodInvocation *context)
++{
++ PolkitAuthorizationResult *auth_result;
++ GError *error = NULL;
++
++ auth_result = polkit_authority_check_authorization_finish (authority, result, &error);
++
++ if (!auth_result)
++ dbus_g_method_return_error (context, error);
++ else {
++ dbus_g_method_return (context,
++ polkit_authorization_result_get_is_authorized (auth_result));
++ }
++
++ if (auth_result)
++ g_object_unref (auth_result);
++ if (error)
++ g_error_free (error);
++}
++
++gboolean
++gdm_settings_unlock (GdmSettings *settings,
++ DBusGMethodInvocation *context)
++{
++ polkit_authority_check_authorization (polkit_authority_get (),
++ polkit_system_bus_name_new (dbus_g_method_get_sender (context)),
++ "org.gnome.displaymanager.settings.write",
++ NULL,
++ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
++ NULL,
++ (GAsyncReadyCallback) unlock_auth_cb,
++ context);
++}
++
++typedef struct
++{
++ GdmSettings *settings;
++ DBusGMethodInvocation *context;
++ gchar *key, *value;
++} SetValueData;
++
++static void
++set_value_auth_cb (PolkitAuthority *authority,
++ GAsyncResult *result,
++ SetValueData *data)
++{
++ PolkitAuthorizationResult *auth_result;
++ GError *error = NULL;
++
++ auth_result = polkit_authority_check_authorization_finish (authority, result, &error);
++
++ if (!auth_result)
++ dbus_g_method_return_error (data->context, error);
++ else {
++ if (polkit_authorization_result_get_is_authorized (auth_result)) {
++ gboolean result;
++
++ result = gdm_settings_backend_set_value (data->settings->priv->backend,
++ data->key,
++ data->value,
++ &error);
++ if (result)
++ dbus_g_method_return (data->context);
++ else
++ dbus_g_method_return_error (data->context, error);
++ }
++ else {
++ error = g_error_new (DBUS_GERROR_REMOTE_EXCEPTION, 0, "Not authorized");
++ dbus_g_method_return_error (data->context, error);
++ }
++ }
++
++ if (auth_result)
++ g_object_unref (auth_result);
++ if (error)
++ g_error_free (error);
++ g_free (data->key);
++ g_free (data->value);
++ g_free (data);
++}
++
+ /*
+ dbus-send --system --print-reply --dest=org.gnome.DisplayManager /org/gnome/DisplayManager/Settings org.gnome.DisplayManager.Settings.SetValue string:"xdmcp/Enable" string:"false"
+ */
+@@ -116,26 +201,30 @@ gboolean
+ gdm_settings_set_value (GdmSettings *settings,
+ const char *key,
+ const char *value,
+- GError **error)
++ DBusGMethodInvocation *context)
+ {
+- GError *local_error;
+- gboolean res;
+-
++ SetValueData *data;
++
+ g_return_val_if_fail (GDM_IS_SETTINGS (settings), FALSE);
+ g_return_val_if_fail (key != NULL, FALSE);
+
+ g_debug ("Setting value %s", key);
+-
+- local_error = NULL;
+- res = gdm_settings_backend_set_value (settings->priv->backend,
+- key,
+- value,
+- &local_error);
+- if (! res) {
+- g_propagate_error (error, local_error);
+- }
+-
+- return res;
++
++ /* Authorize with PolicyKit */
++ data = g_malloc (sizeof(SetValueData));
++ data->settings = settings;
++ data->context = context;
++ data->key = g_strdup(key);
++ data->value = g_strdup(value);
++ polkit_authority_check_authorization (polkit_authority_get (),
++ polkit_system_bus_name_new (dbus_g_method_get_sender (context)),
++ "org.gnome.displaymanager.settings.write",
++ NULL,
++ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
++ NULL,
++ (GAsyncReadyCallback) set_value_auth_cb,
++ data);
++ return TRUE;
+ }
+
+ static gboolean
+--- gdm-3.1.90/common/gdm-settings.xml.wiget 2011-04-25 17:55:04.000000000 +0200
++++ gdm-3.1.90/common/gdm-settings.xml 2011-09-05 21:44:39.831640332 +0200
+@@ -5,7 +5,12 @@
+ <arg name="key" direction="in" type="s"/>
+ <arg name="value" direction="out" type="s"/>
+ </method>
++ <method name="Unlock">
++ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
++ <arg name="is_unlocked" direction="out" type="b"/>
++ </method>
+ <method name="SetValue">
++ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="key" direction="in" type="s"/>
+ <arg name="value" direction="in" type="s"/>
+ </method>
+--- gdm-3.1.90/common/gdm-settings.h.wiget 2011-04-25 17:55:04.000000000 +0200
++++ gdm-3.1.90/common/gdm-settings.h 2011-09-05 21:44:39.831640332 +0200
+@@ -23,6 +23,7 @@
+ #define __GDM_SETTINGS_H
+
+ #include <glib-object.h>
++#include <dbus/dbus-glib.h>
+
+ G_BEGIN_DECLS
+
+@@ -70,10 +71,12 @@ gboolean gdm_settings_get_val
+ const char *key,
+ char **value,
+ GError **error);
++gboolean gdm_settings_unlock (GdmSettings *settings,
++ DBusGMethodInvocation *context);
+ gboolean gdm_settings_set_value (GdmSettings *settings,
+ const char *key,
+ const char *value,
+- GError **error);
++ DBusGMethodInvocation *context);
+
+ G_END_DECLS
+
+--- gdm-3.1.90/configure.ac.wiget 2011-08-30 20:24:43.000000000 +0200
++++ gdm-3.1.90/configure.ac 2011-09-05 21:45:16.999745584 +0200
+@@ -56,6 +56,7 @@ dnl - Dependencies
+ dnl ---------------------------------------------------------------------------
+
+ DBUS_GLIB_REQUIRED_VERSION=0.74
++POLKIT_GOBJECT_REQUIRED_VERSION=0.92
+ GLIB_REQUIRED_VERSION=2.29.3
+ GTK_REQUIRED_VERSION=2.91.1
+ PANGO_REQUIRED_VERSION=1.3.0
+@@ -78,6 +79,7 @@ AC_SUBST(GTHREAD_LIBS)
+
+ PKG_CHECK_MODULES(COMMON,
+ dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
++ polkit-gobject-1 >= $POLKIT_GOBJECT_REQUIRED_VERSION
+ gobject-2.0 >= $GLIB_REQUIRED_VERSION
+ gio-2.0 >= $GLIB_REQUIRED_VERSION
+ )
+@@ -86,6 +88,7 @@ AC_SUBST(COMMON_LIBS)
+
+ PKG_CHECK_MODULES(DAEMON,
+ dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
++ polkit-gobject-1 >= $POLKIT_GOBJECT_REQUIRED_VERSION
+ gobject-2.0 >= $GLIB_REQUIRED_VERSION
+ gio-2.0 >= $GLIB_REQUIRED_VERSION
+ accountsservice >= $ACCOUNTS_SERVICE_REQUIRED_VERSION
--- /dev/null
+#
+# TODO:
+# - s=/dev/null=/home/services/xdm= in %%trigger for graceful upgrade from xdm/kdm/gdm 2.2
+# - check /etc/pam.d/gdm-autologin
+#
+# Conditiional build:
+%bcond_without selinux # without selinux
+
+Summary: GNOME Display Manager
+Summary(es.UTF-8): Administrador de Entrada del GNOME
+Summary(ja.UTF-8): GNOME ディスプレイマネージャ
+Summary(pl.UTF-8): gdm - zarządca ekranów GNOME
+Summary(pt_BR.UTF-8): Gerenciador de Entrada do GNOME
+Summary(ru.UTF-8): Дисплейный менеджер GNOME
+Summary(uk.UTF-8): Дисплейний менеджер GNOME
+Name: gdm
+Version: 3.2.1.1
+Release: 13
+Epoch: 2
+License: GPL/LGPL
+Group: X11/Applications
+Source0: http://ftp.gnome.org/pub/GNOME/sources/gdm/3.2/%{name}-%{version}.tar.xz
+# Source0-md5: df3f38061066f5e0816676b4eef7854a
+Source1: %{name}.pamd
+Source2: %{name}.init
+Source3: %{name}-pld-logo.png
+Source4: %{name}-autologin.pamd
+Source5: %{name}-custom.desktop
+Source6: %{name}-default.desktop
+Source7: %{name}.upstart
+Source9: %{name}.tmpfiles
+Patch0: %{name}-xdmcp.patch
+Patch1: %{name}-polkit.patch
+Patch2: %{name}-xsession.patch
+Patch3: %{name}-defaults.patch
+Patch4: shell-check.patch
+URL: http://www.gnome.org/projects/gdm/
+BuildRequires: GConf2-devel >= 2.32.0
+BuildRequires: accountsservice-devel >= 0.6.12
+BuildRequires: attr-devel
+BuildRequires: audit-libs-devel
+BuildRequires: autoconf >= 2.60
+BuildRequires: automake >= 1:1.11
+BuildRequires: check >= 0.9.4
+BuildRequires: dbus-glib-devel >= 0.74
+BuildRequires: docbook-dtd412-xml
+BuildRequires: fontconfig-devel >= 2.5.0
+BuildRequires: gettext-devel
+BuildRequires: glib2-devel >= 1:2.28.0
+BuildRequires: gnome-doc-utils
+BuildRequires: gtk+3-devel >= 3.0.0
+BuildRequires: intltool >= 0.40.0
+BuildRequires: iso-codes
+BuildRequires: libcanberra-gtk3-devel >= 0.4
+%{?with_selinux:BuildRequires: libselinux-devel}
+BuildRequires: libtool
+BuildRequires: libwrap-devel
+BuildRequires: libxklavier-devel >= 4.0-2
+BuildRequires: nss-devel >= 3.11.1
+BuildRequires: pam-devel
+BuildRequires: pango-devel >= 1.3.0
+BuildRequires: perl-modules
+BuildRequires: pkgconfig
+BuildRequires: polkit-devel >= 0.93
+BuildRequires: rpmbuild(find_lang) >= 1.23
+BuildRequires: rpmbuild(macros) >= 1.627
+BuildRequires: scrollkeeper >= 0.1.4
+BuildRequires: tar >= 1:1.22
+BuildRequires: upower-devel >= 0.9.0
+BuildRequires: xorg-lib-libX11-devel
+BuildRequires: xorg-lib-libXau-devel
+BuildRequires: xorg-lib-libXdmcp-devel
+BuildRequires: xorg-lib-libXft-devel
+BuildRequires: xorg-lib-libXi-devel
+BuildRequires: xorg-lib-libXinerama-devel
+BuildRequires: xorg-lib-libXrandr-devel
+BuildRequires: xz
+Requires(post,postun): /usr/bin/scrollkeeper-update
+Requires(post,postun): gtk-update-icon-cache
+Requires(post,preun): GConf2
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires(posttrans): dconf
+Requires: %{name}-libs = %{epoch}:%{version}-%{release}
+Requires: /usr/bin/X
+Requires: ConsoleKit-x11 >= 0.4.1
+Requires: accountsservice >= 0.6.12
+Requires: dbus-x11
+Requires: gdm-wm >= 3.2.1
+Requires: gnome-session >= 2.91.91.1
+Requires: gnome-settings-daemon >= 2.91.91
+Requires: hicolor-icon-theme
+Requires: pam >= 0.99.7.1
+Requires: polkit-gnome >= 0.93
+Requires: systemd-units >= 37-0.10
+Requires: which
+Requires: xinitrc-ng >= 1.0
+Requires: xorg-app-sessreg
+Requires: xorg-app-xmodmap
+Suggests: pam-pam_gnome_keyring
+Suggests: zenity
+Provides: XDM
+Provides: group(xdm)
+Provides: user(xdm)
+Obsoletes: gdm-Xnest
+Obsoletes: gdm-systemd
+Obsoletes: gdm-user-switch-applet
+Obsoletes: gnome-applet-fast-user-switch
+Conflicts: gdkxft
+# sr@Latn vs. sr@latin
+Conflicts: glibc-misc < 6:2.7
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Gdm (the GNOME Display Manager) is a highly configurable
+reimplementation of xdm, the X Display Manager. Gdm allows you to log
+into your system with the X Window System running and supports running
+several different X sessions on your local machine at the same time.
+
+%description -l es.UTF-8
+Administrador de Entrada del GNOME.
+
+%description -l ja.UTF-8
+Gdm (the GNOME Display Manager) は、高度に設定可能な xdm X Display Manager
+の再実装版です。 Gdm を使うと、 X Window System が動いているあなたの
+システムにいろいろなセッションを選択してログインすることができます。
+
+このバージョンの Gdm では、各種言語や、XIM を選択することも可能です。
+
+%description -l pl.UTF-8
+Gdm jest wysokokonfigurowalną reimplementacją xdma. Gdm pozwala
+logować się do systemu z poziomu X11 i wspiera jednoczesną pracę kilku
+różnych sesji X na lokalnej maszynie.
+
+%description -l pt_BR.UTF-8
+Gerenciador de Entrada do GNOME.
+
+%description -l ru.UTF-8
+GDM (GNOME Display Manager) - это реимплементация xdm (X Display
+Manager). GDM позволяет вам входить в систему, на которой запущено X
+Window и поддерживает работу нескольуих разных X сеансов одновременно.
+
+%description -l uk.UTF-8
+GDM (GNOME Display Manager) - це реімплементація xdm (X Display
+Manager). GDM дозволяє вам входити в систему, на якій запущено X
+Window та підтримує роботу кількох різних X сеансів одночасно.
+
+%package libs
+Summary: GDM libraries
+Summary(pl.UTF-8): Biblioteki GDM
+Group: Libraries
+
+%description libs
+GDM libraries.
+
+%description libs -l pl.UTF-8
+Biblioteki GDM.
+
+%package devel
+Summary: Header files for GDM
+Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja
+Group: X11/Development/Libraries
+Requires: %{name}-libs = %{epoch}:%{version}-%{release}
+
+%description devel
+This package contains the files necessary to develop applications
+using GDM's libraries.
+
+%description devel -l pl.UTF-8
+Pakiet zawiera pliki potrzebne do rozwoju aplikacji używających
+bibliotek programu GDM.
+
+%package static
+Summary: Static libraries for GDM
+Summary(pl.UTF-8): Biblioteki statyczne dla GDM
+Group: X11/Development/Libraries
+Requires: %{name}-devel = %{epoch}:%{version}-%{release}
+
+%description static
+This package contains static libraries for GDM.
+
+%description static -l pl.UTF-8
+Pakiet zawiera statyczne biblioteki GDM.
+
+%package init
+Summary: Init script for GDM
+Summary(pl.UTF-8): Skrypt init dla GDM-a
+Group: X11/Applications
+Requires(post,preun): /sbin/chkconfig
+Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: open
+Requires: rc-scripts >= 0.4.3.0
+
+%description init
+Init script for GDM.
+
+%description init -l pl.UTF-8
+Skrypt init dla GDM-a.
+
+%package upstart
+Summary: Upstart job description for GDM
+Summary(pl.UTF-8): Opis zadania Upstart dla GDM
+Group: Daemons
+Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: upstart >= 0.6
+
+%description upstart
+Upstart job description for GDM.
+
+%description upstart -l pl.UTF-8
+Opis zadania Upstart dla GDM.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+
+%build
+touch data/gdm.schemas.in.in
+%{__libtoolize}
+%{__glib_gettextize}
+%{__intltoolize}
+%{__aclocal}
+%{__autoheader}
+%{__autoconf}
+%{__automake}
+%configure \
+ --disable-console-helper \
+ --disable-scrollkeeper \
+ --disable-silent-rules \
+ --with-console-kit \
+ --enable-authentication-scheme=pam \
+ --with-pam-prefix=/etc \
+ --with-tcp-wrappers=yes \
+ --with%{!?with_selinux:out}-selinux \
+ --with-xdmcp=yes \
+ --with-xinerama=yes \
+ --with-user=xdm \
+ --with-group=xdm
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,pam.d,security,init} \
+ $RPM_BUILD_ROOT{/home/services/xdm,/var/log/gdm} \
+ $RPM_BUILD_ROOT{%{_datadir}/xsessions,%{systemdunitdir}} \
+ $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ PAM_PREFIX=/etc
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/gdm
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/gdm-password
+cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/pam.d/gdm-autologin
+install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/gdm
+cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/init/%{name}.conf
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_pixmapsdir}
+ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/gdm.service
+install %{SOURCE9} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
+
+touch $RPM_BUILD_ROOT/etc/security/blacklist.gdm
+
+%find_lang %{name} --with-gnome --with-omf --all-name
+
+# allow executing ~/.Xclients and ~/.xsession
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/xsessions/custom.desktop
+cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_datadir}/xsessions/default.desktop
+
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/gdm/simple-greeter/extensions/*.{a,la} \
+ $RPM_BUILD_ROOT%{_libdir}/*.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%posttrans
+umask 022
+/usr/bin/dconf update
+
+%pre
+%groupadd -g 55 -r -f xdm
+%useradd -u 55 -r -d /home/services/xdm -s /bin/false -c "X Display Manager" -g xdm xdm
+
+%post
+%glib_compile_schemas
+%gconf_schema_install gdm-simple-greeter.schemas
+%scrollkeeper_update_post
+%update_icon_cache hicolor
+%systemd_reload
+
+%preun
+%gconf_schema_uninstall gdm-simple-greeter.schemas
+
+%postun
+%scrollkeeper_update_postun
+%update_icon_cache hicolor
+%systemd_reload
+
+if [ "$1" = "0" ]; then
+ %glib_compile_schemas
+ %userremove xdm
+ %groupremove xdm
+fi
+
+%triggerpostun -- %{name} < 2:3.2.1.1-10
+if [ -f /etc/X11/gdm/gdm.conf-custom.rpmsave ]; then
+ mv /etc/X11/gdm/gdm.conf-custom.rpmsave /etc/gdm/custom.conf
+fi
+
+%post init
+/sbin/chkconfig --add gdm
+# -n skips restarting as it would otherise terminate all sessions opened from gdm!
+%service -n gdm restart
+
+%preun init
+if [ "$1" = "0" ]; then
+ %service gdm stop
+ /sbin/chkconfig --del gdm
+fi
+
+%post libs -p /sbin/ldconfig
+%postun libs -p /sbin/ldconfig
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog NEWS README TODO
+%attr(755,root,root) %{_sbindir}/gdm
+%attr(755,root,root) %{_sbindir}/gdm-binary
+%attr(755,root,root) %{_bindir}/gdm-screenshot
+%attr(755,root,root) %{_bindir}/gdmflexiserver
+%dir %{_libdir}/gdm
+%dir %{_libdir}/gdm/simple-greeter
+%dir %{_libdir}/gdm/simple-greeter/extensions
+%attr(755,root,root) %{_libdir}/gdm/simple-greeter/extensions/libfingerprint.so
+%attr(755,root,root) %{_libdir}/gdm/simple-greeter/extensions/libpassword.so
+%attr(755,root,root) %{_libdir}/gdm/simple-greeter/extensions/libsmartcard.so
+%attr(755,root,root) %{_libexecdir}/gdm-crash-logger
+%attr(755,root,root) %{_libexecdir}/gdm-factory-slave
+%attr(755,root,root) %{_libexecdir}/gdm-host-chooser
+%attr(755,root,root) %{_libexecdir}/gdm-product-slave
+%attr(755,root,root) %{_libexecdir}/gdm-session-worker
+%attr(755,root,root) %{_libexecdir}/gdm-simple-chooser
+%attr(755,root,root) %{_libexecdir}/gdm-simple-greeter
+%attr(755,root,root) %{_libexecdir}/gdm-simple-slave
+%attr(755,root,root) %{_libexecdir}/gdm-xdmcp-chooser-slave
+%attr(755,root,root) %{_libexecdir}/gdm-smartcard-worker
+%dir %{_sysconfdir}/gdm
+%dir %{_sysconfdir}/gdm/Init
+%attr(755,root,root) %config %{_sysconfdir}/gdm/Init/Default
+%attr(755,root,root) %config %{_sysconfdir}/gdm/PreSession
+%attr(755,root,root) %config %{_sysconfdir}/gdm/PostSession
+%attr(755,root,root) %config %{_sysconfdir}/gdm/Xsession
+%dir %{_sysconfdir}/gdm/PostLogin
+%config %{_sysconfdir}/gdm/PostLogin/Default.sample
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gdm/custom.conf
+%{_sysconfdir}/gconf/schemas/gdm-simple-greeter.schemas
+%config(noreplace) %verify(not md5 mtime size) /etc/dbus-1/system.d/*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/gdm*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.gdm
+%{_sysconfdir}/dconf/db/gdm.d
+%{_sysconfdir}/dconf/profile/gdm
+%attr(1755,root,xdm) %dir /var/cache/gdm
+%attr(1770,root,xdm) %dir /var/gdm
+%attr(1770,root,xdm) %dir /var/lib/gdm
+%dir /var/lib/gdm/.config
+%attr(755,xdm,xdm) %dir /var/lib/gdm/.config/dconf
+%attr(1750,root,xdm) %dir /var/lib/gdm/.gconf.mandatory
+%attr(1640,root,xdm) /var/lib/gdm/.gconf.mandatory/*.xml
+%attr(644,root,xdm) /var/lib/gdm/.gconf.path
+%attr(755,xdm,xdm) /var/lib/gdm/.local
+%attr(750,xdm,xdm) %dir /var/log/gdm
+%attr(711,root,xdm) %dir /var/run/gdm
+%attr(755,xdm,xdm) %dir /var/run/gdm/greeter
+%attr(750,xdm,xdm) /home/services/xdm
+/usr/lib/tmpfiles.d/%{name}.conf
+%{_pixmapsdir}/*
+%{_datadir}/gdm
+%{_datadir}/polkit-1/actions/gdm.policy
+%{_datadir}/gnome-session/sessions/gdm-fallback.session
+%{_datadir}/gnome-session/sessions/gdm-shell.session
+%{_datadir}/xsessions/custom.desktop
+%{_datadir}/xsessions/default.desktop
+%{_iconsdir}/hicolor/*/apps/*.png
+%{_datadir}/glib-2.0/schemas/org.gnome.login-screen.gschema.xml
+%{systemdunitdir}/gdm.service
+
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libgdmgreeter.so.1.0.0
+%attr(755,root,root) %ghost %{_libdir}/libgdmgreeter.so.1
+%attr(755,root,root) %{_libdir}/libgdmsimplegreeter.so.1.0.0
+%attr(755,root,root) %ghost %{_libdir}/libgdmsimplegreeter.so.1
+%{_libdir}/girepository-1.0/GdmGreeter-1.0.typelib
+
+%files devel
+%defattr(644,root,root,755)
+%dir %{_includedir}/gdm
+%dir %{_includedir}/gdm/greeter
+%{_includedir}/gdm/greeter/gdm-greeter-client.h
+%{_includedir}/gdm/greeter/gdm-greeter-sessions.h
+%dir %{_includedir}/gdm/simple-greeter
+%{_includedir}/gdm/simple-greeter/gdm-login-extension.h
+%{_pkgconfigdir}/gdmgreeter.pc
+%{_pkgconfigdir}/gdmsimplegreeter.pc
+%{_libdir}/libgdmgreeter.so
+%{_libdir}/libgdmsimplegreeter.so
+%{_datadir}/gir-1.0/GdmGreeter-1.0.gir
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libgdmgreeter.a
+%{_libdir}/libgdmsimplegreeter.a
+
+%files init
+%defattr(644,root,root,755)
+%attr(754,root,root) /etc/rc.d/init.d/gdm
+
+%files upstart
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) /etc/init/%{name}.conf