xref: /aoo41x/main/desktop/scripts/unopkg.sh (revision fce70c9b)
1#!/bin/sh
2#**************************************************************
3#
4#  Licensed to the Apache Software Foundation (ASF) under one
5#  or more contributor license agreements.  See the NOTICE file
6#  distributed with this work for additional information
7#  regarding copyright ownership.  The ASF licenses this file
8#  to you under the Apache License, Version 2.0 (the
9#  "License"); you may not use this file except in compliance
10#  with the License.  You may obtain a copy of the License at
11#
12#    http://www.apache.org/licenses/LICENSE-2.0
13#
14#  Unless required by applicable law or agreed to in writing,
15#  software distributed under the License is distributed on an
16#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17#  KIND, either express or implied.  See the License for the
18#  specific language governing permissions and limitations
19#  under the License.
20#
21#**************************************************************
22
23# enable file locking
24SAL_ENABLE_FILE_LOCKING=1
25export SAL_ENABLE_FILE_LOCKING
26
27# resolve installation directory
28sd_cwd=`pwd`
29sd_res=$0
30while [ -h "$sd_res" ] ; do
31    cd "`dirname "$sd_res"`"
32    sd_basename=`basename "$sd_res"`
33    sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"`
34done
35cd "`dirname "$sd_res"`"
36sd_prog=`pwd`
37cd "$sd_cwd"
38
39#collect all bootstrap variables specified on the command line
40#so that they can be passed as arguments to javaldx later on
41#Recognize the "sync" option. sync must be applied without any other
42#options except bootstrap variables or the verbose option
43for arg in $@
44do
45  case "$arg" in
46       -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
47       sync) OPTSYNC=true;;
48       -v) VERBOSE=true;;
49       --verbose) VERBOSE=true;;
50       *) OPTOTHER=$arg;;
51  esac
52done
53
54if [ "$OPTSYNC" = "true" ] && [ -z "$OPTOTHER" ]
55then
56    JVMFWKPARAMS='-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
57fi
58
59# extend the ld_library_path for java: javaldx checks the sofficerc for us
60if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
61    my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS $JVMFWKPARAMS \
62        "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
63    if [ -n "$my_path" ] ; then
64        LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
65        export LD_LIBRARY_PATH
66    fi
67fi
68
69unset XENVIRONMENT
70
71# uncomment line below to disable anti aliasing of fonts
72# SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
73
74# uncomment line below if you encounter problems starting soffice on your system
75# SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
76
77# execute binary
78exec "$sd_prog/unopkg.bin" "$@"  "$JVMFWKPARAMS" \
79    "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
80
81