#!/bin/bash # # determine the root directory of the LAP Library, assuming this script resides # in its designated sub-directory in the directory tree. # if [ -z "${LAPLIBRARY}" ]; then path=$(dirname $0) if [ "${path#./}" != "${path}" ]; then path="$(pwd)/${path#./}" fi if [ "${path#/}" = "${path}" ]; then if [ "${path}" = "." ]; then path="$(pwd)"; else path="$(pwd)/${path}" fi fi LAPLIBRARY="${path%/bin}"; export LAPLIBRARY; fi # # while we depend on a Python version newer than the system default, make at # least an attempt at guessing a suitable LAP Tree location. # if [ -z "${LAPTREE}" -a -d ${LAPLIBRARY%/library}/tree ]; then LAPTREE=${LAPLIBRARY%/library}/tree; fi # # include a shared set of shell functions and global parameters, including the # architecture identifier .LAPOS. # # _fix_me_ # not sure about the division of labor here; arguably, we could try to be fully # independent of the LAP Tree, but would then need to rely on a suitable Python # interpreter in the PATH. (12-mar-15; oe) # if [ -n "${LAPTREE}" ]; then . ${LAPTREE}/etc/library.bash; # # make sure that (non-core) shared libraries from the build environment are # available for dynamic loading (including on request, by add-one modules). # if [ -z "${LD_LIBRARY_PATH}" ]; then LD_LIBRARY_PATH=${LAPTREE}/python/lib; else LD_LIBRARY_PATH=${LAPTREE}/python/lib:${LD_LIBRARY_PATH}; fi export LD_LIBRARY_PATH; # # allow Python to find its own code from the LAP Tree and Library # export PYTHONPATH=${LAPTREE}/python:${LAPLIBRARY}/python:${PYTHONPATH}; export NLTK_DATA=${LAPTREE}/python/nltk_data; exec ${LAPTREE}/python/bin/python ${LAPLIBRARY}/bin/python/store.py "$@"; else # # minimally, allow Python to find its own code from the LAP Library # export PYTHONPATH=:${LAPLIBRARY}/python:${PYTHONPATH}; exec python ${LAPLIBRARY}/bin/python/store.py "$@"; fi