Magellan Linux

Annotation of /trunk/openoffice/ooffice-wrapper

Parent Directory Parent Directory | Revision Log Revision Log


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

1 niro 153 #!/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 niro 331 # Modifications by Niels Rogalla
10 niro 153
11 niro 331 # 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 niro 153
25 niro 331 # For OpenOffice-2.2
26 niro 153 PV=<pv>
27 niro 331 OOHOME="/opt/OpenOffice-${PV}"
28 niro 153
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 niro 331 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 niro 153 done
40    
41 niro 331 SAL_FONTPATH_PRIVATE=${SAL_FONTPATH_PRIVATE:-"${LOCAL_FONTPATH}"}
42 niro 153 export SAL_FONTPATH_PRIVATE
43    
44     ## search LOCALE
45 niro 331 if [[ -n $LC_ALL ]]
46     then
47 niro 153 LOCALE="$LC_ALL"
48     # OOo doesn't understand LC_ALL, so set LANG
49     LANG="$LC_ALL"
50 niro 331 elif [[ -n ${LANG} ]]
51     then
52     LOCALE="${LANG}"
53     elif [[ -n $LC_MESSAGES ]]
54     then
55 niro 153 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 niro 331 [[ x${LOCALE} = xC ]] && LOCALE="en_US"
63 niro 153
64 niro 331 LOCALEOO="${LOCALE/_/-}"
65 niro 153
66     ##
67 niro 331 ## If no file is specified on the command line, which application to start?
68 niro 153 ## The wrapper can be called from several links in /usr/bin
69     ##
70 niro 331 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 niro 153 fi
81    
82     ##
83     ## That's it. Launch the beast (with the given args)
84     ##
85 niro 331 LANG=${LOCALE}
86 niro 153 export LANG
87 niro 331 case $(basename $0) in
88     oopadmin) exec "${OOHOME}/program/spadmin" ;;
89     *) exec "${OOHOME}/program/soffice" "$@" ;;
90 niro 153 esac