[X2Go-Commits] [x2goserver] 01/01: x2goserver.spec: add support for %{_datadir}/applications symlink in %{_sysconfdir}/x2go.

git-admin at x2go.org git-admin at x2go.org
Thu Mar 5 04:21:31 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.

commit 63900ca5436860b59542bf9cec8746f05e5e7736
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Mar 5 04:03:01 2015 +0100

    x2goserver.spec: add support for %{_datadir}/applications symlink in %{_sysconfdir}/x2go.
    
      - Add creation and deletion bits to %post and %preun scriptlets.
      - Refactor %post, %pre, %postun and %preun scriptlets to accommodate for
        last change.
---
 debian/changelog |    5 ++++-
 x2goserver.spec  |   36 ++++++++++++++++++++++++------------
 2 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0173d32..de53d81 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,7 +5,10 @@ x2goserver (4.0.1.20-0x2go1) UNRELEASED; urgency=low
   * x2goserver.spec:
     - Do not search for unavailable file in x2goserver's post
       install script.  Fixes installation bugs reported by Michael DePaulo.
-
+    - Add support for %{_datadir}/applications symlink in %{_sysconfdir}/x2go.
+      + Add creation and deletion bits to %post and %preun scriptlets.
+      + Refactor %post, %pre, %postun and %preun scriptlets to accommodate for
+        last change.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Tue, 24 Feb 2015 22:11:49 +0100
 
diff --git a/x2goserver.spec b/x2goserver.spec
index a2f5317..a5dcf1d 100644
--- a/x2goserver.spec
+++ b/x2goserver.spec
@@ -392,37 +392,49 @@ fi
 %endif
 %endif
 
+# create /etc/x2go/applications symlink if not already there
+# as a regular file, as a symlink, as a special file or as a directory
+if ! [ -e %{_sysconfdir}/x2go/applications ]; then
+  ln -s %{_datadir}/applications %{_sysconfdir}/x2go/applications
+fi
+
 %if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
 %if 0%{?fedora} || 0%{?rhel} >= 7
 %systemd_post x2goserver.service
+%else
+%service_add_post x2goserver.service
+%endif
+%else
+%{_sbindir}/chkconfig --add x2goserver
+%{_sbindir}/service x2goserver condrestart 1>/dev/null 2>&1 || :
+%endif
 
 %preun
+if [ -L %{_sysconfdir}/x2go/applications ]; then
+  rm -f %{_sysconfdir}/x2go/applications || :
+fi
+
+%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
+%if 0%{?fedora} || 0%{?rhel} >= 7
 %systemd_preun x2goserver.service
 
 %postun
 %systemd_postun x2goserver.service
 %else
-%service_add_post x2goserver.service
-
-%preun
 %service_del_preun x2goserver.service
 
 %postun
 %service_del_postun x2goserver.service
 %endif
 %else
-/sbin/chkconfig --add x2goserver
-/sbin/service x2goserver condrestart 1>/dev/null 2>&1 || :
+if [ "$1" = 0 ]; then
+  %{_sbindir}/service x2goserver stop 1>/dev/null 2>&1
+  %{_sbindir}/chkconfig --del x2goserver
+fi
 
 %postun
 if [ "$1" -ge "1" ] ; then
-    /sbin/service x2goserver condrestart 1>/dev/null 2>&1 || :
-fi
-
-%preun
-if [ "$1" = 0 ]; then
-        /sbin/service x2goserver stop 1>/dev/null 2>&1
-        /sbin/chkconfig --del x2goserver
+  %{_sbindir}/service x2goserver condrestart 1>/dev/null 2>&1 || :
 fi
 %endif
 

--
Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list