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