sit/python_install.sh

111 lines
2.2 KiB
Bash
Raw Permalink Normal View History

2011-04-18 14:19:34 +00:00
#!/usr/bin/env bash
# Installation script for python and stuff
# Christoph Niethammer <niethammer@hlrs.de> (C) 2011
# Jose Gracia <gracia@hlrs.de> (c) 2011
set -e
set -x
source "functions.sh"
export ORIGDIR=`pwd`
export SIT_DIR=$(dirname "$ORIGDIR/$0")
#echo $SIT_DIR
export SRC_POOL=${HOME}/src
export WORKDIR_BASE=${HOME}/work
PYTHON_VERSION=2.7.1
SETUPTOOLS_VERSION=0.6c11
CAIRO_VERSION=1.2.2
2015-03-06 12:48:54 +00:00
#PYGRAPHVIZ_VERSION=1.0
2011-04-18 14:19:34 +00:00
NETWORKX_VERSION=1.4
PYGTK_VERSION=2.10.6
PYGOBJECT_VERSION=2.12.3
#export BASE_PREFIX=${HOME}/opt/python
2015-03-06 12:48:54 +00:00
export BASE_PREFIX=/sw/laki-SL6x/hlrs/python
2011-04-18 14:19:34 +00:00
PREFIX=${BASE_PREFIX}/${PYTHON_VERSION}
MAKEOPTS="-j4"
function sit_auto_install() {
export WORKDIR=$WORKDIR_BASE/${P}
export SRCDIR=${WORKDIR}/${P}
export BUILDDIR=${WORKDIR}/build
if [ -d ${WORKDIR} ]
then
rm -rf ${WORKDIR}
fi
mkdir -p ${WORKDIR}
mkdir -p ${BUILDDIR}
mkdir -p ${PREFIX}
cd ${WORKDIR}
sit_unpack
sit_configure
sit_build
sit_install
}
# install python interpreter
P=Python-${PYTHON_VERSION}
A=Python-${PYTHON_VERSION}.tar.bz2
sit_auto_install
# set python variables to installation
export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib
echo "Python interpreter installed under"
echo " $PREFIX"
# install setuptool
chmod +x ${SRC_POOL}/setuptools-${SETUPTOOLS_VERSION}-py2.7.egg
${SRC_POOL}/setuptools-${SETUPTOOLS_VERSION}-py2.7.egg
# install additional packages under PREFIX
# and use python setup.py install --prefix $PREFIX
echo "Installing additional python modules/packages under"
echo " ${PREFIX}"
echo "Use '--prefix=${PREFIX}' with distutils."
# install pycairo
echo "Installing pycairo ${CAIRO_VERSION}"
P=pycairo-${CAIRO_VERSION}
A=${P}.tar.gz
sit_auto_install
2015-03-06 12:48:54 +00:00
## install pygraphviz
#echo "installing pygraphviz ${PYGRAPHVIZ_VERSION}"
#P=pygraphviz-${PYGRAPHVIZ_VERSION}
#A=${P}.tar.gz
#easy_install --allow-hosts None -f ${SRC_POOL} pygraphviz
2011-04-18 14:19:34 +00:00
# install networkx
echo "installing networkx ${NETWORKX_VERSION}"
easy_install --allow-hosts None -f ${SRC_POOL} networkx
# install pygtk
echo "Installing pygtk ${PYGTK_VERSION}"
P=pygtk-${PYGTK_VERSION}
2015-03-06 12:48:54 +00:00
A=${P}.tar.gz
2011-04-18 14:19:34 +00:00
sit_auto_install
# install pygobject
echo "Installing pygobject ${PYGOBJECT_VERSION}"
P=pygobject-${PYGOBJECT_VERSION}
A=${P}.tar.gz
sit_auto_install
exit 0