merge the formfield patch from ooo-build
[ooovba.git] / solenv / bin / installoffice
blob29645688b56a5160794fc10bc6bbe6781b19c947
1 #!/bin/bash
2 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
25 #***********************************************************************/
27 EXIT_SUCCESS=0
28 EXIT_FAILURE=1
29 EXIT_ERROR=2
30 EXIT_BUG=10
32 if [ x${SOLARENV}x = xx ]; then
33 echo No environment found, please use 'configure' or 'setsolar'
34 exit $EXIT_FAILURE
36 usage() {
37 echo "Usage: $SCRIPTNAME [-t DESTPATH] [-o] [-d] [-a]" >&2
38 echo "" >&2
39 echo "[-t] target path: path wehre tho office should installed to. The default is '$DESTPATH'" >&2
40 echo "" >&2
41 echo "[-o] force OpenOffice.org installation instead of StarOffice" >&2
42 echo "" >&2
43 echo "[-d] installation with debug output" >&2
44 echo "" >&2
45 echo "[-a] the office will be patched to run without FirstStartWizard" >&2
46 echo "" >&2
47 echo "[-i] impress should open documents without autopilot" >&2
48 exit $EXIT_FAILURE
51 if [ x${USER}x = xx ]; then
52 if [ x${LOGNAME}x = xx ]; then
53 echo "ERROR: could not determine username. Please export variable USER" >&2
54 exit $EXIT_FAILURE
55 else
56 USER=$LOGNAME
57 export USER
61 DESTPATH=/tmp/$USER
62 PARAM=""
64 while getopts ':mt:aicdhot' OPTION ; do
65 case $OPTION in
66 d) PARAM="$PARAM -debug true"
68 c) PARAM="$PARAM -cwscheckapi true"
70 o) PARAM="$PARAM -ooo true"
72 a) PARAM="$PARAM -autorun true"
74 i) PARAM="$PARAM -autoimpress true"
76 t) DESTPATH="$OPTARG"
78 h) usage $EXIT_SUCCESS
80 \?) echo "unkown option \"-$OPTARG\"." >&2
81 usage $EXIT_ERROR
83 *) echo "this is not possible...">&2
84 usage $EXIT_BUG
86 esac
87 done
89 shift `expr $OPTIND - 1`
91 LOCALINSTALLDIR=$DESTPATH/office
92 LOCALUNPACKDIR=$DESTPATH/unpack
94 export LOCALINSTALLDIR
95 export LOCALUNPACKDIR
96 echo "export LOCALINSTALLDIR"
97 echo "export LOCALUNPACKDIR"
99 unset LD_LIBRARY_PATH
100 unset FORCE2ARCHIVE
102 echo "### $SOLARENV/bin/installoffice.pl $PARAM -cleanup true $@"
103 exec perl -w $SOLARENV/bin/installoffice.pl $PARAM -cleanup true $@
105 exit $?