xref: /aoo41x/main/padmin/source/spadmin.sh (revision 30971150)
1#!/bin/sh
2#*************************************************************************
3#
4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5#
6# Copyright 2000, 2010 Oracle and/or its affiliates.
7#
8# OpenOffice.org - a multi-platform office productivity suite
9#
10# This file is part of OpenOffice.org.
11#
12# OpenOffice.org is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Lesser General Public License version 3
14# only, as published by the Free Software Foundation.
15#
16# OpenOffice.org is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19# GNU Lesser General Public License version 3 for more details
20# (a copy is included in the LICENSE file that accompanied this code).
21#
22# You should have received a copy of the GNU Lesser General Public License
23# version 3 along with OpenOffice.org.  If not, see
24# <http://www.openoffice.org/license.html>
25# for a copy of the LGPLv3 License.
26#
27#*************************************************************************
28
29# enable file locking
30SAL_ENABLE_FILE_LOCKING=1
31export SAL_ENABLE_FILE_LOCKING
32
33# resolve installation directory
34sd_cwd="`pwd`"
35if [ -h "$0" ] ; then
36	sd_basename=`basename "$0"`
37 	sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
38    cd "`dirname "$0"`"
39    cd "`dirname "$sd_script"`"
40else
41    cd "`dirname "$0"`"
42fi
43sd_prog=`pwd`
44cd "$sd_cwd"
45
46#collect all bootstrap variables specified on the command line
47#so that they can be passed as arguments to javaldx later on
48for arg in $@
49do
50  case "$arg" in
51       -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
52  esac
53done
54
55# extend the ld_library_path for java: javaldx checks the sofficerc for us
56if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
57    # this is a temporary hack until we can live with the default search paths
58    case "`uname -s`" in
59    FreeBSD)
60	sd_prog1="$sd_prog/../basis-link/program"
61	sd_prog2="$sd_prog/../basis-link/ure-link/lib"
62	LD_LIBRARY_PATH=$sd_prog1:$sd_prog2${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}
63	export LD_LIBRARY_PATH
64	;;
65    esac
66    my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
67        "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
68    if [ -n "$my_path" ] ; then
69        LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
70        export LD_LIBRARY_PATH
71    fi
72fi
73
74unset XENVIRONMENT
75
76# uncomment line below to disable anti aliasing of fonts
77# SAL_ANTIALIAS_DISABLE=true; export SAL_ANTIALIAS_DISABLE
78
79# Set PATH so that crash_report is found:
80PATH=$sd_prog${PATH+:$PATH}
81export PATH
82
83# execute binary
84exec "$sd_prog/../basis-link/program/spadmin.bin" "$@" \
85    "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
86