Changes between Initial Version and Version 1 of UsersWikiPostGIS20Debian60src


Ignore:
Timestamp:
Mar 7, 2012, 1:23:38 AM (12 years ago)
Author:
Mike Taves
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20Debian60src

    v1 v1  
     1= How to install PostGIS 2.0 on Debian 6.0 (''squeeze'') from source =
     2
     3== Prerequisites ==
     4
     5Several components are needed, which can either be built from source or installed from pre-built packages, as shown below. It is assumed you have already installed and configured `sudo` (not done by default).
     6
     7Install prerequisite packages using:
     8{{{
     9sudo apt-get install build-essential postgresql-8.4 postgresql-server-dev-8.4 libxml2-dev proj libjson0-dev
     10}}}
     11
     12Optional package for raster support:
     13{{{
     14sudo apt-get install libgdal-dev
     15}}}
     16Optional packages for testing PostGIS:
     17{{{
     18sudo apt-get install libcunit1-dev
     19}}}
     20Optional packages for building documentation:
     21{{{
     22sudo apt-get install xsltproc docbook-xsl docbook-mathml imagemagick
     23}}}
     24(for building PDF documentation, add `dblatex`, but expect a large download)
     25
     26
     27=== Build GEOS 3.3.2 ===
     28PostGIS 2.0 requires GEOS >= 3.3.2 for topology support.
     29
     30There are multiple ways to build GEOS, but this is the simplest:
     31{{{
     32wget http://download.osgeo.org/geos/geos-3.3.2.tar.bz2
     33tar xvfj geos-3.3.2.tar.bz2
     34cd geos-3.3.2
     35./configure
     36make
     37sudo make install
     38}}}
     39
     40== Build PostGIS ==
     41{{{
     42wget http://postgis.refractions.net/download/postgis-2.0.0beta2SVN.tar.gz
     43tar xfvz postgis-2.0.0beta2SVN.tar.gz
     44cd postgis-2.0.0beta2SVN
     45}}}
     46PostGIS 2.0 can be configured to disable topology or raster extensions, using the configure flags `--without-raster` and `--without-topology`. The default is to build both extensions:
     47{{{
     48./configure
     49make
     50sudo make install
     51sudo make comments-install
     52}}}
     53
     54== Template ==
     55Complete a post-install by creating a template, which can be re-used for creating multiple spatially-enabled databases. Or if you just want to make one spatially enabled database, you can modify the commands for your needs.
     56
     57Log-in as `postgres` from `root` using "`su - postgres`", and use the following commands:
     58{{{
     59createdb template_postgis
     60createlang plpgsql template_postgis
     61psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/postgis.sql
     62psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/spatial_ref_sys.sql
     63psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/postgis_comments.sql
     64}}}
     65
     66=== Enable raster extension ===
     67Adding on to `template_postgis`:
     68{{{
     69psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/rtpostgis.sql
     70psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/raster_comments.sql
     71}}}
     72
     73=== Enable topology extension ===
     74Adding on to `template_postgis`:
     75{{{
     76psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/topology.sql
     77psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/topology_comments.sql
     78}}}