comparison contrib/make_flys_release/bin/make-opt-package.sh @ 5180:520b4fea63bb

Add script to build third party libs for the flys-importer package
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 07 Mar 2013 10:22:30 +0100
parents
children f3b2aeb27e4b
comparison
equal deleted inserted replaced
5179:4355b4cecef8 5180:520b4fea63bb
1 # Required packages are the build essential stuff make gcc etc.
2 # and:
3 # postgresql-devel libexpat-devel python-devel
4 set -e
5 # This script is intended to be run on suse enterprise linux
6
7 # Path to the oracle zip archives
8 ORACLE_LOC=/home/intevation
9 # 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
10 SOURCES=/home/intevation/Downloads
11 #mkdir -p $SOURCES
12 #cd $SOURCES
13 #wget http://download.osgeo.org/gdal/gdal-1.9.2.tar.gz
14 #wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz
15 #wget http://downloads.sourceforge.net/project/cx-oracle/5.1.2/cx_Oracle-5.1.2.tar.gz
16
17 DEVELDIR=/tmp/gdalbuild
18 INSTALL_PREFIX=$DEVELDIR/opt
19 export ORACLE_HOME=$DEVELDIR/opt/instantclient_11_2
20 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
21
22 rm -rf $DEVELDIR
23 mkdir -p $DEVELDIR
24
25 mkdir -p $SOURCES
26 cd $SOURCES
27 wget http://download.osgeo.org/gdal/gdal-1.9.2.tar.gz
28 wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz
29 wget http://downloads.sourceforge.net/project/cx-oracle/5.1.2/cx_Oracle-5.1.2.tar.gz
30
31
32 # Oracle
33 unzip $ORACLE_LOC/instantclient-basic-linux-x86-64-11.2.0.2.0.zip -d $DEVELDIR/opt
34 unzip $ORACLE_LOC/instantclient-sdk-linux-x86-64-11.2.0.2.0.zip -d $DEVELDIR/opt
35 unzip $ORACLE_LOC/instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip -d $DEVELDIR/opt
36 mkdir $ORACLE_HOME/lib
37 cd $ORACLE_HOME/lib
38 ln -s ../libclntsh.so.11.1 .
39 ln -s ../libclntsh.so.11.1 libclntsh.so
40 ln -s ../libnnz11.so .
41 ln -s ../libocci.so.11.1 .
42 ln -s ../libocci.so.11.1 libocci.so
43 ln -s ../libociei.so .
44 ln -s ../libocijdbc11.so .
45 ln -s ../libsqlplusic.so .
46 ln -s ../libsqlplus.so .
47 cd $ORACLE_HOME
48 ln -s libclntsh.so.11.1 libclntsh.so
49
50 cd $DEVELDIR
51 tar -xf $SOURCES/proj-4.8.0.tar.gz
52 cd proj-4.8.0
53 ./configure --prefix=$INSTALL_PREFIX && make && make install
54
55
56 cd $DEVELDIR
57 tar -xf $SOURCES/gdal-1.9.2.tar.gz
58 cd gdal-1.9.2
59 patch -l -p0 << "EOF"
60 Index: ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp
61 ===================================================================
62 --- ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp (revision 25700)
63 +++ ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp (working copy)
64 @@ -264,7 +264,7 @@
65 char **papszResult;
66 int iDim = -1;
67
68 - oDimCmd.Append( "SELECT COUNT(*) FROM ALL_SDO_GEOM_METADATA u," );
69 + oDimCmd.Append( "SELECT COUNT(*) FROM USER_SDO_GEOM_METADATA u," );
70 oDimCmd.Append( " TABLE(u.diminfo) t" );
71 oDimCmd.Append( " WHERE u.table_name = '" );
72 oDimCmd.Append( osTableName );
73 EOF
74 LDFLAGS="-Wl,--no-as-needed" ./configure --with-python --with-oci=$ORACLE_HOME \
75 --prefix=$INSTALL_PREFIX && make && make install
76
77 cd $DEVELDIR
78 tar -xf $SOURCES/cx_Oracle-5.1.2.tar.gz
79 cd cx_Oracle-5.1.2
80 python setup.py build
81 python setup.py install --prefix=$INSTALL_PREFIX
82
83 cd $DEVELDIR
84 tar -czf flys-importer-opt.tar.gz opt
85 echo "Package is:"
86 readlink -f flys-importer-opt.tar.gz

http://dive4elements.wald.intevation.org