| 1 | = How to install PostGIS 1.5 on Ubuntu 11.10 (''oneiric'') 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 postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev libgeos-dev proj |
| 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 == |
| 22 | Download, configure, build and install: |
| 23 | {{{ |
| 24 | wget http://postgis.refractions.net/download/postgis-1.5.3.tar.gz |
| 25 | tar xfvz postgis-1.5.3.tar.gz |
| 26 | cd postgis-1.5.3 |
| 27 | ./configure |
| 28 | make |
| 29 | sudo make install |
| 30 | }}} |
| 31 | |
| 32 | === Documentation/comments === |
| 33 | From the `postgis-1.5.3` directory: |
| 34 | {{{ |
| 35 | cd doc |
| 36 | make |
| 37 | sudo make install |
| 38 | sudo make comments-install |
| 39 | }}} |
| 40 | |
| 41 | == Template == |
| 42 | 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. |
| 43 | {{{ |
| 44 | sudo -u postgres createdb template_postgis |
| 45 | sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql |
| 46 | sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql |
| 47 | sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis_comments.sql |
| 48 | }}} |
| 49 | |
| 50 | == See also == |
| 51 | * https://help.ubuntu.com/community/PostgreSQL |