changeset 5179:4355b4cecef8

Improve importer packaging by just expecting a tarball with third party libs and no longer hack around with rpm2cpio. It is now also possible to generate a "light" importer package without third party libs by not providing that tarball.
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 07 Mar 2013 10:21:46 +0100
parents 13f3484d4618
children 520b4fea63bb
files contrib/make_flys_release/README contrib/make_flys_release/bin/make-importer-package.sh
diffstat 2 files changed, 29 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/make_flys_release/README	Wed Mar 06 16:44:42 2013 +0100
+++ b/contrib/make_flys_release/README	Thu Mar 07 10:21:46 2013 +0100
@@ -41,18 +41,13 @@
 
 Importer:
 =========
-Das script um den Importer zu bauen und zu paketieren liegt unter 
-bin/make-importer-package.sh dies muss man anpassen in dem man Pfade angibt
-unter welchem sich weitere pakete befinden.
-Um das Paket zu bauen muss rpm2cpio installiert sein.
+Das script um den Importer zu bauen und zu paketieren liegt unter
+bin/make-importer-package.sh
+Dieses muss man anpassen und ein paar pfade setzen
 
-Benötigt werden in den einzustellenden Verzeichnissen:
-EXTRAS:
-    - libgdal1-1.9.0-intevation1.x86\_64.rpm
-    - gdal-1.9.0-intevation1.x86\_64.rpm 
-    - python-gdal-1.9.0-intevation1.x86\_64.rpm
-ORACLE:
-    - cx\_Oracle-5.1.2-11g-py26-1.x86\_64.rpm
-    - instantclient-basic-linux-x86-64-11.2.0.2.0.zip
-    - instantclient-sdk-linux-x86-64-11.2.0.2.0.zip
-    - instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip
+Wenn man ein "Standalone" Paket bauen möchte kann man diesem script
+einen Parameter übergeben an welchem sich ein tarball befindet
+der mit ins importer paket gepackt werden soll. Dieser Tarball
+kann abhängigkeiten (gdal / proj / oracle) enthalten.
+Das skript um diesen tarball für sles zu erstellen ist
+bin/make-opt-package.sh
--- a/contrib/make_flys_release/bin/make-importer-package.sh	Wed Mar 06 16:44:42 2013 +0100
+++ b/contrib/make_flys_release/bin/make-importer-package.sh	Thu Mar 07 10:21:46 2013 +0100
@@ -5,20 +5,29 @@
 
 # The working directory. Resulting tarball will be placed in the directory above.
 PKG_DIR=/tmp/flys-importer
-# Path to oracle zip archives and an oracle_cx rpm
-ORACLE=/path/to/oracle/archives
 # Default conf
 CONF_DIR=/path/to/conf/dir
 # Path to the flys checkout
 FLYS_DIR=/path/to/flys/root
-# Extra packages
-EXTRAS=/path/to/gdal
+# Tarball that will be extracted into flys-imprter/opt
+EXTRAS=$1
 
 rm -fr $PKG_DIR
 mkdir -p $PKG_DIR/hydr_morph
 mkdir -p $PKG_DIR/geodaesie
 mkdir -p $PKG_DIR/opt/lib64
 mkdir -p $PKG_DIR/schema
+mkdir -p $PKG_DIR/conf
+
+cat > "$PKG_DIR/conf/log4j.properties" << "EOF"
+log4j.rootLogger=DEBUG, IMPORTER
+log4j.appender.IMPORTER.layout=org.apache.log4j.PatternLayout
+log4j.appender.IMPORTER.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
+log4j.appender.IMPORTER=org.apache.log4j.RollingFileAppender
+log4j.appender.IMPORTER.File=./import.log
+log4j.appender.IMPORTER.MaxFileSize=100000KB
+log4j.appender.IMPORTER.MaxBackupIndex=10
+EOF
 
 cd ${FLYS_DIR}/flys-backend
 mvn -f pom-oracle.xml clean compile assembly:single
@@ -32,44 +41,19 @@
     ${FLYS_DIR}/flys-backend/contrib/run_hydr_morph.sh \
     ${FLYS_DIR}/flys-backend/contrib/import_river.sh \
     $PKG_DIR
-cp -r ${CONF_DIR} $PKG_DIR
 cp ${FLYS_DIR}/flys-backend/doc/annotation-types.xml $PKG_DIR/conf
-ln -s /usr/lib64/libproj.so.0.6.6 $PKG_DIR/opt/lib64/libproj.so # workaround for bad packaging
-rm -rf /tmp/other_rpms
-mkdir /tmp/other_rpms
-cd /tmp/other_rpms
-
-rpm2cpio ${EXTRAS}/libgdal1-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories
-rpm2cpio ${EXTRAS}/gdal-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories
-rpm2cpio ${EXTRAS}/python-gdal-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories
-rpm2cpio ${ORACLE}/cx\_Oracle-5.1.2-11g-py26-1.x86\_64.rpm | cpio -i --make-directories
-cp -r /tmp/other_rpms/usr/* $PKG_DIR/opt
-rm -rf /tmp/other_rpms
+if [ -f $EXTRAS ];
+    cd $PKG_DIR
+    tar -xzf $1
+fi
 
 cp ${FLYS_DIR}/flys-backend/doc/schema/*.sql $PKG_DIR/schema
 cp ${FLYS_DIR}/flys-backend/doc/documentation/de/importer-manual.pdf $PKG_DIR
 
-# Oracle (Do not distribute)
-unzip ${ORACLE}/instantclient-basic-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt
-unzip ${ORACLE}/instantclient-sdk-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt
-unzip ${ORACLE}/instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt
-
-mkdir $PKG_DIR//opt/instantclient_11_2/lib
-cd $PKG_DIR//opt/instantclient_11_2/lib
-ln -s ../libclntsh.so.11.1 .
-ln -s ../libclntsh.so.11.1 libclntsh.so
-ln -s ../libnnz11.so .
-ln -s ../libocci.so.11.1 .
-ln -s ../libocci.so.11.1 libocci.so
-ln -s ../libociei.so .
-ln -s ../libocijdbc11.so .
-ln -s ../libsqlplusic.so .
-ln -s ../libsqlplus.so .
-# End Oracle
-
 sed -i 's/shpimporter\/shp/geodaesie\/shp/' $PKG_DIR/run_geo.sh
 
 cd $PKG_DIR/..
 DATE=$(date +%Y%m%d%H%m)
-tar -czf flys-importer${DATE}.tar.gz flys-importer
-sha1sum flys-importer${DATE}.tar.gz > flys-importer${DATE}.tar.gz.sha1
+tar -czf flys-importer_${DATE}.tar.gz flys-importer
+sha1sum flys-importer_${DATE}.tar.gz > flys-importer_${DATE}.tar.gz.sha1
+echo Package is at: `readlink -f flys-importer${DATE}.tar.gz`

http://dive4elements.wald.intevation.org