Magellan Linux

Contents of /trunk/openoffice/ooffice-wrapper

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (show annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years ago) by niro
File size: 2749 byte(s)
-import

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