File gdm.spec of Package gdm.import4636

# spec file for package gdm
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

Name:           gdm
BuildRequires:  check-devel
BuildRequires:  fdupes
BuildRequires:  gconf2-devel
BuildRequires:  gnome-doc-utils-devel
BuildRequires:  gnome-panel-devel
BuildRequires:  gnome-patch-translation
BuildRequires:  intltool
BuildRequires:  iso-codes-devel
BuildRequires:  libcanberra-devel
BuildRequires:  libselinux-devel
BuildRequires:  libupower-glib-devel
BuildRequires:  libxklavier-devel
BuildRequires:  pam-devel
BuildRequires:  pwdutils
BuildRequires:  tcpd-devel
BuildRequires:  translation-update-upstream
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-server
BuildRequires:  xorg-x11-server-extra
BuildRequires:  zenity
License:        GPLv2+
Group:          System/GUI/GNOME
Version:        2.32.0
Release:        9.<RELEASE16>
Summary:        The GNOME Display Manager
Source:         %{name}-%{version}.tar.bz2
Source1:        gdm.pamd
Source2:        gdm-autologin.pamd
# PATCH-FEATURE-UPSTREAM gdm-plymouth.patch -- Get a nice transition from plymouth; taken from Fedora
Patch0:         gdm-plymouth.patch
# PATCH-FIX-UPSTREAM gdm-plymouth-X-nr.patch -- Patch on top of the previous patch (we keep it separate so it's easy to sync with Fedora) to use -nr when starting X
Patch1:         gdm-plymouth-X-nr.patch
# PATCH-FIX-UPSTREAM gdm-helper-directory.patch bgo582320 -- Add --with-gnome-settings-daemon-directory, --with-consolekit-directory, --with-at-spi-registryd-directory
Patch2:         gdm-helper-directory.patch
# PATCH-FIX-OPENSUSE gdm-is-not-unstable-unless.patch -- Make gdm think it's never running a development version unless SUSE_ENABLE_UNSTABLE_CHECK is set. This disables fatal warnings as well as abusive log
Patch3:         gdm-is-not-unstable-unless.patch
# PATCH-FIX-UPSTREAM gdm-vt-allocation-hack.patch bgo511168 -- Needed for user switching
Patch4:         gdm-vt-allocation-hack.patch
# PATCH-FIX-UPSTREAM gdm-focus-user-chooser.patch bgo#629310 bnc#652938 -- Correctly give the focus to the user chooser on startup
Patch5:         gdm-focus-user-chooser.patch
# PATCH-FIX-OPENSUSE gdm-desktop-session-env-pam.patch bnc427744 -- Sets a PAM environment variable to let the pam gnome-keyring module know which session is started
Patch6:         gdm-desktop-session-env-pam.patch
# PATCH-FIX-OPENSUSE gdm-suse-xsession.patch -- Use the /etc/X11/xdm/* scripts
Patch7:         gdm-suse-xsession.patch
# PATCH-FIX-OPENSUSE gdm-sysconfig-settings.patch bnc432360 -- Read autologin options from /etc/sysconfig/displaymanager
Patch8:         gdm-sysconfig-settings.patch
# PATCH-FEATURE-OPENSUSE gdm-passwordless-login.patch -- Support DISPLAYMANAGER_PASSWORD_LESS_LOGIN sysconfig option
Patch9:         gdm-passwordless-login.patch
# PATCH-NEEDS-REBASE gdm-domain-logon.patch -- Add UI to log in a specific domain (was: PATCH_FEATURE-SLED bnc#627575)
Patch10:        gdm-domain-logon.patch
# PATCH-FIX-UPSTREAM gdm-xdmcp-disconnect.patch -- Make XDMCP disconnect work, taken from git.
Patch11:        gdm-xdmcp-disconnect.patch
# PATCH-FIX-UPSTREAM gdm-greeter-greater-ui.patch bnc436431 bgo560508 -- Improve the layout of the greeter. Note: the patch contains a patched glade file *and* the result glade file (for reference only, in case we need to rebase the patch)
Patch15:        gdm-greeter-greater-ui.patch
# PATCH-FIX-UPSTREAM gdm-always-reflect-keyboard-layout.patch bnc438159 bgo561771 -- Make keyboard selector not neglect to apply the selected keyboard in some situations.
Patch18:        gdm-always-reflect-keyboard-layout.patch
# PATCH-FIX-UPSTREAM gdm-selecting-desktop-environment.patch bnc460591 -- Selecting the right desktop environment
Patch20:        gdm-selecting-desktop-environment.patch
# PATCH-FIX-OPENSUSE gdm-gconf-path.patch -- Fix gconf paths to be consistent with the ones used in openSUSE
Patch31:        gdm-gconf-path.patch
# PATCH-FIX-OPENSUSE gdm-default-wm.patch -- Use sysconfig to know to which desktop to use by default
Patch34:        gdm-default-wm.patch
# PATCH-FIX-OPENSUSE gdm-xauthlocalhostname.patch bgo555464 -- Set XAUTHLOCALHOSTNAME to localhost for local logins to avoid issues in the session in case the hostname changes
Patch35:        gdm-xauthlocalhostname.patch
# PATCH-FIX-UPSTREAM gdm-autologin-once.patch bgo587606 -- Make autologin work only once
Patch37:        gdm-autologin-once.patch
# PATCH-FIX-UPSTREAM gdm-look-at-runlevel.patch bnc540482 bgo599180 -- Look at the current runlevel before managing the display again, so we don't do this when shutting down or rebooting
Patch40:        gdm-look-at-runlevel.patch
# PATCH-FIX-UPSTREAM gdm-no-uri-handler.patch CVE-2011-1709 bnc#694858 -- Use /bin/true as URI handler to avoid security issues where a link could open firefox for the gdm user
Patch41:        gdm-no-uri-handler.patch
# PATCH-FIX-OPENSUSE gdm-selinux.patch -- Small changes to make it compile fine with SELinux
Patch60:        gdm-selinux.patch
# PATCH-FIX-UPSTREAM gdm-CVE-2011-0727-bnc679786.patch CVE-2011-0727 bnc#679687 -- Change to user before copying user files.
Patch61:        gdm-CVE-2011-0727-bnc679786.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
DocDir:         %{_defaultdocdir}
Provides:       gdm2 = %{version}
Obsoletes:      gdm2 < %{version}
Requires:       %{name}-branding
Requires:       ConsoleKit-x11
Requires:       gnome-session-core
Requires:       gnome-themes
Requires:       klogd
Requires:       xorg-x11-server-extra
# For groupadd, useradd, usermod
PreReq:         pwdutils
PreReq:         %insserv_prereq
Recommends:     %{name}-lang
Recommends:     gnome-power-manager
Recommends:     gnome-settings-daemon
Recommends:     iso-codes

This version of GDM, the GNOME display manager, is based on GTK2 and is
suited for the GNOME Desktop. GDM is a flexible X Window System
display manager that has many options, is usable for remote login, and
provides a good looking graphical interface.

%package branding-upstream
License:        GPLv2+
Summary:        The GNOME Display Manager
Group:          System/GUI/GNOME
Provides:       %{name}-branding = %{version}
Conflicts:      otherproviders(%{name}-branding)
Supplements:    packageand(%{name}:branding-upstream)
#BRAND: Provide two equal files - /usr/share/gdm/defaults.conf and
#BRAND: factory-defaults.conf with default configuration of gdm.
#BRAND: Branding package requires the package with the default theme.
#NOTE: We may want to create gdm-themes with upstream themes.

%description branding-upstream
This version of GDM, the GNOME display manager, is based on GTK2 and is
suited for the GNOME Desktop. GDM is a flexible X Window System
display manager that has many options, is usable for remote login, and
provides a good looking graphical interface.

%package -n gnome-applets-gdm
License:        GPLv2+
Summary:        Switch User Panel Applet
Group:          System/GUI/GNOME
Supplements:    packageand(%{name}:gnome-panel)
Provides:       fast-user-switch-applet = 2.22.0
Obsoletes:      fast-user-switch-applet <= 2.22.0

%description -n gnome-applets-gdm
This package provides the switch user panel applet, that uses GDM,
the GNOME display manager.

%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
#%patch10 -p1
%patch11 -p1
%patch15 -p1
%patch18 -p1
%patch20 -p1
%patch31 -p1
%patch34 -p1
%patch35 -p0
%patch37 -p1
%patch40 -p1
%patch41 -p1
%patch61 -p1

libtoolize -f -i
autoreconf -f -i
	--libexecdir=%{_prefix}/lib/gdm \
	--localstatedir=%{_localstatedir} \
	--with-at-spi-registryd-directory=%{_libexecdir}/at-spi \
	--with-gnome-settings-daemon-directory=%{_libexecdir}/gnome-settings-daemon \
	--with-consolekit-directory=%{_libexecdir}/ConsoleKit \
        --with-polkit-gnome-directory=%{_libexecdir}/polkit-gnome \
	--with-selinux \
%__make %{?jobs:-j%jobs}

%if 0%{?suse_version} <= 1120
%{__rm} %{buildroot}%{_datadir}/locale/en@shaw/LC_MESSAGES/*
# Remove wrapper, it is not needed.
mv $RPM_BUILD_ROOT%{_sbindir}/gdm-binary $RPM_BUILD_ROOT%{_sbindir}/gdm
# Install PAM files.
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
cp %{S:1} $RPM_BUILD_ROOT/etc/pam.d/gdm
cp %{S:2} $RPM_BUILD_ROOT/etc/pam.d/gdm-autologin
# Install PostLogin script.
mv $RPM_BUILD_ROOT%{_sysconfdir}/gdm/PostLogin/Default.sample $RPM_BUILD_ROOT%{_sysconfdir}/gdm/PostLogin/Default
mkdir -p $RPM_BUILD_ROOT{_localstatedir}/log/gdm
mkdir -p $RPM_BUILD_ROOT{_localstatedir}/run/gdm
%find_lang %{name} %{?no_lang_C}
mkdir -p $RPM_BUILD_ROOT%{_bindir}
ln -s ../sbin/gdm $RPM_BUILD_ROOT%{_bindir}/gdm


%pre -f %{name}.schemas_pre
/usr/sbin/groupadd -r gdm 2> /dev/null || :
/usr/sbin/useradd -r -o -g gdm -s /bin/false \
-c "Gnome Display Manager daemon" -d /var/lib/gdm gdm 2> /dev/null || :
/usr/sbin/usermod -g gdm -G gdm -s /bin/false gdm 2> /dev/null
# Fix incorrect interpretation of DISPLAYMANAGER_PASSWORD_LESS_LOGIN (#307566).
# Last done in SLED10&10.1, first fixed in 10.3.
# Can be removed after SLES12:
if test -f sbin/conf.d/SuSEconfig.gdm && grep -q gdm-autologin sbin/conf.d/SuSEconfig.gdm ; then
    if grep -q '^DISPLAYMANAGER_PASSWORD_LESS_LOGIN="no"' etc/sysconfig/displaymanager ; then
	sed 's/^\(auth[[:space:]][[:space:]]*\)include[[:space:]]\([[:space:]]*\)common-auth/\1required\' <etc/pam.d/gdm-autologin >etc/pam.d/
	if cmp -s etc/pam.d/gdm-autologin etc/pam.d/ ; then
	    rm etc/pam.d/
	    mv etc/pam.d/ etc/pam.d/gdm-autologin
# Fix how DISPLAYMANAGER_PASSWORD_LESS_LOGIN is used. Before 11.4,
# /etc/pam.d/gdm was changed to use pam_permit. We don't want this anymore.
if test -f /sbin/conf.d/SuSEconfig.gdm; then
    grep -q /etc/pam.d/gdm
    if test $? -eq 0; then
        # We'll just use the file from the new package
        mv /etc/pam.d/gdm /etc/pam.d/gdm.rpmold


%preun -f %{name}.schemas_preun

%posttrans -f %{name}.schemas_posttrans


%files -f %{name}.schemas_list
%dir %{_datadir}/gnome/
%dir %{_datadir}/gnome/help/
%dir %{_datadir}/gnome/help/%{name}/
%doc %{_datadir}/gnome/help/%{name}/C/
%dir %{_datadir}/omf/
%dir %{_datadir}/omf/%{name}/
%doc %{_datadir}/omf/%{name}/%{name}-C.omf
%dir %config %{_sysconfdir}/gdm
%config %{_sysconfdir}/gdm/[IPXl]*
%dir %{_libexecdir}/gdm
%exclude %{_libexecdir}/gdm/gdm-user-switch-applet
%attr(750,gdm,gdm) %dir %{_localstatedir}/lib/gdm
%ghost %attr(751,gdm,gdm) %dir %{_localstatedir}/run/gdm
%attr(750,gdm,gdm) %dir %{_localstatedir}/log/gdm
%attr(750,gdm,gdm) %dir %{_localstatedir}/lib/gdm/.gconf.mandatory
%attr(640,gdm,gdm) %{_localstatedir}/lib/gdm/.gconf.mandatory/%gconf-tree.xml
%attr(640,gdm,gdm) %{_localstatedir}/lib/gdm/.gconf.path
%attr(750,gdm,gdm) %dir %{_localstatedir}/lib/gdm/.local
%attr(750,gdm,gdm) %dir %{_localstatedir}/lib/gdm/.local/share
%attr(750,gdm,gdm) %dir %{_localstatedir}/lib/gdm/.local/share/applications
%attr(750,gdm,gdm) %{_localstatedir}/lib/gdm/.local/share/applications/mimeapps.list
%attr(750,gdm,gdm) %{_localstatedir}/lib/gdm/.local/share/applications/mime-dummy-handler.desktop
%dir %{_localstatedir}/cache/gdm
%config /etc/pam.d/*
%config %{_sysconfdir}/dbus-1/system.d/gdm.conf

%files branding-upstream
%config(noreplace) %{_sysconfdir}/gdm/custom.conf

%files -n gnome-applets-gdm

%files lang -f %{name}.lang

openSUSE Build Service is sponsored by