#! /bin/bash
#
# Build pyhdf (v0.7-2 patched for numpy) from source on Linux
# -----------------------------------------------------------

PACKAGE=pyhdf-0.7-3-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

CPPFLAGS="-I$PREFIX/include/hdf" LDFLAGS="-L$PREFIX/lib" python setup.py install --prefix=$PREFIX

cd $ROOTDIR

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

rm -fr $PACKAGE
