| 1 | = How to install PostGIS 1.5 on Ubuntu 10.10 LTS (''lucid'') 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 | Install prerequisite packages using: |
| 7 | {{{ |
| 8 | sudo apt-get install build-essential proj postgresql-8.4 postgresql-server-dev-8.4 libxml2-dev |
| 9 | }}} |
| 10 | |
| 11 | Optional packages for testing PostGIS: |
| 12 | {{{ |
| 13 | sudo apt-get install libcunit1-dev |
| 14 | }}} |
| 15 | Optional packages for building documentation: |
| 16 | {{{ |
| 17 | sudo apt-get install xsltproc docbook-xsl imagemagick |
| 18 | }}} |
| 19 | (for building PDF documentation, add `dblatex`, but expect a large download) |
| 20 | |
| 21 | === Build GEOS 3.3.x === |
| 22 | PostGIS 1.5 requires GEOS >= 3.1.1, however Ubuntu 10.10 only has GEOS 3.1 available in packages, so it needs to be built from source. |
| 23 | |
| 24 | There are multiple ways to build GEOS, but this is the simplest: |
| 25 | {{{ |
| 26 | wget http://download.osgeo.org/geos/geos-3.3.2.tar.bz2 |
| 27 | tar xvfj geos-3.3.2.tar.bz2 |
| 28 | cd geos-3.3.2 |
| 29 | ./configure |
| 30 | make |
| 31 | sudo make install |
| 32 | }}} |
| 33 | |
| 34 | == Build PostGIS == |
| 35 | Download, configure, build and install: |
| 36 | {{{ |
| 37 | wget http://postgis.refractions.net/download/postgis-1.5.3.tar.gz |
| 38 | tar xfvz postgis-1.5.3.tar.gz |
| 39 | cd postgis-1.5.3 |
| 40 | ./configure |
| 41 | make |
| 42 | sudo make install |
| 43 | sudo ldconfig |
| 44 | }}} |
| 45 | |
| 46 | === Documentation/comments === |
| 47 | From the `postgis-1.5.3` directory: |
| 48 | {{{ |
| 49 | cd doc |
| 50 | make |
| 51 | sudo make install |
| 52 | sudo make comments-install |
| 53 | }}} |
| 54 | |
| 55 | == Template == |
| 56 | 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. |
| 57 | |
| 58 | Log-in as `postgres` from `root` using "`su - postgres`", and use the following commands: |
| 59 | {{{ |
| 60 | sudo -u postgres createdb template_postgis |
| 61 | sudo -u postgres createlang plpgsql template_postgis |
| 62 | sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql |
| 63 | sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql |
| 64 | sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis_comments.sql |
| 65 | }}} |