File lxdm-gtk3.spec of Package lxdm-gtk3

# spec file for package lxdm
# Copyright (c) 2017 SUSE LINUX 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

%define prefer_gtk2 0
%define pkg_name    lxdm
%define pkg_suffix  gtk3

%define _dminitdir %{_libexecdir}/X11/displaymanagers
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run

Name:           %{pkg_name}-%{pkg_suffix}
Version:        0.5.3
Release:        0
Summary:        LXDE Display Manager
License:        GPL-2.0 and LGPL-2.0
Group:          System/GUI/LXDE
Source1:        README.SUSE
Source2:        lxdm.pamd
Source3:        lxdm-config.desktop
Source4:        config-users.png
Source5:        lxdm
Source6:        sysconfig.lxdm
# PATCH-FEATURE-OPENSUSE lxdm-0.5.1-use-sysconfig.patch
# this patch allow lxdm to read system settings from /etc/sysconfig
Patch1:         lxdm-0.5.1-use-sysconfig.patch
Patch2:         lxdm-0.5.0-gnome-start.patch
# PATCH-FIX-OPENSUSE lxdm-0.5.0-common.patch
# this patch fix bnc#586555 lxdm now use common scripts in /etc/X11/xdm
Patch3:         lxdm-0.5.0-common.patch
# Patch needed to use current new default wallpaper location
# bnc#732671
Patch4:         lxdm-0.5.0-use-openSUSE-background.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  fdupes
BuildRequires:  gcc
BuildRequires:  gettext-runtime
BuildRequires:  gettext-tools
BuildRequires:  intltool
BuildRequires:  libtool
BuildRequires:  make
BuildRequires:  pam-devel
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(iso-codes)
BuildRequires:  pkgconfig(systemd)
%if %{prefer_gtk2}
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(gtk+-3.0)
Requires:       desktop-data-openSUSE
Requires:       pam
Requires(pre):  pwdutils
# FIXME: use proper Requires(pre/post/preun/...)
PreReq:         %fillup_prereq
Recommends:     %{name}-lang
Recommends:     gnome-control-center-user-faces
Provides:       lxdm-conf = %{version}
Obsoletes:      lxdm-conf < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

LXDM is the future display manager of LXDE, the Lightweight X11 Desktop
environment. It is designed as a lightweight alternative to replace GDM or
KDM in LXDE distros.

%setup -q -n %{pkg_name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
cp %{SOURCE1} .

autoreconf -fi

%configure \
%if !(0%{?prefer_gtk2})
make %{?_smp_mflags}

mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_datadir}/applications
install %{SOURCE3} %{buildroot}/%{_datadir}/applications/
#need by post checks
mkdir -p %{buildroot}/%{_datadir}/pixmaps
install %{SOURCE4} %{buildroot}/%{_datadir}/pixmaps
%suse_update_desktop_file lxdm-config
rm %{buildroot}/%{_sbindir}/lxdm
rm -rf %{buildroot}/%{_sysconfdir}/pam.d/lxdm
install %{SOURCE2} %{buildroot}/%{_sysconfdir}/pam.d/lxdm
chmod -x %{buildroot}/%{_sysconfdir}/pam.d/lxdm
ln -sf %{_sbindir}/lxdm-binary %{buildroot}/%{_bindir}/lxdm
ln -sf %{_sbindir}/lxdm-binary %{buildroot}/%{_sbindir}/rclxdm
mkdir -p %{buildroot}/%{_rundir}
mkdir -p %{buildroot}/%{_localstatedir}/lib/lxdm
touch %{buildroot}/%{_rundir}/
mkdir -p %{buildroot}%{_dminitdir}/
cp %{SOURCE5} %{buildroot}%{_dminitdir}/
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
cp %{SOURCE6} %{buildroot}%{_localstatedir}/adm/fillup-templates/
# FIX: lxdm location is /usr/bin not /usr/sbin
sed -i 's/sbin/bin/' %{buildroot}%{_prefix}/lib/systemd/system/lxdm.service
%find_lang %{pkg_name}
%fdupes -s  %{buildroot}/%{_datadir}

getent group  lxdm >/dev/null || %{_sbindir}/groupadd -r lxdm 2> /dev/null || :
getent passwd lxdm >/dev/null || %{_sbindir}/useradd -r -g lxdm -s /bin/false \
-c "LXDE Display Manager daemon" -d %{_localstatedir}/lib/lxdm lxdm 2> /dev/null || :
%{_sbindir}/usermod -g lxdm -G lxdm -s /bin/false lxdm 2> /dev/null
exit 0
%service_add_pre lxdm.service

# this is only needed on initial upgrades because of the "noreplace"
# option into files section

chmod 640 %{_sysconfdir}/lxdm/lxdm.conf
chown lxdm:lxdm %{_sysconfdir}/lxdm/lxdm.conf
%{fillup_only -ns displaymanager lxdm}
%service_add_post lxdm.service

%service_del_preun lxdm.service

%service_del_postun lxdm.service

%defattr (-,root,root,-)
%dir %{_datadir}/lxdm/
%dir %{_sysconfdir}/lxdm/
%dir %{_dminitdir}/
%config(noreplace) %{_sysconfdir}/lxdm/Xsession
%config(noreplace) %{_sysconfdir}/lxdm/PreReboot
%config(noreplace) %{_sysconfdir}/lxdm/PreShutdown
%config(noreplace) %{_sysconfdir}/lxdm/PreLogin
%config(noreplace) %{_sysconfdir}/lxdm/PostLogin
%config(noreplace) %{_sysconfdir}/lxdm/PostLogout
%config(noreplace) %{_sysconfdir}/lxdm/LoginReady
%attr(640,lxdm,lxdm) %config(noreplace) %{_sysconfdir}/lxdm/lxdm.conf
%config(noreplace) %{_sysconfdir}/pam.d/lxdm
%attr(750,lxdm,lxdm) %dir %{_localstatedir}/lib/lxdm
%ghost %{_rundir}/
%exclude /%{_datadir}/pixmaps
%config %{_localstatedir}/adm/fillup-templates/sysconfig.lxdm

%files lang -f %{pkg_name}.lang
%defattr (-,root,root,-)

openSUSE Build Service is sponsored by