Changes between Initial Version and Version 1 of UsersWikiPostGIS20Debian60pkg


Ignore:
Timestamp:
09/27/12 18:54:22 (12 years ago)
Author:
danielceregatti
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20Debian60pkg

    v1 v1  
     1=== Steps for creating a "proper" Postgis 2.0 package on Debian Squeeze ===
     2
     3I prefer to build in a chroot. Install debootstrap if you don't already have it. Change amd64 to i386 or whatever is necessary to suit your environment.
     4{{{
     5mkdir chroot
     6debootstrap --arch=amd64 squeeze chroot http://ftp.debian.org/debian/
     7sudo mount --bind /proc chroot/proc
     8sudo mount --bind /sys chroot/sys
     9sudo mount --bind /dev chroot/dev
     10sudo mount --bind /dev/pts chroot/dev/pts
     11sudo chroot chroot /bin/bash
     12}}}
     13
     14Add the backports repo for postgresql 9.1 (Optional). I for one want to use modern software, so I chose to go with Postgresql 9.1 instead of 8.4 which is what squeeze defaults to.
     15{{{
     16cat >> /etc/apt/sources.list.d/backports.list <<EOF
     17deb http://backports.debian.org/debian-backports squeeze-backports main
     18EOF
     19
     20cat >> /etc/apt/preferences.d/postgresql.pref <<EOF
     21Package: libpq5
     22Pin: release o=Debian Backports
     23Pin-Priority: 1000
     24
     25Package: libpq-dev
     26Pin: release o=Debian Backports
     27Pin-Priority: 1000
     28
     29Package: postgresql-9.1
     30Pin: release o=Debian Backports
     31Pin-Priority: 1000
     32
     33Package: postgresql-client-9.1
     34Pin: release o=Debian Backports
     35Pin-Priority: 1000
     36
     37Package: postgresql-client-common
     38Pin: release o=Debian Backports
     39Pin-Priority: 1000
     40
     41Package: postgresql-common
     42Pin: release o=Debian Backports
     43Pin-Priority: 1000
     44
     45Package: postgresql-contrib
     46Pin: release o=Debian Backports
     47Pin-Priority: 1000
     48
     49Package: postgresql-contrib-9.1
     50Pin: release o=Debian Backports
     51Pin-Priority: 1000
     52
     53Package: postgresql-plperl-9.1
     54Pin: release o=Debian Backports
     55Pin-Priority: 1000
     56
     57Package: postgresql-server-dev-9.1
     58Pin: release o=Debian Backports
     59Pin-Priority: 1000
     60EOF
     61
     62apt-get update
     63}}}
     64
     65Install the dependencies required for building everything. Note that here I install the postgresql 9.1 files. YMMV if you use postgresql 8.4.
     66{{{
     67sudo apt-get install build-essential postgresql-9.1 debhelper devscripts dh-make-perl autotools-dev flex bison libgeos-dev libproj-dev libssl-dev xsltproc docbook docbook-xsl default-jdk libpg-java fastjar libjts-java imagemagick libcunit1-dev dblatex libxml2-dev libgtk2.0-dev postgresql-server-dev-9.1 apt-file libclass-data-inheritable-perl alien doxygen swig ruby ruby-dev libpopt-dev libjson0-dev checkinstall proj-bin grass-dev libcurl4-dev libdap-dev libgif-dev libhdf4-alt-dev libhdf5-serial-dev libjasper-dev libjpeg-dev libltdl3-dev libmysqlclient-dev libnetcdf-dev libpng-dev libpq-dev libspatialite-dev libsqlite3-dev libxerces-c2-dev unixodbc-dev libgdal1-dev ant
     68}}}
     69
     70Create a scratch directory to perform all the tasks and cd into it
     71{{{
     72mkdir scratch
     73cd scratch
     74}}}
     75
     76Download the two patch files from this page into this scratch directory
     77
     78Build a GEOS 3.3.3 package. I used the control files from wheezy.
     79{{{
     80wget http://ftp.us.debian.org/debian/pool/main/g/geos/geos_3.3.3.orig.tar.gz
     81tar xvf geos_3.3.3.orig.tar.gz
     82cd geos-3.3.3
     83wget http://ftp.us.debian.org/debian/pool/main/g/geos/geos_3.3.3-1.1.debian.tar.gz
     84tar xvf geos_3.3.3-1.1.debian.tar.gz
     85rm -f geos_3.3.3-1.1.debian.tar.gz
     86dpkg-buildpackage
     87cd ..
     88}}}
     89
     90Install the GEOS dev packages. These are required to build Postgis 2.0
     91{{{
     92sudo dpkg -i
     93}}}
     94
     95Build Postgis 2.0. This uses the postgis 1.5.3 control files from squeeze. The two patches are applied here to fix an issue with the Postgis (a bad URL in java/jdbc/build.xml to the maven jar that ant requires for building), and to make the control files build the package.
     96{{{
     97wget http://postgis.org/download/postgis-2.0.1.tar.gz
     98tar xvf postgis-2.0.1.tar.gz
     99cd postgis-2.0.1
     100patch -p0 < ../postgis_maven.patch
     101wget http://ftp.de.debian.org/debian/pool/main/p/postgis/postgis_1.5.3-2.debian.tar.gz
     102tar xvfz postgis_1.5.3-2.debian.tar.gz
     103rm -f postgis_1.5.3-2.debian.tar.gz
     104patch -p0 < ../../postgis_debian-2.0.1.patch
     105rm -rf debian/source
     106dpkg-buildpackage
     107cd ..
     108}}}
     109
     110Install the pacakges. This command line would install all packages created by this process. Obviously don't pick anything you don't really need. For example, I have no use for the GEOS ruby bindings or the Postgis java package.
     111{{{
     112sudo dpkg -i libgeos-3.3.3_3.3.3-1.1_amd64.deb libgeos-dbg_3.3.3-1.1_amd64.deb libgeos++-dev_3.3.3-1.1_amd64.deb libgeos-ruby1.8_3.3.3-1.1_amd64.deb libgeos-c1_3.3.3-1.1_amd64.deb libgeos-dev_3.3.3-1.1_amd64.deb libgeos-doc_3.3.3-1.1_all.deb libpostgis-java_2.0.1_all.deb postgis_2.0.1_amd64.deb postgresql-9.1-postgis_2.0.1_amd64.deb
     113}}}
     114
     115Pull in deps
     116{{{
     117sudo apt-get -f install
     118}}}