Code

Ticket #17584: 17584-ubuntu-oneiric-postgis-template.diff

File 17584-ubuntu-oneiric-postgis-template.diff, 1.5 KB (added by akaihola, 2 years ago)

Adds support for Ubuntu 11.10 and derivatives to postgis template creation script

Line 
1diff --git a/docs/ref/contrib/gis/create_template_postgis-debian.sh b/docs/ref/contrib/gis/create_template_postgis-debian.sh
2index 61bbef4..2d9e98d 100755
3--- a/docs/ref/contrib/gis/create_template_postgis-debian.sh
4+++ b/docs/ref/contrib/gis/create_template_postgis-debian.sh
5@@ -5,6 +5,7 @@ if [ -d "/usr/share/postgresql-8.3-postgis" ]
6 then
7     POSTGIS_SQL_PATH=/usr/share/postgresql-8.3-postgis
8     POSTGIS_SQL=lwpostgis.sql
9+    GEOGRAPHY=0
10 fi
11 
12 # For Ubuntu 10.04
13@@ -12,6 +13,7 @@ if [ -d "/usr/share/postgresql/8.4/contrib" ]
14 then
15     POSTGIS_SQL_PATH=/usr/share/postgresql/8.4/contrib
16     POSTGIS_SQL=postgis.sql
17+    GEOGRAPHY=0
18 fi
19 
20 # For Ubuntu 10.10 (with PostGIS 1.5)
21@@ -20,12 +22,18 @@ then
22     POSTGIS_SQL_PATH=/usr/share/postgresql/8.4/contrib/postgis-1.5
23     POSTGIS_SQL=postgis.sql
24     GEOGRAPHY=1
25-else
26-    GEOGRAPHY=0
27+fi
28+
29+# For Ubuntu 11.10 / Linux Mint 12 (with PostGIS 1.5)
30+if [ -d "/usr/share/postgresql/9.1/contrib/postgis-1.5" ]
31+then
32+    POSTGIS_SQL_PATH=/usr/share/postgresql/9.1/contrib/postgis-1.5
33+    POSTGIS_SQL=postgis.sql
34+    GEOGRAPHY=1
35 fi
36 
37 createdb -E UTF8 template_postgis && \
38-createlang -d template_postgis plpgsql && \
39+( createlang -d template_postgis -l | grep plpgsql || createlang -d template_postgis plpgsql ) && \
40 psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" && \
41 psql -d template_postgis -f $POSTGIS_SQL_PATH/$POSTGIS_SQL && \
42 psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql && \