# $Id: install.sh,v 1.6 2004/03/04 15:56:23 jacek Exp $
# The goal is to provide a single command that can be executed by the
# user which will download the relevant software, compile it, install
# it, and run the test suite, on any supported platform. A journey of
# a thousand miles starts with a single step ... so far this only
# works in Bourne compatible shells, on CERN RH 7.3 GNU/Linux with
# AFS. Go to the directory where you wish to install Pylcgdict, place
# this file there, and type
#
#     source install.sh
#
# give the password "cvs" when asked for a CVS password, then sit back
# and enjoy the ride. If, when everything stops, you see something
# like
#
#   Ran 272 tests in 0.726s
#   
#   OK
#   34 hidden failing tests
#   51 hidden segfaulting tests
#
# then the installation was successful.
#
# For an example of usage try:
#
#     python -i examples/root/hsimple.py 10000
#
# (More explicit tutorial and examples will be added soon ...)
INSTALL_DIR=`pwd`
# Check out the package 
cvs -z3 -d:pserver:anonymous@seal.cvs.cern.ch:/cvs/SEAL co seal/Scripting/PyLCGDict2
# For political reasons, the directory must be renamed
mv seal src
# Move to build location
cd src
# Prepare the environment
source Scripting/PyLCGDict2/env.sh
# Install the software
python Scripting/PyLCGDict2/python/setup.py install --prefix $INSTALL_DIR --install-lib $INSTALL_DIR/python standalone
export PYTHONPATH=$INSTALL_DIR/python:$PYTHONPATH
export LD_LIBRARY_PATH=$INSTALL_DIR/python/pylcgdict/tests/lib:$LD_LIBRARY_PATH
# Run the test suite
python $INSTALL_DIR/tests/bin/runtests.py
# Return to the top installation directory
cd $INSTALL_DIR

