--- osm2pgsql-0.52.20080408.orig/debian/compat
+++ osm2pgsql-0.52.20080408/debian/compat
@@ -0,0 +1 @@
+5
--- osm2pgsql-0.52.20080408.orig/debian/patches/10-missing-includes.dpatch
+++ osm2pgsql-0.52.20080408/debian/patches/10-missing-includes.dpatch
@@ -0,0 +1,17 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10-missing-includes.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Add missing includes to compile with gcc-4.3. Patch by Chris Lamb <chris@chris-lamb.co.uk>.
+
+@DPATCH@
+diff -urNad osm2pgsql-0.52.20080408~/build_geometry.cpp osm2pgsql-0.52.20080408/build_geometry.cpp
+--- osm2pgsql-0.52.20080408~/build_geometry.cpp	2007-12-10 22:02:04.000000000 +0000
++++ osm2pgsql-0.52.20080408/build_geometry.cpp	2008-04-12 20:31:38.000000000 +0000
+@@ -22,6 +22,7 @@
+ 
+ #include <iostream>
+ #include <cstring>
++#include <cstdlib>
+ 
+ #include <geos_c.h>
+ 
--- osm2pgsql-0.52.20080408.orig/debian/patches/00list
+++ osm2pgsql-0.52.20080408/debian/patches/00list
@@ -0,0 +1 @@
+10-missing-includes
--- osm2pgsql-0.52.20080408.orig/debian/copyright
+++ osm2pgsql-0.52.20080408/debian/copyright
@@ -0,0 +1,66 @@
+This package was debianized by Andreas Putzo <andreas@putzo.net> on
+Sun, 30 Sep 2007 10:57:29 +0000.
+
+It was downloaded using svn from 
+http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/.
+
+Upstream Authors: 
+
+    Jon Burgess <jburgess777@googlemail.com>
+    Artem Pavlenko <artem@mapnik.org>
+
+Copyright: 
+
+    Copyright (C) 2006,2007,2008 Jon Burgess
+    Copyright (C) 2007,2007 Artem Pavlenko
+
+License:
+
+    This package is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+ 
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+
+rb.c: Copyright (C) 1998-2002, 2004 Free Software Foundation, Inc.
+      Upstream Author: Ben Pfaff <blp@gnu.org>
+      License: GPL, see above.
+
+
+sprompt.c:  Copyright (c) 1994, The Regents of the University of California
+            Copyright (c) 1996-2006, PostgreSQL Global Development Group
+
+License:
+
+    Permission to use, copy, modify, and distribute this software and its
+    documentation for any purpose, without fee, and without a written agreement
+    is hereby granted, provided that the above copyright notice and this
+    paragraph and the following two paragraphs appear in all copies.
+    
+    IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+    DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+    LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+    DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
+    POSSIBILITY OF SUCH DAMAGE.
+    
+    THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+    AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+    ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
+    PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+    
+              
+The Debian packaging is (C) 2007, Andreas Putzo <andreas@putzo.net> and
+is licensed under the GPL, see above.
--- osm2pgsql-0.52.20080408.orig/debian/control
+++ osm2pgsql-0.52.20080408/debian/control
@@ -0,0 +1,17 @@
+Source: osm2pgsql
+Section: utils
+Priority: optional
+Maintainer: Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org>
+Uploaders: Andreas Putzo <andreas@putzo.net>, Dominic Hargreaves <dom@earth.li>
+Build-Depends: debhelper (>= 5), dpatch, libbz2-dev, libgeos-dev, libpq-dev, libxml2-dev, proj
+Standards-Version: 3.7.3
+
+Package: osm2pgsql
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: postgresql-8.2-postgis
+Suggests: josm, gosmore 
+Description: Openstreetmap data to PostgreSQL converter
+ Convert OSM planet snapshot data to SQL suitable for loading
+ into a PostgreSQL database which can then be used by Mapnik to
+ render map tiles.
--- osm2pgsql-0.52.20080408.orig/debian/docs
+++ osm2pgsql-0.52.20080408/debian/docs
@@ -0,0 +1 @@
+README.txt
--- osm2pgsql-0.52.20080408.orig/debian/dirs
+++ osm2pgsql-0.52.20080408/debian/dirs
@@ -0,0 +1 @@
+usr/bin
--- osm2pgsql-0.52.20080408.orig/debian/install
+++ osm2pgsql-0.52.20080408/debian/install
@@ -0,0 +1 @@
+osm2pgsql /usr/bin/
--- osm2pgsql-0.52.20080408.orig/debian/osm2pgsql.1
+++ osm2pgsql-0.52.20080408/debian/osm2pgsql.1
@@ -0,0 +1,101 @@
+.TH OSM2PGSQL 1 "April 12, 2008"
+.\" Please adjust this date whenever revising the manpage.
+.SH NAME
+osm2pgsql \- Openstreetmap data to PostgreSQL converter.
+.SH SYNOPSIS
+.B osm2pgsql
+.RI [ options ] " planet.osm"
+.br
+.B osm2pgsql
+.RI [ options ] " planet.osm.{gz,bz2}"
+.br
+.B osm2pgsql
+.RI [ options ] " file1.osm file2.osm file3.osm"
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B osm2pgsql
+command.
+.PP
+.B osm2pgsql
+imports data from OSM file(s) into a PostgreSQL database
+suitable for use by the Mapnik renderer.
+.br
+OSM planet snapshots can be downloaded from http://planet.openstreetmap.org
+.PP
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+.TP
+\fB\-a\fR|\-\-append
+Add the OSM file into the database without removing
+existing data.
+.TP
+\fB\-b\fR|\-\-bbox
+Apply a bounding box filter on the imported data
+Must be specified as: minlon,minlat,maxlon,maxlat
+e.g. \fB\-\-bbox\fR \fB\-0\fR.5,51.25,0.5,51.75
+.TP
+\fB\-c\fR|\-\-create
+Remove existing data from the database. This is the
+default if \fB\-\-append\fR is not specified.
+.TP
+\fB\-d\fR|\-\-database
+The name of the PostgreSQL database to connect
+to (default: gis).
+.TP
+\fB\-l\fR|\-\-latlong
+Store data in degrees of latitude & longitude.
+.TP
+\fB\-m\fR|\-\-merc
+Store data in proper spherical mercator, not OSM merc
+.TP
+\fB\-E\fR|\-\-proj num
+Use projection EPSG:num
+.TP
+\fB\-u\fR|\-\-utf8\-sanitize
+Repair bad UTF8 input data (present in planet
+dumps prior to August 2007). Adds about 10% overhead.
+.TP
+\fB\-p\fR|\-\-prefix
+Prefix for table names (default planet_osm)
+.TP
+\fB\-U\fR|\-\-username
+Postgresql user name.
+.TP
+\fB\-W\fR|\-\-password
+Force password prompt.
+.TP
+\fB\-H\fR|\-\-host
+Database server hostname or socket location.
+.TP
+\fB\-P\fR|\-\-port
+Database server port.
+.TP
+\fB\-h\fR|\-\-help
+Help information.
+.br
+Add \fB\-v\fR to display supported projections.
+.br
+Use \fB\-E\fR to access any espg projections (usually in /usr/share/proj/epsg)
+.TP
+\fB\-v\fR|\-\-verbose
+Verbose output.
+.PP
+.SH SUPPORTED PROJECTIONS
+Latlong             (-l) SRS:  4326 (none)
+.br       
+WGS84 Mercator      (  ) SRS:  3395 +proj=merc +datum=WGS84  +k=1.0 +units=m +over +no_defs
+.br
+Spherical Mercator  (-m) SRS:900913 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over
+.PP
+.SH SEE ALSO
+.BR proj (1),
+.BR postgres (1).
+.br
+.SH AUTHOR
+osm2pgsql was written by Jon Burgess and Artem Pavlenko.
+.PP
+This manual page was written by Andreas Putzo <andreas@putzo.net>,
+for the Debian project (but may be used by others).
--- osm2pgsql-0.52.20080408.orig/debian/manpages
+++ osm2pgsql-0.52.20080408/debian/manpages
@@ -0,0 +1 @@
+debian/osm2pgsql.1
--- osm2pgsql-0.52.20080408.orig/debian/rules
+++ osm2pgsql-0.52.20080408/debian/rules
@@ -0,0 +1,82 @@
+#!/usr/bin/make -f
+# debian/rules for osm2pgsql  
+#
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+include /usr/share/dpatch/dpatch.make
+
+SVNREPO := http://svn.openstreetmap.org/applications/utils/export/osm2pgsql
+SVNREV  := 7141
+VERSION := 0.52
+DATE := $(shell date +%Y%m%d)
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+get-orig-source:
+	dh_testdir
+	test -d ../tarballs/. || mkdir -p ../tarballs
+	@echo Downloading osm2pgsql from ${SVNREPO}
+	svn export -r ${SVNREV} ${SVNREPO} ../tarballs/osm2pgsql-${VERSION}.${DATE}/
+	@echo Building snapshot tarball.
+	tar czvf ../tarballs/osm2pgsql-${VERSION}.${DATE}.orig.tar.gz -C ../tarballs osm2pgsql-${VERSION}.${DATE}
+	@echo Cleaning up
+	rm -rf ../tarballs/osm2pgsql-${VERSION}.${DATE}
+	@echo .
+	@echo To update debian/changelog type
+	@echo dch -v ${VERSION}.${DATE}-1
+	@echo .
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+build: patch build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+	$(MAKE)
+	touch $@
+
+clean: clean-patched unpatch
+clean-patched:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	[ ! -f Makefile ] || $(MAKE) clean
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+binary-indep: build install
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs 
+	dh_installdocs
+	dh_install
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source
--- osm2pgsql-0.52.20080408.orig/debian/changelog
+++ osm2pgsql-0.52.20080408/debian/changelog
@@ -0,0 +1,46 @@
+osm2pgsql (0.52.20080408-2~bpo40+1) etch-backports; urgency=low
+
+  * Backport to etch
+    - add myself to Uploaders
+
+ -- Dominic Hargreaves <dom@earth.li>  Fri,  2 May 2008 00:52:25 +0100
+
+osm2pgsql (0.52.20080408-2) unstable; urgency=low
+
+  * Added 10-missing-includes.dpatch to actually build with
+    gcc-4.3. Thanks Chris Lamb for the patch. (Closes: #475692)
+  * Added dpatch to Build-Depends in debian/control.
+    Added patch targets to debian/rules.
+  * Added a get-orig-source target to debian/rules to fetch upstream
+    source from svn repository.
+  * Bumped debhelper compatibility level to 5.
+
+  * Upload sponsored by Petter Reinholdtsen.
+
+ -- Andreas Putzo <andreas@putzo.net>  Sat, 12 Apr 2008 23:27:12 +0000
+
+osm2pgsql (0.52.20080408-1) unstable; urgency=low
+
+  * New upstream snapshot. (Closes: #474846)
+  * Adopt rename of readme.txt in debian/docs.
+  * Update manual page from usage output. (Closes: #468767)
+  * Add license and copyright of added file sprompt.c to debian/copyright.
+
+  * Upload sponsored by Petter Reinholdtsen.
+
+ -- Andreas Putzo <andreas@putzo.net>  Fri, 11 Apr 2008 22:43:08 +0000
+
+osm2pgsql (0.50.20071211-1) unstable; urgency=low
+
+  * New upstream snapshot
+    - Missing includes added (FTBS with gcc-4.3) (Closes: #454849)
+  * Bumped Standards-Version to 3.7.3
+
+ -- Andreas Putzo <andreas@putzo.net>  Tue, 11 Dec 2007 19:18:26 +0000
+
+osm2pgsql (0.08.20071007-1) unstable; urgency=low
+
+  * Initial release (Closes: #444705)
+
+ -- Andreas Putzo <andreas@putzo.net>  Sun, 07 Oct 2007 13:41:33 +0000
+
