#! /bin/bash
#
# Build pycdf (v0.6-2-rc1m patched for numpy) from source on Linux
# ----------------------------------------------------------------

PACKAGE=pycdf-0.6-2-rc1-numpy

# 1. Installation and current path
# --------------------------------

if [ -z $PREFIX ]; then
   PREFIX=$HOME/linux
fi

ROOTDIR=`pwd`

# 2. Untar
# --------

tar -xvzf $PACKAGE.tar.gz

# 3. Configure, build and install pycdf
# -------------------------------------

cd $PACKAGE

LDFLAGS="-L$PREFIX/lib" python setup.py install --prefix=$PREFIX

cd $ROOTDIR

# 4. Clean up
# -----------

rm -fr $PACKAGE
