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