merged tag ooo/DEV300_m102
[LibreOffice.git] / pyuno / zipcore / python.sh
blobb57bc6c3e3b6f54c4090078b1ad07f4afae4435d
1 #!/bin/sh
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 # Copyright 2000, 2010 Oracle and/or its affiliates.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # This file is part of OpenOffice.org.
12 # OpenOffice.org is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU Lesser General Public License version 3
14 # only, as published by the Free Software Foundation.
16 # OpenOffice.org 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
19 # GNU Lesser General Public License version 3 for more details
20 # (a copy is included in the LICENSE file that accompanied this code).
22 # You should have received a copy of the GNU Lesser General Public License
23 # version 3 along with OpenOffice.org. If not, see
24 # <http://www.openoffice.org/license.html>
25 # for a copy of the LGPLv3 License.
27 #*************************************************************************
29 # resolve installation directory
30 sd_cwd="`pwd`"
31 if [ -h "$0" ] ; then
32 sd_basename=`basename "$0"`
33 sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
34 cd "`dirname "$0"`"
35 cd "`dirname "$sd_script"`"
36 else
37 cd "`dirname "$0"`"
39 sd_prog=`pwd`
40 cd "$sd_cwd"
42 # Set PATH so that crash_report is found:
43 PATH=$sd_prog${PATH+:$PATH}
44 export PATH
46 # Set LD_LIBRARY_PATH so that "import pyuno" finds libpyuno.so:
47 LD_LIBRARY_PATH=$sd_prog/../basis-link/program:$sd_prog/../basis-link/ure-link/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
48 export LD_LIBRARY_PATH
50 # Set UNO_PATH so that "officehelper.bootstrap()" can find soffice executable:
51 : ${UNO_PATH=$sd_prog}
52 export UNO_PATH
54 # Set URE_BOOTSTRAP so that "uno.getComponentContext()" bootstraps a complete
55 # OOo UNO environment:
56 : ${URE_BOOTSTRAP=vnd.sun.star.pathname:$sd_prog/fundamentalrc}
57 export URE_BOOTSTRAP
59 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}
60 export PYTHONPATH
61 PYTHONHOME=$sd_prog/../basis-link/program/python-core-%%PYVERSION%%
62 export PYTHONHOME
64 # execute binary
65 exec "$sd_prog/../basis-link/program/python.bin" "$@"