From 0263fd5e6fcec7a0137cfccda01d268948775063e934d5acd8e217d4e77a1c40 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Fri, 21 Mar 2014 13:19:15 +0000 Subject: [PATCH] Accepting request 226983 from home:WernerFink:branches:X11:XOrg - Move forward to systemd, that is use a real service unit file (bnc#869260) OBS-URL: https://build.opensuse.org/request/show/226983 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xdm?expand=0&rev=62 --- display-manager.service | 16 ++++++++++++++++ xdm.changes | 5 +++++ xdm.spec | 42 ++++++++++++++++++++++++++++++++++++++++- xdm.tar.bz2 | 4 ++-- 4 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 display-manager.service diff --git a/display-manager.service b/display-manager.service new file mode 100644 index 0000000..eafaaf8 --- /dev/null +++ b/display-manager.service @@ -0,0 +1,16 @@ +[Unit] +Description=X Display Manager +Requires=var-run.mount +After=ypbind.service gpm.service time-sync.target winbind.service acpid.service +Wants=remote-fs.target dbus.socket systemd-user-sessions.service +After=remote-fs.target dbus.socket systemd-user-sessions.service + +[Service] +Type=forking +PIDFile=/var/run/displaymanager.pid +ExecStart=/usr/lib/X11/display-manager start +ExecStop=/usr/lib/X11/display-manager stop +ExecReload=/usr/lib/X11/display-manager reload + +[Install] +WantedBy=graphical.target diff --git a/xdm.changes b/xdm.changes index d498a3e..c319b60 100644 --- a/xdm.changes +++ b/xdm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 21 10:50:02 UTC 2014 - werner@suse.de + +- Move forward to systemd, that is use a real service unit file (bnc#869260) + ------------------------------------------------------------------- Wed Mar 5 08:40:58 UTC 2014 - cxiong@suse.com diff --git a/xdm.spec b/xdm.spec index 97a7cac..406119c 100644 --- a/xdm.spec +++ b/xdm.spec @@ -41,6 +41,7 @@ Source0: http://xorg.freedesktop.org/releases/individual/app/%{name}-%{ve Source1: xdm.tar.bz2 Source2: HOWTO.xdm Source3: xdm-fallbacks.tar.bz2 +Source4: display-manager.service %if !%with_systemd Patch0: xdm-consolekit.diff %endif @@ -48,7 +49,7 @@ Patch1: xdm-tolerant-hostname-changes.diff Patch2: U_xdm_config-AC_LIBTOOL_DLOPEN-is-required-for-dynamic-lin.patch Patch3: U_xdm_config-use-libtool-export-dynamic-option-for-reverse.patch Patch4: U_xdm_Fix-missing-linking-dependency-on-ldl.patch -%if 0%{?suse_version} >= 01140 +%if 0%{?suse_version} >= 01140 && 0%{?suse_version} < 1320 # Needed to create the man page symlink to init.d BuildRequires: aaa_base-extras %endif @@ -71,6 +72,9 @@ BuildRequires: pkgconfig(xtrans) %if !%with_systemd BuildRequires: ConsoleKit-devel Requires: ConsoleKit +%else +BuildRequires: systemd-rpm-macros +%{?systemd_requires} %endif Requires: /sbin/pidof Requires: logrotate @@ -82,6 +86,10 @@ Recommends: dbus-1-x11 Conflicts: xorg-x11 <= 7.6 BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if !%with_systemd +%define _unitdir /usr/lib/systemd/system +%endif + %description Xdm manages a collection of X displays, which may be on the local host or remote servers. @@ -133,9 +141,21 @@ rm %{buildroot}%{_libdir}/X11/xdm/libXdmGreet.la mv %{buildroot}%{_libdir}/X11/xdm/chooser %{buildroot}%{_bindir} # fdo#35868 (closed INVALID, but because of above fix, we want it) ln -s xdm.1%{?ext_man} %{buildroot}%{_mandir}/man1/chooser.1%{?ext_man} +%if 0%{?suse_version} < 1320 # missing manual page mkdir -p %{buildroot}%{_mandir}/man8 ln -s ../man7/init.d.7%{?ext_man} %{buildroot}%{_mandir}/man8/rcxdm.8%{?ext_man} +ln -sf %{_sysconfdir}/init.d/xdm %{buildroot}%{_sbindir}/rcxdm +%else +rm -f %{buildroot}%{_sbindir}/rcxdm +install -D %{S:4} -m 0644 %{buildroot}%{_unitdir}/display-manager.service +ln -sf service %{buildroot}%{_sbindir}/rcdisplay-manager +cat > %{buildroot}%{_sbindir}/rcxdm <<-'EOF' + #!/bin/bash + exec -a rcdisplay-manager %{_sbindir}/rcdisplay-manager ${1+"$@"} + EOF +chmod 0755 %{buildroot}%{_sbindir}/rcxdm +%endif # Note: # no %%stop_on_removal in %%preun @@ -143,11 +163,19 @@ ln -s ../man7/init.d.7%{?ext_man} %{buildroot}%{_mandir}/man8/rcxdm.8%{?ext_man} # => we don't want to end an existing session %post +%if 0%{?suse_version} < 1320 %{fillup_and_insserv -Y xdm} +%else +%service_add_post display-manager.service +%endif %{fillup_only -n displaymanager} %postun +%if 0%{?suse_version} < 1320 %{insserv_cleanup} +%else +%service_del_postun display-manager.service +%endif %files %defattr(-,root,root) @@ -165,7 +193,14 @@ ln -s ../man7/init.d.7%{?ext_man} %{buildroot}%{_mandir}/man8/rcxdm.8%{?ext_man} %endif %config %{_sysconfdir}/X11/xdm/ %config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/xdmcp +%if 0%{?suse_version} < 1320 %{_sysconfdir}/init.d/xdm +%exclude %{_libexecdir}/X11/display-manager +%else +%exclude %{_sysconfdir}/init.d/xdm +%{_unitdir}/display-manager.service +%{_libexecdir}/X11/display-manager +%endif %config %{_sysconfdir}/logrotate.d/xdm %config %{_sysconfdir}/pam.d/xdm %config %{_sysconfdir}/pam.d/xdm-np @@ -178,12 +213,17 @@ ln -s ../man7/init.d.7%{?ext_man} %{buildroot}%{_mandir}/man8/rcxdm.8%{?ext_man} %{_bindir}/xdm %{_bindir}/xdmshell %{_sbindir}/rcxdm +%if 0%{?suse_version} >= 1320 +%{_sbindir}/rcdisplay-manager +%endif %{_libdir}/X11/xdm/ %dir %{_datadir}/X11/app-defaults %{_datadir}/X11/app-defaults/Chooser %{_mandir}/man1/chooser.1%{?ext_man} %{_mandir}/man1/xdm.1%{?ext_man} +%if 0%{?suse_version} < 1320 %{_mandir}/man8/rcxdm.8%{?ext_man} +%endif %ifnarch %ix86 %dir %{_libdir}/X11 %endif diff --git a/xdm.tar.bz2 b/xdm.tar.bz2 index 0fc332d..47a4e45 100644 --- a/xdm.tar.bz2 +++ b/xdm.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:38aea81b9feb48649cd4a37d1c052182269554ab2a4856726a47e6c1af5e9155 -size 20926 +oid sha256:1b26b384c510a6db57f56829648395ae72b5edd8dcc2abda2ed430ec97f2266a +size 20485