Changes between Version 6 and Version 7 of UsersWikiPostGIS20Debian60pkg


Ignore:
Timestamp:
Sep 28, 2012, 4:14:49 PM (12 years ago)
Author:
danielceregatti
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20Debian60pkg

    v6 v7  
    77mkdir chroot
    88sudo debootstrap --arch=amd64 squeeze chroot http://ftp.debian.org/debian/
     9}}}
     10
     11Prevent start-stop-daemon from starting daemons inside the chroot.
     12{{{
     13echo "exit 0" > chroot/sbin/start-stop-deamon
     14}}}
    915sudo mount --bind /proc chroot/proc
    1016sudo mount --bind /sys chroot/sys
     
    1925{{{
    2026apt-get update
     27echo -e "en_US ISO-8859-1\nen_US.UTF-8 UTF-8" >> /etc/locale.gen
    2128apt-get install locales
    22 echo -e "en_US ISO-8859-1\nen_US.UTF-8 UTF-8" >> /etc/locale.gen
    23 locale-gen
    2429}}}
    25 Add the official Debian backports repo and pin the postgresql 9.1 packages and its immediate dependencies. Also add debhelper, as version 9 is required for building GEOS, as it is also available from backports.
     30Add the official Debian backports repo and pin the postgresql 9.1 dependency packages. Also add debhelper, as version 9 is required for building GEOS, which is also available from backports.
    2631{{{
    2732cat >> /etc/apt/sources.list.d/backports.list <<EOF
     
    3843Pin-Priority: 1000
    3944
    40 Package: postgresql-9.1
    41 Pin: release o=Debian Backports
    42 Pin-Priority: 1000
    43 
    44 Package: postgresql-client-9.1
    45 Pin: release o=Debian Backports
    46 Pin-Priority: 1000
    47 
    4845Package: postgresql-client-common
    4946Pin: release o=Debian Backports
     
    5148
    5249Package: postgresql-common
    53 Pin: release o=Debian Backports
    54 Pin-Priority: 1000
    55 
    56 Package: postgresql-contrib
    57 Pin: release o=Debian Backports
    58 Pin-Priority: 1000
    59 
    60 Package: postgresql-contrib-9.1
    61 Pin: release o=Debian Backports
    62 Pin-Priority: 1000
    63 
    64 Package: postgresql-plperl-9.1
    6550Pin: release o=Debian Backports
    6651Pin-Priority: 1000
     
    7863}}}
    7964
    80 Install the dependencies required for building everything. And yes, it's a lot of stuff.
    81 
    82 Disclaimer: Not entirely sure all of these are needed, but it'd take a considerable amount of time to determine only what is need at this point, so I'm not doing that.
     65Install the dependencies required for building everything.
    8366{{{
    84 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
     67apt-get install build-essential debhelper postgresql-server-dev-9.1 doxygen swig ruby ruby1.8 ruby1.8-dev autotools-dev flex bison libproj-dev xsltproc docbook docbook-xsl default-jdk libpg-java fastjar libjts-java imagemagick libcunit1-dev dblatex libxml2-dev libgtk2.0-dev libgdal1-dev ant
    8568}}}
    86 
    8769Create a scratch directory to perform all the tasks and cd into it
    8870{{{
     
    9072cd scratch
    9173}}}
    92 
    93 Download the two patch files from this page into this scratch directory
    94 
    9574Build a GEOS 3.3.3 package. I used the control files from wheezy.
    9675{{{
     
    10483cd ..
    10584}}}
     85Install the GEOS dev package to support building Postgis 2.0.
     86{{{
     87dpkg -i libgeos-dev_3.3.3-1.1_amd64.deb libgeos-c1_3.3.3-1.1_amd64.deb libgeos-3.3.3_3.3.3-1.1_amd64.deb
     88}}}
     89Download the two patch files from this page into the scratch directory.
    10690
    107 Install the GEOS dev packages. These are required to build Postgis 2.0
    108 {{{
    109 sudo dpkg -i
    110 }}}
    111 
    112 Build 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.
     91Build 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 itself (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. Ensure that both postgis_debian-2.0.1.patch and postgis_maven.patch are in the scratch directory.
    11392{{{
    11493wget http://postgis.org/download/postgis-2.0.1.tar.gz
     
    11998tar xvfz postgis_1.5.3-2.debian.tar.gz
    12099rm -f postgis_1.5.3-2.debian.tar.gz
    121 patch -p0 < ../../postgis_debian-2.0.1.patch
     100patch -p0 < ../postgis_debian-2.0.1.patch
    122101rm -rf debian/source
    123102dpkg-buildpackage
    124103cd ..
     104}}}
     105
     106Exit the chroot, umount the bind mounted directories from inside the chroot, copy the deb files that were created out, then delete the chroot.
     107{{{
     108exit
     109sudo umount chroot/proc
     110sudo umount chroot/sys
     111sudo umount chroot/dev/pts
     112sudo umount chroot/dev
     113cp chroot/scratch/*.deb .
     114sudo rm -rf chroot
    125115}}}
    126116