xref: /aoo41x/main/desktop/scripts/unopkg.sh (revision cdf0e10c)
1#!/bin/sh
2#*************************************************************************
3#
4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5#
6# Copyright 2000, 2010 Oracle and/or its affiliates.
7#
8# OpenOffice.org - a multi-platform office productivity suite
9#
10# This file is part of OpenOffice.org.
11#
12# OpenOffice.org is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Lesser General Public License version 3
14# only, as published by the Free Software Foundation.
15#
16# OpenOffice.org is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19# GNU Lesser General Public License version 3 for more details
20# (a copy is included in the LICENSE file that accompanied this code).
21#
22# You should have received a copy of the GNU Lesser General Public License
23# version 3 along with OpenOffice.org.  If not, see
24# <http://www.openoffice.org/license.html>
25# for a copy of the LGPLv3 License.
26#
27#*************************************************************************
28
29# enable file locking
30SAL_ENABLE_FILE_LOCKING=1
31export SAL_ENABLE_FILE_LOCKING
32
33# resolve installation directory
34sd_cwd=`pwd`
35sd_res=$0
36while [ -h "$sd_res" ] ; do
37    cd "`dirname "$sd_res"`"
38    sd_basename=`basename "$sd_res"`
39    sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"`
40done
41cd "`dirname "$sd_res"`"
42sd_prog=`pwd`
43cd "$sd_cwd"
44
45#collect all bootstrap variables specified on the command line
46#so that they can be passed as arguments to javaldx later on
47#Recognize the "sync" option. sync must be applied without any other
48#options except bootstrap variables or the verbose option
49for arg in $@
50do
51  case "$arg" in
52       -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
53       sync) OPTSYNC=true;;
54       -v) VERBOSE=true;;
55       --verbose) VERBOSE=true;;
56       *) OPTOTHER=$arg;;
57  esac
58done
59
60if [ "$OPTSYNC" = "true" ] && [ -z "$OPTOTHER" ]
61then
62    JVMFWKPARAMS='-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
63fi
64
65# extend the ld_library_path for java: javaldx checks the sofficerc for us
66if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
67    my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS $JVMFWKPARAMS \
68        "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
69    if [ -n "$my_path" ] ; then
70        LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
71        export LD_LIBRARY_PATH
72    fi
73fi
74
75unset XENVIRONMENT
76
77# uncomment line below to disable anti aliasing of fonts
78# SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
79
80# uncomment line below if you encounter problems starting soffice on your system
81# SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
82
83# execute binary
84exec "$sd_prog/unopkg.bin" "$@"  "$JVMFWKPARAMS" \
85    "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
86
87