#!/bin/sh

working=gdal141

cd $z_cvs

svn checkout  https://svn.osgeo.org/gdal/branches/1.4/gdal $working 2>&1 | tee $z_cvs/$working/log.svn

rsync -a --delete --stats $z_cvs/$working/ $HOME/src/straight/$working/ 2>&1 | tee $z_cvs/$working/log.rsync

rm $z_cvs/$working/log.svn
mv $z_cvs/$working/log.rsync $HOME/src/straight/$working/

cd $HOME/src/straight/$working/

./configure --with-libz=internal --with-png=internal --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal --with-geos=yes --with-pg=/usr/bin/pg_config --with-sqlite=/usr/local/lib --with-xerces=yes --with-python --without-ngpython --with-threads 2>&1 | tee log.configure

# --with-hdf4=/usr/local/lib

make -j3 2>&1 | tee log.make

# rm *.spec

sudo checkinstall -D --pkgname=$working --pkgversion=`date +%F` --install=no --strip=yes --stripso=yes --pakdir=$HOME/src/checkinstall_pakdir --deldoc=yes --deldesc=yes --delspec=yes --backup=no 2>&1 | tee log.checkinstall
scnf 2>&1> log.scnf
sbld 2>&1> log.sbld
echo "NOW: sudo dpkg -i $HOME/src/checkinstall_pakdir/${working}_`date +%F`-1_amd64.deb; sudo ldconfig"
