1 |
#!/bin/sh |
#!/bin/sh |
|
# |
|
2 |
# Wrapper script for openoffice |
# Wrapper script for openoffice |
|
# |
|
|
# (C) Peter 'Nidd' Novodvorsky, 2001,2002 |
|
|
# (C) Martin 'empty' Quinson, 2002. |
|
|
# Modifications by Chris Halls |
|
|
# Modifications by Lucien Saviot |
|
3 |
|
|
4 |
# This program is free software; you can redistribute it and/or modify |
OO_PVER=<pver> |
5 |
# it under the terms of the GNU General Public License as published by |
OO_HOME="/opt/openoffice-${OO_PVER}" |
|
# the Free Software Foundation; either version 2 of the License, or |
|
|
# (at your option) any later version. |
|
|
# |
|
|
# This program is distributed in the hope that it will be useful, |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
# General Public License for more details. |
|
|
# |
|
|
# You should have received a copy of the GNU General Public License |
|
|
# along with this program; if not, write to the Free Software |
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
6 |
|
|
7 |
# For OpenOffice.org1.9 |
export OOO_EXTRA_ARG='' |
8 |
PV=<pv> |
unset PYTHONPATH |
|
OOHOME="/opt/OpenOffice.org${PV}" |
|
9 |
|
|
10 |
## |
## |
11 |
## Add /usr/share/fonts to font search path |
## If no file is specified on the command line, which application to start? |
|
## |
|
|
|
|
|
# Default font path. This is used if SAL_FONTPATH_PRIVATE is not defined. |
|
|
|
|
|
GENTOO_FONTPATH="" |
|
|
for d in `find /usr/share/fonts -maxdepth 1 -mindepth 1 -type d` ; do |
|
|
GENTOO_FONTPATH="$GENTOO_FONTPATH;$d" |
|
|
done |
|
|
|
|
|
SAL_FONTPATH_PRIVATE=${SAL_FONTPATH_PRIVATE:-"$GENTOO_FONTPATH"} |
|
|
export SAL_FONTPATH_PRIVATE |
|
|
|
|
|
## search LOCALE |
|
|
if [ -n "$LC_ALL" ]; then |
|
|
LOCALE="$LC_ALL" |
|
|
# OOo doesn't understand LC_ALL, so set LANG |
|
|
LANG="$LC_ALL" |
|
|
elif [ -n "$LANG" ]; then |
|
|
LOCALE="$LANG" |
|
|
elif [ -n "$LC_MESSAGES" ]; then |
|
|
LOCALE="$LC_MESSAGES" |
|
|
LANG="$LC_MESSAGES" |
|
|
else |
|
|
LOCALE="en_US" |
|
|
fi |
|
|
|
|
|
# Set locale to en_US if locale is C |
|
|
if [ "x$LOCALE" = "xC" ] ; then LOCALE="en_US"; fi |
|
|
|
|
|
LOCALEOO=`echo $LOCALE | sed 's/_/-/'` |
|
|
|
|
|
## |
|
|
## If no file is specified on the command line, which application to start? |
|
12 |
## The wrapper can be called from several links in /usr/bin |
## The wrapper can be called from several links in /usr/bin |
13 |
## |
## |
14 |
if [ $# = 0 ]; then |
if [ $# = 0 ] |
15 |
case `basename $0` in |
then |
16 |
oocalc) set -- private:factory/scalc;; |
case $(basename $0) in |
17 |
oodraw) set -- private:factory/sdraw;; |
oobase) set -- -base ;; |
18 |
ooimpress) set -- private:factory/simpress;; |
oocalc) set -- -calc ;; |
19 |
oomath) set -- private:factory/smath;; |
oodraw) set -- -draw ;; |
20 |
ooweb) set -- private:factory/swriter/web;; |
ooimpress) set -- -impress ;; |
21 |
oowriter) set -- private:factory/swriter;; |
oomath) set -- -math ;; |
22 |
esac |
ooweb) set -- -web ;; |
23 |
|
oowriter) set -- -writer ;; |
24 |
|
esac |
25 |
fi |
fi |
26 |
|
|
27 |
## |
case $(basename $0) in |
28 |
## That's it. Launch the beast (with the given args) |
oopadmin) exec "${OO_HOME}/program/spadmin" ;; |
29 |
## |
*) exec "${OO_HOME}/program/soffice" "$@" ;; |
|
LANG=$LOCALE |
|
|
export LANG |
|
|
case `basename $0` in |
|
|
oopadmin) exec "$OOHOME/program/spadmin" |
|
|
;; |
|
|
*) exec "$OOHOME/program/soffice" "$@" |
|
|
;; |
|
30 |
esac |
esac |