1cdf0e10cSrcweir#!/bin/sh 2fce70c9bSAndrew Rist#************************************************************** 3fce70c9bSAndrew Rist# 4fce70c9bSAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 5fce70c9bSAndrew Rist# or more contributor license agreements. See the NOTICE file 6fce70c9bSAndrew Rist# distributed with this work for additional information 7fce70c9bSAndrew Rist# regarding copyright ownership. The ASF licenses this file 8fce70c9bSAndrew Rist# to you under the Apache License, Version 2.0 (the 9fce70c9bSAndrew Rist# "License"); you may not use this file except in compliance 10fce70c9bSAndrew Rist# with the License. You may obtain a copy of the License at 11fce70c9bSAndrew Rist# 12fce70c9bSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 13fce70c9bSAndrew Rist# 14fce70c9bSAndrew Rist# Unless required by applicable law or agreed to in writing, 15fce70c9bSAndrew Rist# software distributed under the License is distributed on an 16fce70c9bSAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17fce70c9bSAndrew Rist# KIND, either express or implied. See the License for the 18fce70c9bSAndrew Rist# specific language governing permissions and limitations 19fce70c9bSAndrew Rist# under the License. 20fce70c9bSAndrew Rist# 21fce70c9bSAndrew Rist#************************************************************** 22cdf0e10cSrcweir 23cdf0e10cSrcweir# resolve installation directory 24cdf0e10cSrcweirsd_cwd="`pwd`" 25cdf0e10cSrcweirif [ -h "$0" ] ; then 26cdf0e10cSrcweir sd_basename=`basename "$0"` 27cdf0e10cSrcweir sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"` 28cdf0e10cSrcweir cd "`dirname "$0"`" 29cdf0e10cSrcweir cd "`dirname "$sd_script"`" 30cdf0e10cSrcweirelse 31cdf0e10cSrcweir cd "`dirname "$0"`" 32cdf0e10cSrcweirfi 33cdf0e10cSrcweirsd_prog=`pwd` 34cdf0e10cSrcweircd "$sd_cwd" 35cdf0e10cSrcweir 36cdf0e10cSrcweir# Set PATH so that crash_report is found: 37cdf0e10cSrcweirPATH=$sd_prog${PATH+:$PATH} 38cdf0e10cSrcweirexport PATH 39cdf0e10cSrcweir 40cdf0e10cSrcweir# Set LD_LIBRARY_PATH so that "import pyuno" finds libpyuno.so: 41*28b67305SJürgen SchmidtLD_LIBRARY_PATH=$sd_prog:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} 42cdf0e10cSrcweirexport LD_LIBRARY_PATH 43cdf0e10cSrcweir 44cdf0e10cSrcweir# Set UNO_PATH so that "officehelper.bootstrap()" can find soffice executable: 45cdf0e10cSrcweir: ${UNO_PATH=$sd_prog} 46cdf0e10cSrcweirexport UNO_PATH 47cdf0e10cSrcweir 48cdf0e10cSrcweir# Set URE_BOOTSTRAP so that "uno.getComponentContext()" bootstraps a complete 49cdf0e10cSrcweir# OOo UNO environment: 50cdf0e10cSrcweir: ${URE_BOOTSTRAP=vnd.sun.star.pathname:$sd_prog/fundamentalrc} 51cdf0e10cSrcweirexport URE_BOOTSTRAP 52cdf0e10cSrcweir 53*28b67305SJürgen SchmidtPYTHONPATH=$sd_prog:$sd_prog/python-core-%%PYVERSION%%/lib:$sd_prog/python-core-%%PYVERSION%%/lib/lib-dynload:$sd_prog/python-core-%%PYVERSION%%/lib/lib-tk:$sd_prog/python-core-%%PYVERSION%%/lib/site-packages${PYTHONPATH+:$PYTHONPATH} 54cdf0e10cSrcweirexport PYTHONPATH 55*28b67305SJürgen SchmidtPYTHONHOME=$sd_prog/python-core-%%PYVERSION%% 56cdf0e10cSrcweirexport PYTHONHOME 57cdf0e10cSrcweir 58cdf0e10cSrcweir# execute binary 59*28b67305SJürgen Schmidtexec "$sd_prog/python.bin" "$@" 60