Magellan Linux

Contents of /trunk/openoffice/ooffice-wrapper

Parent Directory Parent Directory | Revision Log Revision Log


Revision 331 - (show annotations) (download)
Wed Sep 5 15:48:55 2007 UTC (16 years, 8 months ago) by niro
File size: 2396 byte(s)
-magellan-ized: fixed whitespaces and coding style

1 #!/bin/sh
2 #
3 # Wrapper script for openoffice
4 #
5 # (C) Peter 'Nidd' Novodvorsky, 2001,2002
6 # (C) Martin 'empty' Quinson, 2002.
7 # Modifications by Chris Halls
8 # Modifications by Lucien Saviot
9 # Modifications by Niels Rogalla
10
11 # 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
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
15 #
16 # This program 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 GNU
19 # General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
25 # For OpenOffice-2.2
26 PV=<pv>
27 OOHOME="/opt/OpenOffice-${PV}"
28
29 ##
30 ## Add /usr/share/fonts to font search path
31 ##
32
33 # Default font path. This is used if SAL_FONTPATH_PRIVATE is not defined.
34
35 LOCAL_FONTPATH=""
36 for i in $(find /usr/share/fonts -maxdepth 1 -mindepth 1 -type d)
37 do
38 LOCAL_FONTPATH="${LOCAL_FONTPATH};${i}"
39 done
40
41 SAL_FONTPATH_PRIVATE=${SAL_FONTPATH_PRIVATE:-"${LOCAL_FONTPATH}"}
42 export SAL_FONTPATH_PRIVATE
43
44 ## search LOCALE
45 if [[ -n $LC_ALL ]]
46 then
47 LOCALE="$LC_ALL"
48 # OOo doesn't understand LC_ALL, so set LANG
49 LANG="$LC_ALL"
50 elif [[ -n ${LANG} ]]
51 then
52 LOCALE="${LANG}"
53 elif [[ -n $LC_MESSAGES ]]
54 then
55 LOCALE="$LC_MESSAGES"
56 LANG="$LC_MESSAGES"
57 else
58 LOCALE="en_US"
59 fi
60
61 # Set locale to en_US if locale is C
62 [[ x${LOCALE} = xC ]] && LOCALE="en_US"
63
64 LOCALEOO="${LOCALE/_/-}"
65
66 ##
67 ## 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
69 ##
70 if [ $# = 0 ]
71 then
72 case $(basename $0) in
73 oocalc) set -- private:factory/scalc ;;
74 oodraw) set -- private:factory/sdraw ;;
75 ooimpress) set -- private:factory/simpress ;;
76 oomath) set -- private:factory/smath ;;
77 ooweb) set -- private:factory/swriter/web ;;
78 oowriter) set -- private:factory/swriter ;;
79 esac
80 fi
81
82 ##
83 ## That's it. Launch the beast (with the given args)
84 ##
85 LANG=${LOCALE}
86 export LANG
87 case $(basename $0) in
88 oopadmin) exec "${OOHOME}/program/spadmin" ;;
89 *) exec "${OOHOME}/program/soffice" "$@" ;;
90 esac