aheinecke@5180: # Required packages are the build essential stuff make gcc etc.
aheinecke@5180: # and:
aheinecke@5180: # postgresql-devel libexpat-devel python-devel
aheinecke@5180: set -e
aheinecke@5180: # This script is intended to be run on suse enterprise linux
aheinecke@5180: 
aheinecke@5180: # Path to the oracle zip archives
aheinecke@5180: ORACLE_LOC=/home/intevation
aheinecke@5180: # Path to the Source tarballs of gdal-1.9.2.tar.gz proj-4.8.0.tar.gz cx_Oracle-5.1.2.tar.gz
aheinecke@5180: SOURCES=/home/intevation/Downloads
aheinecke@5180: #mkdir -p $SOURCES
aheinecke@5180: #cd $SOURCES
aheinecke@5180: #wget http://download.osgeo.org/gdal/gdal-1.9.2.tar.gz
aheinecke@5180: #wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz
aheinecke@5180: #wget http://downloads.sourceforge.net/project/cx-oracle/5.1.2/cx_Oracle-5.1.2.tar.gz
aheinecke@5180: 
aheinecke@5180: DEVELDIR=/tmp/gdalbuild
aheinecke@5180: INSTALL_PREFIX=$DEVELDIR/opt
aheinecke@5180: export ORACLE_HOME=$DEVELDIR/opt/instantclient_11_2
aheinecke@5180: export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
aheinecke@5180: 
aheinecke@5180: rm -rf $DEVELDIR
aheinecke@5180: mkdir -p $DEVELDIR
aheinecke@5180: 
aheinecke@5180: mkdir -p $SOURCES
aheinecke@5180: cd $SOURCES
aheinecke@5180: wget http://download.osgeo.org/gdal/gdal-1.9.2.tar.gz
aheinecke@5180: wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz
aheinecke@5180: wget http://downloads.sourceforge.net/project/cx-oracle/5.1.2/cx_Oracle-5.1.2.tar.gz
aheinecke@5180: 
aheinecke@5180: 
aheinecke@5180: # Oracle
aheinecke@5180: unzip $ORACLE_LOC/instantclient-basic-linux-x86-64-11.2.0.2.0.zip -d $DEVELDIR/opt
aheinecke@5180: unzip $ORACLE_LOC/instantclient-sdk-linux-x86-64-11.2.0.2.0.zip -d $DEVELDIR/opt
aheinecke@5180: unzip $ORACLE_LOC/instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip -d $DEVELDIR/opt
aheinecke@5180: mkdir $ORACLE_HOME/lib
aheinecke@5180: cd $ORACLE_HOME/lib
aheinecke@5180: ln -s ../libclntsh.so.11.1 .
aheinecke@5180: ln -s ../libclntsh.so.11.1 libclntsh.so
aheinecke@5180: ln -s ../libnnz11.so .
aheinecke@5180: ln -s ../libocci.so.11.1 .
aheinecke@5180: ln -s ../libocci.so.11.1 libocci.so
aheinecke@5180: ln -s ../libociei.so .
aheinecke@5180: ln -s ../libocijdbc11.so .
aheinecke@5180: ln -s ../libsqlplusic.so .
aheinecke@5180: ln -s ../libsqlplus.so .
aheinecke@5180: cd $ORACLE_HOME
aheinecke@5180: ln -s libclntsh.so.11.1 libclntsh.so
aheinecke@5180: 
aheinecke@5180: cd $DEVELDIR
aheinecke@5180: tar -xf $SOURCES/proj-4.8.0.tar.gz 
aheinecke@5180: cd proj-4.8.0
aheinecke@5180: ./configure --prefix=$INSTALL_PREFIX && make && make install
aheinecke@5180: 
aheinecke@5180: 
aheinecke@5180: cd $DEVELDIR
aheinecke@5180: tar -xf $SOURCES/gdal-1.9.2.tar.gz 
aheinecke@5180: cd gdal-1.9.2
aheinecke@5180: patch -l -p0 << "EOF"
aheinecke@5180: Index: ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp
aheinecke@5180: ===================================================================
aheinecke@5180: --- ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp    (revision 25700)
aheinecke@5180: +++ ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp    (working copy)
aheinecke@5180: @@ -264,7 +264,7 @@
aheinecke@5180:          char **papszResult;
aheinecke@5180:          int iDim = -1;
aheinecke@5180:  
aheinecke@5180: -               oDimCmd.Append( "SELECT COUNT(*) FROM ALL_SDO_GEOM_METADATA u," );
aheinecke@5180: +               oDimCmd.Append( "SELECT COUNT(*) FROM USER_SDO_GEOM_METADATA u," );
aheinecke@5180:                 oDimCmd.Append( "  TABLE(u.diminfo) t" );
aheinecke@5180:                 oDimCmd.Append( "  WHERE u.table_name = '" );
aheinecke@5180:                 oDimCmd.Append( osTableName );
aheinecke@5180: EOF
aheinecke@5180: LDFLAGS="-Wl,--no-as-needed" ./configure --with-python --with-oci=$ORACLE_HOME \
aheinecke@5180:     --prefix=$INSTALL_PREFIX && make && make install
aheinecke@5180: 
aheinecke@5180: cd $DEVELDIR
aheinecke@5180: tar -xf $SOURCES/cx_Oracle-5.1.2.tar.gz
aheinecke@5180: cd cx_Oracle-5.1.2
aheinecke@5180: python setup.py build
aheinecke@5180: python setup.py install --prefix=$INSTALL_PREFIX
aheinecke@5180: 
aheinecke@5180: cd $DEVELDIR
aheinecke@5180: tar -czf flys-importer-opt.tar.gz opt
aheinecke@5180: echo "Package is:"
aheinecke@5180: readlink -f flys-importer-opt.tar.gz