Files
lxdm/lxdm.spec
Lars Vogdt df26bfeb6a - introduce _fillupdir and license macros
- use update-alternatives on newer distributions (boo#1069667)
- use systemd-rpm-macros (BR)
- refreshed patches

OBS-URL: https://build.opensuse.org/package/show/X11:lxde/lxdm?expand=0&rev=196
2020-04-06 15:37:55 +00:00

203 lines
6.7 KiB
RPMSpec

#
# spec file for package lxdm
#
# Copyright (c) 2014 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 http://bugs.opensuse.org/
#
%define _dminitdir %{_libexecdir}/X11/displaymanagers
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
Name: lxdm
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: %{name}-%{version}.tar.xz
Source1: README.SUSE
Source2: %{name}.pamd
Source3: %{name}-config.desktop
Source4: config-users.png
Source5: %{name}
Source6: sysconfig.%{name}
# 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: %{name}-0.5.1-use-sysconfig.patch
Patch2: %{name}-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: %{name}-0.5.0-common.patch
# Patch needed to use current new default wallpaper location
# bnc#732671
Patch4: %{name}-0.5.0-use-openSUSE-background.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: gcc
BuildRequires: gettext-runtime
BuildRequires: gettext-tools
BuildRequires: gtk2-devel
BuildRequires: intltool
BuildRequires: iso-codes-devel
BuildRequires: libtool
BuildRequires: make
BuildRequires: pam-devel
BuildRequires: pkg-config
BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros
%{systemd_requires}
BuildRequires: update-desktop-files
Requires: desktop-data-openSUSE
Requires: pam
Requires(pre): pwdutils
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %fillup_prereq
Recommends: gnome-control-center-user-faces
Provides: lxdm-conf = %{version}
Obsoletes: lxdm-conf < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%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
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
cp %{SOURCE1} .
%build
autoreconf -fi
%configure
make %{?_smp_mflags}
%install
make DESTDIR=%{buildroot} install %{?_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}/%{name}
rm -rf %{buildroot}/%{_sysconfdir}/pam.d/%{name}
install %{SOURCE2} %{buildroot}/%{_sysconfdir}/pam.d/%{name}
chmod -x %{buildroot}/%{_sysconfdir}/pam.d/%{name}
ln -sf %{_sbindir}/%{name}-binary %{buildroot}/%{_bindir}/%{name}
ln -sf %{_sbindir}/%{name}-binary %{buildroot}/%{_sbindir}/rc%{name}
%find_lang %{name}
mkdir -p %{buildroot}/%{_rundir}
mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}
touch %{buildroot}/%{_rundir}/%{name}.pid
mkdir -p %{buildroot}%{_dminitdir}/
cp %{SOURCE5} %{buildroot}%{_dminitdir}/
mkdir -p %{buildroot}%{_fillupdir}
cp %{SOURCE6} %{buildroot}%{_fillupdir}/
# FIX: lxdm location is /usr/bin not /usr/sbin
mkdir -p %{buildroot}%{_unitdir}
sed -e 's/sbin/bin/' ./systemd/lxdm.service > %{buildroot}%{_unitdir}/lxdm.service
%fdupes -s %{buildroot}/%{_datadir}
%if 0%{?suse_version} >= 1330
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
touch %{buildroot}%{_sysconfdir}/alternatives/default-displaymanager
ln -s %{_sysconfdir}/alternatives/default-displaymanager %{buildroot}%{_dminitdir}/default-displaymanager
%endif
%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 %{name}.service
# this is only needed on initial upgrades because of the "noreplace"
# option into files section
%post
chmod 640 %{_sysconfdir}/%{name}/%{name}.conf
chown lxdm:lxdm %{_sysconfdir}/%{name}/%{name}.conf
%{fillup_only -ns displaymanager lxdm}
%service_add_post %{name}.service
%if 0%{?suse_version} >= 1330
%{_sbindir}/update-alternatives --install %{_dminitdir}/default-displaymanager \
default-displaymanager %{_dminitdir}/lxdm 25
%endif
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%if 0%{?suse_version} >= 1330
[ -f %{_dminitdir}/lxdm ] || %{_sbindir}/update-alternatives \
--remove default-displaymanager %{_dminitdir}/lxdm
%endif
%files -f %{name}.lang
%defattr (-,root,root,-)
%doc AUTHORS README README.SUSE
%license COPYING
%dir %{_datadir}/%{name}/
%{_datadir}/applications/lxdm-config.desktop
%{_datadir}/%{name}/*
%dir %{_sysconfdir}/%{name}/
%dir %{_dminitdir}/
%if 0%{?suse_version} >= 1330
%{_dminitdir}/default-displaymanager
%ghost %{_sysconfdir}/alternatives/default-displaymanager
%endif
%{_bindir}/%{name}
%{_bindir}/%{name}-config
%{_sbindir}/%{name}-binary
%{_sbindir}/rclxdm
%{_libexecdir}/%{name}-greeter-gtk
%{_libexecdir}/%{name}-greeter-gdk
%{_libexecdir}/%{name}-numlock
%{_libexecdir}/%{name}-session
%config(noreplace) %{_sysconfdir}/%{name}/Xsession
%config(noreplace) %{_sysconfdir}/%{name}/PreReboot
%config(noreplace) %{_sysconfdir}/%{name}/PreShutdown
%config(noreplace) %{_sysconfdir}/%{name}/PreLogin
%config(noreplace) %{_sysconfdir}/%{name}/PostLogin
%config(noreplace) %{_sysconfdir}/%{name}/PostLogout
%config(noreplace) %{_sysconfdir}/%{name}/LoginReady
%attr(640,lxdm,lxdm) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%attr(750,lxdm,lxdm) %dir %{_localstatedir}/lib/%{name}
%ghost %{_rundir}/%{name}.pid
%exclude /%{_datadir}/pixmaps
%{_dminitdir}/lxdm
%dir %{_fillupdir}
%{_fillupdir}/sysconfig.lxdm
%{_unitdir}/%{name}.service
%changelog