update credits
[LibreOffice.git] / desktop / scripts / unopkg.sh
blob779a13746286a6732e211c44553f44f5917b4f72
1 #!/bin/sh
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 # enable file locking
21 SAL_ENABLE_FILE_LOCKING=1
22 export SAL_ENABLE_FILE_LOCKING
24 # resolve installation directory
25 sd_cwd=`pwd`
26 sd_res=$0
27 while [ -h "$sd_res" ] ; do
28 cd "`dirname "$sd_res"`"
29 sd_basename=`basename "$sd_res"`
30 sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"`
31 done
32 cd "`dirname "$sd_res"`"
33 sd_prog=`pwd`
34 cd "$sd_cwd"
36 # this is a temporary hack until we can live with the default search paths
37 case "`uname -s`" in
38 NetBSD|OpenBSD|FreeBSD|DragonFly)
39 sd_prog1="$sd_prog"
40 sd_prog2="$sd_prog/../ure-link/lib"
41 LD_LIBRARY_PATH=$sd_prog1:$sd_prog2${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
42 JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
43 export LD_LIBRARY_PATH
44 if [ -n "${JAVA_HOME}" ]; then
45 export JAVA_HOME
48 AIX)
49 sd_prog1="$sd_prog"
50 sd_prog2="$sd_prog/../ure-link/lib"
51 LIBPATH=$sd_prog1:$sd_prog2${LIBPATH:+:${LIBPATH}}
52 export LIBPATH
54 esac
56 #collect all bootstrap variables specified on the command line
57 #so that they can be passed as arguments to javaldx later on
58 for arg in $@
60 case "$arg" in
61 -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
62 -v) VERBOSE=true;;
63 --verbose) VERBOSE=true;;
64 --shared) SHARED=true;;
65 esac
66 done
68 #make sure shared extensions will be readable by users
69 [ $SHARED = true ] && umask 0022
71 # extend the ld_library_path for java: javaldx checks the sofficerc for us
72 if [ -x "$sd_prog/../ure-link/bin/javaldx" ] ; then
73 my_path=`"$sd_prog/../ure-link/bin/javaldx" $BOOTSTRAPVARS \
74 "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
75 if [ -n "$my_path" ] ; then
76 sd_platform=`uname -s`
77 case $sd_platform in
78 AIX)
79 LIBPATH=$my_path${LIBPATH:+:$LIBPATH}
80 export LIBPATH
83 LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
84 export LD_LIBRARY_PATH
86 esac
90 unset XENVIRONMENT
92 # uncomment line below to disable anti aliasing of fonts
93 # SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
95 # uncomment line below if you encounter problems starting soffice on your system
96 # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
98 # execute binary
99 exec "$sd_prog/unopkg.bin" "$@" \
100 "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"