6 |
# (C) Martin 'empty' Quinson, 2002. |
# (C) Martin 'empty' Quinson, 2002. |
7 |
# Modifications by Chris Halls |
# Modifications by Chris Halls |
8 |
# Modifications by Lucien Saviot |
# Modifications by Lucien Saviot |
9 |
|
# Modifications by Niels Rogalla |
10 |
|
|
11 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
12 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
13 |
# the Free Software Foundation; either version 2 of the License, or |
# the Free Software Foundation; either version 2 of the License, or |
14 |
# (at your option) any later version. |
# (at your option) any later version. |
15 |
# |
# |
16 |
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
17 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
19 |
# General Public License for more details. |
# General Public License for more details. |
20 |
# |
# |
21 |
# You should have received a copy of the GNU General Public License |
# You should have received a copy of the GNU General Public License |
22 |
# along with this program; if not, write to the Free Software |
# along with this program; if not, write to the Free Software |
23 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 |
|
|
25 |
# For OpenOffice.org1.9 |
# For OpenOffice-2.2 |
26 |
PV=<pv> |
PV=<pv> |
27 |
OOHOME="/opt/OpenOffice.org${PV}" |
OOHOME="/opt/OpenOffice-${PV}" |
28 |
|
|
29 |
## |
## |
30 |
## Add /usr/share/fonts to font search path |
## Add /usr/share/fonts to font search path |
32 |
|
|
33 |
# Default font path. This is used if SAL_FONTPATH_PRIVATE is not defined. |
# Default font path. This is used if SAL_FONTPATH_PRIVATE is not defined. |
34 |
|
|
35 |
GENTOO_FONTPATH="" |
LOCAL_FONTPATH="" |
36 |
for d in `find /usr/share/fonts -maxdepth 1 -mindepth 1 -type d` ; do |
for i in $(find /usr/share/fonts -maxdepth 1 -mindepth 1 -type d) |
37 |
GENTOO_FONTPATH="$GENTOO_FONTPATH;$d" |
do |
38 |
|
LOCAL_FONTPATH="${LOCAL_FONTPATH};${i}" |
39 |
done |
done |
40 |
|
|
41 |
SAL_FONTPATH_PRIVATE=${SAL_FONTPATH_PRIVATE:-"$GENTOO_FONTPATH"} |
SAL_FONTPATH_PRIVATE=${SAL_FONTPATH_PRIVATE:-"${LOCAL_FONTPATH}"} |
42 |
export SAL_FONTPATH_PRIVATE |
export SAL_FONTPATH_PRIVATE |
43 |
|
|
44 |
## search LOCALE |
## search LOCALE |
45 |
if [ -n "$LC_ALL" ]; then |
if [[ -n $LC_ALL ]] |
46 |
|
then |
47 |
LOCALE="$LC_ALL" |
LOCALE="$LC_ALL" |
48 |
# OOo doesn't understand LC_ALL, so set LANG |
# OOo doesn't understand LC_ALL, so set LANG |
49 |
LANG="$LC_ALL" |
LANG="$LC_ALL" |
50 |
elif [ -n "$LANG" ]; then |
elif [[ -n ${LANG} ]] |
51 |
LOCALE="$LANG" |
then |
52 |
elif [ -n "$LC_MESSAGES" ]; then |
LOCALE="${LANG}" |
53 |
|
elif [[ -n $LC_MESSAGES ]] |
54 |
|
then |
55 |
LOCALE="$LC_MESSAGES" |
LOCALE="$LC_MESSAGES" |
56 |
LANG="$LC_MESSAGES" |
LANG="$LC_MESSAGES" |
57 |
else |
else |
59 |
fi |
fi |
60 |
|
|
61 |
# Set locale to en_US if locale is C |
# Set locale to en_US if locale is C |
62 |
if [ "x$LOCALE" = "xC" ] ; then LOCALE="en_US"; fi |
[[ x${LOCALE} = xC ]] && LOCALE="en_US" |
63 |
|
|
64 |
LOCALEOO=`echo $LOCALE | sed 's/_/-/'` |
LOCALEOO="${LOCALE/_/-}" |
65 |
|
|
66 |
## |
## |
67 |
## If no file is specified on the command line, which application to start? |
## If no file is specified on the command line, which application to start? |
68 |
## The wrapper can be called from several links in /usr/bin |
## The wrapper can be called from several links in /usr/bin |
69 |
## |
## |
70 |
if [ $# = 0 ]; then |
if [ $# = 0 ] |
71 |
case `basename $0` in |
then |
72 |
oocalc) set -- private:factory/scalc;; |
case $(basename $0) in |
73 |
oodraw) set -- private:factory/sdraw;; |
oocalc) set -- private:factory/scalc ;; |
74 |
ooimpress) set -- private:factory/simpress;; |
oodraw) set -- private:factory/sdraw ;; |
75 |
oomath) set -- private:factory/smath;; |
ooimpress) set -- private:factory/simpress ;; |
76 |
ooweb) set -- private:factory/swriter/web;; |
oomath) set -- private:factory/smath ;; |
77 |
oowriter) set -- private:factory/swriter;; |
ooweb) set -- private:factory/swriter/web ;; |
78 |
esac |
oowriter) set -- private:factory/swriter ;; |
79 |
|
esac |
80 |
fi |
fi |
81 |
|
|
82 |
## |
## |
83 |
## That's it. Launch the beast (with the given args) |
## That's it. Launch the beast (with the given args) |
84 |
## |
## |
85 |
LANG=$LOCALE |
LANG=${LOCALE} |
86 |
export LANG |
export LANG |
87 |
case `basename $0` in |
case $(basename $0) in |
88 |
oopadmin) exec "$OOHOME/program/spadmin" |
oopadmin) exec "${OOHOME}/program/spadmin" ;; |
89 |
;; |
*) exec "${OOHOME}/program/soffice" "$@" ;; |
|
*) exec "$OOHOME/program/soffice" "$@" |
|
|
;; |
|
90 |
esac |
esac |