Update ooo320-m1
[ooovba.git] / pyuno / zipcore / python.sh
blob618138413af9414c16e6fbdb764ce833299f0ae4
1 #!/bin/sh
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # Copyright 2008 by Sun Microsystems, Inc.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # $RCSfile: python.sh,v $
12 # $Revision: 1.10 $
14 # This file is part of OpenOffice.org.
16 # OpenOffice.org is free software: you can redistribute it and/or modify
17 # it under the terms of the GNU Lesser General Public License version 3
18 # only, as published by the Free Software Foundation.
20 # OpenOffice.org is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU Lesser General Public License version 3 for more details
24 # (a copy is included in the LICENSE file that accompanied this code).
26 # You should have received a copy of the GNU Lesser General Public License
27 # version 3 along with OpenOffice.org. If not, see
28 # <http://www.openoffice.org/license.html>
29 # for a copy of the LGPLv3 License.
31 #*************************************************************************
33 # resolve installation directory
34 sd_cwd="`pwd`"
35 if [ -h "$0" ] ; then
36 sd_basename=`basename "$0"`
37 sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
38 cd "`dirname "$0"`"
39 cd "`dirname "$sd_script"`"
40 else
41 cd "`dirname "$0"`"
43 sd_prog=`pwd`
44 cd "$sd_cwd"
46 # Set PATH so that crash_report is found:
47 PATH=$sd_prog${PATH+:$PATH}
48 export PATH
50 # Set LD_LIBRARY_PATH so that "import pyuno" finds libpyuno.so:
51 LD_LIBRARY_PATH=$sd_prog/../basis-link/program:$sd_prog/../basis-link/ure-link/lib${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
52 export LD_LIBRARY_PATH
54 # Set UNO_PATH so that "officehelper.bootstrap()" can find soffice executable:
55 : ${UNO_PATH=$sd_prog}
56 export UNO_PATH
58 # Set URE_BOOTSTRAP so that "uno.getComponentContext()" bootstraps a complete
59 # OOo UNO environment:
60 : ${URE_BOOTSTRAP=vnd.sun.star.pathname:$sd_prog/fundamentalrc}
61 export URE_BOOTSTRAP
63 PYTHONPATH=$sd_prog/../basis-link/program:$sd_prog/../basis-link/program/python-core-%%PYVERSION%%/lib:$sd_prog/../basis-link/program/python-core-%%PYVERSION%%/lib/lib-dynload:$sd_prog/../basis-link/program/python-core-%%PYVERSION%%/lib/lib-tk:$sd_prog/../basis-link/program/python-core-%%PYVERSION%%/lib/site-packages${PYTHONPATH+:$PYTHONPATH}
64 export PYTHONPATH
65 PYTHONHOME=$sd_prog/../basis-link/program/python-core-%%PYVERSION%%
66 export PYTHONHOME
68 # execute binary
69 exec "$sd_prog/../basis-link/program/python.bin" "$@"