summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorChristian Perrier <bubulle@debian.org>2012-10-07 13:27:36 +0100
committerChristian Perrier <bubulle@debian.org>2012-10-07 13:27:36 +0100
commit99f5c8bf63a674faf8c507aea7425b935814548a (patch)
treeb3202c295c4bb71ec09e3748d49b43a9fec6b4cd /debian/patches
gpsdrive (2.10~pre4-6.dfsg-5.2) unstable; urgency=low
* Non-maintainer upload [ Allison Randal ] * Disable optional mapnik libraries, gpsdrive is incompatible with APIs of mapnik version 2.0.0. * debian/patches/107-fix-disable-mapnik.dpatch: Fix known bug with gpsdrive-2.10pre4 when disabling Mapnik library. # imported from the archive
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/00list24
-rw-r--r--debian/patches/01-make.dpatch266
-rw-r--r--debian/patches/03-manpage.dpatch446
-rw-r--r--debian/patches/10-mapnikdir.dpatch252
-rw-r--r--debian/patches/100-fix-insecure-tempfiles.dpatch86
-rw-r--r--debian/patches/101-signalposreq.dpatch70
-rw-r--r--debian/patches/102-unittest.dpatch26
-rw-r--r--debian/patches/103-no-textquery.dpatch18
-rw-r--r--debian/patches/104-fix-xcursor-check.dpatch19
-rw-r--r--debian/patches/105-add-boost-links.dpatch19
-rw-r--r--debian/patches/107-fix-disable-mapnik.dpatch24
-rw-r--r--debian/patches/20-homedir.dpatch44
-rw-r--r--debian/patches/30-icons.dpatch52
-rw-r--r--debian/patches/40-backported.dpatch80
-rw-r--r--debian/patches/50-scripts.dpatch31
-rw-r--r--debian/patches/60-sql.dpatch31
-rw-r--r--debian/patches/70-perl.dpatch362
-rw-r--r--debian/patches/80-dbus.dpatch109
-rw-r--r--debian/patches/85-settings.dpatch26
-rw-r--r--debian/patches/90-usage.dpatch48
-rw-r--r--debian/patches/95-newapi.dpatch18
-rw-r--r--debian/patches/96-mapnik-plugins-dir.dpatch29
-rw-r--r--debian/patches/97-osmxml.dpatch82
-rw-r--r--debian/patches/98-mapnik-exception.dpatch51
-rw-r--r--debian/patches/99-autobestmap.dpatch26
-rw-r--r--debian/patches/gpsdrive2.10pre7_osm_proj.patch572
26 files changed, 2811 insertions, 0 deletions
diff --git a/debian/patches/00list b/debian/patches/00list
new file mode 100644
index 0000000..509e3d4
--- /dev/null
+++ b/debian/patches/00list
@@ -0,0 +1,24 @@
+01-make
+03-manpage
+10-mapnikdir
+20-homedir
+30-icons
+40-backported
+50-scripts
+60-sql
+70-perl
+80-dbus
+85-settings
+90-usage
+95-newapi
+96-mapnik-plugins-dir
+97-osmxml
+98-mapnik-exception
+99-autobestmap
+100-fix-insecure-tempfiles
+101-signalposreq
+102-unittest
+103-no-textquery
+104-fix-xcursor-check
+105-add-boost-links
+107-fix-disable-mapnik.dpatch
diff --git a/debian/patches/01-make.dpatch b/debian/patches/01-make.dpatch
new file mode 100644
index 0000000..a0bed42
--- /dev/null
+++ b/debian/patches/01-make.dpatch
@@ -0,0 +1,266 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01-make.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Remove some SUBDIRS from Makefile.am
+## DP: Remove perl checks from configure.ac
+## DP: Remove map-icons from Makefile.am
+## DP: call pod2man on debian/scripts/gpsfetchmap.pl
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/Makefile.am gpsdrive-2.10~pre4/Makefile.am
+--- gpsdrive-2.10~pre4~/Makefile.am 2007-09-15 15:12:07.000000000 +0000
++++ gpsdrive-2.10~pre4/Makefile.am 2008-07-19 15:23:42.000000000 +0000
+@@ -1,7 +1,7 @@
+ # Makefile.am in main dir
+ #AUTOMAKE_OPTIONS=dist-bzip2
+
+-SUBDIRS = src man scripts data Documentation debian DSL gentoo po tests
++SUBDIRS = src man scripts data Documentation po
+ DIST_SUBDIRS = $(SUBDIRS)
+
+
+diff -urNad gpsdrive-2.10~pre4~/configure.ac gpsdrive-2.10~pre4/configure.ac
+--- gpsdrive-2.10~pre4~/configure.ac 2007-09-15 17:05:51.000000000 +0000
++++ gpsdrive-2.10~pre4/configure.ac 2008-07-19 15:23:42.000000000 +0000
+@@ -36,13 +36,13 @@
+
+ wLL_LINGUAS="da de de_AT es fr hu it ja nl ru sk sv tr"
+
+-AC_CONFIG_FILES([DSL/Makefile])
++dnl AC_CONFIG_FILES([DSL/Makefile])
+ AC_CONFIG_FILES([Documentation/Makefile])
+ AC_CONFIG_FILES([Makefile])
+ AC_CONFIG_FILES([data/Makefile])
+ AC_CONFIG_FILES([data/map-icons/Makefile])
+-AC_CONFIG_FILES([debian/Makefile])
+-AC_CONFIG_FILES([gentoo/Makefile])
++dnl AC_CONFIG_FILES([debian/Makefile])
++dnl AC_CONFIG_FILES([gentoo/Makefile])
+ AC_CONFIG_FILES([man/Makefile])
+ AC_CONFIG_FILES([man/de/Makefile])
+ AC_CONFIG_FILES([man/es/Makefile])
+@@ -54,7 +54,7 @@
+ AC_CONFIG_FILES([src/Makefile])
+ AC_CONFIG_FILES([src/lib_map/Makefile])
+ AC_CONFIG_FILES([src/util/Makefile])
+-AC_CONFIG_FILES([tests/Makefile])
++dnl AC_CONFIG_FILES([tests/Makefile])
+
+ AC_CHECK_FUNCS([bzero])
+ AC_CHECK_FUNCS([floor])
+@@ -667,17 +667,17 @@
+ PERL_PACKAGE_DIR=`echo ${PERL_VENDORLIB} | sed "s,/usr/share,${datadir},"`
+ AC_SUBST(PERL_PACKAGE_DIR)
+
+-AC_PROG_PERL_MODULES(File::Basename , , AC_MSG_ERROR(Need Perl module File::Basename))
+-AC_PROG_PERL_MODULES(File::Copy , , AC_MSG_ERROR(Need Perl module File::Copy))
+-AC_PROG_PERL_MODULES(File::Path , , AC_MSG_ERROR(Need Perl module File::Path))
+-AC_PROG_PERL_MODULES(File::Temp , , AC_MSG_ERROR(Need Perl module File::Temp))
+-AC_PROG_PERL_MODULES(Getopt::Long , , AC_MSG_ERROR(Need Perl module Getopt::Long))
+-AC_PROG_PERL_MODULES(HTTP::Request , , AC_MSG_ERROR(Need Perl module HTTP::Request))
+-AC_PROG_PERL_MODULES(HTTP::Request::Common , , AC_MSG_ERROR(Need Perl module HTTP::Request::Common))
+-AC_PROG_PERL_MODULES(IO::File , , AC_MSG_ERROR(Need Perl module IO::File))
+-AC_PROG_PERL_MODULES(LWP::Simple , , AC_MSG_ERROR(Need Perl module LWP::Simple))
+-AC_PROG_PERL_MODULES(LWP::UserAgent , , AC_MSG_ERROR(Need Perl module LWP::UserAgent))
+-AC_PROG_PERL_MODULES(Math::Trig , , AC_MSG_ERROR(Need Perl module Math::Trig))
++#AC_PROG_PERL_MODULES(File::Basename , , AC_MSG_ERROR(Need Perl module File::Basename))
++#AC_PROG_PERL_MODULES(File::Copy , , AC_MSG_ERROR(Need Perl module File::Copy))
++#AC_PROG_PERL_MODULES(File::Path , , AC_MSG_ERROR(Need Perl module File::Path))
++#AC_PROG_PERL_MODULES(File::Temp , , AC_MSG_ERROR(Need Perl module File::Temp))
++#AC_PROG_PERL_MODULES(Getopt::Long , , AC_MSG_ERROR(Need Perl module Getopt::Long))
++#AC_PROG_PERL_MODULES(HTTP::Request , , AC_MSG_ERROR(Need Perl module HTTP::Request))
++#AC_PROG_PERL_MODULES(HTTP::Request::Common , , AC_MSG_ERROR(Need Perl module HTTP::Request::Common))
++#AC_PROG_PERL_MODULES(IO::File , , AC_MSG_ERROR(Need Perl module IO::File))
++#AC_PROG_PERL_MODULES(LWP::Simple , , AC_MSG_ERROR(Need Perl module LWP::Simple))
++#AC_PROG_PERL_MODULES(LWP::UserAgent , , AC_MSG_ERROR(Need Perl module LWP::UserAgent))
++#AC_PROG_PERL_MODULES(Math::Trig , , AC_MSG_ERROR(Need Perl module Math::Trig))
+
+ # These will only be needed for Building GpsDrive Packages
+ #AC_PROG_PERL_MODULES(File::Slurp , , AC_MSG_ERROR(Need Perl module File::Slurp))
+diff -urNad gpsdrive-2.10~pre4~/data/map-icons/Makefile.am gpsdrive-2.10~pre4/data/map-icons/Makefile.am
+--- gpsdrive-2.10~pre4~/data/map-icons/Makefile.am 2007-09-15 18:50:48.000000000 +0000
++++ gpsdrive-2.10~pre4/data/map-icons/Makefile.am 2008-07-19 15:23:42.000000000 +0000
+@@ -474,92 +474,6 @@
+ svg_wlan_DATA = svg/wlan/closed.svg svg/wlan/open.svg svg/wlan/pay.svg svg/wlan/wep.svg
+ svg_wlandir = $(datadir)/map-icons/svg/wlan
+
+-
+-japan_DATA = japan/health.svg japan/wlan.svg
+-japandir = $(datadir)/map-icons/japan
+-
+-japan_accommodation_DATA =
+-japan_accommodationdir = $(datadir)/map-icons/japan/accommodation
+-
+-japan_accomodation_DATA =
+-japan_accomodationdir = $(datadir)/map-icons/japan/accomodation
+-
+-japan_education_DATA = japan/education/university.svg
+-japan_educationdir = $(datadir)/map-icons/japan/education
+-
+-japan_education_school_DATA = japan/education/school/junior_high.svg
+-japan_education_schooldir = $(datadir)/map-icons/japan/education/school
+-
+-japan_food_DATA =
+-japan_fooddir = $(datadir)/map-icons/japan/food
+-
+-japan_geocache_DATA =
+-japan_geocachedir = $(datadir)/map-icons/japan/geocache
+-
+-japan_health_DATA = japan/health/hospital.svg
+-japan_healthdir = $(datadir)/map-icons/japan/health
+-
+-japan_incomming_DATA = japan/incomming/Bamboo_grove.svg japan/incomming/Barren_land.svg japan/incomming/Broadleaf_trees.svg japan/incomming/Coniferous_trees.svg japan/incomming/Crater_or_Fumarole.svg japan/incomming/District_Forest_Office.svg japan/incomming/Electronic_Datum_point.svg japan/incomming/Factory.svg japan/incomming/Field.svg japan/incomming/Fishing_port.svg japan/incomming/Government_or_Municipal_office.svg japan/incomming/High_school.svg japan/incomming/High_Tower.svg japan/incomming/Historical_site.svg japan/incomming/Home_for_the_aged.svg japan/incomming/Important_port.svg japan/incomming/Junior_college.svg japan/incomming/Koban.svg japan/incomming/Local_port.svg japan/incomming/Meteorological_observatory.svg japan/incomming/Mine.svg japan/incomming/Mulberry_field.svg japan/incomming/Oil_or_Gas_well.svg japan/incomming/Orchard.svg japan/incomming/Other_Ferry.svg japan/incomming/Other_Tree_plantation.svg japan/incomming/Palm_trees.svg japan/incomming/Pithead.svg japan/incomming/Police_station.svg japan/incomming/Power_plant.svg japan/incomming/Quarry.svg japan/incomming/Rice_field.svg japan/incomming/Shrine.svg japan/incomming/Siberian_Dwarf_Pines.svg japan/incomming/Spa.svg japan/incomming/Standard_point.svg japan/incomming/Tea_plantation.svg japan/incomming/Technical_college.svg japan/incomming/Temple.svg japan/incomming/the_Self-Defense_Forces.svg japan/incomming/Town_or_Village_Office.svg japan/incomming/Triangulation_point.svg
+-japan_incommingdir = $(datadir)/map-icons/japan/incomming
+-
+-japan_misc_DATA =
+-japan_miscdir = $(datadir)/map-icons/japan/misc
+-
+-japan_misc_landmark_DATA = japan/misc/landmark/chimney.svg japan/misc/landmark/lighthouse.svg japan/misc/landmark/tower.svg japan/misc/landmark/windmill.svg
+-japan_misc_landmarkdir = $(datadir)/map-icons/japan/misc/landmark
+-
+-japan_money_DATA =
+-japan_moneydir = $(datadir)/map-icons/japan/money
+-
+-japan_nautical_DATA =
+-japan_nauticaldir = $(datadir)/map-icons/japan/nautical
+-
+-japan_people_DATA =
+-japan_peopledir = $(datadir)/map-icons/japan/people
+-
+-japan_places_DATA =
+-japan_placesdir = $(datadir)/map-icons/japan/places
+-
+-japan_public_DATA = japan/public/firebrigade.svg japan/public/post_office.svg
+-japan_publicdir = $(datadir)/map-icons/japan/public
+-
+-japan_public_administration_DATA = japan/public/administration/court_of_law.svg japan/public/administration/townhall.svg
+-japan_public_administrationdir = $(datadir)/map-icons/japan/public/administration
+-
+-japan_recreation_DATA =
+-japan_recreationdir = $(datadir)/map-icons/japan/recreation
+-
+-japan_religion_DATA = japan/religion/cemetery.svg
+-japan_religiondir = $(datadir)/map-icons/japan/religion
+-
+-japan_shopping_DATA =
+-japan_shoppingdir = $(datadir)/map-icons/japan/shopping
+-
+-japan_shopping_rental_DATA = japan/shopping/rental/library.svg
+-japan_shopping_rentaldir = $(datadir)/map-icons/japan/shopping/rental
+-
+-japan_sightseeing_DATA = japan/sightseeing/castle.svg japan/sightseeing/monument.svg japan/sightseeing/museum.svg
+-japan_sightseeingdir = $(datadir)/map-icons/japan/sightseeing
+-
+-japan_sports_DATA =
+-japan_sportsdir = $(datadir)/map-icons/japan/sports
+-
+-japan_transport_DATA =
+-japan_transportdir = $(datadir)/map-icons/japan/transport
+-
+-japan_transport_ferry_DATA = japan/transport/ferry/ferry-car.svg
+-japan_transport_ferrydir = $(datadir)/map-icons/japan/transport/ferry
+-
+-japan_vehicle_DATA =
+-japan_vehicledir = $(datadir)/map-icons/japan/vehicle
+-
+-japan_waypoint_DATA =
+-japan_waypointdir = $(datadir)/map-icons/japan/waypoint
+-
+-japan_wlan_DATA =
+-japan_wlandir = $(datadir)/map-icons/japan/wlan
+-
+-
+ classic.small_DATA = classic.small/accommodation.png classic.small/education.png classic.small/empty.png classic.small/food.png classic.small/geocache.png classic.small/health.png classic.small/misc.png classic.small/money.png classic.small/nautical.png classic.small/people.png classic.small/places.png classic.small/public.png classic.small/recreation.png classic.small/religion.png classic.small/shopping.png classic.small/sightseeing.png classic.small/sports.png classic.small/transport.png classic.small/unknown.png classic.small/vehicle.png classic.small/waypoint.png classic.small/wlan.png
+ classic.smalldir = $(datadir)/map-icons/classic.small
+
+@@ -852,11 +766,6 @@
+ classic.big_wlan_pay_DATA = classic.big/wlan/pay/fon.png
+ classic.big_wlan_paydir = $(datadir)/map-icons/classic.big/wlan/pay
+
+-
+-nickw_DATA = nickw/amenity.png nickw/barn.png nickw/bridge.png nickw/campsite.png nickw/carpark.png nickw/caution.png nickw/church.png nickw/crossing.png nickw/farm.png nickw/industry.png nickw/interest.png nickw/mast.png nickw/node.png nickw/park.png nickw/pbridleway.png nickw/peak.png nickw/peak_small.png nickw/place.png nickw/pub.png nickw/railway.png nickw/restaurant.png nickw/road.png nickw/stationnew.png nickw/station.png nickw/teashop.png nickw/trackpoint.png nickw/tunnel.png nickw/viewpoint.png nickw/waypoint.png
+-nickwdir = $(datadir)/map-icons/nickw
+-
+-
+ icons.xml_DATA = icons.xml
+ icons.xmldir = $(datadir)/map-icons/
+
+@@ -1016,34 +925,6 @@
+ $(svg_waypoint_flag_DATA) \
+ $(svg_waypoint_pin_DATA) \
+ $(svg_wlan_DATA) \
+- $(japan_DATA) \
+- $(japan_accommodation_DATA) \
+- $(japan_accomodation_DATA) \
+- $(japan_education_DATA) \
+- $(japan_education_school_DATA) \
+- $(japan_food_DATA) \
+- $(japan_geocache_DATA) \
+- $(japan_health_DATA) \
+- $(japan_incomming_DATA) \
+- $(japan_misc_DATA) \
+- $(japan_misc_landmark_DATA) \
+- $(japan_money_DATA) \
+- $(japan_nautical_DATA) \
+- $(japan_people_DATA) \
+- $(japan_places_DATA) \
+- $(japan_public_DATA) \
+- $(japan_public_administration_DATA) \
+- $(japan_recreation_DATA) \
+- $(japan_religion_DATA) \
+- $(japan_shopping_DATA) \
+- $(japan_shopping_rental_DATA) \
+- $(japan_sightseeing_DATA) \
+- $(japan_sports_DATA) \
+- $(japan_transport_DATA) \
+- $(japan_transport_ferry_DATA) \
+- $(japan_vehicle_DATA) \
+- $(japan_waypoint_DATA) \
+- $(japan_wlan_DATA) \
+ $(classic.small_DATA) \
+ $(classic.small_accommodation_DATA) \
+ $(classic.small_accommodation_camping_DATA) \
+@@ -1141,7 +1022,6 @@
+ $(classic.big_waypoint_wpttemp_DATA) \
+ $(classic.big_wlan_DATA) \
+ $(classic.big_wlan_pay_DATA) \
+- $(nickw_DATA) \
+ $(icons.xml_DATA) \
+ CMakeLists.txt \
+ overview.de.html \
+diff -urNad gpsdrive-2.10~pre4~/man/Makefile.am gpsdrive-2.10~pre4/man/Makefile.am
+--- gpsdrive-2.10~pre4~/man/Makefile.am 2007-09-15 15:12:06.000000000 +0000
++++ gpsdrive-2.10~pre4/man/Makefile.am 2008-07-19 15:23:42.000000000 +0000
+@@ -17,19 +17,13 @@
+ EXTRA_DIST = CMakeLists.txt
+
+ convert-waypoints.pl.1: $(srcdir)/../scripts/convert-waypoints.pl
+- pod2man $? >$@
+
+ gpsdrive-init-db.pl.1: $(srcdir)/../scripts/gpsdrive-init-db.pl
+- pod2man $? >$@
+
+-gpsfetchmap.pl.1: $(srcdir)/../scripts/gpsfetchmap.pl
+- pod2man $? >$@
++gpsfetchmap.pl.1: $(srcdir)/../debian/scripts/gpsfetchmap.pl
+
+ gpspoint2gpsdrive.pl.1: $(srcdir)/../scripts/gpspoint2gpsdrive.pl
+- pod2man $? >$@
+
+ poi-manager.pl.1: $(srcdir)/../scripts/poi-manager.pl
+- pod2man $? >$@
+
+ geoinfo.pl.1: $(srcdir)/../scripts/geoinfo.pl
+- pod2man $? >$@
+diff -urNad gpsdrive-2.10~pre4~/scripts/Makefile.am gpsdrive-2.10~pre4/scripts/Makefile.am
+--- gpsdrive-2.10~pre4~/scripts/Makefile.am 2007-09-15 15:11:59.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/Makefile.am 2008-07-19 15:23:43.000000000 +0000
+@@ -5,7 +5,7 @@
+ dist_bin_SCRIPTS= \
+ wpcvt wpget gpspoint2gpsdrive.pl geo-nearest geocache2way \
+ geo-code gpssql_backup.sh gpssql_restore.sh gpsreplay\
+- gpssmswatch gpsfetchmap.pl convert-waypoints.pl \
++ gpssmswatch convert-waypoints.pl \
+ geoinfo.pl gpsdrive-init-db.pl wp2sql gpsd_nmea.sh \
+ nasaconv.sh \
+ start_mysql_as_user.sh poi-manager.pl \
diff --git a/debian/patches/03-manpage.dpatch b/debian/patches/03-manpage.dpatch
new file mode 100644
index 0000000..0d1c1ec
--- /dev/null
+++ b/debian/patches/03-manpage.dpatch
@@ -0,0 +1,446 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03-manpage.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Fix typos in gpsdrive.1 (#414240).
+## DP: Fixed in upstream svn.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/man/convert-waypoints.pl.1 gpsdrive-2.10~pre4/man/convert-waypoints.pl.1
+--- gpsdrive-2.10~pre4~/man/convert-waypoints.pl.1 2007-09-15 17:13:54.000000000 +0000
++++ gpsdrive-2.10~pre4/man/convert-waypoints.pl.1 2008-01-08 20:47:21.000000000 +0000
+@@ -131,7 +131,7 @@
+ .IX Title "CONVERT-WAYPOINTS 1"
+ .TH CONVERT-WAYPOINTS 1 "2007-09-14" "perl v5.8.8" "User Contributed Perl Documentation"
+ .SH "NAME"
+-\&\fBconvert\-waypoints\fR
++\&\fBconvert\-waypoints\fR \- Convert old gpsdrive waypoints
+ .SH "DESCRIPTION"
+ .IX Header "DESCRIPTION"
+ \&\fBconvert-waypoints\fR is converting old waypoint info from the database table 'waypoints'
+diff -urNad gpsdrive-2.10~pre4~/man/friendsd2.1 gpsdrive-2.10~pre4/man/friendsd2.1
+--- gpsdrive-2.10~pre4~/man/friendsd2.1 2007-09-15 15:12:05.000000000 +0000
++++ gpsdrive-2.10~pre4/man/friendsd2.1 2008-01-08 20:47:21.000000000 +0000
+@@ -1,6 +1,6 @@
+ .TH FRIENDSD2 1
+ .SH NAME
+-friendsd2 v2.x - displays GPS position on a map
++friendsd2 \- displays GPS position on a map
+ .SH SYNOPSIS
+ .B friendsd2 [options]
+
+diff -urNad gpsdrive-2.10~pre4~/man/geo-code.1 gpsdrive-2.10~pre4/man/geo-code.1
+--- gpsdrive-2.10~pre4~/man/geo-code.1 2007-09-14 21:47:43.000000000 +0000
++++ gpsdrive-2.10~pre4/man/geo-code.1 2008-01-08 20:47:21.000000000 +0000
+@@ -1,7 +1,7 @@
+ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.33.
+ .TH GEO-CODE "1" "09.10.2003" "geo-code" "User Commands"
+ .SH NAME
+-geo-code
++geo-code \- Convert a street address into geo coordinates
+ .SH DESCRIPTION
+ .SS "Usage:"
+ .IP
+diff -urNad gpsdrive-2.10~pre4~/man/geoinfo.pl.1 gpsdrive-2.10~pre4/man/geoinfo.pl.1
+--- gpsdrive-2.10~pre4~/man/geoinfo.pl.1 2007-09-15 17:13:54.000000000 +0000
++++ gpsdrive-2.10~pre4/man/geoinfo.pl.1 2008-01-08 20:47:21.000000000 +0000
+@@ -131,7 +131,7 @@
+ .IX Title "GEOINFO 1"
+ .TH GEOINFO 1 "2007-09-15" "perl v5.8.8" "User Contributed Perl Documentation"
+ .SH "NAME"
+-\&\fBgeoinfo.pl\fR Version 0.9
++\&\fBgeoinfo.pl\fR \- Download and convert waypoints for use with gpsdrive
+ .SH "DESCRIPTION"
+ .IX Header "DESCRIPTION"
+ \&\fBgeoinfo.pl\fR is a program to download and convert waypoints
+diff -urNad gpsdrive-2.10~pre4~/man/gpsdrive.1 gpsdrive-2.10~pre4/man/gpsdrive.1
+--- gpsdrive-2.10~pre4~/man/gpsdrive.1 2007-09-14 21:47:43.000000000 +0000
++++ gpsdrive-2.10~pre4/man/gpsdrive.1 2008-01-08 20:54:10.000000000 +0000
+@@ -1,12 +1,12 @@
+ .TH GPSDRIVE 1
+ .SH NAME
+-gpsdrive v2.x - displays GPS position on a map
++gpsdrive \- displays GPS position on a map
+ .SH SYNOPSIS
+ .B gpsdrive [options]
+
+ .SH About this manual page
+
+-This manual page explain the basic functions of GpsDrive and some
++This manual page explains the basic functions of GpsDrive and some
+ additional info.
+
+ In GpsDrive you find tooltips for nearly all buttons, there is also a
+@@ -30,7 +30,7 @@
+
+ GpsDrive was tested with a GARMIN GPS III, a Crux II GPS PCMCIA
+ card and a Navilock USB receiver. All Garmin GPS reveivers with a serial output should be
+-usable. Other GPS reveivers that sends NMEA protocol over the
++usable. Other GPS receivers that sends NMEA protocol over the
+ serial output should also work with GpsDrive.
+
+ These GPS receivers are reported to work with gpsdrive:
+@@ -89,34 +89,32 @@
+ .B \-d
+ Shows some debugging information.
+ .TP
+-.B \-D
+-Shows a lot of debugging information. If you have problems or program
+-crashes, send this output to the author. You should also combine this
+-with -d. See also the section
+-.I BUGS
++.B \-D <level>
++Shows a lot of debugging information. You should also combine this with -d.
++.br
++See also the section
++.I BUGS.
++.TP
++.B \-T
++Do some internal unit tests (don't start gpsdrive).
++.TP
++.B \-e
++use festival-lite (flite) for speech output.
+ .TP
+ .B \-v
+-Shows program version together with the CVS version of the mainfile
+-gpsdrive.c. If you send a bug report, also include this output.
++Shows program version.
+ .TP
+ .B \-h
+ Displays a short help message.
+ .TP
+-.BI \-o "\| outputfile\^"
++.B \-o <outputfile>
+ With this option, you can
+ .IR write
+ the NMEA sentences to a PTY master, file or serial device. This is
+ useful if you use GpsDrive in simulation mode to provide other GPS
+ applications with test data.
+ .TP
+-.BI \-t "\| device\^"
+-Serial port device (e.g.
+-.IR /dev/ttyS0
+-). You can also set it in the
+-.IR setup
+-menu.
+-.TP
+-.BI \-l "\| language\^"
++.B \-l <language>
+ Sets the language for the speech output. You have to provide the voice
+ files in festival yourself (see below). At the moment
+ .IR german
+@@ -126,58 +124,66 @@
+ .IR english
+ are provided.
+ .TP
+-.B \-x
+-Creates own window for the menu buttons, status and map. This is
+-helpful on small displays like the Compaq iPaq or on Head Mounted
+-Displays, where the menu should be hidden.
+-.TP
+-.BI \-s "\| height\^"
+-Set the height of the screen, if autodetection don't satisfy you,
+-.IR height
+-is i.e. 768,600,480,200
+-.TP
+-.BI \-r "\| width\^"
+-Set the
+-.IR width
+-of the screen, if autodetection don't satisfy you. Works
+-only in combination with
+-.IR -s
++.B \-g <geometry>
++Set the geometry of the screen, if autodetection doesn't satisfy you,
++.IR geometry
++is i.e. 1024x768, 800x600, 640x480
+ .TP
+-.BI \-f "\| friendsserver\^"
+-Define a friendsserver to exchange position information with other
+-people. You can also set it in the Settings/Friends menu. You can start your own friendsserver with the program
+-.B friendsd
++.B \-f <friends server>
++Define a friends server to exchange position information with other
++people. You can also set it in the Settings/Friends menu. You can start your own friends server with the program
++.B friendsd2
+ , which is included. More details are in section
+ .I FRIENDSD server
+-
++.TP
++.B \-X
++Use DBUS for communication with gpsd. This disables socket communication.
++Try this option if gpsdrive fails to interpret output of the gps receiver correctly.
+ .TP
+ .B \-1
+ Set special mode if you only have 1 mouse button, i.e. on touchpads.
+ .TP
+ .B \-a
+-Disable display of battery status. Some implementations of the APM-BIOS
+-are broken, so use this option if gpsdrive crashes.
++Display APM stuff (battery status, temperature)
+ .TP
+-.BI \-b "\| servername\^"
++.B \-b <nmea server>
+ Use a remote NMEA server. You can start gpsd on another
+ .IR host
+ , which has the GPS receiver connected and display the position on
+ your local machine.
+ .TP
+-.BI \-c "\| waypointname\^"
++.B \-c <waypoint>
+ Initial position for simulation mode. Specify a
+ .IR "waypoint name"
+ from your currently used waypoint list.
+ .TP
++.B \-M <mode>
++Set GUI mode. <mode> may be 'desktop' (default), 'pda' or 'car'.
++.TP
++.B \-i
++Ignore NMEA checksum (risky, only for broken GPS receivers).
++.TP
+ .B \-q
+-Disables SQL support. Only useful if you have SQL support compiled in.
++Disables SQL support.
+ .TP
+-.B \-z
+-Don't show zoom and scaling on the map.
++.B \-F
++Force display of position even if it is invalid.
+ .TP
+-.BI \-n
+-Disables the direct serial connection. You have to use Garmin mode
+-or start gpsd
++.B \-S
++Don't show splash screen.
++.TP
++.B \-P
++Start in Position Mode
++.TP
++.B \-W <x>
++Set to 1 to switch WAAS/EGNOS on, set to 0 to switch it off.
++.TP
++.B \-H <altitude>
++Correct altitude.
++.TP
++.B \-C <file>
++Set config file to <file>.
++
+ .br
+
+
+@@ -247,7 +253,7 @@
+ from your shell, if you want another language see section
+ .I LOCALISATION
+
+-On some distribution you may find a "GpsDrive" entry in your Gnome or
++On some distributions you may find a "GpsDrive" entry in your Gnome or
+ KDE menu.
+
+ It is important that you have installed GpsDrive as root, so it can
+@@ -265,13 +271,13 @@
+
+ If you have connected a GPS-Receiver, you see in the
+ .I GPS Info
+-window how much satellites are in view. You can click on this image to switch to the
++window how many satellites are in view. You can click on this image to switch to the
+ .I Satellite position view.
+ .br
+ You must have at least 3 satellites in view. If you want to see your
+ altitude, you need at least 4 satellites. The antenna of your GPS
+ receiver must have free sight to the sky, so you cannot use it
+-indoor. More satellites gives you a better accuracy.
++indoors. More satellites gives you a better accuracy.
+
+ If your receiver has not enough satellites with usable signal, the
+ GPS Info window is red. If your signal is ok and gives a valid
+@@ -283,7 +289,7 @@
+
+ This mode is entered if you have a GPS receiver connected. The cursor is at the position your receiver sends.
+
+-The black and a red arrow shows your position on the map. The
++Black and a red arrows show your position on the map. The
+ .B black arrow
+ is pointing to your selected target, the
+ .B red arrow
+@@ -309,7 +315,7 @@
+ .B not your real position
+ and is marked as an rectangle.
+
+-You can set the position by simple left-mouse click on the map.
++You can set the position by a simple left-mouse click on the map.
+
+ You can leave the position mode by by clicking on the "Pos. mode"
+ button or middle-mouse click or right-mouse click (which also sets
+@@ -323,7 +329,7 @@
+
+ .SH MAP DOWNLOAD
+
+-You can easily download maps from internet with the
++You can easily download maps from the internet with the
+ .B Download
+ button. GpsDrive stores an index of your maps in the file
+ map_koord.txt in your ~/.gpsdrive directory. You can also use any
+@@ -357,7 +363,7 @@
+ Vienna.
+
+
+-There is also the programs
++There is also the program
+ .IR gpsfetchmap.pl
+ provided to download multiple maps for a bigger area.
+ .br
+@@ -365,7 +371,7 @@
+ www.expedia.com if you want to use their maps!
+ .br
+ .B Don't misuse this service by downloading more maps as you need!
+-You will risk being blocked by thier servers, and possibly cause
++You will risk being blocked by these servers, and possibly cause
+ trouble for the gpsdrive project.
+
+ File formats:
+@@ -391,12 +397,12 @@
+ prefix in subdirectories of $HOME/.gpsdrive/ which end in "_map" or
+ "_top".
+
+-There is an "import assistant" built in. Use this to import your maps.
++There is an "import assistant" built in. Use it to import your maps.
+
+ .SH Importing waypoints:
+
+
+-The easiest way is to use the script "wpget" which does all for you if
++The easiest way is to use the script "wpget" which does everything for you if
+ you use a GARMIN receiver.
+ You can use the program "garble" (included in the package) to read
+ out your waypoints from the Garmin GPS (Transfer mode must be set to
+@@ -405,7 +411,7 @@
+ Scripts: "wpget" is a script which calls "garble" in the proper way.
+
+ Be sure to have "wpget", "wpcvt" and "garble" in your path. This is
+-fullfilled, if you did install the program as root and /usr/local/bin
++fulfilled, if you did install the program as root and /usr/local/bin
+ is in your path.
+
+ The manual way:
+@@ -434,7 +440,7 @@
+
+ .SH PROXY SERVER
+ If you must access the internet via a proxy server, you have to set the
+-enviroment variable
++enviromental variable
+ .B HTTP_PROXY
+ or
+ .B http_proxy
+@@ -546,8 +552,8 @@
+ Gpsdrive supports
+ .IR kismet.
+ Kismet is a 802.11b wireless network (WLAN) sniffer. If you have
+-kismet running, gpsdrive will detect it and program start and shows
+-new WLAN accesspoints in realtime on the map. SQL mode is necessary to
++kismet running, gpsdrive will detect it and program starts and shows
++new WLAN access points in real time on the map. SQL mode is necessary to
+ use Gpsdrive with Kismet. WLAN accesspoints which are already
+ stored in the SQL database from prior wardrivings are ignored. If you
+ have voice output in gpsdrive, you hear information about the newly
+@@ -594,7 +600,7 @@
+
+ When you start GpsDrive it will detect the server on port 1314 and
+ puts out some status information as speech. You also have an
+-additonal button (Mute) to switch off sound output.
++additional button (Mute) to switch off sound output.
+
+ GpsDrive tries to select the correct language for your locale.
+ The -l option can force the languages for speech
+@@ -659,12 +665,10 @@
+
+ .SH MAILING LIST
+ The address for the mailing list is
+-.B gpsdrive@warbase.selwerd.nl
+-
+-Subscribing can be done by sending a mail containing
+-.B subscribe gpsdrive
+-
+-to majordomo@warbase.selwerd.nl
++.B gpsdrive@lists.gpsdrivers.org
++.br
++You can browse the archive or subscribe at
++http://lists.gpsdrivers.org/mailman/listinfo/gpsdrive
+
+ .SH BUGS
+ Please send bug reports to the author. Report version (gpsdrive -v),
+@@ -696,9 +700,15 @@
+
+ and send me this output.
+
+-.SH AUTHOR
+-Fritz Ganter
++.SH AUTHORS
++Fritz Ganter,
++.br
++Joerg Ostertag,
++.br
++Gpsdrive Development Team
+ .br
++and others.
++.PP
+ http://www.gpsdrive.de
+ .SH WARRANTY
+ This program is distributed in the hope that it will be useful,
+@@ -707,11 +717,21 @@
+ GNU General Public License for more details.
+
+ .SH COPYRIGHT
+-Copyright (c) 2001-2004 by Fritz Ganter
++Copyright (c) 2001-2006 by Fritz Ganter
++.br
++Copyright (c) 2006-2007 The GpsDrive Development Team
+ .br
+ This program 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.
+
+-
++.SH SEE ALSO
++.PP
++.B gpsd(8),
++.B friendsd(1),
++.B gpsfetchmap(1),
++.B osm2pgsql(1),
++.B kismet(1),
++.B festival(1),
++.B flite(1)
+diff -urNad gpsdrive-2.10~pre4~/man/gpsfetchmap.pl.1 gpsdrive-2.10~pre4/man/gpsfetchmap.pl.1
+--- gpsdrive-2.10~pre4~/man/gpsfetchmap.pl.1 2007-09-15 17:13:54.000000000 +0000
++++ gpsdrive-2.10~pre4/man/gpsfetchmap.pl.1 2008-01-08 20:47:21.000000000 +0000
+@@ -131,7 +131,7 @@
+ .IX Title "GPSFETCHMAP 1"
+ .TH GPSFETCHMAP 1 "2007-09-15" "perl v5.8.8" "User Contributed Perl Documentation"
+ .SH "NAME"
+-\&\fBgpsfetchmap\fR Version 1.04
++\&\fBgpsfetchmap\fR \- Download maps from a mapserver
+ .SH "DESCRIPTION"
+ .IX Header "DESCRIPTION"
+ \&\fBgpsfetchmap\fR is a program to download maps from a mapserver for use with gpsdrive.
+diff -urNad gpsdrive-2.10~pre4~/man/gpspoint2gpsdrive.pl.1 gpsdrive-2.10~pre4/man/gpspoint2gpsdrive.pl.1
+--- gpsdrive-2.10~pre4~/man/gpspoint2gpsdrive.pl.1 2007-09-15 17:13:54.000000000 +0000
++++ gpsdrive-2.10~pre4/man/gpspoint2gpsdrive.pl.1 2008-01-08 20:47:21.000000000 +0000
+@@ -131,7 +131,7 @@
+ .IX Title "GPSPOINT2GPSDRIVE 1"
+ .TH GPSPOINT2GPSDRIVE 1 "2007-09-14" "perl v5.8.8" "User Contributed Perl Documentation"
+ .SH "NAME"
+-\&\fBgpspoint2gpsdrive.pl\fR
++\&\fBgpspoint2gpsdrive.pl\fR \- Extract gpsdrive-compatible tracks from a gpspoint file
+ .SH "DESCRIPTION"
+ .IX Header "DESCRIPTION"
+ \&\fBgpspoint2gpsdrive.pl\fR
+diff -urNad gpsdrive-2.10~pre4~/man/poi-manager.pl.1 gpsdrive-2.10~pre4/man/poi-manager.pl.1
+--- gpsdrive-2.10~pre4~/man/poi-manager.pl.1 2007-09-15 17:13:54.000000000 +0000
++++ gpsdrive-2.10~pre4/man/poi-manager.pl.1 2008-01-08 20:47:21.000000000 +0000
+@@ -130,6 +130,8 @@
+ .\"
+ .IX Title "POI-MANAGER 1"
+ .TH POI-MANAGER 1 "2007-09-14" "perl v5.8.8" "User Contributed Perl Documentation"
++.SH NAME
++poi\-manager \- Manage points of interest
+ .SH "SYNOPSIS"
+ .IX Header "SYNOPSIS"
+ poi\-manager.pl [\-h] [\-v] [\-b] [\-i] [\-e] [\-p] [\-s] [\-f \s-1GPX\-FILE\s0]
diff --git a/debian/patches/10-mapnikdir.dpatch b/debian/patches/10-mapnikdir.dpatch
new file mode 100644
index 0000000..91367cc
--- /dev/null
+++ b/debian/patches/10-mapnikdir.dpatch
@@ -0,0 +1,252 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10-mapnikdir.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Put mapnik files into gpsdrive directory.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/scripts/mapnik/Makefile.am gpsdrive-2.10~pre4/scripts/mapnik/Makefile.am
+--- gpsdrive-2.10~pre4~/scripts/mapnik/Makefile.am 2007-09-14 21:47:06.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/mapnik/Makefile.am 2007-10-16 08:22:45.000000000 +0000
+@@ -2,7 +2,7 @@
+
+ bin_SCRIPTS = gpsdrive_mapnik_gentiles.py
+
+-mapnikdir = $(datadir)/mapnik
++mapnikdir = $(datadir)/gpsdrive/mapnik
+ mapnik_DATA = osm.xml
+
+ EXTRA_DIST = setup_z_order.sql gpsdrive_mapnik_gentiles-in.py osm-in.xml
+@@ -13,7 +13,7 @@
+ dummy:
+
+ gpsdrive_mapnik_gentiles.py: gpsdrive_mapnik_gentiles-in.py
+- sed 's,@DATA_DIR@,${datadir},' < $< > $@
++ sed 's,@DATA_DIR@,${mapnikdir},' < $< > $@
+
+ osm.xml: osm-in.xml
+- sed 's,@DATA_DIR@,${datadir},' < $< > $@
++ sed 's,@DATA_DIR@,${mapnikdir},' < $< > $@
+diff -urNad gpsdrive-2.10~pre4~/scripts/mapnik/osm-in.xml gpsdrive-2.10~pre4/scripts/mapnik/osm-in.xml
+--- gpsdrive-2.10~pre4~/scripts/mapnik/osm-in.xml 2007-09-14 21:47:06.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/mapnik/osm-in.xml 2007-10-16 08:24:20.000000000 +0000
+@@ -93,24 +93,24 @@
+ <Rule>
+ <MaxScaleDenominator>5000</MaxScaleDenominator>
+ <Filter>[amenity]='post_box'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/public/post_box.png" type="png" width="16" height="16" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/public/post_box.png" type="png" width="16" height="16" />
+ </Rule>
+ <Rule>
+ <MaxScaleDenominator>5000</MaxScaleDenominator>
+ <Filter>[amenity]='post_office'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/public/post_office.png" type="png" width="16" height="16" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/public/post_office.png" type="png" width="16" height="16" />
+ </Rule>
+
+ <Rule>
+ <MaxScaleDenominator>250000</MaxScaleDenominator>
+ <MinScaleDenominator>25000</MinScaleDenominator>
+ <Filter>[railway]='station'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/transport/railway_small.png" type="png" width="5" height="5" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/transport/railway_small.png" type="png" width="5" height="5" />
+ </Rule>
+ <Rule>
+ <MaxScaleDenominator>25000</MaxScaleDenominator>
+ <Filter>[railway]='station'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/transport/railway.png" type="png" width="9" height="9" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/transport/railway.png" type="png" width="9" height="9" />
+ </Rule>
+ <Rule>
+ <MaxScaleDenominator>50000</MaxScaleDenominator>
+@@ -127,51 +127,51 @@
+ <Rule>
+ <MaxScaleDenominator>10000</MaxScaleDenominator>
+ <Filter>[amenity]='pub'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/food/pub.png" type="png" width="16" height="16" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/food/pub.png" type="png" width="16" height="16" />
+ </Rule>
+ <Rule>
+ <MaxScaleDenominator>100000</MaxScaleDenominator>
+ <Filter>[natural]='peak'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/misc/landmark/peak.png" type="png" width="8" height="8" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/misc/landmark/peak.png" type="png" width="8" height="8" />
+ </Rule>
+ <Rule>
+ <MaxScaleDenominator>5000</MaxScaleDenominator>
+ <Filter>[man_made]='mast'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/misc/landmark/tower.png" type="png" width="32" height="32" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/misc/landmark/tower.png" type="png" width="32" height="32" />
+ </Rule>
+ <Rule>
+ <MaxScaleDenominator>10000</MaxScaleDenominator>
+ <Filter>[amenity]='recycling'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/public/recycling.png" type="png" width="20" height="20" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/public/recycling.png" type="png" width="20" height="20" />
+ </Rule>
+
+ <Rule>
+ <MaxScaleDenominator>20000</MaxScaleDenominator>
+ <Filter>[amenity]='hospital'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/health/hospital.png" type="png" width="20" height="20" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/health/hospital.png" type="png" width="20" height="20" />
+ </Rule>
+
+ <Rule>
+ <MaxScaleDenominator>5000</MaxScaleDenominator>
+ <Filter>[amenity]='bus_stop' or [highway]='bus_stop'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/transport/bus.png" type="png" width="30" height="12" />
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/transport/bus.png" type="png" width="30" height="12" />
+ </Rule>
+
+ <Rule>
+ <MaxScaleDenominator>20000</MaxScaleDenominator>
+ <Filter>[amenity]='parking'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/vehicle/parking.png" type="png" width="16" height="16" allow_overlap="false"/>
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/vehicle/parking.png" type="png" width="16" height="16" allow_overlap="false"/>
+ </Rule>
+
+ <Rule>
+ <MaxScaleDenominator>10000</MaxScaleDenominator>
+ <Filter>[amenity]='place_of_worship'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/religion/church.png" type="png" width="16" height="16" allow_overlap="false"/>
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/religion/church.png" type="png" width="16" height="16" allow_overlap="false"/>
+ </Rule>
+ <Rule>
+ <MaxScaleDenominator>10000</MaxScaleDenominator>
+ <Filter>[amenity]='airport'</Filter>
+- <PointSymbolizer file="@DATA_DIR@/map-icons/classic.small/transport/airport.png" type="png" width="16" height="16" allow_overlap="false"/>
++ <PointSymbolizer file="/usr/share/icons/openstreetmap/classic.small/transport/airport.png" type="png" width="16" height="16" allow_overlap="false"/>
+ </Rule>
+ </Style>
+
+@@ -203,7 +203,7 @@
+ <Rule>
+ <MaxScaleDenominator>50000</MaxScaleDenominator>
+ <Filter>[landuse] = 'cemetery'</Filter>
+- <PolygonPatternSymbolizer file="@DATA_DIR@/map-icons/classic.small/religion/cemetery.png" type="png" width="16" height="16"/>
++ <PolygonPatternSymbolizer file="/usr/share/icons/openstreetmap/classic.small/religion/cemetery.png" type="png" width="16" height="16"/>
+ </Rule>
+
+ <Rule>
+@@ -1086,7 +1086,7 @@
+ <MaxScaleDenominator>100000</MaxScaleDenominator>
+ <MinScaleDenominator>1000</MinScaleDenominator>
+ <Filter>[railway] = 'rail'</Filter>
+- <LinePatternSymbolizer file="@DATA_DIR@/map-icons/classic.small/transport/track/rail.png" type="png" width="20" height="3" />
++ <LinePatternSymbolizer file="/usr/share/icons/openstreetmap/classic.small/transport/track/rail.png" type="png" width="20" height="3" />
+ </Rule>
+
+ <Rule>
+@@ -1567,7 +1567,7 @@
+ <MaxScaleDenominator>100000</MaxScaleDenominator>
+ <MinScaleDenominator>1000</MinScaleDenominator>
+ <Filter>[railway] = 'preserved'</Filter>
+- <LinePatternSymbolizer file="@DATA_DIR@/map-icons/classic.small/transport/rail_preserved.png" type="png" width="20" height="3" />
++ <LinePatternSymbolizer file="/usr/share/icons/openstreetmap/classic.small/transport/rail_preserved.png" type="png" width="20" height="3" />
+ </Rule>
+
+ </Style>
+@@ -1579,19 +1579,19 @@
+ <Filter>[highway] = 'motorway' and [length] = 2</Filter>
+ <MaxScaleDenominator>500000</MaxScaleDenominator>
+ <MinScaleDenominator>100</MinScaleDenominator>
+- <ShieldSymbolizer name="ref" face_name="DejaVu Sans Book" size="11" fill="#809bc0" placement="line" file="@DATA_DIR@/map-icons/classic.small/vehicle/shield/motorway_shield.png" type="png" width="24" height="17" min_distance="100"/>
++ <ShieldSymbolizer name="ref" face_name="DejaVu Sans Book" size="11" fill="#809bc0" placement="line" file="/usr/share/icons/openstreetmap/classic.small/vehicle/shield/motorway_shield.png" type="png" width="24" height="17" min_distance="100"/>
+ </Rule>
+ <Rule>
+ <Filter>[highway] = 'motorway' and [length] = 3</Filter>
+ <MaxScaleDenominator>500000</MaxScaleDenominator>
+ <MinScaleDenominator>100</MinScaleDenominator>
+- <ShieldSymbolizer name="ref" face_name="DejaVu Sans Book" size="11" fill="#809bc0" placement="line" file="@DATA_DIR@/map-icons/classic.small/vehicle/shield/motorway_shield2.png" type="png" width="31" height="17" min_distance="100"/>
++ <ShieldSymbolizer name="ref" face_name="DejaVu Sans Book" size="11" fill="#809bc0" placement="line" file="/usr/share/icons/openstreetmap/classic.small/vehicle/shield/motorway_shield2.png" type="png" width="31" height="17" min_distance="100"/>
+ </Rule>
+ <Rule>
+ <Filter>[highway] = 'motorway' and [length] = 4</Filter>
+ <MaxScaleDenominator>500000</MaxScaleDenominator>
+ <MinScaleDenominator>100</MinScaleDenominator>
+- <ShieldSymbolizer name="ref" face_name="DejaVu Sans Book" size="11" fill="#809bc0" placement="line" file="@DATA_DIR@/map-icons/classic.small/vehicle/shield/motorway_shield3.png" type="png" width="38" height="17" min_distance="100"/>
++ <ShieldSymbolizer name="ref" face_name="DejaVu Sans Book" size="11" fill="#809bc0" placement="line" file="/usr/share/icons/openstreetmap/classic.small/vehicle/shield/motorway_shield3.png" type="png" width="38" height="17" min_distance="100"/>
+ </Rule>
+ <Rule>
+ <Filter>[highway] = 'trunk' or [highway] = 'primary' or [highway] = 'secondary'</Filter>
+@@ -1628,12 +1628,12 @@
+ <Rule>
+ <Filter>[oneway] = 'yes' or [oneway] = 'true'</Filter>
+ <MaxScaleDenominator>25000</MaxScaleDenominator>
+- <LinePatternSymbolizer file="@DATA_DIR@/map-icons/classic.small/transport/track/arrow.png" type="png" width="80" height="8" />
++ <LinePatternSymbolizer file="/usr/share/icons/openstreetmap/classic.small/transport/track/arrow.png" type="png" width="80" height="8" />
+ </Rule>
+ <Rule>
+ <Filter>[oneway] = '-1'</Filter>
+ <MaxScaleDenominator>25000</MaxScaleDenominator>
+- <LinePatternSymbolizer file="@DATA_DIR@/map-icons/classic.small/transport/track/arrow_back.png" type="png" width="80" height="8" />
++ <LinePatternSymbolizer file="/usr/share/icons/openstreetmap/classic.small/transport/track/arrow_back.png" type="png" width="80" height="8" />
+ </Rule>
+ </Style>
+
+@@ -1641,7 +1641,7 @@
+ <StyleName>world-1</StyleName>
+ <Datasource>
+ <Parameter name="type">shape</Parameter>
+- <Parameter name="file">@DATA_DIR@/mapnik/world_boundaries/world_boundaries_m</Parameter>
++ <Parameter name="file">@DATA_DIR@/world_boundaries/world_boundaries_m</Parameter>
+ </Datasource>
+ </Layer>
+
+@@ -1649,7 +1649,7 @@
+ <StyleName>world</StyleName>
+ <Datasource>
+ <Parameter name="type">shape</Parameter>
+- <Parameter name="file">@DATA_DIR@/mapnik/world_boundaries/world_bnd_m</Parameter>
++ <Parameter name="file">@DATA_DIR@/world_boundaries/world_bnd_m</Parameter>
+ </Datasource>
+ </Layer>
+
+@@ -1657,7 +1657,7 @@
+ <StyleName>coast-poly</StyleName>
+ <Datasource>
+ <Parameter name="type">shape</Parameter>
+- <Parameter name="file">@DATA_DIR@/mapnik/world_boundaries/shoreline_a</Parameter>
++ <Parameter name="file">@DATA_DIR@/world_boundaries/shoreline_a</Parameter>
+ </Datasource>
+ </Layer>
+
+@@ -1665,7 +1665,7 @@
+ <StyleName>coast-line</StyleName>
+ <Datasource>
+ <Parameter name="type">shape</Parameter>
+- <Parameter name="file">@DATA_DIR@/mapnik/world_boundaries/shoreline_l</Parameter>
++ <Parameter name="file">@DATA_DIR@/world_boundaries/shoreline_l</Parameter>
+ </Datasource>
+ </Layer>
+
+@@ -1674,7 +1674,7 @@
+ <StyleName>builtup</StyleName>
+ <Datasource>
+ <Parameter name="type">shape</Parameter>
+- <Parameter name="file">@DATA_DIR@/mapnik/world_boundaries/builtup_area</Parameter>
++ <Parameter name="file">@DATA_DIR@/world_boundaries/builtup_area</Parameter>
+ </Datasource>
+ </Layer>
+
+@@ -1786,7 +1786,7 @@
+ <StyleName>places</StyleName>
+ <Datasource>
+ <Parameter name="type">shape</Parameter>
+- <Parameter name="file">@DATA_DIR@/mapnik/world_boundaries/places</Parameter>
++ <Parameter name="file">@DATA_DIR@/world_boundaries/places</Parameter>
+ </Datasource>
+ </Layer>
+ </Map>
+diff -urNad gpsdrive-2.10~pre4~/src/mapnik.cpp gpsdrive-2.10~pre4/src/mapnik.cpp
+--- gpsdrive-2.10~pre4~/src/mapnik.cpp 2007-09-14 21:47:13.000000000 +0000
++++ gpsdrive-2.10~pre4/src/mapnik.cpp 2007-10-16 08:22:45.000000000 +0000
+@@ -156,7 +156,7 @@
+ if ( ! boost:: filesystem::exists(mapnik_config_file) )
+ mapnik_config_file.assign("../scripts/mapnik/osm.xml");
+ if ( ! boost:: filesystem::exists(mapnik_config_file) )
+- mapnik_config_file.assign(DATADIR).append("/mapnik/osm.xml");
++ mapnik_config_file.assign(DATADIR).append("/gpsdrive/mapnik/osm.xml");
+ cout << "Using Mapnik config-file: " << mapnik_config_file << endl;
+
+ if ( ! boost:: filesystem::exists(mapnik_config_file) ) {
diff --git a/debian/patches/100-fix-insecure-tempfiles.dpatch b/debian/patches/100-fix-insecure-tempfiles.dpatch
new file mode 100644
index 0000000..7ad5af1
--- /dev/null
+++ b/debian/patches/100-fix-insecure-tempfiles.dpatch
@@ -0,0 +1,86 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 100-fix-insecure-tempfiles.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Fix insecure tempfile creation in geo-code.
+## DP: Thanks Moritz Muehlenhoff <jmm@inutil.org>.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4-6.dfsg~/scripts/geo-code gpsdrive-2.10~pre4-6.dfsg/scripts/geo-code
+--- gpsdrive-2.10~pre4-6.dfsg~/scripts/geo-code 2007-09-14 21:47:07.000000000 +0000
++++ gpsdrive-2.10~pre4-6.dfsg/scripts/geo-code 2008-12-28 17:47:39.000000000 +0000
+@@ -83,6 +83,7 @@
+ #
+ error() {
+ echo "`basename $PROGNAME`: $1" >&2
++ remove_cruft
+ exit 1
+ }
+
+@@ -130,8 +131,9 @@
+ a) SQLMATCH=all;;
+ D) DEBUG="$OPTARG";;
+ U) echo "Getting latest version of this script..."
+- curl -o$UPDATEcodeFILE "$UPDATEcodeURL"
+- echo "Latest version is in $UPDATEcodeFILE"
++ destdir=`mktemp -d`
++ curl -o$destdir/$UPDATEcodeFILE "$UPDATEcodeURL"
++ echo "Latest version is in $destdir/$UPDATEcodeFILE"
+ exit
+ ;;
+ h|\?) usage;;
+@@ -239,7 +241,7 @@
+ # procedure to remove cruft files
+ #
+ remove_cruft() {
+- for i in $STYLE $COORDS $OUTWAY $MAP
++ for i in $STYLE $COORDS $OUTWAY $MAP $TMP
+ do
+ [ -f $i ] && rm -f $i
+ done
+@@ -248,11 +250,11 @@
+ #
+ # Main Program
+ #
+-TMP=/tmp/geo$$
+-STYLE=${TMP}.style
+-COORDS=${TMP}.coords
+-OUTWAY=${TMP}.way
+-MAP=${TMP}.gif
++TMP=`mktemp -d`
++STYLE=${TMP}/style
++COORDS=${TMP}/coords
++OUTWAY=${TMP}/way
++MAP=${TMP}/gif
+ UA="Mozilla/5.0"
+
+ if [ "$GURL" != "" ]; then
+@@ -269,7 +271,6 @@
+ | head -n1 \
+ `
+ if [ "$URL" = "" ]; then
+- cp $COORDS /tmp/geo.google
+ error "Unable to lookup telephone number or name with Google"
+ else
+ URL="http://maps.yahoo.com/$URL"
+@@ -295,7 +296,7 @@
+ fi
+
+ if [ $DEBUG -gt 0 ]; then
+- filter="tee /tmp/geo.yahoo"
++ filter="tee `mktemp`"
+ else
+ filter=cat
+ fi
+@@ -306,9 +307,9 @@
+ -e 's/.*slt=\([^%]*\).*sln=\([^%]*\).*Create.*/\1 \2/p' \
+ > $COORDS
+
+-if [ $DEBUG -gt 0 ]; then
+- cp $COORDS /tmp/geo.coords
+-fi
++#if [ $DEBUG -gt 0 ]; then
++# cp -d $COORDS /tmp/geo.coords
++#fi
+
+ #
+ # Convert the coords, address, and type to the desired
diff --git a/debian/patches/101-signalposreq.dpatch b/debian/patches/101-signalposreq.dpatch
new file mode 100644
index 0000000..f30b1bb
--- /dev/null
+++ b/debian/patches/101-signalposreq.dpatch
@@ -0,0 +1,70 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 101-signalposreq.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Remove signalposreq() from gpsdrive, vulnerable to symlink attacks.
+## DP: Remove weird deletion of temporary files.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4-6.dfsg~/src/gpsdrive.c gpsdrive-2.10~pre4-6.dfsg/src/gpsdrive.c
+--- gpsdrive-2.10~pre4-6.dfsg~/src/gpsdrive.c 2008-12-28 18:10:54.000000000 +0000
++++ gpsdrive-2.10~pre4-6.dfsg/src/gpsdrive.c 2008-12-28 18:11:27.000000000 +0000
+@@ -3087,9 +3087,6 @@
+ /* all default values must be set BEFORE readconfig! */
+ g_strlcpy (setpositionname, "", sizeof (setpositionname));
+
+- /* setup signal handler */
+- signal (SIGUSR1, signalposreq);
+-
+ sql_load_lib();
+ /* I18l */
+
+@@ -3419,9 +3416,6 @@
+ gdk_pixbuf_unref (friendspixbuf);
+
+
+- unlink ("/tmp/cammain.pid");
+- unlink ("/tmp/gpsdrivetext.out");
+- unlink ("/tmp/gpsdrivepos");
+ if (local_config.savetrack)
+ savetrackfile (2);
+ sqlend ();
+diff -urNad gpsdrive-2.10~pre4-6.dfsg~/src/gpsproto.h gpsdrive-2.10~pre4-6.dfsg/src/gpsproto.h
+--- gpsdrive-2.10~pre4-6.dfsg~/src/gpsproto.h 2007-09-14 21:47:13.000000000 +0000
++++ gpsdrive-2.10~pre4-6.dfsg/src/gpsproto.h 2008-12-28 18:11:32.000000000 +0000
+@@ -75,7 +75,6 @@
+ gint settings_main_cb (GtkWidget *widget, guint datum);
+ gint sel_message_cb (GtkWidget * widget, guint datum);
+ gint setmessage_cb (GtkWidget * widget, guint datum);
+-void signalposreq ();
+ gint reinsertwp_cb (GtkWidget * widget, guint datum);
+ GdkPixbuf *create_pixbuf (const gchar * filename);
+ gint simulated_pos (GtkWidget * widget, guint * datum);
+diff -urNad gpsdrive-2.10~pre4-6.dfsg~/src/splash.c gpsdrive-2.10~pre4-6.dfsg/src/splash.c
+--- gpsdrive-2.10~pre4-6.dfsg~/src/splash.c 2007-09-14 21:47:13.000000000 +0000
++++ gpsdrive-2.10~pre4-6.dfsg/src/splash.c 2008-12-28 18:11:18.000000000 +0000
+@@ -630,25 +630,3 @@
+ (gtk_widget_destroy), NULL);
+ return TRUE;
+ }
+-
+-
+-/* writes time and position to /tmp/gpsdrivepos */
+-void
+-signalposreq ()
+-{
+- FILE *f;
+- time_t t;
+- struct tm *ts;
+-
+- f = fopen ("/tmp/gpsdrivepos", "w");
+- if (f == NULL)
+- {
+- perror ("/tmp/gpsdrivepos");
+- return;
+- }
+- time (&t);
+- ts = localtime (&t);
+- fprintf (f, asctime (ts));
+- fprintf (f, "POS %f %f\n", coords.current_lat, coords.current_lon);
+- fclose (f);
+-}
diff --git a/debian/patches/102-unittest.dpatch b/debian/patches/102-unittest.dpatch
new file mode 100644
index 0000000..c83d4ed
--- /dev/null
+++ b/debian/patches/102-unittest.dpatch
@@ -0,0 +1,26 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 102-unittest.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Use mkdtemp to avoid a potential symlink attack.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4-6.dfsg~/src/unit_test.c gpsdrive-2.10~pre4-6.dfsg/src/unit_test.c
+--- gpsdrive-2.10~pre4-6.dfsg~/src/unit_test.c 2007-09-15 15:12:03.000000000 +0000
++++ gpsdrive-2.10~pre4-6.dfsg/src/unit_test.c 2008-12-29 15:33:26.000000000 +0000
+@@ -649,10 +649,12 @@
+ gchar fn[500];
+ gint response;
+
+-
+- g_snprintf (dir_proc, sizeof (dir_proc), "/tmp/gpsdrive-unit-test");
+- mkdir (dir_proc, 0777);
+- g_snprintf (dir_proc, sizeof (dir_proc), "/tmp/gpsdrive-unit-test/proc");
++ strncpy(dir_proc, "/tmp/gpsdrive-unit-test.XXXXXX", sizeof(dir_proc));
++ if (mkdtemp(dir_proc) == NULL) {
++ printf("Error: Faild to create temporary directory\n");
++ exit(1);
++ }
++ strncat(dir_proc, "/proc", sizeof(dir_proc));
+ mkdir (dir_proc, 0777);
+
+ if (mydebug > 0)
diff --git a/debian/patches/103-no-textquery.dpatch b/debian/patches/103-no-textquery.dpatch
new file mode 100644
index 0000000..7adf796
--- /dev/null
+++ b/debian/patches/103-no-textquery.dpatch
@@ -0,0 +1,18 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 103-no-textquery.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' gpsdrive-2.10pre7~/scripts/osm/perl_lib/Geo/Gpsdrive/getstreet.pm gpsdrive-2.10pre7/scripts/osm/perl_lib/Geo/Gpsdrive/getstreet.pm
+--- gpsdrive-2.10pre7~/scripts/osm/perl_lib/Geo/Gpsdrive/getstreet.pm 2009-06-14 15:57:25.000000000 +0200
++++ gpsdrive-2.10pre7/scripts/osm/perl_lib/Geo/Gpsdrive/getstreet.pm 2010-03-08 10:47:16.000000000 +0100
+@@ -2,7 +2,6 @@
+ #noch nicht alle variablen angepasst
+ use LWP::UserAgent;
+ use WWW::Mechanize;
+-use Text::Query;
+ use Getopt::Long; #maybe not needed any more
+ use Pod::Usage;
+ use DBI;
diff --git a/debian/patches/104-fix-xcursor-check.dpatch b/debian/patches/104-fix-xcursor-check.dpatch
new file mode 100644
index 0000000..97b71bd
--- /dev/null
+++ b/debian/patches/104-fix-xcursor-check.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## Description: XcursorImageCreate is defined in Xcursor
+## Origin/Author: Julian Taylor <jtaylor.debian@googlemail.com>
+## Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=615653
+## fix-xcursor-check.dpatch by Julian Taylor <jtaylor.debian@googlemail.com>
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' gpsdrive~/configure.ac gpsdrive/configure.ac
+--- gpsdrive~/configure.ac 2011-07-05 13:43:55.000000000 +0200
++++ gpsdrive/configure.ac 2011-07-05 13:51:30.531707412 +0200
+@@ -471,7 +471,7 @@
+ if $PKG_CONFIG xcursor --atleast-version=1.1.2
+ then
+ AC_MSG_RESULT([yes])
+- AC_CHECK_LIB(fontconfig, XcursorImageCreate, [], [
++ AC_CHECK_LIB(Xcursor, XcursorImageCreate, [], [
+ echo "Error with test of xcursor library not found"
+ exit -1
+ ])
diff --git a/debian/patches/105-add-boost-links.dpatch b/debian/patches/105-add-boost-links.dpatch
new file mode 100644
index 0000000..d6231b8
--- /dev/null
+++ b/debian/patches/105-add-boost-links.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## Description: requires direct link against boost {file,}system
+## Origin/Author: Julian Taylor <jtaylor.debian@googlemail.com>
+## Bug: https://bugs.launchpad.net/ubuntu/+source/gpsdrive/+bug/749273
+## 105-add-boost-links.dpatch by Julian Taylor <jtaylor.debian@googlemail.com>
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' gpsdrive~/src/Makefile.am gpsdrive/src/Makefile.am
+--- gpsdrive~/src/Makefile.am 2011-07-05 13:59:11.000000000 +0200
++++ gpsdrive/src/Makefile.am 2011-07-05 14:02:23.341707820 +0200
+@@ -42,7 +42,7 @@
+ INCLUDES = $(DBUS_CFLAGS) -DDBUS_API_SUBJECT_TO_CHANGE=1
+ endif
+
+-gpsdrive_LDADD=@LIBS@ $(LIBADD_DL)
++gpsdrive_LDADD=@LIBS@ $(LIBADD_DL) -lboost_filesystem -lboost_system
+
+ PRGS = gpsdrive.c splash.c splash.h gpsdrive_config.c gpsdrive_config.h \
+ navigation.c \
diff --git a/debian/patches/107-fix-disable-mapnik.dpatch b/debian/patches/107-fix-disable-mapnik.dpatch
new file mode 100644
index 0000000..545c7f4
--- /dev/null
+++ b/debian/patches/107-fix-disable-mapnik.dpatch
@@ -0,0 +1,24 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 107-disable-mapnik.dpatch by Allison Randal <allison@canonical.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Don't call into the mapnik library APIs when mapnik is disabled.
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ftbfs-precise~/src/map_handler.c ftbfs-precise/src/map_handler.c
+--- ftbfs-precise~/src/map_handler.c 2011-12-01 22:24:15.000000000 +0000
++++ ftbfs-precise/src/map_handler.c 2011-12-01 22:37:16.298094236 +0000
+@@ -660,9 +660,12 @@
+ if (maploaded)
+ gdk_pixbuf_unref (image);
+
++#ifdef MAPNIK
+ if ( !strcmp (filename,"mapnik") ) {
+ limage = gdk_pixbuf_new_from_data(get_mapnik_imagedata(), GDK_COLORSPACE_RGB, FALSE, 8, 1280, 1024, 1280 * 3, NULL, NULL);
+- } else {
++ } else
++#endif // MAPNIK
++ {
+ limage = gdk_pixbuf_new_from_file (filename, NULL);
+ if (limage == NULL)
+ {
diff --git a/debian/patches/20-homedir.dpatch b/debian/patches/20-homedir.dpatch
new file mode 100644
index 0000000..88b1ff7
--- /dev/null
+++ b/debian/patches/20-homedir.dpatch
@@ -0,0 +1,44 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20-homedir.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Do not overwrite ~/.gpsdrive/osm.xml when gpsdrive is started.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/src/mapnik.cpp gpsdrive-2.10~pre4/src/mapnik.cpp
+--- gpsdrive-2.10~pre4~/src/mapnik.cpp 2007-09-17 07:48:41.000000000 +0000
++++ gpsdrive-2.10~pre4/src/mapnik.cpp 2007-09-17 07:50:02.000000000 +0000
+@@ -165,20 +165,21 @@
+ }
+
+ // load files
+-
+- ifstream InputXML (mapnik_config_file.c_str());
+- ofstream DestXML (Dest);
++ if ( ! boost:: filesystem::exists(Dest) ) {
++ ifstream InputXML (mapnik_config_file.c_str());
++ ofstream DestXML (Dest);
+
+- if (InputXML && DestXML) {
+- if (InputXML.is_open()) {
+- string s ;
+- while (getline(InputXML, s)) {
+- DestXML << ReplaceString("@USER@", Username, s) << endl;
+- }
+- }
+- }
+- InputXML.close();
+- DestXML.close();
++ if (InputXML && DestXML) {
++ if (InputXML.is_open()) {
++ string s ;
++ while (getline(InputXML, s)) {
++ DestXML << ReplaceString("@USER@", Username, s) << endl;
++ }
++ }
++ }
++ InputXML.close();
++ DestXML.close();
++ }
+
+ return -1;
+ }
diff --git a/debian/patches/30-icons.dpatch b/debian/patches/30-icons.dpatch
new file mode 100644
index 0000000..6a92582
--- /dev/null
+++ b/debian/patches/30-icons.dpatch
@@ -0,0 +1,52 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 30-icons.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add map-icon paths for debian.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Gpsdrive/DB_Defaults.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Gpsdrive/DB_Defaults.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Gpsdrive/DB_Defaults.pm 2007-09-15 15:12:11.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Gpsdrive/DB_Defaults.pm 2007-09-29 21:54:55.000000000 +0000
+@@ -52,6 +52,7 @@
+ $icon_file = '/usr/local/share/map-icons/icons.xml' unless -s $icon_file;
+ $icon_file = '/usr/share/map-icons/icons.xml' unless -s $icon_file;
+ $icon_file = '/opt/gpsdrive/icons.xml' unless -s $icon_file;
++ $icon_file = '/usr/share/gpsdrive/map-icons/icons.xml' unless -s $icon_file;
+ die "no Icon File found" unless -s $icon_file;
+
+ our $title = ''; our $title_en = '';
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Gpsdrive/OSM.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Gpsdrive/OSM.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Gpsdrive/OSM.pm 2007-09-15 18:04:02.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Gpsdrive/OSM.pm 2007-09-29 21:57:27.000000000 +0000
+@@ -574,6 +574,7 @@
+ "data/map-icons/icons.xml",
+ "/usr/local/map-icons/icons.xml",
+ "/usr/local/share/map-icons/icons.xml",
++ "/usr/share/gpsdrive/map-icons/icons.xml",
+ ) {
+ unless ( $icons_filename && -s $icons_filename ){
+ print STDERR "Checking icons-file: $fn\n"
+diff -urNad gpsdrive-2.10~pre4~/src/icons.c gpsdrive-2.10~pre4/src/icons.c
+--- gpsdrive-2.10~pre4~/src/icons.c 2007-09-29 21:32:42.000000000 +0000
++++ gpsdrive-2.10~pre4/src/icons.c 2007-09-29 21:53:08.000000000 +0000
+@@ -219,6 +219,7 @@
+ {"%s/gpsdrive/pixmaps/", (gchar *) DATADIR},
+ {"%s/map-icons/", "/usr/share"},
+ {"%s/gpsdrive/pixmaps/", "/usr/share"},
++ {"/usr/share/icons/openstreetmap/"},
+ {"END", NULL}
+ };
+
+diff -urNad gpsdrive-2.10~pre4~/src/poi.c gpsdrive-2.10~pre4/src/poi.c
+--- gpsdrive-2.10~pre4~/src/poi.c 2007-09-29 21:32:42.000000000 +0000
++++ gpsdrive-2.10~pre4/src/poi.c 2007-09-29 21:53:08.000000000 +0000
+@@ -713,7 +713,7 @@
+ if (xml_reader == NULL)
+ {
+ g_snprintf (iconsxml_file, sizeof (iconsxml_file),
+- "%s/map-icons/icons.xml", DATADIR);
++ "%s/gpsdrive/map-icons/icons.xml", DATADIR);
+ xml_reader = xmlNewTextReaderFilename(iconsxml_file);
+ }
+ if (xml_reader == NULL)
diff --git a/debian/patches/40-backported.dpatch b/debian/patches/40-backported.dpatch
new file mode 100644
index 0000000..79259e3
--- /dev/null
+++ b/debian/patches/40-backported.dpatch
@@ -0,0 +1,80 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40-backported.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Bugfixes from gpsdrive VCS.
+## DP: r1713: use poi_type_name as title for POI when no title is available .
+## DP: r1716: gpsdrive sets textdomain too late.
+## DP: r1717: include src/main_gui.c into the series of files to extract
+## DP: translatable strings from, so that all of the GUI can get
+## DP: translated.
+## DP: r1733: Adapt font path to debian files.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/po/POTFILES.in gpsdrive-2.10~pre4/po/POTFILES.in
+--- gpsdrive-2.10~pre4~/po/POTFILES.in 2007-09-14 21:47:47.000000000 +0000
++++ gpsdrive-2.10~pre4/po/POTFILES.in 2007-10-03 12:24:09.000000000 +0000
+@@ -21,6 +21,7 @@
+ src/lib_map/map_port.c
+ src/lib_map/map_render.c
+ src/lib_map/map_transform.c
++src/main_gui.c
+ src/map_handler.c
+ src/map_projection.c
+ src/navigation.c
+diff -urNad gpsdrive-2.10~pre4~/src/gpsdrive.c gpsdrive-2.10~pre4/src/gpsdrive.c
+--- gpsdrive-2.10~pre4~/src/gpsdrive.c 2007-09-15 01:24:15.000000000 +0000
++++ gpsdrive-2.10~pre4/src/gpsdrive.c 2007-10-03 12:23:00.000000000 +0000
+@@ -2985,6 +2985,10 @@
+ main (int argc, char *argv[])
+ {
+
++ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
++ bind_textdomain_codeset (PACKAGE, "utf8");
++ textdomain (GETTEXT_PACKAGE);
++
+ gchar buf[500];
+
+ current.needtosave = FALSE;
+@@ -3167,14 +3171,6 @@
+ */
+ loadmapconfig ();
+
+- /* PORTING */
+- {
+- gchar *p;
+- p = bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+- bind_textdomain_codeset (PACKAGE, "utf8");
+- p = textdomain (GETTEXT_PACKAGE);
+- p = textdomain (NULL);
+- }
+
+ /* Setting locale for correct Umlauts */
+ gtk_set_locale ();
+diff -urNad gpsdrive-2.10~pre4~/src/mapnik.cpp gpsdrive-2.10~pre4/src/mapnik.cpp
+--- gpsdrive-2.10~pre4~/src/mapnik.cpp 2007-09-14 21:47:13.000000000 +0000
++++ gpsdrive-2.10~pre4/src/mapnik.cpp 2007-10-03 12:28:29.000000000 +0000
+@@ -118,7 +118,9 @@
+ // Both datasorce_cache and font_engine are 'singletons'.
+
+ datasource_cache::instance()->register_datasources("/usr/lib/mapnik/input/");
+- freetype_engine::instance()->register_font("/usr/lib/mapnik/fonts/DejaVuSans.ttf");
++ // XXX We should make the fontname and path a config option
++ freetype_engine::instance()->register_font("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
++
+
+ MapnikMap.WidthInt = 1280;
+ MapnikMap.HeightInt = 1024;
+diff -urNad gpsdrive-2.10~pre4~/src/poi.c gpsdrive-2.10~pre4/src/poi.c
+--- gpsdrive-2.10~pre4~/src/poi.c 2007-09-15 15:12:03.000000000 +0000
++++ gpsdrive-2.10~pre4/src/poi.c 2007-10-03 12:18:30.000000000 +0000
+@@ -907,6 +907,10 @@
+ g_strlcpy(t_description, t_desc_en, sizeof(t_description));
+ if (strcmp(t_title, "n/a")==0)
+ g_strlcpy(t_title, t_title_en, sizeof(t_title));
++ /* if also no english title is available,
++ * use the poi_type_name as title */
++ if (strcmp(t_title, "n/a")==0)
++ g_strlcpy(t_title, t_name, sizeof(t_title));
+
+
+ g_strlcpy (poi_type_list[index].description,
diff --git a/debian/patches/50-scripts.dpatch b/debian/patches/50-scripts.dpatch
new file mode 100644
index 0000000..fd02f85
--- /dev/null
+++ b/debian/patches/50-scripts.dpatch
@@ -0,0 +1,31 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50-scripts.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Fix path to osm.xml (Thanks Giovanni Mascellani)
+## DP: Fix bashism in examples/wpget.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/scripts/mapnik/gpsdrive_mapnik_gentiles-in.py gpsdrive-2.10~pre4/scripts/mapnik/gpsdrive_mapnik_gentiles-in.py
+--- gpsdrive-2.10~pre4~/scripts/mapnik/gpsdrive_mapnik_gentiles-in.py 2007-09-15 15:11:59.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/mapnik/gpsdrive_mapnik_gentiles-in.py 2008-07-15 17:37:07.000000000 +0000
+@@ -166,7 +166,7 @@
+
+ home = os.environ['HOME']
+ data = "@DATA_DIR@/mapnik"
+- mapfile = data + "/osm.xml"
++ mapfile = home + "/.gpsdrive/osm.xml"
+ tile_dir = home + "/.gpsdrive/maps/mapnik/"
+ mapkoordfile = home + "/.gpsdrive/maps/map_koord.txt"
+
+diff -urNad gpsdrive-2.10~pre4~/scripts/wpget gpsdrive-2.10~pre4/scripts/wpget
+--- gpsdrive-2.10~pre4~/scripts/wpget 2007-09-14 21:47:07.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/wpget 2008-07-15 17:38:12.000000000 +0000
+@@ -32,7 +32,7 @@
+ done
+
+ opt=${opt:= -w}
+-if [[ ${#opt} != "3" && ${#opt} != "12" ]]; then
++if [ ${#opt} -ne 3 -a ${#opt} -ne 12 ]; then
+ echo "Usage: $0 [-r|--get-routes]|[-w|--get-waypts]|[-t|--get-tracks] [-d device|--device device]" >&2 ;
+ echo "defaults are: --get-waypts and --device /dev/gps" >&2 ;
+ exit 1 ;
diff --git a/debian/patches/60-sql.dpatch b/debian/patches/60-sql.dpatch
new file mode 100644
index 0000000..914491d
--- /dev/null
+++ b/debian/patches/60-sql.dpatch
@@ -0,0 +1,31 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 60-sql.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Moved remaining patches from 01old.dpatch.
+## DP: Fixed in upstream svn.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/Documentation/README.SQL gpsdrive-2.10~pre4/Documentation/README.SQL
+--- gpsdrive-2.10~pre4~/Documentation/README.SQL 2007-09-14 21:47:42.000000000 +0000
++++ gpsdrive-2.10~pre4/Documentation/README.SQL 2007-10-03 17:04:32.000000000 +0000
+@@ -8,7 +8,7 @@
+ ----------
+
+ There is no MySQL needed for compiling, the needed library
+-libmysqlclient.so.10 will be loaded at runtime, if found.
++libmysqlclient.so will be loaded at runtime, if found.
+
+ Running and first initialization:
+ ---------------------------------
+diff -urNad gpsdrive-2.10~pre4~/src/gpsdrive.h gpsdrive-2.10~pre4/src/gpsdrive.h
+--- gpsdrive-2.10~pre4~/src/gpsdrive.h 2007-09-14 21:47:13.000000000 +0000
++++ gpsdrive-2.10~pre4/src/gpsdrive.h 2007-10-03 17:04:05.000000000 +0000
+@@ -247,7 +247,7 @@
+ const char *db,
+ unsigned int port,
+ const char *unix_socket,
+- unsigned int clientflag);
++ unsigned long clientflag);
+ void (*dl_mysql_close)(MYSQL *sock);
+ int (*dl_mysql_query)(MYSQL *mysql, const char *q);
+ my_ulonglong (*dl_mysql_affected_rows)(MYSQL *mysql);
diff --git a/debian/patches/70-perl.dpatch b/debian/patches/70-perl.dpatch
new file mode 100644
index 0000000..2fd023c
--- /dev/null
+++ b/debian/patches/70-perl.dpatch
@@ -0,0 +1,362 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 70-perl.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Move perl modules to Geo::Gpsdrive for now.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/scripts/geoinfo.pl gpsdrive-2.10~pre4/scripts/geoinfo.pl
+--- gpsdrive-2.10~pre4~/scripts/geoinfo.pl 2007-09-15 15:11:59.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/geoinfo.pl 2008-01-08 23:15:25.000000000 +0000
+@@ -45,7 +45,7 @@
+ use IO::File;
+ use Pod::Usage;
+
+-use Utils::Debug;
++use Geo::Gpsdrive::Utils::Debug;
+
+ use Geo::Gpsdrive::DBFuncs;
+ use Geo::Gpsdrive::Utils;
+@@ -193,7 +193,7 @@
+ }
+
+ if ( $do_list_areas ) {
+- print Geo::Filter::Area->list_areas()."\n";
++ print Geo::Gpsdrive::Filter::Area->list_areas()."\n";
+ }
+
+ pod2usage(1) if $help;
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Filter/Area.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Filter/Area.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Filter/Area.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Filter/Area.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::Filter::Area;
++package Geo::Gpsdrive::Filter::Area;
+ ##################################################################
+
+ use strict;
+@@ -136,7 +136,7 @@
+
+ # ------------------------------------------------------------------
+
+-my $test_area = Geo::Filter::Area->new(area=>"uk");
++my $test_area = Geo::Gpsdrive::Filter::Area->new(area=>"uk");
+ if ( $test_area->inside({lat=>10,lon=>10})) {
+ Carp::confess("Area filters are not working\n");
+ };
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/GPX/File.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/GPX/File.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/GPX/File.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/GPX/File.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::GPX::File;
++package Geo::Gpsdrive::GPX::File;
+ ##################################################################
+
+ use Exporter;
+@@ -18,10 +18,10 @@
+ use Date::Manip;
+ use POSIX qw(strftime);
+
+-use Geo::Geometry;
+-use Utils::File;
+-use Utils::Math;
+-use Utils::Debug;
++use Geo::Gpsdrive::Geometry;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::Math;
++use Geo::Gpsdrive::Utils::Debug;
+
+ # -----------------------------------------------------------------------------
+ # Read GPS Data from GPX - File
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Geometry.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Geometry.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Geometry.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Geometry.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::Geometry;
++package Geo::Gpsdrive::Geometry;
+ ##################################################################
+
+ use strict;
+@@ -16,9 +16,9 @@
+
+ use Math::Trig;
+
+-use Utils::File;
+-use Utils::Math;
+-use Utils::Debug;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::Math;
++use Geo::Gpsdrive::Utils::Debug;
+
+ # ------------------------------------------------------------------
+ # Distance in Km between 2 geo points with lat/lon
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Gpsdrive/OSM.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Gpsdrive/OSM.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Gpsdrive/OSM.pm 2008-01-08 23:15:22.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Gpsdrive/OSM.pm 2008-01-08 23:16:55.000000000 +0000
+@@ -13,16 +13,15 @@
+ use File::Path;
+ use Geo::Gpsdrive::DBFuncs;
+ use Geo::Gpsdrive::Utils;
+-use Geo::OSM::Planet;
++use Geo::Gpsdrive::OSM::Planet;
+ use Data::Dumper;
+ use XML::Parser;
+ use XML::Simple;
+-use Geo::Filter::Area;
+-use Geo::OSM::Planet;
+-use Utils::Debug;
+-use Utils::File;
+-use Utils::LWP::Utils;
+-use Utils::Math;
++use Geo::Gpsdrive::Filter::Area;
++use Geo::Gpsdrive::Utils::Debug;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::LWP::Utils;
++use Geo::Gpsdrive::Utils::Math;
+
+ our $OSM_polite = 10; # Wait n times as long as the request lasted
+ our $AREA_FILTER;
+@@ -411,7 +410,7 @@
+
+ my $start_time=time();
+
+- $AREA_FILTER = Geo::Filter::Area->new( area => $area_name );
++ $AREA_FILTER = Geo::Gpsdrive::Filter::Area->new( area => $area_name );
+
+ print("\rReading $file_name for $area_name\n") if $VERBOSE || $debug;
+ print "$file_name: ".(-s $file_name)." Bytes\n" if $debug;
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/OSM/Planet.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/OSM/Planet.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/OSM/Planet.pm 2007-09-15 01:24:19.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/OSM/Planet.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::OSM::Planet;
++package Geo::Gpsdrive::OSM::Planet;
+ ##################################################################
+
+ use Exporter;
+@@ -26,9 +26,9 @@
+ use Storable ();
+ use Data::Dumper;
+
+-use Utils::File;
+-use Utils::Debug;
+-use Utils::LWP::Utils;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::Debug;
++use Geo::Gpsdrive::Utils::LWP::Utils;
+
+
+ # As of planet-061220
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/GpsBabel.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/GpsBabel.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/GpsBabel.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/GpsBabel.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::Tracks::GpsBabel;
++package Geo::Gpsdrive::Tracks::GpsBabel;
+ ##################################################################
+
+ use Exporter;
+@@ -11,11 +11,11 @@
+ use warnings;
+ use IO::File;
+
+-use Geo::Geometry;
+-use Utils::File;
+-use Utils::Math;
+-use Utils::Debug;
+-use Geo::GPX::File;
++use Geo::Gpsdrive::Geometry;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::Math;
++use Geo::Gpsdrive::Utils::Debug;
++use Geo::Gpsdrive::GPX::File;
+
+
+ # -----------------------------------------------------------------------------
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/Kismet.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/Kismet.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/Kismet.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/Kismet.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::Tracks::Kismet;
++package Geo::Gpsdrive::Tracks::Kismet;
+ ##################################################################
+
+ use Exporter;
+@@ -15,10 +15,10 @@
+ use Data::Dumper;
+
+ use Data::Dumper;
+-use Geo::Geometry;
+-use Utils::Debug;
+-use Utils::File;
+-use Utils::Math;
++use Geo::Gpsdrive::Geometry;
++use Geo::Gpsdrive::Utils::Debug;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::Math;
+
+ # -----------------------------------------------------------------------------
+ # Read GPS Data from Kismet File
+@@ -61,7 +61,7 @@
+ }
+ my $track=[];
+ for my $elem ( @{$content->[0]->{Kids}} ) {
+- next unless ref($elem) eq "Geo::Tracks::Kismet::gps-point";
++ next unless ref($elem) eq "Geo::Gpsdrive::Tracks::Kismet::gps-point";
+ next unless $elem->{'bssid'} eq 'GP:SD:TR:AC:KL:OG';
+ delete $elem->{Kids};
+ if ( defined($elem->{"time-sec"}) && defined($elem->{"time-usec"}) ) {
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/NMEA.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/NMEA.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/NMEA.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/NMEA.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::Tracks::NMEA;
++package Geo::Gpsdrive::Tracks::NMEA;
+ ##################################################################
+
+ use Exporter;
+@@ -16,10 +16,10 @@
+ use IO::File;
+ use Math::Trig;
+
+-use Geo::Geometry;
+-use Utils::Debug;
+-use Utils::File;
+-use Utils::Math;
++use Geo::Gpsdrive::Geometry;
++use Geo::Gpsdrive::Utils::Debug;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::Math;
+
+ # -----------------------------------------------------------------------------
+ # Read GPS Data from NMEA - File
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/TRK.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/TRK.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/TRK.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/TRK.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::Tracks::TRK;
++package Geo::Gpsdrive::Tracks::TRK;
+ ##################################################################
+
+ use Exporter;
+@@ -12,9 +12,9 @@
+
+ use Data::Dumper;
+ use IO::File;
+-use Utils::Debug;
+-use Utils::File;
+-use Utils::Math;
++use Geo::Gpsdrive::Utils::Debug;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::Math;
+ use Date::Manip;
+ use Date::Parse;
+ use Time::Local;
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/Tools.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/Tools.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Geo/Tracks/Tools.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Geo/Tracks/Tools.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Geo::Tracks::Tools;
++package Geo::Gpsdrive::Tracks::Tools;
+ ##################################################################
+
+ use Exporter;
+@@ -23,10 +23,10 @@
+ use warnings;
+ use Carp;
+
+-use Geo::Geometry;
+-use Utils::File;
+-use Utils::Math;
+-use Utils::Debug;
++use Geo::Gpsdrive::Geometry;
++use Geo::Gpsdrive::Utils::File;
++use Geo::Gpsdrive::Utils::Math;
++use Geo::Gpsdrive::Utils::Debug;
+
+ # Copy the track structure
+ sub copy_track_structure($$){
+@@ -364,7 +364,7 @@
+
+ =head1 NAME
+
+-Geo::Tracks::Tools
++Geo::Gpsdrive::Tracks::Tools
+
+ =head1 COPYRIGHT
+
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Utils/Debug.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Utils/Debug.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Utils/Debug.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Utils/Debug.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Utils::Debug;
++package Geo::Gpsdrive::Utils::Debug;
+ ##################################################################
+
+ use Exporter;
+@@ -19,7 +19,7 @@
+ use warnings;
+
+ use IO::File;
+-use Utils::Math;
++use Geo::Gpsdrive::Utils::Math;
+
+
+ # print the time elapsed since starting
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Utils/File.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Utils/File.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Utils/File.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Utils/File.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Utils::File;
++package Geo::Gpsdrive::Utils::File;
+ ##################################################################
+
+ use Exporter;
+@@ -15,7 +15,7 @@
+ use warnings;
+
+ use IO::File;
+-use Utils::Debug;
++use Geo::Gpsdrive::Utils::Debug;
+
+ use File::Basename;
+ use File::Copy;
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Utils/LWP/Utils.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Utils/LWP/Utils.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Utils/LWP/Utils.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Utils/LWP/Utils.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Utils::LWP::Utils;
++package Geo::Gpsdrive::Utils::LWP::Utils;
+ ##################################################################
+
+ use Exporter;
+@@ -14,7 +14,7 @@
+
+ use LWP::UserAgent;
+
+-use Utils::Debug;
++use Geo::Gpsdrive::Utils::Debug;
+
+ our $PROXY='';
+
+diff -urNad gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Utils/Math.pm gpsdrive-2.10~pre4/scripts/osm/perl_lib/Utils/Math.pm
+--- gpsdrive-2.10~pre4~/scripts/osm/perl_lib/Utils/Math.pm 2007-09-14 21:47:52.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/osm/perl_lib/Utils/Math.pm 2008-01-08 23:15:25.000000000 +0000
+@@ -1,5 +1,5 @@
+ ##################################################################
+-package Utils::Math;
++package Geo::Gpsdrive::Utils::Math;
+ ##################################################################
+
+ use strict;
diff --git a/debian/patches/80-dbus.dpatch b/debian/patches/80-dbus.dpatch
new file mode 100644
index 0000000..d24ae45
--- /dev/null
+++ b/debian/patches/80-dbus.dpatch
@@ -0,0 +1,109 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 80-dbus.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Fix DBUS support
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/src/gps_handler.c gpsdrive-2.10~pre4/src/gps_handler.c
+--- gpsdrive-2.10~pre4~/src/gps_handler.c 2007-09-14 21:47:13.000000000 +0000
++++ gpsdrive-2.10~pre4/src/gps_handler.c 2007-12-17 22:38:52.000000000 +0000
+@@ -371,6 +371,7 @@
+ {
+ struct tm time;
+ time_t ttime;
++ double direction;
+
+ if (!early && (dbus_current_fix.mode==-1)) {
+ /* We have handled this one, so clean the mode and bail out */
+@@ -416,10 +417,10 @@
+ coords.current_lon = dbus_current_fix.longitude;
+ /* Handle speed */
+ if (__finite(dbus_current_fix.speed))
+- groundspeed = dbus_current_fix.speed * 3.6; // Convert m/s to km/h
++ current.groundspeed = dbus_current_fix.speed * 3.6; // Convert m/s to km/h
+ else if (dbus_old_fix.mode>1) {
+ gdouble timediff = dbus_current_fix.time-dbus_old_fix.time;
+- groundspeed = (timediff>0)?(calcdist2(dbus_old_fix.longitude, dbus_old_fix.latitude) * 3600 / timediff) : 0.0;
++ current.groundspeed = (timediff>0)?(calcdist2(dbus_old_fix.longitude, dbus_old_fix.latitude) * 3600 / timediff) : 0.0;
+ }
+ /* Handle bearing */
+ if (__finite(dbus_current_fix.track))
+@@ -435,7 +436,7 @@
+ }
+ if ( mydebug + gps_handler_debug > 80 )
+ g_print("gps_handler: DBUS fix: %6.0f %10.6f/%10.6f sp:%5.2f(%5.2f) crs:%5.1f(%5.2f)\n", dbus_current_fix.time,
+- dbus_current_fix.latitude, dbus_current_fix.longitude, dbus_current_fix.speed, groundspeed,
++ dbus_current_fix.latitude, dbus_current_fix.longitude, dbus_current_fix.speed, current.groundspeed,
+ dbus_current_fix.track, direction * 180 / M_PI);
+ /* Handle altitude */
+ if (dbus_current_fix.mode>2) {
+@@ -453,46 +454,31 @@
+ }
+
+ static DBusHandlerResult dbus_handle_gps_fix (DBusMessage* message) {
+- DBusMessageIter iter;
+- //double temp_time;
+- //char b[100];
++
++ DBusError error;
++ double temp_time;
+ struct dbus_gps_fix fix;
+- //gint32 mode;
+- //gdouble dump;
+-
+- if (!dbus_message_iter_init (message, &iter)) {
+- /* we have a problem */
+- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+- }
+
+- /* Fill the fix struct */
+- fix.time = floor(dbus_message_iter_get_double (&iter));
+- dbus_message_iter_next (&iter);
+- fix.mode = dbus_message_iter_get_int32 (&iter);
+- dbus_message_iter_next (&iter);
+- fix.ept = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.latitude = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.longitude = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.eph = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.altitude = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.epv = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.track = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.epd = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.speed = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.eps = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.climb = dbus_message_iter_get_double (&iter);
+- dbus_message_iter_next (&iter);
+- fix.epc = dbus_message_iter_get_double (&iter);
++ dbus_error_init(&error);
++
++ dbus_message_get_args(message,
++ &error,
++ DBUS_TYPE_DOUBLE, &temp_time,
++ DBUS_TYPE_INT32, &fix.mode,
++ DBUS_TYPE_DOUBLE, &fix.ept,
++ DBUS_TYPE_DOUBLE, &fix.latitude,
++ DBUS_TYPE_DOUBLE, &fix.longitude,
++ DBUS_TYPE_DOUBLE, &fix.eph,
++ DBUS_TYPE_DOUBLE, &fix.altitude,
++ DBUS_TYPE_DOUBLE, &fix.epv,
++ DBUS_TYPE_DOUBLE, &fix.track,
++ DBUS_TYPE_DOUBLE, &fix.epd,
++ DBUS_TYPE_DOUBLE, &fix.speed,
++ DBUS_TYPE_DOUBLE, &fix.eps,
++ DBUS_TYPE_DOUBLE, &fix.climb,
++ DBUS_TYPE_DOUBLE, &fix.epc,
++ DBUS_TYPE_INVALID);
++ fix.time = floor(temp_time);
+
+ if ( mydebug + gps_handler_debug > 80 ) {
+ g_print("gps_handler: DBUS raw: ti:%6.0f mode:%d ept:%f %10.6f/%10.6f eph:%f\n", fix.time, fix.mode, fix.ept, fix.latitude, fix.longitude, fix.eph);
diff --git a/debian/patches/85-settings.dpatch b/debian/patches/85-settings.dpatch
new file mode 100644
index 0000000..5278d49
--- /dev/null
+++ b/debian/patches/85-settings.dpatch
@@ -0,0 +1,26 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 85-settings.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Use basename() for way.txt. Don't rely on a '/' in gpsdriverc
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/src/settings.c gpsdrive-2.10~pre4/src/settings.c
+--- gpsdrive-2.10~pre4~/src/settings.c 2007-09-15 15:12:03.000000000 +0000
++++ gpsdrive-2.10~pre4/src/settings.c 2008-01-14 23:18:38.000000000 +0000
+@@ -32,6 +32,7 @@
+ #include <stdio.h>
+ #include <signal.h>
+ #include <unistd.h>
++#include <dirent.h>
+ #include <sys/mman.h>
+ #include <math.h>
+ #include "poi.h"
+@@ -1763,7 +1764,7 @@
+ /* waypoints quick select */
+ {
+ g_strlcpy (path, local_config.dir_home, sizeof (path));
+- current_wpfile = g_strrstr (local_config.wp_file, "/") + 1;
++ current_wpfile = basename (local_config.wp_file);
+ names = g_new (namesstruct, 102);
+ d = opendir (path);
+ if (NULL != d)
diff --git a/debian/patches/90-usage.dpatch b/debian/patches/90-usage.dpatch
new file mode 100644
index 0000000..63c7245
--- /dev/null
+++ b/debian/patches/90-usage.dpatch
@@ -0,0 +1,48 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 90-usage.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Correct usage() output.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/src/gpsdrive.c gpsdrive-2.10~pre4/src/gpsdrive.c
+--- gpsdrive-2.10~pre4~/src/gpsdrive.c 2007-12-18 22:08:34.000000000 +0000
++++ gpsdrive-2.10~pre4/src/gpsdrive.c 2007-12-18 22:09:55.000000000 +0000
+@@ -2738,30 +2738,27 @@
+ _("-D X set debug Level to X\n"),
+ _("-T do some internal unit Tests(don't start gpsdrive)\n"),
+ _("-e use Festival-Lite (flite) for speech output\n"),
+- _("-o serial device, pty master, or file for NMEA *output*\n"),
+- _("-f X Select friends server, X is i.e. friendsd.gpsdrive.de\n"),
++ _("-o thing serial device, pty master, or file for NMEA *output*\n"),
++ _("-f server Select friends server, X is i.e. friendsd.gpsdrive.de\n"),
+ #ifdef DBUS_ENABLE
+ _("-X Use DBUS for communication with gpsd. This disables serial and socket communication\n"),
+ #endif
+- _("-l LANG Select language of the voice,\n"
+- " LANG may be english, spanish or german\n"),
+- _("-s HEIGHT set height of the screen, if autodetection\n"
+- " don't satisfy you, X is i.e. 768,600,480,200\n"),
+- _("-r WIDTH set width of the screen, only with -s\n"),
++ _("-l lang. Select language of the voice,\n"
++ " language may be 'english', 'spanish' or 'german'\n"),
++ _("-g geom. set window geometry, e.g. 800x600\n"),
+ _("-1 have only 1 button mouse, for example using touchscreen\n"),
+ _("-a display APM Stuff ( battery status, Temperature)\n"),
+ _("-b Server Servername for NMEA server (if gpsd runs on another host)\n"),
+ _("-c WP set start position in simulation mode to waypoint name WP\n"),
+- _("-x create separate window for menu\n"),
+- _("-M mode set guimode to desktop, pda or car\n"),
++ _("-M mode set GUI mode; mode may be 'desktop' (default), 'pda' or 'car'\n"),
+ _("-i ignore NMEA checksum (risky, only for broken GPS receivers\n"),
+ _("-q disable SQL support\n"),
+ _("-F force display of position even it is invalid\n"),
+ _("-S don't show splash screen\n"),
+- _("-P start in Pos Mode\n"),
++ _("-P start in Position Mode\n"),
+ _("-W x set x to 1 to switch WAAS/EGNOS on, set to 0 to switch off\n"),
+ _("-H ALT correct altitude, adding this value (ALT) to altitude\n"),
+- _("-C file set config file (--config-file)\n"));
++ _("-C file set config file (--config-file)\n"));
+
+ }
+
diff --git a/debian/patches/95-newapi.dpatch b/debian/patches/95-newapi.dpatch
new file mode 100644
index 0000000..e500c06
--- /dev/null
+++ b/debian/patches/95-newapi.dpatch
@@ -0,0 +1,18 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 95-newapi.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
+##
+## DP: Use new api method to register fonts.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/src/mapnik.cpp gpsdrive-2.10~pre4/src/mapnik.cpp
+--- gpsdrive-2.10~pre4~/src/mapnik.cpp 2008-02-20 14:27:41.000000000 +0100
++++ gpsdrive-2.10~pre4/src/mapnik.cpp 2008-02-20 14:28:04.000000000 +0100
+@@ -119,7 +119,7 @@
+
+ datasource_cache::instance()->register_datasources("/usr/lib/mapnik/input/");
+ // XXX We should make the fontname and path a config option
+- freetype_engine::instance()->register_font("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
++ freetype_engine::register_font("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
+
+
+ MapnikMap.WidthInt = 1280;
diff --git a/debian/patches/96-mapnik-plugins-dir.dpatch b/debian/patches/96-mapnik-plugins-dir.dpatch
new file mode 100644
index 0000000..3abaf96
--- /dev/null
+++ b/debian/patches/96-mapnik-plugins-dir.dpatch
@@ -0,0 +1,29 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 96-mapnik-plugins-dir.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
+##
+## DP: Use correct mapnik path on debian systems.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4-6.dfsg~/src/mapnik.cpp gpsdrive-2.10~pre4-6.dfsg/src/mapnik.cpp
+--- gpsdrive-2.10~pre4-6.dfsg~/src/mapnik.cpp 2009-06-11 19:23:32.000000000 +0000
++++ gpsdrive-2.10~pre4-6.dfsg/src/mapnik.cpp 2009-06-11 19:23:32.000000000 +0000
+@@ -108,6 +108,10 @@
+ return StringToReplace;
+ }
+
++#if !defined(MAPNIK_PATH)
++#define MAPNIK_PATH "/usr/lib/mapnik/0.6"
++#endif
++
+ /*
+ * initialize mapnik
+ */
+@@ -117,7 +121,7 @@
+ // register datasources (plug-ins) and a font
+ // Both datasorce_cache and font_engine are 'singletons'.
+
+- datasource_cache::instance()->register_datasources("/usr/lib/mapnik/input/");
++ datasource_cache::instance()->register_datasources( MAPNIK_PATH "/input/");
+ // XXX We should make the fontname and path a config option
+ freetype_engine::register_font("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
+
diff --git a/debian/patches/97-osmxml.dpatch b/debian/patches/97-osmxml.dpatch
new file mode 100644
index 0000000..0ca6228
--- /dev/null
+++ b/debian/patches/97-osmxml.dpatch
@@ -0,0 +1,82 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 97-osmxml.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Fix hexadecimal color.
+## DP: Comment world_boundaries by default.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/scripts/mapnik/osm-in.xml gpsdrive-2.10~pre4/scripts/mapnik/osm-in.xml
+--- gpsdrive-2.10~pre4~/scripts/mapnik/osm-in.xml 2008-02-29 09:01:17.000000000 +0000
++++ gpsdrive-2.10~pre4/scripts/mapnik/osm-in.xml 2008-02-29 09:01:58.000000000 +0000
+@@ -1,5 +1,11 @@
+ <?xml version="1.0" encoding="utf-8"?>
+ <!DOCTYPE Map>
++
++<!-- world_boundaries are disabled by default.
++ See commented BLOCK below.
++-->
++
++
+ <Map bgcolor="#b5d0d0" srs="+proj=merc +datum=WGS84 +k=1.0 +units=m +over +no_defs">
+ <Style name="mapnik:selection">
+ <Rule>
+@@ -346,7 +352,7 @@
+ <Filter>[amenity] = 'parking'</Filter>
+ <MaxScaleDenominator>25000</MaxScaleDenominator>
+ <LineSymbolizer>
+- <CssParameter name="stroke">eeeed1</CssParameter>
++ <CssParameter name="stroke">#eeeed1</CssParameter>
+ <CssParameter name="stroke-width">0.3</CssParameter>
+ </LineSymbolizer>
+ </Rule>
+@@ -1637,6 +1643,9 @@
+ </Rule>
+ </Style>
+
++
++<!-- BEGIN WORLD_BOUNDARIES BLOCK Uncomment this part if you have world_boundaries installed
++
+ <Layer name="world-1" status="on" srs="+proj=merc +datum=WGS84 +over">
+ <StyleName>world-1</StyleName>
+ <Datasource>
+@@ -1677,7 +1686,18 @@
+ <Parameter name="file">@DATA_DIR@/world_boundaries/builtup_area</Parameter>
+ </Datasource>
+ </Layer>
+-
++
++ <Layer name="places" status="on">
++ <StyleName>places</StyleName>
++ <Datasource>
++ <Parameter name="type">shape</Parameter>
++ <Parameter name="file">@DATA_DIR@/world_boundaries/places</Parameter>
++ </Datasource>
++ </Layer>
++
++END WORLD BOUNDARIES BLOCK -->
++
++
+ <Layer name="leisure" status="on" srs="+proj=merc +datum=WGS84 +k=1.0 +units=m +over +no_defs">
+ <StyleName>leisure</StyleName>
+ <Datasource>
+@@ -1729,7 +1749,6 @@
+ </Layer>
+
+ <Layer name="roads" status="on" srs="+proj=merc +datum=WGS84 +k=1.0 +units=m +over +no_defs">
+- <!--StyleName>roads-casing</StyleName-->
+ <StyleName>roads</StyleName>
+ <Datasource>
+ <Parameter name="type">postgis</Parameter>
+@@ -1781,12 +1800,4 @@
+ <Parameter name="estimate_extent">true</Parameter>
+ </Datasource>
+ </Layer>
+-
+- <Layer name="places" status="on">
+- <StyleName>places</StyleName>
+- <Datasource>
+- <Parameter name="type">shape</Parameter>
+- <Parameter name="file">@DATA_DIR@/world_boundaries/places</Parameter>
+- </Datasource>
+- </Layer>
+ </Map>
diff --git a/debian/patches/98-mapnik-exception.dpatch b/debian/patches/98-mapnik-exception.dpatch
new file mode 100644
index 0000000..6dd5a1c
--- /dev/null
+++ b/debian/patches/98-mapnik-exception.dpatch
@@ -0,0 +1,51 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 98-mapnik-exception.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: Add exception handling for mapnik config file loading.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/src/mapnik.cpp gpsdrive-2.10~pre4/src/mapnik.cpp
+--- gpsdrive-2.10~pre4~/src/mapnik.cpp 2008-02-28 23:37:07.000000000 +0000
++++ gpsdrive-2.10~pre4/src/mapnik.cpp 2008-02-28 23:37:46.000000000 +0000
+@@ -23,6 +23,7 @@
+ #include <mapnik/memory_datasource.hpp>
+ #include <mapnik/datasource_cache.hpp>
+ #include <mapnik/font_engine_freetype.hpp>
++#include <mapnik/config_error.hpp>
+ #include <string>
+ #include <fstream>
+
+@@ -37,6 +38,7 @@
+ using mapnik::feature_ptr;
+ using mapnik::geometry_ptr;
+ using mapnik::CoordTransform;
++using mapnik::config_error;
+
+ extern int mydebug;
+ extern int borderlimit;
+@@ -131,11 +133,22 @@
+ MapnikMap.BorderlimitInt = borderlimit;
+ MapnikMap.ScaleInt = -1; // <-- force creation of map if a map is set
+ MapnikMap.MapPtr = new mapnik::Map(MapnikMap.WidthInt, MapnikMap.HeightInt);
++
+
+ //load map
+- std::string mapnik_config_file (ConfigXML);
+- mapnik::load_map(*MapnikMap.MapPtr, mapnik_config_file);
+- MapnikInitYsn = -1;
++ try {
++ std::string mapnik_config_file (ConfigXML);
++ mapnik::load_map(*MapnikMap.MapPtr, mapnik_config_file);
++ MapnikInitYsn = -1;
++ }
++ catch(const mapnik::config_error &ex) {
++ cerr << "Cannot init mapnik. Mapnik support DISABLED: " << ex.what() << "\n" << endl;
++ cerr << "Mapnik now raises exceptions on syntax errors in the map file,\n" <<
++ "failed db connections, missing files, etc.\n" <<
++ "Please fix or remove ~/.gpsdrive/osm.xml.\n" <<
++ "See also NEWS.Debian." << endl;
++ MapnikInitYsn = 0;
++ }
+ }
+
+ /*
diff --git a/debian/patches/99-autobestmap.dpatch b/debian/patches/99-autobestmap.dpatch
new file mode 100644
index 0000000..d0fc7db
--- /dev/null
+++ b/debian/patches/99-autobestmap.dpatch
@@ -0,0 +1,26 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 99-autobestmap.dpatch by Andreas Putzo <andreas@putzo.net>
+##
+## DP: The autobestmap config option is not updated when using the toggle button
+## DP: in gpsdrive. Patch backported from 2.10pre5.
+
+@DPATCH@
+diff -urNad gpsdrive-2.10~pre4~/src/main_gui.c gpsdrive-2.10~pre4/src/main_gui.c
+--- gpsdrive-2.10~pre4~/src/main_gui.c 2007-09-15 15:12:03.000000000 +0000
++++ gpsdrive-2.10~pre4/src/main_gui.c 2008-07-15 19:48:34.000000000 +0000
+@@ -229,6 +229,7 @@
+ gtk_label_set_text (GTK_LABEL (statusprefscale_lb), _("Auto"));
+ if (mapscaler_scaler)
+ gtk_widget_set_sensitive (mapscaler_scaler, FALSE);
++ local_config.autobestmap = TRUE;
+ }
+ else
+ {
+@@ -238,6 +239,7 @@
+ gtk_label_set_text (GTK_LABEL (statusprefscale_lb), sc);
+ if (mapscaler_scaler)
+ gtk_widget_set_sensitive (mapscaler_scaler, TRUE);
++ local_config.autobestmap = FALSE;
+ }
+
+ current.needtosave = TRUE;
diff --git a/debian/patches/gpsdrive2.10pre7_osm_proj.patch b/debian/patches/gpsdrive2.10pre7_osm_proj.patch
new file mode 100644
index 0000000..4d529cb
--- /dev/null
+++ b/debian/patches/gpsdrive2.10pre7_osm_proj.patch
@@ -0,0 +1,572 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## gpsdrive2.10pre7_osm_proj.patch by H. Bowman <hamish_b yahoo com>
+##
+## DP: Fix OpenStreetMap projection handling (backport from upstream)
+
+@DPATCH@
+Index: src/map_download.c
+===================================================================
+--- src/map_download.c (revision 2476)
++++ src/map_download.c (revision 2477)
+@@ -61,8 +61,8 @@
+ # endif
+
+
+-#include <gpsdrive.h>
+-#include <map_handler.h>
++#include "gpsdrive.h"
++#include "map_handler.h"
+ #include "gpsdrive_config.h"
+ #include "gui.h"
+ #include "map_download.h"
+@@ -133,24 +133,20 @@
+ MAPSOURCE_LANDSAT, "1 : 50 million", 0, 50000000,
+
+ MAPSOURCE_OSM_TAH, "OpenStreetMap Tiles@Home", -1, -1,
+- MAPSOURCE_OSM_TAH, "1 : 147 456 000", 1, 256*576000,
+- MAPSOURCE_OSM_TAH, "1 : 73 728 000", 2, 128*576000,
+- MAPSOURCE_OSM_TAH, "1 : 36 864 000", 3, 64*576000,
+- MAPSOURCE_OSM_TAH, "1 : 18 432 000", 4, 32*576000,
+- MAPSOURCE_OSM_TAH, "1 : 9 216 000", 5, 16*576000,
+- MAPSOURCE_OSM_TAH, "1 : 4 608 000", 6, 8*576000,
+- MAPSOURCE_OSM_TAH, "1 : 2 304 000", 7, 4*576000,
+- MAPSOURCE_OSM_TAH, "1 : 1 152 000", 8, 2*576000,
+-
+- MAPSOURCE_OSM_TAH, "1 : 576 000", 9, 576000,
+- MAPSOURCE_OSM_TAH, "1 : 288 000", 10, 288000,
+- MAPSOURCE_OSM_TAH, "1 : 144 000", 11, 144000,
+- MAPSOURCE_OSM_TAH, "1 : 72 000", 12, 72000,
+- MAPSOURCE_OSM_TAH, "1 : 36 000", 13, 36000,
+- MAPSOURCE_OSM_TAH, "1 : 18 000", 14, 18000,
+- MAPSOURCE_OSM_TAH, "1 : 9 000", 15, 9000,
+- MAPSOURCE_OSM_TAH, "1 : 4 500", 16, 4500,
+- MAPSOURCE_OSM_TAH, "1 : 2 250", 17, 2250,
++ /* scale varies with latitude, so this is just a rough guide
++ which will only be valid for mid-lats */
++ /* Octave code: for lat=0:5:75; disp( [lat (a * 2*pi *pixelfact * cos(lat * pi/180)) / (256*2^9)]); end */
++ MAPSOURCE_OSM_TAH, "1 : 2 500", 17, 2250,
++ MAPSOURCE_OSM_TAH, "1 : 5 000", 16, 4500,
++ MAPSOURCE_OSM_TAH, "1 : 10 000", 15, 9000,
++ MAPSOURCE_OSM_TAH, "1 : 20 000", 14, 18000,
++ MAPSOURCE_OSM_TAH, "1 : 40 000", 13, 36000,
++ MAPSOURCE_OSM_TAH, "1 : 75 000", 12, 72000,
++ MAPSOURCE_OSM_TAH, "1 : 150 000", 11, 144000,
++ MAPSOURCE_OSM_TAH, "1 : 300 000", 10, 288000,
++ MAPSOURCE_OSM_TAH, "1 : 600 000", 9, 576000,
++ /* the distortion gets too bad at scales wider than 1:500k
++ It would be more accurate to stop earlier, but we compromise */
+ MAPSOURCE_N_ITEMS, "", 0, 0
+ };
+
+@@ -165,7 +161,23 @@
+ gtk_entry_set_text (GTK_ENTRY (lon_entry), lon);
+ }
+
++/* *****************************************************************************
++ * calculate the local map scale based on Web Tile zoom level and latitude
++ */
++double
++calc_webtile_scale (double lat, int zoom)
++{
++ double scale;
++ double a = 6378137.0; /* major radius of WGS84 ellipsoid (meters) */
+
++ scale = (a * 2*M_PI * cos(DEG2RAD(lat)) * PIXELFACT) / (256 * pow(2,zoom));
++
++ if (mydebug > 3)
++ g_print ("Tile scale: %.2f\n", scale);
++
++ return scale;
++}
++
+ /* *****************************************************************************
+ * callback to set paramaters for map to download
+ */
+@@ -195,9 +207,13 @@
+ 3, &mapdl_scale, -1);
+ /* TODO: determine map_ or top_ proj at this point so drawdownloadrectangle()
+ * knows how big to draw the green preview box */
++ if (local_config.mapsource_type == MAPSOURCE_OSM_TAH)
++ mapdl_scale = (int)calc_webtile_scale(mapdl_lat, mapdl_zoom);
++
+ if (mydebug > 3)
+ g_print ("new map scale/zoom level: %d / %d\n",
+ mapdl_scale, mapdl_zoom);
++
+ local_config.mapsource_scale = gtk_combo_box_get_active (GTK_COMBO_BOX (scale_combobox));
+ current.needtosave = TRUE;
+ }
+@@ -439,6 +455,7 @@
+ gchar file_path[512];
+ gchar path[40];
+ gchar img_fmt[4];
++ gchar scale_str[40];
+
+ if (mapdl_active)
+ return TRUE;
+@@ -450,11 +467,14 @@
+ g_strlcpy (path, "landsat", sizeof (path));
+ g_strlcpy (img_fmt, "jpg", sizeof (img_fmt));
+ mapdl_geturl_landsat ();
++ g_snprintf (scale_str, sizeof (scale_str), "%d", mapdl_scale);
+ break;
+ case MAPSOURCE_OSM_TAH:
+ g_strlcpy (path, "openstreetmap_tah", sizeof (path));
+ g_strlcpy (img_fmt, "png", sizeof (img_fmt));
+ mapdl_geturl_osm_tah ();
++ mapdl_scale = (int)calc_webtile_scale(mapdl_lat, mapdl_zoom);
++ g_snprintf (scale_str, sizeof (scale_str), "%d", mapdl_zoom);
+ break;
+ default:
+ return TRUE;
+@@ -464,10 +484,11 @@
+ g_print (" download url:\n%s\n", mapdl_url);
+
+ /* set file path and create directory if necessary */
+-
+-
+- g_snprintf (file_path, sizeof (file_path), "%s%s/%d/%.0f/%.0f/",
+- local_config.dir_maps, path, mapdl_scale, mapdl_lat, mapdl_lon);
++
++ g_snprintf (file_path, sizeof (file_path), "%s%s/%s/%.0f/%.0f/",
++ local_config.dir_maps, path, scale_str, mapdl_lat, mapdl_lon);
++
++
+ if(!g_file_test (file_path, G_FILE_TEST_IS_DIR))
+ {
+ if (g_mkdir_with_parents (file_path, 0700))
+@@ -477,14 +498,15 @@
+ }
+
+ /* complete filename */
+- g_snprintf (mapdl_file_w_path, sizeof (mapdl_file_w_path), "%s%s_%d_%5.3f_%5.3f.%s",
+- file_path, mapdl_proj, mapdl_scale, mapdl_lat, mapdl_lon, img_fmt);
++ g_snprintf (mapdl_file_w_path, sizeof (mapdl_file_w_path), "%s%s_%s_%5.3f_%5.3f.%s",
++ file_path, mapdl_proj, scale_str, mapdl_lat, mapdl_lon, img_fmt);
+
+ if (mydebug > 10)
+ g_print (" filename: %s\n", mapdl_file_w_path);
+
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (mapdl_progress),
+ _("Loading Map..."));
++
+ mapdl_abort = FALSE;
+ mapdl_download ();
+
+Index: src/map_download.h
+===================================================================
+--- src/map_download.h (revision 2476)
++++ src/map_download.h (revision 2477)
+@@ -1,10 +1,9 @@
+ /***********************************************************************
+
+ Copyright (c) 2008 Guenther Meyer <d.s.e (at) sordidmusic.com>
+-
+ Website: www.gpsdrive.de/
+
+-Disclaimer: Please do not use for navigation.
++Disclaimer: Please do not use as a primary means of navigation.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+@@ -36,5 +35,6 @@
+ void mapdl_set_coords (gchar *lat, gchar *lon);
+ gint mapdl_init (void);
+ gint mapdl_cleanup (void);
++double calc_webtile_scale (double, int);
+
+ #endif /* GPSDRIVE_MAP_DOWNLOAD_H */
+Index: scripts/gpsfetchmap.pl
+===================================================================
+--- scripts/gpsfetchmap.pl (revision 2479)
++++ scripts/gpsfetchmap.pl (revision 2480)
+@@ -47,6 +47,7 @@
+ modified (Jul 2007) by Maciek Kaliszewski <mkalkal\@interia.pl>
+ modified (Oct 2007) by Andreas Putzo <andreas\@putzo.net>
+ modified (Jan 2008) by Gernot Hillier <gernot\@hillier.de> (added Openstreetmap support)
++modified (Aug 2009) by Hamish Bowman <hamish_b yahoo com> (fix OSM+WMS map scales)
+ Version svn-$Version
+ ";
+
+@@ -151,24 +152,20 @@
+ 10000000 =>10000000,
+ 50000000 =>50000000,
+ },
++# Web Map Tiles scale varies with latitude by the formula
++# (a * 2*pi * PIXELFACT * cos(lat * pi/180)) / (256 * 2^zoom)
++# where a is major radius of the Earth according to the WGS84 ellipsoid definition.
++# zoom levels lower than 9 (~1:500k) badly distort the Mercator so are not offered.
+ openstreetmap_tah => {
+- 256*576000 => 1,
+- 128*576000 => 2,
+- 64*576000 => 3,
+- 32*576000 => 4,
+- 16*576000 => 5,
+- 8*576000 => 6,
+- 4*576000 => 7,
+- 2*576000 => 8,
+- 576000 => 9,
+- 288000 => 10,
+- 144000 => 11,
+- 72000 => 12,
+- 36000 => 13,
+- 18000 => 14,
+- 9000 => 15,
+- 4500 => 16,
+- 2250 => 17
++ 600000 => 9,
++ 300000 => 10,
++ 150000 => 11,
++ 75000 => 12,
++ 40000 => 13,
++ 20000 => 14,
++ 10000 => 15,
++ 5000 => 16,
++ 2500 => 17
+ }
+ };
+
+@@ -240,8 +237,6 @@
+ $polite=1;
+ }
+
+-
+-
+ if ( $mapserver eq 'geoscience' )
+ {
+ $scale ||= join(",",keys %{$Scale2Zoom->{'geoscience'}});
+@@ -269,22 +264,24 @@
+ pod2usage(-verbose=>2) if $man;
+
+ sub append_koords($$$$); # {}
++sub calc_webtile_scale ($$); # {}
+ sub check_coverage($); # {}
+ sub check_koord_file($); # {}
+ sub debug($); # {}
++sub file_count($); # {}
+ sub geoscience_url($$$); # {}
+-sub landsat_url($$$); # {}
+-sub resize($$); #{}
+-sub file_count($); # {}
+ sub get_coords_for_route; # {}
+ sub get_coords_for_track($); # {}
++sub get_gpsd_position(); # {}
+ sub get_waypoint($); # {}
+ sub is_map_file($); # {}
++sub landsat_url($$$); # {}
++sub openstreetmap_tah_url($$$); # {}
+ sub read_gpstool_map_file(); # {}
+ sub read_koord_file($); # {}
++sub resize($$); # {}
+ sub update_gpsdrive_map_koord_file(); # {}
+ sub wget_map($$$); # {}
+-sub get_gpsd_position(); # {}
+
+ STDERR->autoflush(1);
+ STDOUT->autoflush(1);
+@@ -407,7 +404,9 @@
+
+ my ($existing,$wanted) = file_count($desired_locations);
+ print "You are about to download $wanted (".($existing+$wanted).") file(s).\n";
+-
++if ($debug) {
++ print "Politeness delay set to $polite seconds,\n";
++}
+ if ( $mapserver eq 'geoscience' ){
+ print "+-----------------------------------------------------------+\n";
+ print "| Geoscience Maps are Copyright, Commonwealth of Australia |\n";
+@@ -419,6 +418,7 @@
+ print "+----------------------------------------------------------------+\n";
+ print "| Landsat maps are courtesy JPL/NASA's OnEarth WMS Global Mosaic |\n";
+ print "| Map prefix will be set automatically based on scale. |\n";
++ print "+----------------------------------------------------------------+\n";
+ # By law, US Government data is without copyright.
+ }elsif ( $mapserver eq 'openstreetmap_tah' ){
+ print "+-----------------------------------------------------------+\n";
+@@ -427,6 +427,8 @@
+ print "| They are free for use under the terms of the |\n";
+ print "| Creative Commons \"Attribution-Share Alike 2.0 Generic\" |\n";
+ print "| license. See http://www.openstreetmap.org for details. |\n";
++ print "+-----------------------------------------------------------+\n";
++
+ } elsif ( ! $force) {
+ print "You may violating the map servers terms of use!\n";
+ print "Please use their service responsible!\n";
+@@ -654,14 +656,32 @@
+ ######################################################################
+ sub map_filename($$$){
+ my ($scale,$lati,$long) = @_;
++
++ my $mscale = $scale;
++
++ if ( $mapserver eq 'openstreetmap_tah' ) {
++ my $zoom = undef;
++ for my $s ( sort keys %{$Scale2Zoom->{openstreetmap_tah}} ) {
++ next unless $s == $scale;
++ $zoom = $Scale2Zoom->{openstreetmap_tah}->{$s};
++ last;
++ }
++ unless ( $zoom ) {
++ print "Error calculating Zoomlevel for Scale: $scale\n";
++ return (undef);
++ }
++ $mscale = $zoom;
++ }
+
+- my $filename = "$mapserver/$scale"
++ my $filename = "$mapserver/$mscale"
+ ."/".int($lati)
+ # ."/".sprintf("%3.1f",$lati)
+ ."/".int($long)
+- ."/$FILEPREFIX$scale-$lati-$long.$fileext";
+- printf("Filename(%.0f,%.5f,%.5f): $filename\n",$scale,$lati,$long)
++ ."/$FILEPREFIX$mscale-$lati-$long.$fileext";
++
++ printf("Filename(%.0f,%.5f,%.5f): $filename\n",$mscale,$lati,$long)
+ if $debug;
++
+ return $filename;
+ }
+
+@@ -678,6 +698,9 @@
+ # mapblast/1000/047/047.0232/9/map_1000-047.0232-0009.8140.gif 47.02320 9.81400 1000
+ #my $filename = "$mapserver/$scale/".int($lati)."/".sprintf("%3.1f",$lati).
+ #"/".int($long)."/$FILEPREFIX$scale-$lati-$long.gif";
++ if ($debug) {
++ print "---------------\n";
++ }
+
+ # redundant??
+ if ($mapserver eq 'landsat')
+@@ -1082,7 +1105,7 @@
+ $lon2 += 360;
+ }
+
+- debug( "landsat_url(LAT=$lat,LON=$lon,SCALE=$scale,FACTOR=$factor)");
++ debug( "landsat_url(LAT=$lat,LON=$lon,SCALE=$scale)");
+
+ debug( "Calculated Lat1 $lat1");
+ debug( "Calculated Lat2 $lat2");
+@@ -1111,7 +1134,28 @@
+ return ($url,$scale);
+ }
+
++
+ #############################################################################
++# calculate the local map scale based on Web Tile zoom level and latitude
++# This same formula is used by OSM, Google Maps, Microsoft Maps, ...
++sub calc_webtile_scale ($$){
++ my $lat = shift;
++ my $zoom = shift;
++
++ # major radius of WGS84 ellipsoid (meters)
++ my $a = $RADIUS_KM * 1000;
++
++ my $zscale = (2*$a*$PI * cos($lat*$D2R) * $PIXELFACT) / (256 * 2**$zoom);
++
++ if ($debug) {
++ print "Tile scale: $zscale\n";
++ }
++
++ return ($zscale);
++}
++
++
++#############################################################################
+ sub openstreetmap_tah_url($$$){
+ my $lati = shift;
+ my $long = shift;
+@@ -1122,7 +1166,7 @@
+ for my $s ( sort keys %{$Scale2Zoom->{openstreetmap_tah}} ) {
+ next unless $s == $scale;
+ $zoom = $Scale2Zoom->{openstreetmap_tah}->{$s};
+- $mapscale = $s;
++ $mapscale = calc_webtile_scale($lati, $zoom);
+ last;
+ }
+
+@@ -1132,10 +1176,9 @@
+ }
+
+ if ($debug) {
+- print "\n";
+- print "Using openstreetmap_tah zoom ", $zoom, " for requested scale ", $scale, ":1 actual scale ", $mapscale, ":1\n";
+- print "lat: $lati\n";
+- print "lon: $long\n";
++ print "Using openstreetmap_tah zoom ", $zoom, " for requested scale 1:", $scale, ". Actual scale 1:", $mapscale, "\n";
++ print "cetner lat: $lati\n";
++ print "cetner lon: $long\n";
+ }
+
+ my $url = "http://tah.openstreetmap.org/MapOf/?lat=$lati&long=$long&z=$zoom&w=1280&h=1024&format=png";
+@@ -1903,7 +1946,7 @@
+
+ gpsfetchmap -w <WAYPOINT NAME> -sc <SCALE> -a <#> -p
+
+-gpsfetchmap -la <latitude DD.DDDD> -lo <latitude DD.DDDD> -sc <SCALE> -a <#> -p
++gpsfetchmap -la <latitude DD.DDDD> -lo <longitude DD.DDDD> -sc <SCALE> -a <#> -p
+
+ gpsfetchmap -sla <start latitude DD.DDDD> -endla <end latitude DD.DDDD> -slo <start longitude DD.DDDD> -endlo <end longitude DD.DDDD> -sc <SCALE> -a <#> -p
+
+@@ -1915,7 +1958,7 @@
+ [-la <latitude DD.DDDD>] [-lo <longitude DD.DDDD>]
+ [-sla <start latitude DD.DDDD>] [-endla <end latitude DD.DDDD>]
+ [-slo <start longitude DD.DDDD>] [-endlo <end longitude DD.DDDD>]
+- [-sc <SCALE>] [-a <#>] [-p] [-m <MAPSERVER>]
++ [-sc <SCALE>] [-a <#>] [-p <#>] [-m <MAPSERVER>]
+ [-u <UNIT>] [-md <DIR>] [-W <FILE>] [-t <FILE>] [-r]
+ [-C <FILE>] [-P <PREFIX>] [-F] [-d] [-v] [-h] [-M] [-n] [-U] [-c]
+
+@@ -2000,7 +2043,7 @@
+ of longitude. 'units' is read from the configuration file (-C) or as defined
+ by (-u).
+
+-=item B<-p, --polite>
++=item B<-p, --polite <#>>
+
+ This causes the program to sleep one second between downloads to be polite
+ to the mapserver. Takes an optional value of number of seconds to sleep.
+@@ -2117,6 +2160,13 @@
+
+ Prints the manual page and exits.
+
++=back
++
++
++=head1 OUTPUT
++
++=over 2
++
+ =item B<Download>
+
+ When downloading Maps the output reads as folows:
+@@ -2130,5 +2180,16 @@
+
+ =back
+
++
++=head1 EXAMPLE
++
++Download all 1:10000 OpenStreetMaps in a 5 km radius around the
++Sydney Convention Centre. Between tile downloads it will let
++the server rest for 3 seconds.
++
++gpsfetchmap --mapserver openstreetmap_tah --polite 3 \
++ --lat "-33.8753" --lon 151.2001 --scale 10000 \
++ --area 5 --unit kilometers
++
+ =cut
+
+Index: scripts/mapnik/gpsdrive_mapnik_gentiles-in.py
+===================================================================
+--- scripts/mapnik/gpsdrive_mapnik_gentiles-in.py (revision 2473)
++++ scripts/mapnik/gpsdrive_mapnik_gentiles-in.py (revision 2479)
+@@ -7,14 +7,20 @@
+
+ Options:
+ -h, --help show this help
+- -b, --bbox boundingbox (lon,lat,lon,lat) - Be carefull! Quote negative values!
+- -s, --scale scale single/range
+- 1 = 147456000
+- 2 = 73728000
+- ...
+- 15 = 9000
+- 16 = 4500
+- 17 = 2250
++ -b, --bbox boundingbox (minlon,minlat,maxlon,maxlat)
++ - Be carefull! "Quote" negative values!
++ -s, --scale scale single/range (zoom level or min-max)
++ (below "9" Mercator becomes distorted;
++ actual scale will vary with latitude)
++ 9 - 1:600,000
++ 10 - 1:300,000
++ 11 - 1:150,000
++ 12 - 1:75,000
++ 13 - 1:40,000
++ 14 - 1:20,000
++ 15 - 1:10,000
++ 16 - 1:5,000
++ 17 - 1:2,500
+ --test testrun = generates Munich example
+
+ Examples:
+@@ -22,7 +28,7 @@
+ Munich:
+ gpsdrive_mapnik_gentiles.py -b 11.4,48.07,11.7,48.2 -s 10-16
+
+- World:
++ World: (just to demonstrate lat/lon order; scale not recommended)
+ gpsdrive_mapnik_gentiles.py -b "-180.0,-90.0,180.0,90.0" -s 1-6
+ """
+
+@@ -32,12 +38,19 @@
+ import getopt
+ import string
+
+-zoom2scale = [728 * 576000,256 * 576000,128 * 576000,64 * 576000,32 * 576000,16 * 576000,8 * 576000,4 * 576000,2 * 576000,576000,288000,144000,72000,36000,18000,9000,4500,2250,1125]
+
+-
+ DEG_TO_RAD = pi/180
+ RAD_TO_DEG = 180/pi
+
++def calc_scale (lat, zoom):
++ # GpsDrive's hardcoded pixels per meter ratio
++ PixelFact = 2817.947378
++ # wgs84 major Earth axis
++ a = 6378137.0
++ dynscale = ( a * 2*pi * cos(lat * DEG_TO_RAD) * PixelFact ) / ( 256*pow(2,zoom) )
++ print dynscale
++ return dynscale
++
+ def minmax (a,b,c):
+ a = max(a,b)
+ a = min(a,c)
+@@ -90,17 +103,28 @@
+ os.mkdir(tile_dir)
+
+ gprj = GoogleProjection(maxZoom+1)
++
+ #m = Map(2 * 256,2 * 256)
+ m = Map(1280,1024)
+ load_map(m,mapfile)
+- prj = Projection("+proj=merc +datum=WGS84")
+-
++
++ #prj = Projection("+proj=merc +datum=WGS84")
++ # What follows is from /usr/share/proj/esri.extra, EPSG:900913
++ # "Chris' funny epsgish code for the google mercator"
++ prj = Projection("+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 +wktext +no_defs")
++
+ ll0 = (bbox[0],bbox[3])
+ ll1 = (bbox[2],bbox[1])
+-
++
+ for z in range(minZoom,maxZoom + 1):
++ if z == 9:
++ print "CAUTION: Mercator projection begins to be noticeably distorted at this zoom level."
++ elif z < 9:
++ print "WARNING: Mercator projection is very distorted at this zoom level."
++
+ px0 = gprj.fromLLtoPixel(ll0,z)
+ px1 = gprj.fromLLtoPixel(ll1,z)
++
+ for x in range(int(px0[0]/640.0),int(px1[0]/640.0)+1):
+ for y in range(int(px0[1]/512.0),int(px1[1]/512.0)+1):
+ p0 = gprj.fromPixelToLL((x * 640.0, (y+1) * 512.0),z)
+@@ -145,7 +169,7 @@
+ fh_mapkoord.write(tile_path + " ")
+ fh_mapkoord.write(str((p0[1] + p1[1]) / 2) + " ")
+ fh_mapkoord.write(str((p0[0] + p1[0]) / 2) + " ")
+- fh_mapkoord.write(str(zoom2scale[z]))
++ fh_mapkoord.write(str( calc_scale( (p0[1] + p1[1])/2, z) ))
+ fh_mapkoord.write(" " + str(p0[1]) + " " + str(p0[0]))
+ fh_mapkoord.write(" " + str(p1[1]) + " " + str(p1[0]))
+ fh_mapkoord.write("\n")
+@@ -221,6 +245,7 @@
+
+ # check for correct values
+ if str(eval(bboxs[0])) != bboxs[0] or str(eval(bboxs[1])) != bboxs[1] or str(eval(bboxs[2])) != bboxs[2] or str(eval(bboxs[3])) != bboxs[3]:
++ # rounding problems... what exactly is this supposed to be checking ???
+ sys.exit("Boundingbox invalid!")
+
+ if minZoom < 1 or minZoom > 17 or maxZoom < 1 and maxZoom > 17 or minZoom > maxZoom or int(minZoom) <> minZoom or int(maxZoom) <> maxZoom: