summaryrefslogtreecommitdiff
path: root/indra/newview/linux_tools
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-08-21 21:52:21 +0000
committerAdam Moss <moss@lindenlab.com>2009-08-21 21:52:21 +0000
commitc3cbd049859c058526ae9a07a5cbfa7e51085943 (patch)
tree80f74a033a2f56f465cd4a67fa3e11a00bc18248 /indra/newview/linux_tools
parent87be6648d50efc55785e2298a9ed6ec0546da564 (diff)
svn merge -r130238:130240 svn+ssh://svn.lindenlab.com/svn/linden/branches/linux-updater-6
QAR-1771 Linux Viewer Autoupdater + XUI-parse refactoring
Diffstat (limited to 'indra/newview/linux_tools')
-rw-r--r--indra/newview/linux_tools/client-readme.txt10
-rwxr-xr-xindra/newview/linux_tools/handle_secondlifeprotocol.sh2
-rwxr-xr-xindra/newview/linux_tools/install.sh106
-rwxr-xr-xindra/newview/linux_tools/refresh_desktop_app_entry.sh36
-rwxr-xr-xindra/newview/linux_tools/register_secondlifeprotocol.sh4
-rwxr-xr-xindra/newview/linux_tools/wrapper.sh12
6 files changed, 156 insertions, 14 deletions
diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt
index 99c973f7ea..07a8f951ee 100644
--- a/indra/newview/linux_tools/client-readme.txt
+++ b/indra/newview/linux_tools/client-readme.txt
@@ -75,8 +75,9 @@ Life Linux client is very similar to that for Windows, as detailed at:
3. INSTALLING & RUNNING
-=-=-=-=-=-=-=-=-=-=-=-
-The Second Life Linux client entirely runs out of the directory you have
-unpacked it into - no installation step is required.
+The Second Life Linux client can entirely run from the directory you have
+unpacked it into - no installation step is required. If you wish to
+perform a separate installation step anyway, you may run './install.sh'
Run ./secondlife from the installation directory to start Second Life.
@@ -96,10 +97,7 @@ you wish.
4. KNOWN ISSUES
-=-=-=-=-=-=-=-
-* UPDATING - when the client detects that a new version of Second Life
- is available, it will ask you if you wish to download the new version.
- This option is not implemented; to upgrade, you should manually download a
- new version from the Second Life web site, <http://www.secondlife.com/>.
+* No significant known issues at this time.
5. TROUBLESHOOTING
diff --git a/indra/newview/linux_tools/handle_secondlifeprotocol.sh b/indra/newview/linux_tools/handle_secondlifeprotocol.sh
index 7ff86d1b93..203012132e 100755
--- a/indra/newview/linux_tools/handle_secondlifeprotocol.sh
+++ b/indra/newview/linux_tools/handle_secondlifeprotocol.sh
@@ -11,7 +11,7 @@ if [ -z "$URL" ]; then
fi
RUN_PATH=`dirname "$0" || echo .`
-cd "${RUN_PATH}"
+cd "${RUN_PATH}/.."
exec ./secondlife -url \'"${URL}"\'
diff --git a/indra/newview/linux_tools/install.sh b/indra/newview/linux_tools/install.sh
new file mode 100755
index 0000000000..c94510267a
--- /dev/null
+++ b/indra/newview/linux_tools/install.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# Install the Second Life Viewer. This script can install the viewer both
+# system-wide and for an individual user.
+
+VT102_STYLE_NORMAL='\E[0m'
+VT102_COLOR_RED='\E[31m'
+
+SCRIPTSRC=`readlink -f "$0" || echo "$0"`
+RUN_PATH=`dirname "${SCRIPTSRC}" || echo .`
+tarball_path=${RUN_PATH}
+
+function prompt()
+{
+ local prompt=$1
+ local input
+
+ echo -n "$prompt"
+
+ while read input; do
+ case $input in
+ [Yy]* )
+ return 1
+ ;;
+ [Nn]* )
+ return 0
+ ;;
+ * )
+ echo "Please enter yes or no."
+ echo -n "$prompt"
+ esac
+ done
+}
+
+function die()
+{
+ warn $1
+ exit 1
+}
+
+function warn()
+{
+ echo -n -e $VT102_COLOR_RED
+ echo $1
+ echo -n -e $VT102_STYLE_NORMAL
+}
+
+function homedir_install()
+{
+ warn "You are not running as a privileged user, so you will only be able"
+ warn "to install the Second Life Viewer in your home directory. If you"
+ warn "would like to install the Second Life Viewer system-wide, please run"
+ warn "this script as the root user, or with the 'sudo' command."
+ echo
+
+ prompt "Proceed with the installation? [Y/N]: "
+ if [[ $? == 0 ]]; then
+ exit 0
+ fi
+
+ install_to_prefix "$HOME/.secondlife-install"
+ $HOME/.secondlife-install/etc/refresh_desktop_app_entry.sh
+}
+
+function root_install()
+{
+ local default_prefix="/opt/secondlife-install"
+
+ echo -n "Enter the desired installation directory [${default_prefix}]: ";
+ read
+ if [[ "$REPLY" = "" ]] ; then
+ local install_prefix=$default_prefix
+ else
+ local install_prefix=$REPLY
+ fi
+
+ install_to_prefix "$install_prefix"
+
+ mkdir -p /usr/local/share/applications
+ ${install_prefix}/etc/refresh_desktop_app_entry.sh
+}
+
+function install_to_prefix()
+{
+ test -e "$1" && backup_previous_installation "$1"
+ mkdir -p "$1" || die "Failed to create installation directory!"
+
+ echo " - Installing to $1"
+
+ cp -a "${tarball_path}"/* "$1/" || die "Failed to complete the installation!"
+}
+
+function backup_previous_installation()
+{
+ local backup_dir="$1".backup-$(date -I)
+ echo " - Backing up previous installation to $backup_dir"
+
+ mv "$1" "$backup_dir" || die "Failed to create backup of existing installation!"
+}
+
+
+if [ "$UID" == "0" ]; then
+ root_install
+else
+ homedir_install
+fi
diff --git a/indra/newview/linux_tools/refresh_desktop_app_entry.sh b/indra/newview/linux_tools/refresh_desktop_app_entry.sh
new file mode 100755
index 0000000000..d2b2a732d5
--- /dev/null
+++ b/indra/newview/linux_tools/refresh_desktop_app_entry.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+SCRIPTSRC=`readlink -f "$0" || echo "$0"`
+RUN_PATH=`dirname "${SCRIPTSRC}" || echo .`
+
+install_prefix=${RUN_PATH}/..
+
+function install_desktop_entry()
+{
+ local installation_prefix="$1"
+ local desktop_entries_dir="$2"
+
+ local desktop_entry="\
+[Desktop Entry]\n\
+Name=Second Life\n\
+Comment=Client for the On-line Virtual World, Second Life\n\
+Exec=${installation_prefix}/secondlife\n\
+Icon=${installation_prefix}/secondlife_icon.png\n\
+Terminal=false\n\
+Type=Application\n\
+Categories=Application;Network;\n\
+StartupNotify=true\n\
+X-Desktop-File-Install-Version=3.0"
+
+ echo " - Installing menu entries in ${desktop_entries_dir}"
+ mkdir -vp "${desktop_entries_dir}"
+ echo -e $desktop_entry > "${desktop_entries_dir}/secondlife-viewer.desktop" || "Failed to install application menu!"
+}
+
+if [ "$UID" == "0" ]; then
+ # system-wide
+ install_desktop_entry "$install_prefix" /usr/local/share/applications
+else
+ # user-specific
+ install_desktop_entry "$install_prefix" "$HOME/.local/share/applications"
+fi
diff --git a/indra/newview/linux_tools/register_secondlifeprotocol.sh b/indra/newview/linux_tools/register_secondlifeprotocol.sh
index 4ab96f97d6..c7b4d55461 100755
--- a/indra/newview/linux_tools/register_secondlifeprotocol.sh
+++ b/indra/newview/linux_tools/register_secondlifeprotocol.sh
@@ -7,10 +7,10 @@
HANDLER="$1"
RUN_PATH=`dirname "$0" || echo .`
-cd "${RUN_PATH}"
+cd "${RUN_PATH}/.."
if [ -z "$HANDLER" ]; then
- HANDLER=`pwd`/handle_secondlifeprotocol.sh
+ HANDLER=`pwd`/etc/handle_secondlifeprotocol.sh
fi
# Register handler for GNOME-aware apps
diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh
index e188abe5d2..3209654498 100755
--- a/indra/newview/linux_tools/wrapper.sh
+++ b/indra/newview/linux_tools/wrapper.sh
@@ -91,12 +91,14 @@ echo "Running from ${RUN_PATH}"
cd "${RUN_PATH}"
# Re-register the secondlife:// protocol handler every launch, for now.
-./register_secondlifeprotocol.sh
+./etc/register_secondlifeprotocol.sh
+
+# Re-register the application with the desktop system every launch, for now.
+./etc/refresh_desktop_app_entry.sh
+
## Before we mess with LD_LIBRARY_PATH, save the old one to restore for
## subprocesses that care.
-if [ "${LD_LIBRARY_PATH+isset}" = "isset" ]; then
- export SAVED_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
-fi
+export SAVED_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
if [ -n "$LL_TCMALLOC" ]; then
tcmalloc_libs='/usr/lib/libtcmalloc.so.0 /usr/lib/libstacktrace.so.0 /lib/libpthread.so.0'
@@ -118,7 +120,7 @@ fi
export SL_ENV='LD_LIBRARY_PATH="`pwd`"/lib:"`pwd`"/app_settings/mozilla-runtime-linux-i686:"${LD_LIBRARY_PATH}"'
export SL_CMD='$LL_WRAPPER bin/do-not-directly-run-secondlife-bin'
-export SL_OPT="`cat gridargs.dat` $@"
+export SL_OPT="`cat etc/gridargs.dat` $@"
# Run the program
eval ${SL_ENV} ${SL_CMD} ${SL_OPT} || LL_RUN_ERR=runerr