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 .
21 SAL_ENABLE_FILE_LOCKING
=1
22 export SAL_ENABLE_FILE_LOCKING
24 # resolve installation directory
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"`
32 cd "`dirname "$sd_res"`"
36 # this is a temporary hack until we can live with the default search paths
38 NetBSD|OpenBSD|FreeBSD|DragonFly
)
39 LD_LIBRARY_PATH
="$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
40 JAVA_HOME
=$
(javaPathHelper
-h libreoffice-java
2> /dev
/null
)
41 export LD_LIBRARY_PATH
42 if [ -n "${JAVA_HOME}" ]; then
47 LIBPATH
="$sd_prog${LIBPATH:+:${LIBPATH}}"
57 #collect all bootstrap variables specified on the command line
58 #so that they can be passed as arguments to javaldx later on
59 -env:*) BOOTSTRAPVARS
=$BOOTSTRAPVARS" ""$arg";;
61 # make sure shared extensions will be readable by all users
67 --bundled) isnotuser
=1;;
68 -h|
--help) help_mode
=1;;
72 # we don't really want root to run unopkg without --shared or --bundled option
73 # but we might at least let him read help
74 if [ "$(id -u)" -eq "0" ]; then
75 if [ $isnotuser -eq 0 ] && [ $help_mode -eq 0 ]; then
76 echo "Cannot run '${0} $*' as root without --shared or --bundled option."
81 # extend the ld_library_path for java: javaldx checks the sofficerc for us
82 if [ -x "${sd_prog}/javaldx" ] ; then
83 my_path
=`"${sd_prog}/javaldx" $BOOTSTRAPVARS \
84 "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
85 if [ -n "$my_path" ] ; then
86 sd_platform
=`uname -s`
87 case "$sd_platform" in
89 LIBPATH
="$my_path${LIBPATH:+:$LIBPATH}"
93 LD_LIBRARY_PATH
="$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
94 export LD_LIBRARY_PATH
102 # uncomment line below to disable anti aliasing of fonts
103 # SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
105 # uncomment line below if you encounter problems starting soffice on your system
106 # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
109 exec "$sd_prog/unopkg.bin" "$@" \
110 "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"