[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:30 CET 2015


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

x2go pushed a commit to branch master
in repository x2goserver.

commit 532d4f3e72f222ce9eba2f91a06d268bfefe2ea2
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 |    4 ++++
 x2goserver.spec  |   38 +++++++++++++++++++++++++-------------
 2 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c3c397e..40b1682 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -155,6 +155,10 @@ x2goserver (4.1.0.0-0x2go1.1) UNRELEASED; urgency=low
       proper Requires(post) statements to make sure perl-X2Go-Server-DB and
       x2goserver-common are available when x2goserver's post install script is
       being executed. 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.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Fri, 09 May 2014 13:06:24 +0200
 
diff --git a/x2goserver.spec b/x2goserver.spec
index a8347cd..6446d79 100644
--- a/x2goserver.spec
+++ b/x2goserver.spec
@@ -499,40 +499,52 @@ if grep -E "^backend=sqlite.*" /etc/x2go/x2gosql/sql 1>/dev/null 2>/dev/null; th
   fi
 fi
 
+# 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
+%service_del_preun x2goserver.service
 
 %pre
 %service_add_pre 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