LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File lxdm-gtk3.spec of Package lxdm-gtk3 (Project home:jcsl:LXDE-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 http://bugs.opensuse.org/
#


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

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

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
Url:            http://lxde.org/
Source0:        https://downloads.sourceforge.net/lxde/%{pkg_name}-%{version}.tar.xz
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 andrea@opensuse.org
# 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 werner@novell.com
# 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)
%else
BuildRequires:  pkgconfig(gtk+-3.0)
%endif
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
%lang_package

%description
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.

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

%build
#sh autogen.sh
autoreconf -fi

%configure \
%if !(0%{?prefer_gtk2})
	--enable-gtk3
%endif
	%{nil}
make %{?_smp_mflags}

%install
%make_install
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}/lxdm.pid
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}

%pre
# https://en.opensuse.org/openSUSE:Packaging_guidelines#Users_and_Groups
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

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

%preun
%service_del_preun lxdm.service

%postun
%service_del_postun lxdm.service

%files
%defattr (-,root,root,-)
%doc AUTHORS README COPYING README.SUSE
%dir %{_datadir}/lxdm/
%{_datadir}/applications/lxdm-config.desktop
%{_datadir}/lxdm/*
%dir %{_sysconfdir}/lxdm/
%dir %{_dminitdir}/
%{_bindir}/lxdm
%{_bindir}/lxdm-config
%{_sbindir}/lxdm-binary
%{_sbindir}/rclxdm
%{_libexecdir}/lxdm-greeter-gtk
%{_libexecdir}/lxdm-greeter-gdk
%{_libexecdir}/lxdm-numlock
%{_libexecdir}/lxdm-session
%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}/lxdm.pid
%exclude /%{_datadir}/pixmaps
%{_dminitdir}/lxdm
%config %{_localstatedir}/adm/fillup-templates/sysconfig.lxdm
%{_unitdir}/lxdm.service

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

%changelog