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

File 17584-ubuntu-oneiric-postgis-template.diff, 1.5 KB (added by Antti Kaihola, 13 years ago)

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

  • docs/ref/contrib/gis/create_template_postgis-debian.sh

    diff --git a/docs/ref/contrib/gis/create_template_postgis-debian.sh b/docs/ref/contrib/gis/create_template_postgis-debian.sh
    index 61bbef4..2d9e98d 100755
    a b if [ -d "/usr/share/postgresql-8.3-postgis" ]  
    55then
    66    POSTGIS_SQL_PATH=/usr/share/postgresql-8.3-postgis
    77    POSTGIS_SQL=lwpostgis.sql
     8    GEOGRAPHY=0
    89fi
    910
    1011# For Ubuntu 10.04
    if [ -d "/usr/share/postgresql/8.4/contrib" ]  
    1213then
    1314    POSTGIS_SQL_PATH=/usr/share/postgresql/8.4/contrib
    1415    POSTGIS_SQL=postgis.sql
     16    GEOGRAPHY=0
    1517fi
    1618
    1719# For Ubuntu 10.10 (with PostGIS 1.5)
    then  
    2022    POSTGIS_SQL_PATH=/usr/share/postgresql/8.4/contrib/postgis-1.5
    2123    POSTGIS_SQL=postgis.sql
    2224    GEOGRAPHY=1
    23 else
    24     GEOGRAPHY=0
     25fi
     26
     27# For Ubuntu 11.10 / Linux Mint 12 (with PostGIS 1.5)
     28if [ -d "/usr/share/postgresql/9.1/contrib/postgis-1.5" ]
     29then
     30    POSTGIS_SQL_PATH=/usr/share/postgresql/9.1/contrib/postgis-1.5
     31    POSTGIS_SQL=postgis.sql
     32    GEOGRAPHY=1
    2533fi
    2634
    2735createdb -E UTF8 template_postgis && \
    28 createlang -d template_postgis plpgsql && \
     36( createlang -d template_postgis -l | grep plpgsql || createlang -d template_postgis plpgsql ) && \
    2937psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" && \
    3038psql -d template_postgis -f $POSTGIS_SQL_PATH/$POSTGIS_SQL && \
    3139psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql && \
Back to Top