LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File x2gopath.diff of Package x2goserver (Project X11:RemoteDesktop:x2go)

x2gopath: new helper to yield distro paths

Distributions have different directory layouts and names, so files
may not necessarily be located in <base>/lib/x2go at all times. Do
not hardcode such paths and have the programs instead use the new
x2gopath helper (obsoletes x2gobasepath).

---
 x2goserver-compat/share/x2gofeature.d/x2goserver-compat.features              |    2 
 x2goserver-extensions/bin/x2goserver-run-extensions                           |    4 -
 x2goserver-extensions/man/man8/x2goserver-run-extensions.8                    |    4 -
 x2goserver-extensions/share/x2gofeature.d/x2goserver-extensions.features      |    2 
 x2goserver-fmbindings/share/x2go/x2gofeature.d/x2goserver-fmbindings.features |    2 
 x2goserver-printing/bin/x2goprint                                             |    2 
 x2goserver-printing/share/x2gofeature.d/x2goserver-printing.features          |    2 
 x2goserver-pyhoca/share/x2gofeature.d/x2goserver-pyhoca.features              |    2 
 x2goserver-xsession/etc/Xsession                                              |    4 -
 x2goserver-xsession/share/x2gofeature.d/x2goserver-xsession.features          |    2 
 x2goserver/bin/x2gobasepath                                                   |   31 ----------
 x2goserver/bin/x2gocmdexitmessage                                             |    2 
 x2goserver/bin/x2gofeature                                                    |    4 -
 x2goserver/bin/x2gofeaturelist                                                |    4 -
 x2goserver/bin/x2gogetapps                                                    |    2 
 x2goserver/bin/x2gogetservers                                                 |    2 
 x2goserver/bin/x2golistdesktops                                               |    2 
 x2goserver/bin/x2golistmounts                                                 |    2 
 x2goserver/bin/x2golistsessions                                               |    2 
 x2goserver/bin/x2gomountdirs                                                  |    2 
 x2goserver/bin/x2gopath                                                       |   19 ++++++
 x2goserver/bin/x2goresume-session                                             |    2 
 x2goserver/bin/x2goruncommand                                                 |    2 
 x2goserver/bin/x2gosessionlimit                                               |    2 
 x2goserver/bin/x2gosetkeyboard                                                |    2 
 x2goserver/bin/x2goshowblocks                                                 |    2 
 x2goserver/bin/x2gostartagent                                                 |    2 
 x2goserver/bin/x2gosuspend-session                                            |    2 
 x2goserver/bin/x2goterminate-session                                          |    2 
 x2goserver/bin/x2goumount-session                                             |    2 
 x2goserver/bin/x2goversion                                                    |    2 
 x2goserver/lib/x2gochangestatus                                               |    2 
 x2goserver/lib/x2gocreatesession                                              |    2 
 x2goserver/lib/x2godbwrapper.pm                                               |    4 -
 x2goserver/lib/x2gogetagent                                                   |    2 
 x2goserver/lib/x2gogetdisplays                                                |    2 
 x2goserver/lib/x2gogetports                                                   |    2 
 x2goserver/lib/x2gogetstatus                                                  |    2 
 x2goserver/lib/x2goinsertport                                                 |    2 
 x2goserver/lib/x2goinsertsession                                              |    2 
 x2goserver/lib/x2golistsessions_sql                                           |    2 
 x2goserver/lib/x2gologlevel                                                   |    2 
 x2goserver/lib/x2goresume                                                     |    2 
 x2goserver/lib/x2gormport                                                     |    2 
 x2goserver/lib/x2gosuspend-agent                                              |    2 
 x2goserver/lib/x2gosyslog                                                     |    2 
 x2goserver/man/man8/x2gopath.8                                                |   28 +++++++++
 x2goserver/sbin/x2gocleansessions                                             |    4 -
 x2goserver/sbin/x2godbadmin                                                   |    2 
 x2goserver/sbin/x2golistsessions_root                                         |    4 -
 x2goserver/share/x2gofeature.d/x2goserver.features                            |    2 
 51 files changed, 106 insertions(+), 84 deletions(-)

Index: x2goserver-3.1.1.6/x2goserver-compat/share/x2gofeature.d/x2goserver-compat.features
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-compat/share/x2gofeature.d/x2goserver-compat.features
+++ x2goserver-3.1.1.6/x2goserver-compat/share/x2gofeature.d/x2goserver-compat.features
@@ -20,7 +20,7 @@
 # Copyright (C) 2011-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver-extensions/bin/x2goserver-run-extensions
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-extensions/bin/x2goserver-run-extensions
+++ x2goserver-3.1.1.6/x2goserver-extensions/bin/x2goserver-run-extensions
@@ -25,7 +25,7 @@ set -e
 
 test -z $2 && { echo "usage: $(basename $0) <X2GO_SESSION_ID> <MODALITY>"; exit -1; }
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
@@ -33,7 +33,7 @@ X2GO_SESSION="$1"
 X2GO_MODALITY="$2"
 
 # scan extensions and execute them
-find /usr/lib/x2go/extensions/${X2GO_MODALITY}.d/ -maxdepth 1 -mindepth 1 | egrep "/[0-9]{3}_[[:alnum:]]+" | sort | while read x2go_extension; do
+find "$X2GO_LIB_PATH/extensions/$X2GO_MODALITY.d/" -maxdepth 1 -mindepth 1 | egrep "/[0-9]{3}_[[:alnum:]]+" | sort | while read x2go_extension; do
 	$X2GO_LIB_PATH/x2gosyslog "$0" "debug" "executing $x2go_extension with option $X2GO_SESSION"
 	$x2go_extension "$X2GO_SESSION" &>/dev/null && {
 		$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$x2go_extension ($(basename $0)) for session $X2GO_SESSION has finished sucessfully"
Index: x2goserver-3.1.1.6/x2goserver-extensions/man/man8/x2goserver-run-extensions.8
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-extensions/man/man8/x2goserver-run-extensions.8
+++ x2goserver-3.1.1.6/x2goserver-extensions/man/man8/x2goserver-run-extensions.8
@@ -36,9 +36,9 @@ Calling X2Go Server core scripts current
 .PP
 The modality names all refer to a sub-directory of the path:
 
-  \fI<INSTALL_PREFIX>/lib/x2go/extensions\fR,
+  \fI<libexecdir>/x2go/extensions\fR,
 
-where <INSTALL_PREFIX> mostly is /usr on commonly-used GNU/Linux systems.
+where <libexecdir> is /usr/libexec/x2go or /usr/lib/x2go on commonly-used GNU/Linux systems.
 .PP
 In any of these sub-directories third-party X2Go extension packages can place scripts or binaries that will then get executed by the core X2Go server
 commands, either before or after the essential functionality (e.g. x2goagent startup, x2goagent suspension, x2goagent resumption, etc.) or on failure of that
Index: x2goserver-3.1.1.6/x2goserver-extensions/share/x2gofeature.d/x2goserver-extensions.features
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-extensions/share/x2gofeature.d/x2goserver-extensions.features
+++ x2goserver-3.1.1.6/x2goserver-extensions/share/x2gofeature.d/x2goserver-extensions.features
@@ -20,7 +20,7 @@
 # Copyright (C) 2011-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver-fmbindings/share/x2go/x2gofeature.d/x2goserver-fmbindings.features
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-fmbindings/share/x2go/x2gofeature.d/x2goserver-fmbindings.features
+++ x2goserver-3.1.1.6/x2goserver-fmbindings/share/x2go/x2gofeature.d/x2goserver-fmbindings.features
@@ -20,7 +20,7 @@
 # Copyright (C) 2011  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver-printing/bin/x2goprint
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-printing/bin/x2goprint
+++ x2goserver-3.1.1.6/x2goserver-printing/bin/x2goprint
@@ -26,7 +26,7 @@ use File::Copy;
 use File::Path;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper;
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver-printing/share/x2gofeature.d/x2goserver-printing.features
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-printing/share/x2gofeature.d/x2goserver-printing.features
+++ x2goserver-3.1.1.6/x2goserver-printing/share/x2gofeature.d/x2goserver-printing.features
@@ -20,7 +20,7 @@
 # Copyright (C) 2011-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver-pyhoca/share/x2gofeature.d/x2goserver-pyhoca.features
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-pyhoca/share/x2gofeature.d/x2goserver-pyhoca.features
+++ x2goserver-3.1.1.6/x2goserver-pyhoca/share/x2gofeature.d/x2goserver-pyhoca.features
@@ -20,7 +20,7 @@
 # Copyright (C) 2011-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver-xsession/etc/Xsession
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-xsession/etc/Xsession
+++ x2goserver-3.1.1.6/x2goserver-xsession/etc/Xsession
@@ -8,6 +8,8 @@
 
 set -e
 
+X2GO_LIBEXEC_PATH="$(x2gopath libexec)";
+
 PROGNAME=XSession-x2go
 
 message () {
@@ -110,7 +112,7 @@ if [ -n "$SESSIONFILES" ]; then
 
     set +e
     for SESSIONFILE in $SESSIONFILES; do
-        /usr/lib/x2go/x2gosyslog "$0" "info" "executing $SESSIONFILE"
+        "$X2GO_LIBEXEC_PATH/x2gosyslog" "$0" "info" "executing $SESSIONFILE"
         . $SESSIONFILE
     done
     set -e
Index: x2goserver-3.1.1.6/x2goserver-xsession/share/x2gofeature.d/x2goserver-xsession.features
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver-xsession/share/x2gofeature.d/x2goserver-xsession.features
+++ x2goserver-3.1.1.6/x2goserver-xsession/share/x2gofeature.d/x2goserver-xsession.features
@@ -20,7 +20,7 @@
 # Copyright (C) 2011-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gobasepath
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gobasepath
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gobasepath
@@ -1,30 +1,3 @@
-#!/usr/bin/perl
+#!/bin/sh
 
-# Copyright (C) 2007-2012 X2Go Project - http://wiki.x2go.org
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# Copyright (C) 2007-2012  Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
-
-use strict;
-use Cwd;
-use Cwd q{abs_path};
-use File::Basename;
-
-my $dir = dirname($0);
-my $base_path = abs_path("$dir/.."); 
-
-print "$base_path";
+exec x2gopath base "$@";
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gocmdexitmessage
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gocmdexitmessage
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gocmdexitmessage
@@ -20,7 +20,7 @@
 # Copyright (C) 2007-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2007-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 X2GO_ROOT=${HOME}/.x2go
 MESSAGE_FILE=$X2GO_ROOT/C-$1/cmdoutput
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gofeature
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gofeature
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gofeature
@@ -22,8 +22,8 @@
 
 [ -z $1 ] && { echo usage: "$(basename $0) <X2GO_FEATURE_NAME>"; exit -2; }
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
-X2GO_SHARE_PATH=`echo -n \$(x2gobasepath)/share/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
+X2GO_SHARE_PATH="$(x2gopath share)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gofeaturelist
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gofeaturelist
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gofeaturelist
@@ -19,8 +19,8 @@
 #
 # Copyright (C) 2011-2012  Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
-X2GO_SHARE_PATH=`echo -n \$(x2gobasepath)/share/x2go`
+X2GO_LIB_PATH=$(x2gopath libexec)
+X2GO_SHARE_PATH=$(x2gopath share)
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gogetapps
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gogetapps
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gogetapps
@@ -24,7 +24,7 @@ use strict;
 use Sys::Syslog qw( :standard :macros );
 use MIME::Base64 qw(encode_base64);
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath libexec`;
 use x2gologlevel;
 
 my @iconext=("png","svg","jpeg","jpg","xpm","bmp");
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gogetservers
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gogetservers
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gogetservers
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2golistdesktops
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2golistdesktops
+++ x2goserver-3.1.1.6/x2goserver/bin/x2golistdesktops
@@ -24,7 +24,7 @@ use strict;
 use Sys::Hostname;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 openlog($0,'cons,pid','user');
Index: x2goserver-3.1.1.6/x2goserver/bin/x2golistmounts
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2golistmounts
+++ x2goserver-3.1.1.6/x2goserver/bin/x2golistmounts
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2golistsessions
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2golistsessions
+++ x2goserver-3.1.1.6/x2goserver/bin/x2golistsessions
@@ -24,7 +24,7 @@ use strict;
 use Sys::Hostname;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gomountdirs
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gomountdirs
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gomountdirs
@@ -24,7 +24,7 @@ use strict;
 use Sys::Syslog qw( :standard :macros );
 use File::BaseDir qw( xdg_config_home );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper;
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gopath
===================================================================
--- /dev/null
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gopath
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+base="${0%/*}";
+if test "$base" = "$0"; then
+	base=".";
+fi;
+base=$(readlink -f "$base/..");
+# The following section is subject to substitution by distro packaging tools.
+case "$1" in
+base) echo -n "$base";;
+lib) echo -n "$base/lib/x2go";;
+libexec) echo -n "$base/lib/x2go";;
+share) echo -n "$base/share/x2go";;
+xinerama) echo -n "/usr/lib/nx/X11/Xinerama";;
+*) exit 1;;
+esac;
+if test -t 1; then
+	echo "";
+fi;
Index: x2goserver-3.1.1.6/x2goserver/bin/x2goresume-session
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2goresume-session
+++ x2goserver-3.1.1.6/x2goserver/bin/x2goresume-session
@@ -28,7 +28,7 @@ X2GO_KBD_LAYOUT="$5"
 X2GO_KBD_TYPE="$6"
 X2GO_SET_KBD="$7"
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 X2GO_AGENT_PID=`$X2GO_LIB_PATH/x2gogetagent "$SESSION_NAME"`
 
 X2GO_ROOT="${HOME}/.x2go"
Index: x2goserver-3.1.1.6/x2goserver/bin/x2goruncommand
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2goruncommand
+++ x2goserver-3.1.1.6/x2goserver/bin/x2goruncommand
@@ -27,7 +27,7 @@ cmd=$5
 sndsys=$6
 X2GO_SESS_TYPE=$7
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gosessionlimit
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gosessionlimit
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gosessionlimit
@@ -24,7 +24,7 @@ use strict;
 use Config::Simple;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 openlog($0,'cons,pid','user');
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gosetkeyboard
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gosetkeyboard
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gosetkeyboard
@@ -21,7 +21,7 @@
 # Copyright (C) 2011-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2goshowblocks
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2goshowblocks
+++ x2goserver-3.1.1.6/x2goserver/bin/x2goshowblocks
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gostartagent
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gostartagent
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gostartagent
@@ -20,7 +20,7 @@
 # Copyright (C) 2007-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2007-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2gosuspend-session
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2gosuspend-session
+++ x2goserver-3.1.1.6/x2goserver/bin/x2gosuspend-session
@@ -26,7 +26,7 @@ else
 	SESSION_NAME="$X2GO_SESSION"
 fi
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2goterminate-session
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2goterminate-session
+++ x2goserver-3.1.1.6/x2goserver/bin/x2goterminate-session
@@ -26,7 +26,7 @@ else
 	SESSION_NAME="$X2GO_SESSION"
 fi
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2goumount-session
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2goumount-session
+++ x2goserver-3.1.1.6/x2goserver/bin/x2goumount-session
@@ -25,7 +25,7 @@ use Sys::Hostname;
 use Sys::Syslog qw( :standard :macros );
 use File::BaseDir qw( xdg_config_home );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/bin/x2goversion
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/bin/x2goversion
+++ x2goserver-3.1.1.6/x2goserver/bin/x2goversion
@@ -20,7 +20,7 @@
 # Copyright (C) 2011-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gochangestatus
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gochangestatus
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gochangestatus
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gocreatesession
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gocreatesession
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gocreatesession
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2godbwrapper.pm
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2godbwrapper.pm
+++ x2goserver-3.1.1.6/x2goserver/lib/x2godbwrapper.pm
@@ -26,8 +26,8 @@ use DBI;
 use POSIX;
 use Sys::Syslog qw( :standard :macros );
 
-my $x2go_lib_path=`echo -n \$(x2gobasepath)/lib/x2go`;
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+my $x2go_lib_path = `x2gopath libexec`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gogetagent
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gogetagent
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gogetagent
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gogetdisplays
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gogetdisplays
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gogetdisplays
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gogetports
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gogetports
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gogetports
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gogetstatus
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gogetstatus
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gogetstatus
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath libexec`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2goinsertport
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2goinsertport
+++ x2goserver-3.1.1.6/x2goserver/lib/x2goinsertport
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2goinsertsession
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2goinsertsession
+++ x2goserver-3.1.1.6/x2goserver/lib/x2goinsertsession
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2golistsessions_sql
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2golistsessions_sql
+++ x2goserver-3.1.1.6/x2goserver/lib/x2golistsessions_sql
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gologlevel
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gologlevel
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gologlevel
@@ -22,7 +22,7 @@
 
 use strict;
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 print x2gologlevel();
Index: x2goserver-3.1.1.6/x2goserver/lib/x2goresume
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2goresume
+++ x2goserver-3.1.1.6/x2goserver/lib/x2goresume
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gormport
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gormport
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gormport
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2godbwrapper; 
 use x2gologlevel;
 
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gosuspend-agent
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gosuspend-agent
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gosuspend-agent
@@ -23,7 +23,7 @@
 strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 openlog($0,'cons,pid','user');
Index: x2goserver-3.1.1.6/x2goserver/lib/x2gosyslog
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/lib/x2gosyslog
+++ x2goserver-3.1.1.6/x2goserver/lib/x2gosyslog
@@ -23,7 +23,7 @@
 use strict;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 setlogmask( LOG_UPTO(x2gologlevel()) );
Index: x2goserver-3.1.1.6/x2goserver/man/man8/x2gopath.8
===================================================================
--- /dev/null
+++ x2goserver-3.1.1.6/x2goserver/man/man8/x2gopath.8
@@ -0,0 +1,28 @@
+.TH x2gopath 8 "Feb 2012" "Version 3.1.0.x" "X2Go Server Tool"
+.SH Name
+.PP
+x2gopath - Show X2Go Server installation paths
+.SH Synopsis
+.PP
+\fBx2gopath\fP {\fBbase\fP|\fBlib\fP|\fBlibexec\fP|\fBshare\fP}
+.SH Description
+.PP
+\fBx2gopath\fP displays the paths of the selected X2Go installation directory.
+.TP
+\fBbase\fP
+The prefix under which X2Go was installed. This is generally \fB/usr\fP or
+\fB/usr/local\fP.
+.TP
+\fBlib\fP
+The location of X2Go architecture-dependent parts (e.g. libraries,
+but also Perl modules).
+.\" Possible examplares are /usr/lib64/x2go (traditional biarch) and
+.\" /usr/lib/x86_64-gnu-linux/x2go (Debian-style multiarch)
+.TP
+\fBlibexec\fP
+The location of private X2Go binaries.
+.\" Possible examples are /usr/libexec/x2go and /usr/lib/x2go.
+.TP
+\fBshare\fP
+The location of X2Go's data files.
+.\" prefix + /share/x2go
Index: x2goserver-3.1.1.6/x2goserver/sbin/x2gocleansessions
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/sbin/x2gocleansessions
+++ x2goserver-3.1.1.6/x2goserver/sbin/x2gocleansessions
@@ -24,8 +24,8 @@ use strict;
 use Sys::Hostname;
 use Sys::Syslog qw( :standard :macros );
 
-my $x2go_lib_path=`echo -n \$(x2gobasepath)/lib/x2go`;
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+my $x2go_lib_path = `x2gopath libexec`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 openlog($0,'cons,pid','user');
Index: x2goserver-3.1.1.6/x2goserver/sbin/x2godbadmin
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/sbin/x2godbadmin
+++ x2goserver-3.1.1.6/x2goserver/sbin/x2godbadmin
@@ -26,7 +26,7 @@ use Getopt::Long;
 use Config::Simple;   
 use DBI;
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 openlog($0,'cons,pid','user');
Index: x2goserver-3.1.1.6/x2goserver/sbin/x2golistsessions_root
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/sbin/x2golistsessions_root
+++ x2goserver-3.1.1.6/x2goserver/sbin/x2golistsessions_root
@@ -23,7 +23,7 @@ use strict;
 use Sys::Hostname;
 use Sys::Syslog qw( :standard :macros );
 
-use lib `echo -n \$(x2gobasepath)/lib/x2go`;
+use lib `x2gopath lib`;
 use x2gologlevel;
 
 openlog($0,'cons,pid','user');
@@ -43,7 +43,7 @@ sub check_stat
 	return 1;
 }
 
-my $x2go_lib_path=`echo -n \$(x2gobasepath)/lib/x2go`;
+my $x2go_lib_path = `x2gopath libexec`;
 
 my $uname;
 
Index: x2goserver-3.1.1.6/x2goserver/share/x2gofeature.d/x2goserver.features
===================================================================
--- x2goserver-3.1.1.6.orig/x2goserver/share/x2gofeature.d/x2goserver.features
+++ x2goserver-3.1.1.6/x2goserver/share/x2gofeature.d/x2goserver.features
@@ -20,7 +20,7 @@
 # Copyright (C) 2011-2012  Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
 # Copyright (C) 2011-2012  Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de>
 
-X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+X2GO_LIB_PATH="$(x2gopath libexec)";
 
 $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"