Strabon

changeset 1456:3a20ea696d0e

#58 Added dependencies and a script for initializing the template_postgis
(strabon-init). See more at Changelog.
author Giannis Vlachopoulos <johnvl@di.uoa.gr>
date Thu Jan 15 13:44:51 2015 +0200 (2015-01-15)
parents 5f2026e24c32
children c56f16b4fb1a
files ChangeLog endpoint-exec/pom.xml endpoint-exec/src/deb/control/control endpoint-exec/strabon-endpoint endpoint-exec/strabon-init
line diff
     1.1 --- a/ChangeLog	Thu Dec 18 19:14:14 2014 +0200
     1.2 +++ b/ChangeLog	Thu Jan 15 13:44:51 2015 +0200
     1.3 @@ -1,3 +1,9 @@
     1.4 +	* Bug #58: Added dependencies - java, postgresql, tomcat. Also, added
     1.5 +	  a strabon-init script that detects the postgis installation path
     1.6 +	  and sets up the template_postgis. Finally the script creates a db
     1.7 +	  called "endpoint" (assuming it does not already exist) that is used
     1.8 +	  for the strabon-endpoint command.
     1.9 +
    1.10  	* Fixed a bug that would return no results when a variable that results 
    1.11  	  from a BIND clause appears in the FILTER or in the projection of a
    1.12  	  query and is inside a spatial function.
     2.1 --- a/endpoint-exec/pom.xml	Thu Dec 18 19:14:14 2014 +0200
     2.2 +++ b/endpoint-exec/pom.xml	Thu Jan 15 13:44:51 2015 +0200
     2.3 @@ -125,6 +125,17 @@
     2.4                                                                          <filemode>755</filemode>
     2.5                                                                  </mapper>
     2.6                                                          </data>
     2.7 +							<data>
     2.8 +                                                                <src>${basedir}/strabon-init</src>
     2.9 +                                                                <type>file</type>
    2.10 +                                                                <mapper>
    2.11 +                                                                        <type>perm</type>
    2.12 +                                                                        <prefix>/usr/local/bin</prefix>
    2.13 +                                                                        <user>root</user>
    2.14 +                                                                        <group>root</group>
    2.15 +                                                                        <filemode>755</filemode>
    2.16 +                                                                </mapper>
    2.17 +                                                        </data>
    2.18                                                  </dataSet>
    2.19                                          </configuration>
    2.20                                  </execution>
     3.1 --- a/endpoint-exec/src/deb/control/control	Thu Dec 18 19:14:14 2014 +0200
     3.2 +++ b/endpoint-exec/src/deb/control/control	Thu Jan 15 13:44:51 2015 +0200
     3.3 @@ -1,8 +1,9 @@
     3.4  Package: Strabon
     3.5 -Version: 3.2.10
     3.6 +Version: 3.2.11
     3.7  Section: strabon-endpoint
     3.8  Priority: optional
     3.9  Architecture: all
    3.10  Maintainer: Manolis Karpathiotakis <manos.karpathiotakis@epfl.ch>, Kostis Kyzirakos <Kostis.Kyzirakos@cwi.nl>, Charalampos Nikolaou <charnik@di.uoa.gr>, Konstantina Bereta <konstantina.bereta@di.uoa.gr>, Georgios Garbis <ggarbis@di.uoa.gr>,  Dimitrios Bilidas <dbilidas@di.uoa.gr>, Stella Giannakopoulou <sgian@di.uoa.gr>, Panayiotis Smeros <psmeros@di.uoa.gr>, Kalliroi Dogani <kallirroi@di.uoa.gr>, Maria Karpathiotaki <mkarpat@di.uoa.gr>, Ioannis Vlachopoulos <johnvl@di.uoa.gr>, Dimitrianos Savva <dimis@di.uoa.gr>, Georgios Stamoulis <gstam@di.uoa.gr>, Kanela Kaligosi <kalkan@di.uoa.gr>
    3.11  Description: Strabon endpoint executable
    3.12 +Depends: openjdk-7-jre | oracle-java7-installer, postgresql (>= 9.1) | postgresql-9.1, tomcat7
    3.13  Distribution: Mozilla v2.0 Public Liscence
     4.1 --- a/endpoint-exec/strabon-endpoint	Thu Dec 18 19:14:14 2014 +0200
     4.2 +++ b/endpoint-exec/strabon-endpoint	Thu Jan 15 13:44:51 2015 +0200
     4.3 @@ -1,4 +1,4 @@
     4.4  #!/bin/bash
     4.5  
     4.6 -java -jar /usr/share/jdeb/lib/strabon-endpoint-executable-3.2.10-SNAPSHOT.jar "$@"
     4.7 +java -jar /usr/share/jdeb/lib/strabon-endpoint-executable-*-SNAPSHOT.jar "$@"
     4.8  
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/endpoint-exec/strabon-init	Thu Jan 15 13:44:51 2015 +0200
     5.3 @@ -0,0 +1,53 @@
     5.4 +#!/bin/bash
     5.5 +
     5.6 +sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';"
     5.7 +
     5.8 +
     5.9 +#dpkg -l
    5.10 +POSTGRES_SQL_PATH=`pg_config --sharedir`'/contrib/';
    5.11 +mytemp=`ls $POSTGRES_SQL_PATH | grep 'postgis-'`
    5.12 +
    5.13 +#check if mytemp is empty, in this case the user must explicitly provide the postgis contrib path
    5.14 +if [ $mytemp == "" ]
    5.15 +then
    5.16 +	echo "Postgis installation could not be found in the default directory. Please state explicitly the full path of your PostGIS installation (e.g. /home/user/...)"
    5.17 +	read POSTGIS_SQL_PATH;
    5.18 +else
    5.19 +	POSTGIS_SQL_PATH=$POSTGRES_SQL_PATH$mytemp
    5.20 +fi
    5.21 +
    5.22 +FILE=$POSTGIS_SQL_PATH'/postgis.sql'
    5.23 +if [ -f $FILE ];
    5.24 +then
    5.25 +   echo "PostGIS installation directory found : $POSTGIS_SQL_PATH "
    5.26 +else
    5.27 +   echo "PostGis installation directory not found. Aborting..."
    5.28 +fi
    5.29 +
    5.30 +template_exists=`sudo -u postgres psql -l | grep template_postgis | wc -l`
    5.31 +if [ $template_exists -eq 1 ]
    5.32 +then
    5.33 +	echo "Database template_postgis already exists, aborting...";
    5.34 +	exit 0
    5.35 +fi
    5.36 +
    5.37 +sudo -u postgres createdb -E UTF8 -T template0 template_postgis
    5.38 +sudo -u postgres createlang -d  template_postgis plpgsql
    5.39 +sudo -u postgres  psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
    5.40 +sudo -u postgres  psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql
    5.41 +
    5.42 +sudo -u postgres psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
    5.43 +sudo -u postgres psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
    5.44 +sudo -u postgres psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
    5.45 +
    5.46 +sudo -u postgres psql -d template_postgis -c "VACUUM FULL;"
    5.47 +sudo -u postgres psql -d template_postgis -c "VACUUM FREEZE;"
    5.48 +
    5.49 +sudo -u postgres psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
    5.50 +sudo -u postgres psql -d postgres -c "UPDATE pg_database SET datallowconn='false' WHERE datname='template_postgis';"
    5.51 +
    5.52 +endpoint_exists=`sudo -u postgres psql -l | grep endpoint | wc -l`
    5.53 +if [ $template_exists -eq 0 ]
    5.54 +then
    5.55 +	sudo -u postgres createdb endpoint -T template_postgis
    5.56 +fi