diff --git a/xfce4-session.changes b/xfce4-session.changes index 1c2120f..2702ce2 100644 --- a/xfce4-session.changes +++ b/xfce4-session.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 17 14:19:47 UTC 2017 - fvogt@suse.com + +- Use update-alternatives to create default.desktop xsession (boo#1030873) + ------------------------------------------------------------------- Mon Sep 19 17:55:53 UTC 2016 - robert@linux-source.org diff --git a/xfce4-session.spec b/xfce4-session.spec index d90a4e6..e71c764 100644 --- a/xfce4-session.spec +++ b/xfce4-session.spec @@ -1,7 +1,7 @@ # # spec file for package xfce4-session # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# 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 @@ -55,6 +55,8 @@ Requires: xfce4-settings Requires: xfconf # bnc#845264 Requires: iceauth +Requires(post): update-alternatives +Requires(postun): update-alternatives Recommends: %{name}-doc = %{version} Recommends: %{name}-lang = %{version} # minimal packages for an Xfce session @@ -139,6 +141,10 @@ find %{buildroot} -type f -name "*.la" -delete -print rm %{buildroot}%{_datadir}/polkit-1/actions/org.xfce.session.policy \ %{buildroot}%{_libdir}/xfce4/session/xfsm-shutdown-helper +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/default-xsession.desktop +ln -s %{_sysconfdir}/alternatives/default-xsession.desktop %{buildroot}%{_datadir}/xsessions/default.desktop + %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig @@ -146,10 +152,14 @@ rm %{buildroot}%{_datadir}/polkit-1/actions/org.xfce.session.policy \ %post %desktop_database_post %icon_theme_cache_post +%{_sbindir}/update-alternatives --install %{_datadir}/xsessions/default.desktop \ + default-xsession.desktop %{_datadir}/xsessions/xfce.desktop 20 %postun %desktop_database_postun %icon_theme_cache_postun +[ -f %{_datadir}/xsessions/xfce.desktop ] || %{_sbindir}/update-alternatives \ + --remove default-xsession.desktop %{_datadir}/xsessions/xfce.desktop %files %defattr(-,root,root) @@ -166,6 +176,8 @@ rm %{buildroot}%{_datadir}/polkit-1/actions/org.xfce.session.policy \ %{_libdir}/xfce4 %{_datadir}/xfce %{_datadir}/xsessions/xfce.desktop +%ghost %{_datadir}/xsessions/default.desktop +%ghost %{_sysconfdir}/alternatives/default-xsession.desktop %{_datadir}/themes/* %{_datadir}/applications/*.desktop %{_datadir}/icons/*/*/*