aheinecke@5097: #!/bin/bash aheinecke@5097: set -e aheinecke@5097: aheinecke@5097: # See README for more information aheinecke@5097: aheinecke@5097: # The working directory. Resulting tarball will be placed in the directory above. aheinecke@5097: PKG_DIR=/tmp/flys-importer aheinecke@5097: # Path to oracle zip archives and an oracle_cx rpm aheinecke@5097: ORACLE=/path/to/oracle/archives aheinecke@5097: # Default conf aheinecke@5097: CONF_DIR=/path/to/conf/dir aheinecke@5097: # Path to the flys checkout aheinecke@5097: FLYS_DIR=/path/to/flys/root aheinecke@5097: # Extra packages aheinecke@5097: EXTRAS=/path/to/gdal aheinecke@5097: aheinecke@5097: rm -fr $PKG_DIR aheinecke@5097: mkdir -p $PKG_DIR/hydr_morph aheinecke@5097: mkdir -p $PKG_DIR/geodaesie aheinecke@5097: mkdir -p $PKG_DIR/opt/lib64 aheinecke@5097: mkdir -p $PKG_DIR/schema aheinecke@5097: aheinecke@5097: cd ${FLYS_DIR}/flys-backend aheinecke@5097: mvn -f pom-oracle.xml clean compile assembly:single aheinecke@5097: cp target/flys-backend-1.0-SNAPSHOT-jar-with-dependencies.jar \ aheinecke@5097: $PKG_DIR/hydr_morph/importer.jar aheinecke@5097: cp ${FLYS_DIR}/flys-backend/contrib/shpimporter/*.py $PKG_DIR/geodaesie aheinecke@5097: cp ${FLYS_DIR}/flys-backend/contrib/run_geo.sh \ aheinecke@5097: ${FLYS_DIR}/flys-backend/contrib/run_hydr_morph.sh \ aheinecke@5097: $PKG_DIR aheinecke@5097: cp -r ${CONF_DIR} $PKG_DIR aheinecke@5097: ln -s /usr/lib64/libproj.so.0.6.6 $PKG_DIR/opt/lib64/libproj.so # workaround for bad packaging aheinecke@5097: rm -rf /tmp/other_rpms aheinecke@5097: mkdir /tmp/other_rpms aheinecke@5097: cd /tmp/other_rpms aheinecke@5097: aheinecke@5097: rpm2cpio ${EXTRAS}/libgdal1-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories aheinecke@5097: rpm2cpio ${EXTRAS}/gdal-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories aheinecke@5097: rpm2cpio ${EXTRAS}/python-gdal-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories aheinecke@5097: rpm2cpio ${ORACLE}/cx\_Oracle-5.1.2-11g-py26-1.x86\_64.rpm | cpio -i --make-directories aheinecke@5097: cp -r /tmp/other_rpms/usr/* $PKG_DIR/opt aheinecke@5097: rm -rf /tmp/other_rpms aheinecke@5097: aheinecke@5097: cp ${FLYS_DIR}/flys-backend/doc/schema/*.sql $PKG_DIR/schema aheinecke@5097: cp ${FLYS_DIR}/flys-backend/doc/documentation/de/importer-manual.pdf $PKG_DIR aheinecke@5097: aheinecke@5097: # Oracle (Do not distribute) aheinecke@5097: unzip ${ORACLE}/instantclient-basic-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt aheinecke@5097: unzip ${ORACLE}/instantclient-sdk-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt aheinecke@5097: unzip ${ORACLE}/instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt aheinecke@5097: aheinecke@5097: mkdir $PKG_DIR//opt/instantclient_11_2/lib aheinecke@5097: cd $PKG_DIR//opt/instantclient_11_2/lib aheinecke@5097: ln -s ../libclntsh.so.11.1 . aheinecke@5097: ln -s ../libclntsh.so.11.1 libclntsh.so aheinecke@5097: ln -s ../libnnz11.so . aheinecke@5097: ln -s ../libocci.so.11.1 . aheinecke@5097: ln -s ../libocci.so.11.1 libocci.so aheinecke@5097: ln -s ../libociei.so . aheinecke@5097: ln -s ../libocijdbc11.so . aheinecke@5097: ln -s ../libsqlplusic.so . aheinecke@5097: ln -s ../libsqlplus.so . aheinecke@5097: # End Oracle aheinecke@5097: aheinecke@5097: sed -i 's/shpimporter\/shp/geodaesie\/shp/' $PKG_DIR/run_geo.sh aheinecke@5097: aheinecke@5097: cd $PKG_DIR/.. aheinecke@5097: DATE=$(date +%Y%m%d%H%m) aheinecke@5097: tar -czf flys-importer${DATE}.tar.gz flys-importer aheinecke@5097: sha1sum flys-importer${DATE}.tar.gz > flys-importer${DATE}.tar.gz.sha1