Magellan Linux

Diff of /trunk/openoffice/ooffice-wrapper

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1013 by niro, Wed Sep 5 16:02:20 2007 UTC revision 1014 by niro, Wed Mar 10 23:58:23 2010 UTC
# Line 1  Line 1 
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  
 #     Modifications by Niels Rogalla  
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-2.2  export OOO_EXTRA_ARG=''
8  PV=<pv>  unset PYTHONPATH
 OOHOME="/opt/openoffice-${PV}"  
   
 ##  
 ## Add /usr/share/fonts to font search path  
 ##  
   
 # Default font path.  This is used if SAL_FONTPATH_PRIVATE is not defined.  
   
 LOCAL_FONTPATH=""  
 for i in $(find /usr/share/fonts -maxdepth 1 -mindepth 1 -type d)  
 do  
  LOCAL_FONTPATH="${LOCAL_FONTPATH};${i}"  
 done  
   
 SAL_FONTPATH_PRIVATE=${SAL_FONTPATH_PRIVATE:-"${LOCAL_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  
 [[ x${LOCALE} = xC ]] && LOCALE="en_US"  
   
 LOCALEOO="${LOCALE/_/-}"  
9    
10  ##  ##
11  ## 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?
# Line 70  LOCALEOO="${LOCALE/_/-}" Line 14  LOCALEOO="${LOCALE/_/-}"
14  if [ $# = 0 ]  if [ $# = 0 ]
15  then  then
16   case $(basename $0) in   case $(basename $0) in
17   oocalc) set -- private:factory/scalc ;;   oobase) set -- -base ;;
18   oodraw) set -- private:factory/sdraw ;;   oocalc) set -- -calc ;;
19   ooimpress) set -- private:factory/simpress ;;   oodraw) set -- -draw ;;
20   oomath) set -- private:factory/smath ;;   ooimpress) set -- -impress ;;
21   ooweb) set -- private:factory/swriter/web ;;   oomath) set -- -math ;;
22   oowriter) set -- private:factory/swriter ;;   ooweb) set -- -web ;;
23     oowriter) set -- -writer ;;
24   esac   esac
25  fi  fi
26    
 ##  
 ## That's it. Launch the beast (with the given args)  
 ##  
 LANG=${LOCALE}  
 export LANG  
27  case $(basename $0) in  case $(basename $0) in
28   oopadmin) exec "${OOHOME}/program/spadmin" ;;   oopadmin) exec "${OO_HOME}/program/spadmin" ;;
29   *) exec "${OOHOME}/program/soffice" "$@" ;;   *) exec "${OO_HOME}/program/soffice" "$@" ;;
30  esac  esac

Legend:
Removed from v.1013  
changed lines
  Added in v.1014