| 1 | = How to install PostGIS 1.5 on Debian 6.0 (''squeeze'') from source = |
| 2 | |
| 3 | == Prerequisites == |
| 4 | Several components are needed, which can either be built from source or installed from pre-built packages, as shown below. |
| 5 | |
| 6 | As `root` (or prefix "`sudo`", if available), install prerequisite packages using: |
| 7 | {{{ |
| 8 | apt-get install proj postgresql-server-dev-8.4 libxml2-dev libgeos-dev |
| 9 | }}} |
| 10 | |
| 11 | Optional packages for testing PostGIS: |
| 12 | {{{ |
| 13 | apt-get install libcunit1-dev |
| 14 | }}} |
| 15 | Optional packages for building documentation: |
| 16 | {{{ |
| 17 | apt-get install xsltproc docbook-xsl imagemagick |
| 18 | }}} |
| 19 | (for building PDF documentation, add `dblatex`, but expect a large download) |
| 20 | |
| 21 | == Build == |
| 22 | |
| 23 | PostGIS can be built built from any user account: |
| 24 | {{{ |
| 25 | wget http://postgis.refractions.net/download/postgis-1.5.3.tar.gz |
| 26 | tar xfvz postgis-1.5.3.tar.gz |
| 27 | cd postgis-1.5.3 |
| 28 | ./configure |
| 29 | make |
| 30 | }}} |
| 31 | And as `root`: |
| 32 | {{{ |
| 33 | make install |
| 34 | }}} |
| 35 | |
| 36 | === Documentation/comments === |
| 37 | From the `postgis-1.5.3` directory: |
| 38 | {{{ |
| 39 | cd doc |
| 40 | make |
| 41 | }}} |
| 42 | and as `root`: |
| 43 | {{{ |
| 44 | make install |
| 45 | make comments-install |
| 46 | }}} |
| 47 | |
| 48 | == Template == |
| 49 | Complete 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. |
| 50 | |
| 51 | Log-in as `postgres` from `root` using "`su - postgres`", and use the following commands: |
| 52 | {{{ |
| 53 | createdb template_postgis |
| 54 | createlang plpgsql template_postgis |
| 55 | psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql |
| 56 | psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql |
| 57 | psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis_comments.sql |
| 58 | }}} |