comparison contrib/make_flys_release/bin/make-importer-package.sh @ 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 a51515056c45
children 801866a89ee0
comparison
equal deleted inserted replaced
5178:13f3484d4618 5179:4355b4cecef8
3 3
4 # See README for more information 4 # See README for more information
5 5
6 # The working directory. Resulting tarball will be placed in the directory above. 6 # The working directory. Resulting tarball will be placed in the directory above.
7 PKG_DIR=/tmp/flys-importer 7 PKG_DIR=/tmp/flys-importer
8 # Path to oracle zip archives and an oracle_cx rpm
9 ORACLE=/path/to/oracle/archives
10 # Default conf 8 # Default conf
11 CONF_DIR=/path/to/conf/dir 9 CONF_DIR=/path/to/conf/dir
12 # Path to the flys checkout 10 # Path to the flys checkout
13 FLYS_DIR=/path/to/flys/root 11 FLYS_DIR=/path/to/flys/root
14 # Extra packages 12 # Tarball that will be extracted into flys-imprter/opt
15 EXTRAS=/path/to/gdal 13 EXTRAS=$1
16 14
17 rm -fr $PKG_DIR 15 rm -fr $PKG_DIR
18 mkdir -p $PKG_DIR/hydr_morph 16 mkdir -p $PKG_DIR/hydr_morph
19 mkdir -p $PKG_DIR/geodaesie 17 mkdir -p $PKG_DIR/geodaesie
20 mkdir -p $PKG_DIR/opt/lib64 18 mkdir -p $PKG_DIR/opt/lib64
21 mkdir -p $PKG_DIR/schema 19 mkdir -p $PKG_DIR/schema
20 mkdir -p $PKG_DIR/conf
21
22 cat > "$PKG_DIR/conf/log4j.properties" << "EOF"
23 log4j.rootLogger=DEBUG, IMPORTER
24 log4j.appender.IMPORTER.layout=org.apache.log4j.PatternLayout
25 log4j.appender.IMPORTER.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
26 log4j.appender.IMPORTER=org.apache.log4j.RollingFileAppender
27 log4j.appender.IMPORTER.File=./import.log
28 log4j.appender.IMPORTER.MaxFileSize=100000KB
29 log4j.appender.IMPORTER.MaxBackupIndex=10
30 EOF
22 31
23 cd ${FLYS_DIR}/flys-backend 32 cd ${FLYS_DIR}/flys-backend
24 mvn -f pom-oracle.xml clean compile assembly:single 33 mvn -f pom-oracle.xml clean compile assembly:single
25 cp target/flys-backend-1.0-SNAPSHOT-jar-with-dependencies.jar \ 34 cp target/flys-backend-1.0-SNAPSHOT-jar-with-dependencies.jar \
26 $PKG_DIR/hydr_morph/importer.jar 35 $PKG_DIR/hydr_morph/importer.jar
30 cp ${FLYS_DIR}/flys-backend/contrib/shpimporter/*.py $PKG_DIR/geodaesie 39 cp ${FLYS_DIR}/flys-backend/contrib/shpimporter/*.py $PKG_DIR/geodaesie
31 cp ${FLYS_DIR}/flys-backend/contrib/run_geo.sh \ 40 cp ${FLYS_DIR}/flys-backend/contrib/run_geo.sh \
32 ${FLYS_DIR}/flys-backend/contrib/run_hydr_morph.sh \ 41 ${FLYS_DIR}/flys-backend/contrib/run_hydr_morph.sh \
33 ${FLYS_DIR}/flys-backend/contrib/import_river.sh \ 42 ${FLYS_DIR}/flys-backend/contrib/import_river.sh \
34 $PKG_DIR 43 $PKG_DIR
35 cp -r ${CONF_DIR} $PKG_DIR
36 cp ${FLYS_DIR}/flys-backend/doc/annotation-types.xml $PKG_DIR/conf 44 cp ${FLYS_DIR}/flys-backend/doc/annotation-types.xml $PKG_DIR/conf
37 ln -s /usr/lib64/libproj.so.0.6.6 $PKG_DIR/opt/lib64/libproj.so # workaround for bad packaging 45 if [ -f $EXTRAS ];
38 rm -rf /tmp/other_rpms 46 cd $PKG_DIR
39 mkdir /tmp/other_rpms 47 tar -xzf $1
40 cd /tmp/other_rpms 48 fi
41
42 rpm2cpio ${EXTRAS}/libgdal1-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories
43 rpm2cpio ${EXTRAS}/gdal-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories
44 rpm2cpio ${EXTRAS}/python-gdal-1.9.0-intevation1.x86\_64.rpm | cpio -i --make-directories
45 rpm2cpio ${ORACLE}/cx\_Oracle-5.1.2-11g-py26-1.x86\_64.rpm | cpio -i --make-directories
46 cp -r /tmp/other_rpms/usr/* $PKG_DIR/opt
47 rm -rf /tmp/other_rpms
48 49
49 cp ${FLYS_DIR}/flys-backend/doc/schema/*.sql $PKG_DIR/schema 50 cp ${FLYS_DIR}/flys-backend/doc/schema/*.sql $PKG_DIR/schema
50 cp ${FLYS_DIR}/flys-backend/doc/documentation/de/importer-manual.pdf $PKG_DIR 51 cp ${FLYS_DIR}/flys-backend/doc/documentation/de/importer-manual.pdf $PKG_DIR
51
52 # Oracle (Do not distribute)
53 unzip ${ORACLE}/instantclient-basic-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt
54 unzip ${ORACLE}/instantclient-sdk-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt
55 unzip ${ORACLE}/instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip -d $PKG_DIR//opt
56
57 mkdir $PKG_DIR//opt/instantclient_11_2/lib
58 cd $PKG_DIR//opt/instantclient_11_2/lib
59 ln -s ../libclntsh.so.11.1 .
60 ln -s ../libclntsh.so.11.1 libclntsh.so
61 ln -s ../libnnz11.so .
62 ln -s ../libocci.so.11.1 .
63 ln -s ../libocci.so.11.1 libocci.so
64 ln -s ../libociei.so .
65 ln -s ../libocijdbc11.so .
66 ln -s ../libsqlplusic.so .
67 ln -s ../libsqlplus.so .
68 # End Oracle
69 52
70 sed -i 's/shpimporter\/shp/geodaesie\/shp/' $PKG_DIR/run_geo.sh 53 sed -i 's/shpimporter\/shp/geodaesie\/shp/' $PKG_DIR/run_geo.sh
71 54
72 cd $PKG_DIR/.. 55 cd $PKG_DIR/..
73 DATE=$(date +%Y%m%d%H%m) 56 DATE=$(date +%Y%m%d%H%m)
74 tar -czf flys-importer${DATE}.tar.gz flys-importer 57 tar -czf flys-importer_${DATE}.tar.gz flys-importer
75 sha1sum flys-importer${DATE}.tar.gz > flys-importer${DATE}.tar.gz.sha1 58 sha1sum flys-importer_${DATE}.tar.gz > flys-importer_${DATE}.tar.gz.sha1
59 echo Package is at: `readlink -f flys-importer${DATE}.tar.gz`

http://dive4elements.wald.intevation.org