#!/usr/bin/env bash
# Build Path: /app/.heroku/vendor/

OUT_PREFIX=$1

# Use new path, containing autoconf.
export PATH="/app/.heroku/python/bin/:$PATH"
hash -r


echo "Building gdal..."

SOURCE_TARBALL='http://download.osgeo.org/proj/proj-4.8.0.tar.gz'

curl -L $SOURCE_TARBALL | tar zx

cd proj-4.8.0
./configure --prefix=$OUT_PREFIX  &&
make
make install

# Cleanup
cd ..
