merge the formfield patch from ooo-build
[ooovba.git] / desktop / scripts / unopkg.sh
blob96d2b4c246015a72685d313a3420c11f8dd2429e
1 #!/bin/sh
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # Copyright 2008 by Sun Microsystems, Inc.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # $RCSfile: unopkg.sh,v $
12 # $Revision: 1.14 $
14 # This file is part of OpenOffice.org.
16 # OpenOffice.org is free software: you can redistribute it and/or modify
17 # it under the terms of the GNU Lesser General Public License version 3
18 # only, as published by the Free Software Foundation.
20 # OpenOffice.org is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU Lesser General Public License version 3 for more details
24 # (a copy is included in the LICENSE file that accompanied this code).
26 # You should have received a copy of the GNU Lesser General Public License
27 # version 3 along with OpenOffice.org. If not, see
28 # <http://www.openoffice.org/license.html>
29 # for a copy of the LGPLv3 License.
31 #*************************************************************************
33 # enable file locking
34 SAL_ENABLE_FILE_LOCKING=1
35 export SAL_ENABLE_FILE_LOCKING
37 # resolve installation directory
38 sd_cwd="`pwd`"
39 if [ -h "$0" ] ; then
40 sd_basename=`basename "$0"`
41 sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
42 cd "`dirname "$0"`"
43 cd "`dirname "$sd_script"`"
44 else
45 cd "`dirname "$0"`"
47 sd_prog=`pwd`
48 cd "$sd_cwd"
50 isshared=0
51 for arg in $@
53 if [ "$arg" = "--shared" ]; then
54 isshared=1
56 done
57 if [ $isshared -eq 1 ]; then
58 echo $@ | grep -q env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY
59 if [ $? -ne 0 ]; then
60 set -- $@ '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
62 echo $@ | grep -q env:UNO_JAVA_JFW_INSTALL_DATA
63 if [ $? -ne 0 -a -w $sd_prog/../share/config/javasettingsunopkginstall.xml ]; then
64 set -- $@ '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
66 echo $@ | grep -q env:UserInstallation
67 if [ $? -ne 0 ]; then
68 INSTDIR=`mktemp -d -t unoinstall.XXXXXX`
69 set -- $@ '-env:UserInstallation=file://'$INSTDIR
73 #collect all bootstrap variables specified on the command line
74 #so that they can be passed as arguments to javaldx later on
75 for arg in $@
77 case "$arg" in
78 -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
79 esac
80 done
82 # extend the ld_library_path for java: javaldx checks the sofficerc for us
83 if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
84 my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
85 "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
86 if [ -n "$my_path" ] ; then
87 LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
88 export LD_LIBRARY_PATH
92 unset XENVIRONMENT
94 # uncomment line below to disable anti aliasing of fonts
95 # SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
97 # uncomment line below if you encounter problems starting soffice on your system
98 # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
100 # Set PATH so that crash_report is found:
101 PATH=$sd_prog${PATH+:$PATH}
102 export PATH
104 # execute binary
105 "$sd_prog/unopkg.bin" "$@" \
106 "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
107 if [ -n "$INSTDIR" ]; then
108 rm -rf $INSTDIR