--- gpsdrive-2.10~pre4-6.dfsg.orig/config.guess +++ gpsdrive-2.10~pre4-6.dfsg/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2006-02-23' +timestamp='2009-04-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -55,8 +56,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -160,6 +161,7 @@ arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -210,7 +212,7 @@ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} @@ -322,14 +324,30 @@ case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -530,7 +548,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[45]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -770,6 +788,8 @@ case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac @@ -777,10 +797,7 @@ i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS_NT-*:*:*) + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) @@ -790,12 +807,18 @@ i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[345]*) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T:Interix*:[345]*) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd | genuineintel) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -829,6 +852,16 @@ echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) @@ -918,6 +951,9 @@ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -947,6 +983,9 @@ x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -965,9 +1004,6 @@ a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. @@ -989,7 +1025,7 @@ LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun) + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout @@ -1082,8 +1118,11 @@ pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 @@ -1121,6 +1160,16 @@ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1196,6 +1245,9 @@ BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1205,6 +1257,15 @@ SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1295,6 +1356,9 @@ i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1455,9 +1519,9 @@ the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be --- gpsdrive-2.10~pre4-6.dfsg.orig/config.sub +++ gpsdrive-2.10~pre4-6.dfsg/config.sub @@ -1,9 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2006-02-23' +timestamp='2009-04-17' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -71,8 +72,8 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -121,6 +122,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -240,20 +242,24 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ @@ -266,6 +272,7 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ | nios | nios2 \ @@ -274,19 +281,17 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m32c) + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -318,25 +323,28 @@ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ + | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ @@ -358,22 +366,24 @@ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; - m32c-*) + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -437,6 +447,10 @@ basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -445,10 +459,22 @@ basic_machine=ns32k-sequent os=-dynix ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; c90) basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -477,8 +503,8 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16c) - basic_machine=cr16c-unknown + cr16) + basic_machine=cr16-unknown os=-elf ;; crds | unos) @@ -516,6 +542,10 @@ basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -670,6 +700,14 @@ basic_machine=m68k-isi os=-sysv ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; m88k-omron*) basic_machine=m88k-omron ;; @@ -685,6 +723,10 @@ basic_machine=i386-pc os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; @@ -811,6 +853,14 @@ basic_machine=i860-intel os=-osf ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; pbd) basic_machine=sparc-tti ;; @@ -912,6 +962,10 @@ sb1el) basic_machine=mipsisa64sb1el-unknown ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; sei) basic_machine=mips-sei os=-seiux @@ -923,6 +977,9 @@ basic_machine=sh-hitachi os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown ;; @@ -1012,6 +1069,10 @@ basic_machine=tic6x-unknown os=-coff ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -1087,6 +1148,10 @@ basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1125,10 +1190,10 @@ we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) @@ -1197,8 +1262,9 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1207,7 +1273,7 @@ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ + | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1217,7 +1283,7 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1347,6 +1413,9 @@ -zvmoe) os=-zvmoe ;; + -dicos*) + os=-dicos + ;; -none) ;; *) @@ -1369,6 +1438,12 @@ # system, and we'll never get to this point. case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 ;; @@ -1378,9 +1453,9 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1406,6 +1481,9 @@ m68*-cisco) os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf ;; --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/NEWS.Debian +++ gpsdrive-2.10~pre4-6.dfsg/debian/NEWS.Debian @@ -0,0 +1,11 @@ +gpsdrive (2.10~pre4-3) unstable; urgency=low + + The mapnik library since version 0.5.0 introduces a more strict checking + of the map configuration file ~/.gpsdrive/osm.xml. + If gpsdrive fails to initialize mapnik during startup please either remove + ~/.gpsdrive/osm.xml or remove/fix all elements mapnik is complaining + about, usually missing world_boundaries or a database connection problem. + If removed, the file will be re-created during next start of gpsdrive with + the world_boundaries part commented out. + + -- Andreas Putzo Thu, 28 Feb 2008 23:20:02 +0000 --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/gpsdrive.install +++ gpsdrive-2.10~pre4-6.dfsg/debian/gpsdrive.install @@ -0,0 +1,6 @@ +usr/bin/gpsdrive +usr/bin/friendsd2 +usr/share/applications/gpsdrive.desktop +usr/share/gpsdrive/map_koord.txt +usr/share/gpsdrive/mapnik/osm.xml +usr/share/map-icons/icons.xml usr/share/gpsdrive/map-icons/ --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/README.Debian +++ gpsdrive-2.10~pre4-6.dfsg/debian/README.Debian @@ -0,0 +1,51 @@ +gpsdrive for Debian +------------------- + +Upgrading from gpsdrive 2.09 (etch) +------------------------------------- +* The mysql database schema has been changed. + The existing database can be upgraded with the same command to create a new database. + geoinfo --db-user=root --db-password= --create-db --fill-defaults + See README.mysql.gz for a more detailed description how to setup the mysql database. +* Existing waypoints can be imported with convert-waypoints and poi-manager: + convert-waypoints + poi-manager -i -f way_converted_txt.gpx + poi-manager -i -f way_converted_sql.gpx + If everything went fine the old files can safely be removed: + rm ~/.gpsdrive/way.txt + rm ~/.gpsdrive/way-SQLRESULT.txt + + +Using gpsdrive with mapnik +--------------------------- +* Install osm2pgsql and postgresql-8.3-postgis if not already done. + aptitude install osm2pgsql postgresql-8.3-postgis +* Download a OpenStreetmap planet file from http://planet.openstreetmap.org/, + wget http://planet.openstreetmap.org/planet-latest.osm.bz2 +* Set up postgresql: + sudo -u postgres createuser -Upostgres -S -D -R `whoami` + sudo -u postgres createdb -Upostgres -EUNICODE gis + echo GRANT ALL ON SCHEMA PUBLIC TO `whoami` | sudo -u postgres psql -Upostgres gis + sudo -u postgres createlang -Upostgres plpgsql gis + sudo -u postgres psql gis < /usr/share/postgresql-8.3-postgis/lwpostgis.sql + echo GRANT ALL ON geometry_columns TO `whoami` | sudo -u postgres psql -Upostgres gis + echo GRANT ALL ON spatial_ref_sys TO `whoami` | sudo -u postgres psql -Upostgres gis +* Import planet.osm (this may take a long time). + osm2pgsql -v planet-latest.osm.bz2 +* Gpsdrive should now be usable with mapnik. Simply enable the mapnik checkbox in the + gpsdrive sidebar menu. +* For world boundaries (e.g. not just street data) please do the following: + wget http://artem.dev.openstreetmap.org/files/world_boundaries.tar.bz2 + sudo tar xjvf world_boundaries.tar.bz2 -C /usr/share/gpsdrive/mapnik + +If you use a different database setup or path for the world boundaries you may +need to edit ~/.gpsdrive/osm.xml to reflect your changes. +Replace `whoami` in above commands with your username if you create the database +with a different account. + + -- Andreas Putzo Wed Oct 15 20:06:28 CEST 2007 + +All scripts installed by gpsdrive has been renamed to a version without language extension, + e.g. /usr/bin/gpsfetchmap.pl has been renamed to /usr/bin/gpsfetchmap. + + -- Andreas Putzo Wed Jul 18 16:18:55 CEST 2007 --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/rules +++ gpsdrive-2.10~pre4-6.dfsg/debian/rules @@ -0,0 +1,164 @@ +#!/usr/bin/make -f +# debian/rules for gpsdrive + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/dpatch/dpatch.make + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_VERSION := $(shell dpkg-parsechangelog |egrep '^Version:' | cut -f 2 -d ' ') +DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-) +DEB_UPSTREAM_VERSION := 2.10~pre4-6.dfsg +UPSTREAM_VERSION := 2.10pre4 +DESTDIR := ${CURDIR}/debian/tmp +MAPNIK_PATH = $(shell mapnik-plugin-base) + +CFLAGS = -Wall -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +CFLAGS += -DMAPNIK_PATH=$(MAPNIK_PATH) + +get-orig-source: + dh_testdir + test -d ../tarballs/. || mkdir -p ../tarballs + @echo Downloading gpsdrive-${UPSTREAM_VERSION} + /usr/bin/wget -P ../tarballs/ -N http://gpsdrive.de/packages/gpsdrive-${UPSTREAM_VERSION}.tar.gz + tar xzf ../tarballs/gpsdrive-${UPSTREAM_VERSION}.tar.gz -C ../tarballs/ + @echo Removing upstream debian/ dir + rm -rf ../tarballs/gpsdrive-${UPSTREAM_VERSION}/debian/ + @echo Remove gpsfetchmap.pl script. + rm -f ../tarballs/gpsdrive-${UPSTREAM_VERSION}/scripts/gpsfetchmap.pl + @echo Removing icons. + rm -rf ../tarballs/gpsdrive-${UPSTREAM_VERSION}/data/map-icons/japan/ + rm -rf ../tarballs/gpsdrive-${UPSTREAM_VERSION}/data/map-icons/nickw/ + @echo Building tarball + tar czf ../tarballs/gpsdrive_${DEB_UPSTREAM_VERSION}.orig.tar.gz -C ../tarballs gpsdrive-${UPSTREAM_VERSION} + @echo Cleaning up + rm -rf ../tarballs/gpsdrive-${UPSTREAM_VERSION} + rm -f ../tarballs/gpsdrive-${UPSTREAM_VERSION}.tar.gz + +config.status: configure patch-stamp + dh_testdir + aclocal -I m4 --force + automake --add-missing + autoconf + libtoolize -i -f + ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + --enable-mapnik \ + --enable-dbus \ + CFLAGS="$(CFLAGS)" + +build: build-arch build-indep + +build-arch: config.status build-arch-stamp +build-arch-stamp: + dh_testdir + $(MAKE) + touch $@ + +build-indep: config.status build-indep-stamp +build-indep-stamp: + touch $@ + +clean: clean-patched unpatch + +clean-patched: + dh_testdir + dh_testroot + rm -f build-arch-stamp build-indep-stamp + [ ! -f Makefile ] || $(MAKE) distclean +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + dh_clean + +install: install-arch install-indep + dh_clean -k + +install-arch: build-arch + dh_testdir + dh_testroot + dh_installdirs -a + $(MAKE) -C data/ \ + install-appsDATA \ + install-cfg_filesDATA \ + install-pixmapDATA \ + install-poiDATA \ + install-mapsDATA \ + DESTDIR=$(DESTDIR) + install -d $(CURDIR)/debian/tmp/usr/share/gpsdrive/mapnik + install -m 644 $(CURDIR)/scripts/mapnik/osm.xml $(CURDIR)/debian/tmp/usr/share/gpsdrive/mapnik/osm.xml + install -d $(CURDIR)/debian/tmp/usr/share/map-icons + install -m 644 $(CURDIR)/data/map-icons/icons.xml $(CURDIR)/debian/tmp/usr/share/map-icons/icons.xml + $(MAKE) -C scripts/mapnik/ install DESTDIR=$(DESTDIR) + $(MAKE) -C src/ install DESTDIR=$(DESTDIR) + +install-indep: build-indep + dh_testdir + dh_testroot + dh_installdirs -i + $(MAKE) -C scripts/ install DESTDIR=$(DESTDIR) + +binary-indep: build-indep install-indep + dh_testdir + dh_testroot + dh_installchangelogs -i ChangeLog + dh_installdocs -i -Xdebian/TODO + dh_installman -i --language=C + dh_install -i --sourcedir=$(DESTDIR) + dh_compress -i + dh_fixperms -i + dh_installdeb -i + # strip language extensions + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/convert-waypoints.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/convert-waypoints + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/geoinfo.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/geoinfo + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpsdrive_mapnik_gentiles.py $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpsdrive_mapnik_gentiles + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpspoint2gpsdrive.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpspoint2gpsdrive + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/poi-manager.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/poi-manager + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/convert-waypoints.pl.1.gz \ + $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/convert-waypoints.1.gz + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/geoinfo.pl.1.gz \ + $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/geoinfo.1.gz + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/gpspoint2gpsdrive.pl.1.gz \ + $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/gpspoint2gpsdrive.1.gz + mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/poi-manager.pl.1.gz \ + $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/poi-manager.1.gz + # install gpsfetchmap from debian/scripts + install -m 755 $(CURDIR)/debian/scripts/gpsfetchmap.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpsfetchmap + dh_perl -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +binary-arch: build-arch install-arch + dh_testdir + dh_testroot + dh_installchangelogs -a ChangeLog + dh_installdocs -a -Xdebian/TODO + dh_installman -a --language=C + dh_installman -a --language=de -pgpsdrive man/de/gpsdrive.1 + dh_installman -a --language=es -pgpsdrive man/es/gpsdrive.1 + dh_installexamples -a + dh_install -a --sourcedir=$(DESTDIR) + dh_strip -a + dh_compress -a + dh_fixperms -a + dh_makeshlibs -a + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install-arch install-indep install --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/compat +++ gpsdrive-2.10~pre4-6.dfsg/debian/compat @@ -0,0 +1 @@ +5 --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/examples +++ gpsdrive-2.10~pre4-6.dfsg/debian/examples @@ -0,0 +1,6 @@ +scripts/gpssql_backup.sh +scripts/gpssql_restore.sh +scripts/nasaconv.sh +scripts/wp2sql +scripts/wpcvt +scripts/wpget --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/changelog +++ gpsdrive-2.10~pre4-6.dfsg/debian/changelog @@ -0,0 +1,316 @@ +gpsdrive (2.10~pre4-6.dfsg-3) unstable; urgency=low + + * Regenerate aclocal.m4 with libtoolize in debian/rules. + Thanks to Adam D. Barratt (Closes: #527956) + * Updated build-dep to libmapnik-dev >= 0.6. + * Updated 96-mapnik-plugins-dir.dpatch to define the correct + MAPNIK_PATH. + + -- Andreas Putzo Thu, 11 Jun 2009 19:26:06 +0000 + +gpsdrive (2.10~pre4-6.dfsg-2) unstable; urgency=low + + * Remove example script gpssmswatch. Prone to symlink attacks + and removed upstream. + * Added 101-signalposreq.dpatch to remove signalposreq() from + gpsdrive to fix a potential symlink vulnerability. Removed + unused unlinks of temporary files (Closes: #508597,#508596). + * Added 102-unittest.dpatch to use mkdtemp in src/unit_test.c to + fix a symlink vulnerability. + * Updated patch for geo-code to avoid a potential race condition + (CVE-2008-5380). + + -- Andreas Putzo Mon, 29 Dec 2008 16:08:22 +0000 + +gpsdrive (2.10~pre4-6.dfsg-1) unstable; urgency=low + + * Added .dfsg to version to allow a sourceful upload + that really removes files with unknown or incompatible + licenses (gpsfetchmap.pl, map-icons/japan, map-icons/nickw) + from the upstream tarball, generated using the get-orig-source + target in debian/rules. (Closes: #497115) + * Fixed spelling error in short description of the gpsdrive-data package. + (Closes: #494657) + * Added patch 100-fix-insecure-tempfiles.dpatch that uses mktemp + in geo-code to avoid symlink attacks. Thanks Moritz Muehlenhoff for + the patch. (Closes: #496436) + + -- Andreas Putzo Sun, 31 Aug 2008 17:40:05 +0000 + +gpsdrive (2.10~pre4-6) unstable; urgency=low + + * gpsdrive-data: Remove dependency on gpsdrive and put it + back to Recommends which is sufficient. + + -- Andreas Putzo Sun, 10 Aug 2008 20:35:58 +0000 + +gpsdrive (2.10~pre4-5) unstable; urgency=low + + * Add missing Replaces to the gpsdrive-data package + and add a dependency on gpsdrive. (Closes: #493892) + * Update Suggests and README.Debian to postgresql-8.3-postgis. + * Remove make install for map-icons in debian/rules. + * Added Vcs-* fields to debian/control. + + -- Andreas Putzo Thu, 07 Aug 2008 10:13:33 +0000 + +gpsdrive (2.10~pre4-4) unstable; urgency=low + + * No longer create openstreetmap-map-icons-* binary packages. + They are build from the openstreetmap-map-icons source package + now. (Closes: #482866). + * Build a gpsdrive-data packages that contains architecture independent + files. + * Added DM-Upload-Allowed field to debian/control. + * Bumped Policy to 3.8.0, without changes. + * Updated 50-scripts.dpatch to fix bashism in wpget. + (Closes: #489603). + * Removed debian revison from mapnik dependency to + fix a lintian warning. + * Added 99-autobestmap.dpatch so that the toggle button + in gpsdrive works again. Already fixed upstream. + (Closes: #480234). + * Wrap lines in copyright file at 80 characters. + + * Upload sponsored by Petter Reinholdtsen. + + -- Andreas Putzo Sat, 19 Jul 2008 20:01:39 +0000 + +gpsdrive (2.10~pre4-3) unstable; urgency=low + + * Fix regression of last upload in the mapnik handling. + Mapnik no longer tolerates errors in the map config file. + - Add 97-osmxml.dpatch to fix a syntax error and to comment + the world_boundaries. + (Closes: #472825) + - Add 98-mapnik-exception.dpatch to handle errors more gracefully. + - Add NEWS file to explain how to handle existing osm.xml files + * Updated 50-scripts.dpatch (gpsdrive_mapnik_gentiles.py) to search + for osm.xml in user's home directory. + Thanks to Giovanni Mascellani. + (Closes: #466227) + + -- Andreas Putzo Wed, 26 Mar 2008 18:35:38 +0000 + +gpsdrive (2.10~pre4-2) unstable; urgency=low + + [ Andreas Putzo ] + * Enable DBUS support. All gps receivers supported by + gpsd should work with this interface. + - Added 80-dbus.dpatch + - Added libdubs-glib-1-dev to Build-Depends + - Changed debian/rules to use --enable-dbus + * Add 90-usage.dpatch to fix usage output + (Closes: #456152) + * Update 03-manpage.dpatch. + - Reflect usage changes. + - Changed mailinglist. + - Changed AUTHORS. + - Minor cosmetic changes. + * Updated 70-perl.dpatch, correcting module path of Geo::Gpsdrive::Filter. + Thanks to Michael Eric Menk. + (Closes: #458273) + * Add settings.dpatch using basename() to determine patch of way.txt in + gpsdriverc. + (Closes: #459213) + * Remove geo-nearest from the gpsdrive-scripts package. + Script no longer works with geocaching.com. + (Closes: #464982) + * Revise long description, removing redundancy. + (Closes: #467046) + + [ Francesco Paolo Lovergine ] + * Added 95-newapi.dpatch patch to manage new mapnik 0.5 API. + Thanks Dominic Hargreaves. + (Closes: #465344,#466472) + * Added 96-mapnik-plugin-dir.dpatch to use the mapnik-plugin-dir utility + instead of the embedded lib path. This is suboptimal because + it should be autoconfiscated instead in gpsdrive bulding system. + But it works :) + * Policy bumped to 3.7.3, without changes. + + -- Andreas Putzo Tue, 26 Feb 2008 22:37:16 +0000 + +gpsdrive (2.10~pre4-1) unstable; urgency=low + + * New upstream release. + * Split the package to lower dependencies (-scripts) and + disk space usage (map-icons). + * Repackage upstream tarball to remove the debian/ dir. + Added get-orig-source target to debian/rules. + * Removed gpsfetchmap.pl from upstream tarball due to license issues. + A new version has been released under GPL which will be installed from + debian/scripts/gpsfetchmap.pl now. Updated the manpage for that reason. + * Removed map-icons with unclear licenses. + * Updated debian/copyright. + * Add Homepage field in debian/control. + * Bumped to debhelper compat level 5. + * Removed some docs and install some of the scripts as examples. + * Added Build-Depends on automake1.9. + * Add 01-make.dpatch to remove unneeded dirs from Makefile.{am,in} + and to remove checks for perl modules in configure.ac + * Add 03-manpage.dpatch, merged typo fixes for manpage from old patch. + * Add 10-mapnikdir.dpatch to install mapnik files in gpsdrive dir. + * Add 20-homedir.dpatch to avoid overriding files in user's homedir. + * Add 30-icons.dpatch so that the icons are found. + * Add 40-backported.dpatch to include some bugfixes from upstream VCS. + * Add 50-scripts.dpatch to use python2.5. + * Add 60-sql.dpatch, merged from old patch. + * Add 70-perl.dpatch to avoid namespace clashes for the perl modules. + * Removed 04_missing_includes.dpatch - package builds fine with gcc-4.3. + * Removed 05_start_gpsd.dpatch - feature has been removed. + * Added postgres and osm2pgsql to Suggests in debian/control. + * Updated dependencies. + * Updated debian readme file with install/upgrade hints. + + -- Andreas Putzo Tue, 16 Oct 2007 20:00:05 +0000 + +gpsdrive (2.10~pre2-2) unstable; urgency=low + + * Removed libfly.so, libnautic.so, because they weren't used. + * Removed gpsfetchmap wrapper from debian/. + * Fixed mistake in debian/rules which caused gpsdrive to configure twice. + * Documentation were installed twice in different dirs. + * Added missing perl dependencies. + + -- Andreas Putzo Sun, 29 Jul 2007 12:27:49 +0000 + +gpsdrive (2.10~pre2-1) unstable; urgency=low + + * New upstream release. Closes: #321429. + - Proxy support works again + Closes: #300443. + Closes: #400745. + - Package can be build twice in a row (FTBFS). Closes: #424369. + * Acknowledge NMU. Closes: 343815. + * Set Debian GIS Project as new Maintainer and myself as Uploader. + Closes: #406522. + * Added missing #includes (FTBFS gcc-4.3). Closes: #417498. + * Fixed typos. + Closes: #363622. + Closes: #428263. + * Suggesting libmysqlclient15off now. + Closes: #357397. + * Switched to dpatch, rewrite of debian/rules. + * Build-depend on autotools-dev to symlink to config.guess/config.sub. + * Updated debian/copyright, debin/control + * Fixed misspelled email address in debian/changelog. + * Created manpages for gpsfetchmap and friendsd2 + * Changed gpsdrive.c to use the correct command line switches for gpsd + Closes: #317809 + + -- Andreas Putzo Tue, 17 Jul 2007 16:29:39 +0200 + +gpsdrive (2.09-2.2) unstable; urgency=low + + * Porter NMU. + * Update config.guess/config.sub. Closes: #317323. + * Update po/de.po. Closes: #314065. + + -- Aurelien Jarno Sun, 10 Dec 2006 23:24:43 +0100 + +gpsdrive (2.09-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Build-depend on libmysqlclient15-dev instead of the obsolete + libmysqlclient10-dev which should be removed for etch; requires minor + source changes due to changed library name and a small ABI change. + Closes: #343815. + + -- Steve Langasek Mon, 20 Feb 2006 01:00:45 -0800 + +gpsdrive (2.09-2sarge1) stable-security; urgency=high + + * Non-maintainer upload by the Security Team + * Corrected format string to fix arbitrary code execution + [src/friendsd.c, CVE-2005-3523] + + -- Martin Schulze Mon, 7 Nov 2005 07:32:56 +0100 + +gpsdrive (2.09-2) unstable; urgency=low + + * closes: #286902 (does not compile with gcc-4.x (FTBFS (amd64/gcc-4.0))) + * closes: #224905 (gpsdrive: Please give gpsd it's own package) + * closes: #238050 (new upstream version) + * closes: #282886 (gpsdrive: missing dependency to libgdk-pixbuf2) + (was never needed, since libgdk-pixbuf2 is part + of libgtk2.0) + + -- Frank Kirschner Mon, 10 Jan 2005 12:05:36 +0100 + +gpsdrive (2.09-1) unstable; urgency=low + + * new upstream release + * closes: #248609 (mapblast/expedia map-servers do work again) + + -- Frank Kirschner Tue, 25 May 2004 11:44:03 +0200 + +gpsdrive (2.07-1) unstable; urgency=low + + * new upstream release + * replaced non-free script 'gpsfetchmap' with a wrapper to 'gpsfetchmap.pl' + closes: #224913 + + -- Frank Kirschner Tue, 27 Jan 2004 13:25:20 +0100 + +gpsdrive (2.04-2) unstable; urgency=low + + * closes: #200247 (bug in loadmapconfig() on map_koord.txt files < 512 bytes + long) (This was not a real bug) + * Suggests libmysql for MySQL support. + * fixed several lintian warnings + + -- Frank Kirschner Thu, 9 Oct 2003 14:20:05 +0200 + +gpsdrive (2.04-1) unstable; urgency=low + + * new upstream release. + * closes: #186437 (MySQL Support needed) + * closes: #194403 (mapblast doesn't send images) + * closes: #197789 (FTBFS with g++-3.3: Missing include) + * closes: #197832 (gpsfetchmap script gives syntax error) + * closes: #199364 (Expedia map service changed, no longer directly + compatible with gpsdrive) + * closes: #210807 (Gpsdrive requires xfonts-75dpi to run) + * closes: #210977 (much newer version available) + + -- Frank Kirschner Thu, 9 Oct 2003 09:33:26 +0200 + +gpsdrive (2.0-0pre9-1) unstable; urgency=low + + * new upstream release. + + -- Frank Kirschner Tue, 1 Jul 2003 20:00:06 +0200 + +gpsdrive (1.32-1) unstable; urgency=low + + * new upstram release. (closes: #183066) + + -- Frank Kirschner Wed, 12 Mar 2003 17:14:37 +0100 + +gpsdrive (1.30-1) unstable; urgency=low + + * new upstream release. (closes: #170823) + + -- Frank Kirschner Sat, 30 Nov 2002 12:18:33 +0100 + +gpsdrive (1.18-1) unstable; urgency=low + + * new upstream release. + * added xutils to build-dependencies. (closes: #144287) + + -- Frank Kirschner Wed, 24 Apr 2002 23:40:31 +0200 + +gpsdrive (1.17-1) unstable; urgency=low + + * new package-maintainer. (closes: #143320) + * new upstream release. + + -- Frank Kirschner Wed, 17 Apr 2002 18:44:47 +0200 + +gpsdrive (1.6-1) unstable; urgency=low + + * Initial Release. + + -- Cosimo Alfarano Fri, 7 Dec 2001 19:14:57 +0100 + --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/gpsdrive-scripts.install +++ gpsdrive-2.10~pre4-6.dfsg/debian/gpsdrive-scripts.install @@ -0,0 +1,14 @@ +usr/bin/convert-waypoints.pl +usr/bin/geo-code +usr/bin/geocache2way +usr/bin/geoinfo.pl +usr/bin/gpspoint2gpsdrive.pl +usr/bin/gpsreplay +usr/bin/poi-manager.pl +usr/bin/gpsdrive_mapnik_gentiles.py +usr/share/perl5/Geo/Filter/* usr/share/perl5/Geo/Gpsdrive/Filter +usr/share/perl5/Geo/GPX/* usr/share/perl5/Geo/Gpsdrive/GPX +usr/share/perl5/Geo/Geometry.pm usr/share/perl5/Geo/Gpsdrive +usr/share/perl5/Geo/Gpsdrive/* +usr/share/perl5/Geo/OSM/Planet.pm usr/share/perl5/Geo/Gpsdrive/OSM +usr/share/perl5/Utils/* usr/share/perl5/Geo/Gpsdrive/Utils --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/gpsdrive.manpages +++ gpsdrive-2.10~pre4-6.dfsg/debian/gpsdrive.manpages @@ -0,0 +1,2 @@ +man/friendsd2.1 +man/gpsdrive.1 --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/copyright +++ gpsdrive-2.10~pre4-6.dfsg/debian/copyright @@ -0,0 +1,129 @@ +This package was debianized by Frank Kirschner on +Wed Apr 17 18:35:19 CEST 2002. + +The current Debian Maintainer is the Debian GIS Team +. + +It was downloaded from http://gpsdrive.de/packages/gpsdrive-2.10pre4.tar.gz The +debian/ dir has been removed from the tarball. The file scripts/gpsfetchmap.pl +has been removed from the tarball because of a non-free license. The license has +been changed upstream to GPL. This version will be installed instead. The +directories data/map-icons/{japan,nickw} have been removed due to unclear +license issues. They are not used by gpsdrive anyway. + +Upstream Authors: + + GpsDrive Development Team + Fritz Ganter + Joerg Ostertag + Guenter Meyer + Christoph Metz + and Contributors. + +Copyright: + + Copyright (C) 2001-2006 Fritz Ganter + 2006-2007 The GpsDrive Development Team + +License: + +This package is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + + This package is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this package; if not, write to the Free Software Foundation, Inc., 51 + Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL' + + +The files + src/lib_map/map_load.c + src/lib_map/map_render.c + src/lib_map/map_transform.c + src/lib_map/map_port_cpp.cpp + src/lib_map/map_render_cpp.cpp + src/util/gmapview.c + src/util/gps.c + src/util/mmapview.c + src/util/wmapview.c + src/util/worldgen.c + src/util/qmapview.cpp +are Copyright (C) 2005 Daniel Wallner and are licensed under the GNU General +Public License version 2 or later (see above). + + +The files + scripts/gpssql_backup.sh + scripts/gpssql_restore.sh +are Copyleft 2002 Sven Fichtner . + + +The files + scripts/osm/perl_lib/Geo/OSM/OsmChangeReaderV5.pm + scripts/osm/perl_lib/OsmReader*.pm + scripts/osm/perl_lib/OsmChangeReader*.pm +are Copyright (C) 2006 Oliver Whilte + 2007 Martijn van Oosterhout +and are licensed under the GNU General Public License version 2 or later +(see above). + + +The file + scripts/geo-code +is Copyright (C) Rick Richardson +and has been donated to the public domain. + + +The file + scripts/gpsreplay +is Copyright (C) 2002,2003 Tim Witham +and is licensed under the GNU General Public License version 2 or later +(see above). + + +The file + scripts/gpspoint2gpsdrive.pl +is Copyright (C) 2002 Stephen Merrony +and is licensed under the GNU General Public License version 2 or later +(see above). + + +The file + scripts/wpcvt +is Copyright (C) 2002 Ned Konz +and is licensed under the GNU General Public License version 2 or later +(see above). + + +The file + scripts/osm/perl_lib/Geo/OSM/OsmXML.pm +is Copyright (C) 2006 Oliver White +and is licensed under the GNU General Public License version 2 or later +(see above). + + +The files + scripts/osm/perl_lib/Geo/OSM/APIClientV4.pm + scripts/osm/perl_lib/Geo/OSM/EntitiesV3.pm + scripts/osm/perl_lib/Geo/OSM/APIClientV5.pm +are Copyright (C) 2007 Martijn van Oosterhout +and are licensed under the GNU Lesser General Public License. + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in `/usr/share/common-licenses/LGPL' + + +The files + data/map-icons/* +are Copyright (C) 2007 Joerg Ostertag + 2007 Guenther Meyer +and have been donated to the public domain. --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/control +++ gpsdrive-2.10~pre4-6.dfsg/debian/control @@ -0,0 +1,46 @@ +Source: gpsdrive +Section: utils +Priority: optional +Maintainer: Debian GIS Project +Uploaders: Andreas Putzo +DM-Upload-Allowed: yes +Build-Depends: debhelper (>= 5), automake1.9, libtool, pkg-config, libpcre3-dev, libgtk2.0-dev,libart-2.0-dev, libxml2-dev, libmysqlclient15-dev, autotools-dev, dpatch, libmapnik-dev (>= 0.6), libboost-dev, libboost-filesystem-dev, libboost-serialization-dev, libdbus-glib-1-dev +Standards-Version: 3.8.0 +Homepage: http://gpsdrive.de +Vcs-Svn: svn://svn.debian.org/svn/pkg-grass/packages/gpsdrive/ +Vcs-Browser: http://svn.debian.org/viewsvn/pkg-grass/packages/gpsdrive/ + +Package: gpsdrive +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gpsdrive-data, openstreetmap-map-icons-square, openstreetmap-map-icons-classic +Recommends: gpsd, gpsdrive-scripts +Suggests: flite | festival, osm2pgsql, mysql-server, postgresql-8.3-postgis +Description: Car navigation system + Map-based navigation system that displays the current + position provided by a GPS receiver on a zoomable map. + Maps can be downloaded from different map providers or + rendered on-the-fly using the OpenStreetMap dataset. + . + Route planning, optionally with spoken directions, + is supported through waypoints. + +Package: gpsdrive-data +Architecture: all +Recommends: gpsdrive +Replaces: gpsdrive (<= 2.10~pre4-4) +Description: Car navigation system + Map-based navigation system that displays the current + position provided by a GPS receiver on a zoomable map. + Maps can be downloaded from different map providers or + rendered on-the-fly using the OpenStreetMap dataset. + . + This package contains the data files. + +Package: gpsdrive-scripts +Architecture: all +Depends: gpsdrive, ${perl:Depends}, python2.5, python-imaging, python-mapnik, libdbi-perl, libdbd-mysql-perl, libdate-manip-perl, libfile-slurp-perl, libmime-base64-perl, libtext-query-perl, libtime-local-perl, libwww-curl-perl, libwww-mechanize-perl, libxml-parser-perl, libxml-simple-perl, libxml-twig-perl, libxml-writer-perl, perlmagick, perl-tk +Description: Various scripts for gpsdrive + Gpsdrive is a car (bike, ship, plane) navigation system. + . + This package contains various scripts to download maps + from different sources and to manage point-of-interests. --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/TODO +++ gpsdrive-2.10~pre4-6.dfsg/debian/TODO @@ -0,0 +1,18 @@ +Debian maintainers TODO list +---------------------------- + +* Help upstream to get the perl module namespace organized. +* Remove the following patches on next release as they are fixed upstream + - 01-make (upstream switched to cmake) + - 03-manpage + - 20-homedir (~/.gpsdrive/osm.xml no longer overwritten) + - 40-backported (bugfixes backported from upstream vcs) + - 60-sql (uses sqlite now) + - 90-usage (fixed upstream) + - 95-newapi (should be fixed) + - 96-mapnik-plugins-dir (should be fixed) + - 98-mapnik-exception (fixed upstream) + - 99-autobestmap (fixed upstream) +* Create a bpo package for 2.4.10pre5 + +-- Andreas Putzo at Tue Jul 15 20:56:13 UTC 2008 --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/docs +++ gpsdrive-2.10~pre4-6.dfsg/debian/docs @@ -0,0 +1,18 @@ +README +NEWS +Documentation/CREDITS +Documentation/FAQ.gpsdrive +Documentation/FAQ.gpsdrive.fr +Documentation/GPS-receivers +Documentation/LISEZMOI +Documentation/LISEZMOI.SQL +Documentation/LISEZMOI.kismet +Documentation/NMEA.txt +Documentation/README.Bluetooth +Documentation/README.OpenStreetMap-Vektordata +Documentation/README.SQL +Documentation/README.kismet +Documentation/README.lib_map +Documentation/README.mysql +Documentation/README.nasamaps +Documentation/TODO --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/gpsdrive-scripts.manpages +++ gpsdrive-2.10~pre4-6.dfsg/debian/gpsdrive-scripts.manpages @@ -0,0 +1,6 @@ +man/convert-waypoints.pl.1 +man/geo-code.1 +man/geoinfo.pl.1 +debian/man/gpsfetchmap.1 +man/gpspoint2gpsdrive.pl.1 +man/poi-manager.pl.1 --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/gpsdrive-data.install +++ gpsdrive-2.10~pre4-6.dfsg/debian/gpsdrive-data.install @@ -0,0 +1,3 @@ +usr/share/gpsdrive/maps +usr/share/gpsdrive/pixmaps +usr/share/gpsdrive/poi --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/scripts/gpsfetchmap.pl +++ gpsdrive-2.10~pre4-6.dfsg/debian/scripts/gpsfetchmap.pl @@ -0,0 +1,1975 @@ +#!/usr/bin/perl +# +# gpsfetchmap +# Copyright (C) 2002-2007 Gpsdrive Development Team +# +# 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +BEGIN { + my $dir = $0; + $dir =~s,[^/]+/[^/]+$,,; + unshift(@INC,"$dir/perl_lib"); + + # For Debug Purpose in the build Directory + unshift(@INC,"./perl_lib"); + unshift(@INC,"./scripts/perl_lib"); + unshift(@INC,"../scripts/perl_lib"); + + # For DSL + unshift(@INC,"/opt/gpsdrive/share/perl5"); + unshift(@INC,"/opt/gpsdrive"); # For DSL +}; + +my $Version = '$Revision: 1743 $'; +$Version =~ s/\$Revision:\s*(\d+)\s*\$/$1/; + +my $VERSION ="gpsfetchmap (c) 2002 Kevin Stephens +modified (Sep 2002) by Sven Fichtner +modified (Nov 2002) by Magnus MÃ¥nsson +modified (Nov 2003) by camel +modified (Feb 2004) by Robin Cornelius +modified (Jan 2005) by Joerg Ostertag +modified (May 2005) by Olli Salonen +modified (Jul 2005) by Jaroslaw Zachwieja +modified (Dec 2005) by David Pollard +modified (Jul 2007) by Maciek Kaliszewski +modified (Oct 2007) by Andreas Putzo +Version svn-$Version +"; + +sub redirect_ok { return 1; } + + +use IO::Socket; +use Data::Dumper; +use strict; +use warnings; +use LWP::UserAgent; +use LWP::Debug qw(- -conns -trace); +#use LWP::Debug qw(+ +conns +trace); +use HTTP::Request; +use HTTP::Request::Common; +use HTML::Parser; +use Getopt::Long; +use Pod::Usage; +use File::Basename; +use File::Path; +use File::Copy; +use IO::File; +use Switch; +use POSIX qw(ceil floor); +use Image::Magick; + +my $long_sleep_time=600; + +my @SCALES = (1000,1500,2000,3000,5000,7500,10000,15000,20000,30000,50000,75000, + 100000,150000,200000,300000,500000,750000,1000000,1500000,2000000,3000000, + 5000000,7500000,10000000,15000000,20000000,30000000,50000000,75000000); + + +# Translates Scale to zoom factor used by Mapserver +# This Variable also is used to see if the required mapserver +# is a valid Mapserver source +my $Scale2Zoom = { + eniro => { + 18000000 => 1, # 480 Km + 3200000 => 2, # 80 Km + 400000 => 3, # 10 Km + 200000 => 4, # 4 Km + 100000 => 5, # 1.1 Km + 20000 => 6, # 400 m + 5000 => 7, # 160 m + }, + gov_au => { + 10000000000 => 1, # + 5000000000 => 2, # + 1000000000 => 3, # + 500000000 => 4, # + 100000000 => 5, # + 50000000 => 6, # + 10000000 => 7, # + 5000000 => 8, # + 1000000 => 9, # + 500000 => 10, # + 100000 => 11, # + 50000 => 12, # + 10000 => 13, # + 5000 => 14, # + 1000 => 15, # + }, + + incrementp => { + 3200000 => 0, # 500 Km + 2400000 => 1, # 250 Km + 1600000 => 2, # 100 Km + 800000 => 3, # 50 Km + 400000 => 4, # 25 Km + 200000 => 5, # 10 Km + 100000 => 6, # 5 Km + 50000 => 7, # 2.5 Km + 25000 => 8, # 1.0 Km + 2500 => 9, # 500 m + 6250 => 10, # 250 m + 3125 => 11, # 100 m + 1562 => 12, # 50 m + }, + geoscience => { + 383000*8 => 8, # DP Still not correct but closer + 383000*4 => 4, + 383000*2 => 2, + 383000*1 => 1, + }, + landsat => { + 2000 => 2*6.4, + 5000 => 5*6.4, + 10000 => 10*6.4, + 50000 => 50*6.4, + 100000 => 100*6.4, + 500000 => 500*6.4, + 1000000 => 1000*6.4, + 5000000 => 5000*6.4, + 10000000 =>10000*6.4, + 50000000 =>50000*6.4, + } +}; + +$Scale2Zoom->{eniro_se} = $Scale2Zoom->{eniro}; +$Scale2Zoom->{eniro_dk} = $Scale2Zoom->{eniro}; +$Scale2Zoom->{eniro_no} = $Scale2Zoom->{eniro}; +$Scale2Zoom->{eniro_fi} = $Scale2Zoom->{eniro}; + + +# Set defaults and get options from command line +Getopt::Long::Configure('no_ignore_case'); +my ($lat,$lon); +my ($slat,$endlat,$slon,$endlon); +my ($waypoint,$area,$unit,$mapdir); +my ($debug,$force,$version,$man,$help); +my $cover_route; +my $failcount = 0; +my $newcount = 0; +my $existcount = 0; +my $polite = 10; +my $MIN_MAP_BYTES = 4000; # Minimum Bytes for a map to be accepted as downloaded +my $scale; +my $CONFIG_DIR = "$ENV{'HOME'}/.gpsdrive"; # Should we allow config of this? +my $CONFIG_FILE = "$CONFIG_DIR/gpsdriverc"; +my $WAYPT_FILE = "$CONFIG_DIR/way.txt"; +my $GPSTOOL_MAP_FILE = "$ENV{'HOME'}/.gpsmap/maps.txt"; +my $FILEPREFIX = 'map_'; +my $mapserver = 'landsat'; +my $simulate_only = 0; +my $check_koord_file = 0; +my $update_koord = 0; +my $check_coverage = 0; +my $TRACK_FILE = ""; +our $MAP_KOORDS = {}; +our $MAP_FILES = {}; +our $GPSTOOL_MAP_KOORDS = {}; +our $GPSTOOL_MAP_FILES = {}; +my $PROXY=$ENV{'http_proxy'}; + +GetOptions ( 'lat=f' => \$lat, 'lon=f' => \$lon, + 'start-lat=f' => \$slat, 'end-lat=f' => \$endlat, + 'start-lon=f' => \$slon, 'end-lon=f' => \$endlon, + 'sla=f' => \$slat, 'ela=f' => \$endlat, + 'slo=f' => \$slon, 'elo=f' => \$endlon, + 'scale=s' => \$scale, 'mapserver=s' => \$mapserver, + 'waypoint=s' => \$waypoint, 'area=s' => \$area, + 'unit=s' => \$unit, 'mapdir=s' => \$mapdir, + 'polite:i' => \$polite, + 'WAYPOINT=s' => \$WAYPT_FILE, 'CONFIG=s' => \$CONFIG_FILE, + 'PREFIX=s' => \$FILEPREFIX, + 'n' => \$simulate_only, + 'track=s' => \$TRACK_FILE, + 'route' => \$cover_route, + 'check-koordfile'=> \$check_koord_file, + 'check-coverage' => \$check_coverage, + 'U' => \$update_koord, + 'FORCE' => \$force, + 'PROXY=s' => \$PROXY, + 'debug+' => \$debug, 'MAN' => \$man, + 'help|x' => \$help, 'version' => \$version + ) + or pod2usage(1); + +# don't allow polite smaller than one second +if ( ($polite =~ /\d+/) && ($polite < 1) ) { + print "A polite value below one second is not supported.\n"; + print "Setting polite to default (one second)!\n"; + $polite=1; +} + + + +if ( $mapserver eq 'geoscience' ) +{ + $scale ||= join(",",keys %{$Scale2Zoom->{'geoscience'}}); +} else { + $scale ||= '100000-5000000'; +} + +if ( ! defined ( $Scale2Zoom->{$mapserver} ) ){ + print "Invalid Mapserver: $mapserver\n"; + print "Valid Mapserver: ".join(",",keys %{$Scale2Zoom} )."\n"; + exit; +} + +if ( $mapserver eq 'landsat') { + $FILEPREFIX = 'top_'; + $FILEPREFIX = 'map_'; +} + +@SCALES = sort {$a <=> $b} keys %{$Scale2Zoom->{$mapserver}}; + +pod2usage(1) if $help; +pod2usage(-verbose=>2) if $man; + +sub append_koords($$$$); # {} +sub check_coverage($); # {} +sub check_koord_file($); # {} +sub debug($); # {} +sub geoscience_url($$$); # {} +sub landsat_url($$$); # {} +sub resize($$); #{} +sub file_count($); # {} +sub get_coords_for_route; # {} +sub get_coords_for_track($); # {} +sub get_waypoint($); # {} +sub is_map_file($); # {} +sub read_gpstool_map_file(); # {} +sub read_koord_file($); # {} +sub update_gpsdrive_map_koord_file(); # {} +sub wget_map($$$); # {} +sub get_gpsd_position(); # {} + +STDERR->autoflush(1); +STDOUT->autoflush(1); + +# Setup up some constants +my $DIFF = 0.0000028; +my $RADIUS_KM = 6371.01; +my $LAT_DIST_KM = 110.87; +my $KM2NAUTICAL = 0.54; +my $KM2MILES = 0.62137119; + + +my $CFG = read_config(); +# Get unit from config file, unless they override with command line +$unit ||= $CFG->{units}; + +# Get mapdir from config file, unless they override with command line +$mapdir ||= $CFG->{mapdir}; +$mapdir ||= "$CONFIG_DIR/maps"; + +my $KOORD_FILE = "$mapdir/map_koord.txt"; + + +debug( $VERSION); +############################################################################# +# LPW::UserAgent initialisieren +my $ua = LWP::UserAgent->new; +if ( $PROXY ) { + $PROXY =~ s,^(http|ftp)://,,; + $PROXY =~ s,/$,,; + $PROXY = "http://$PROXY/"; + debug("Using Proxy '$PROXY'"); + $ua->proxy(['http','ftp'],$PROXY); +} +#$ua->level("+trace") if $debug; + + +# Print version +if ($version) { + print $VERSION, "\n"; + exit(); +} + + +# Verify that we have the options that we need +pod2usage(1) if (&error_check); + +# Change into the gpsdrive maps directory +chdir($mapdir); + +############################################ +if ( $check_koord_file ) { + check_koord_file($KOORD_FILE); # This also memoizes the filenames + update_gpsdrive_map_koord_file(); + exit(); +} + +if ( $check_coverage ) { + check_coverage($KOORD_FILE); + exit(); +} + +############################################################################# +# Get the list of scales we need +my $SCALES_TO_GET_ref = get_scales(\$scale); +debug( "Scale to download: ". join(",",sort {$a <=> $b} @{$SCALES_TO_GET_ref})); + +# Get the center waypoint if they want one +if ( $waypoint ) { + if ( $waypoint eq "gpsd" ) { + ($lat,$lon) = get_gpsd_position(); + } else { + ($lat,$lon) = get_waypoint($waypoint); + } + debug("Centerpoint: $lat,$lon"); +} + + +my $desired_locations = {}; + +if ($TRACK_FILE) { # download maps along a saved track + my ($number, $i); + print "Downloading maps along a saved track $TRACK_FILE.\n" if $debug; + my ($latsref, $lonsref) = get_coords_for_track($TRACK_FILE); + my ($sla, $slo, $ela, $elo); + $area ||= 1; + $number = @{$latsref}; + print "Inserting $number points to the list.\n" if $debug; + for ($i = 0; $i < $number; $i++) { + ($sla,$slo,$ela,$elo) = get_coords($latsref->[$i],$lonsref->[$i],$area,$unit); + debug(""); + desired_locations($desired_locations,$sla,$slo,$ela,$elo); + } +} elsif ($cover_route) { # download maps between a set of waypoints + print "Downloading maps along the following route:\n" if $debug; + my ($latsref, $lonsref) = get_coords_for_route; + my ($sla, $slo, $ela, $elo, $number, $i); + $area ||= 1; + $number = @{$latsref}; + print "Inserting $number points to the list.\n" if $debug; + for ($i = 0; $i < $number; $i++) { + ($sla,$slo,$ela,$elo) = get_coords($latsref->[$i],$lonsref->[$i],$area,$unit); + desired_locations($desired_locations,$sla,$slo,$ela,$elo); + } +} else { # we are not downloading maps a saved track or between waypoints + # Now get the start and end coordinates + unless ($slat && $slon && $endlat && $endlon) { + ($slat,$slon,$endlat,$endlon) = get_coords($lat,$lon,$area,$unit); + } + print "Upper left: $slat, $slon\n" if $debug; + print "Lower right: $endlat, $endlon\n" if ($debug); + + desired_locations($desired_locations,$slat,$slon,$endlat,$endlon); +} + +my ($existing,$wanted) = file_count($desired_locations); +print "You are about to download $wanted (".($existing+$wanted).") file(s).\n"; + +if ( $mapserver eq 'geoscience' ){ + print "+-----------------------------------------------------------+\n"; + print "| Geoscience Maps are Copyright, Commonwealth of Australia |\n"; + print "| They are free for non commercial use. |\n"; + print "| Full Copyright information can be found at |\n"; + print "| http://www.ga.gov.au/about/copyright.jsp |\n"; + print "+-----------------------------------------------------------+\n"; +}elsif ( $mapserver eq 'landsat' ){ + print "+-----------------------------------------------------------+\n"; + print "| Landsat Maps are Copyright, ..... |\n"; + print "| They are free for non commercial use. |\n"; +} elsif ( ! $force) { + print "You may violating the map servers terms of use!\n"; + print "Please use their service responsible!\n"; + print "Are you sure you want to continue? [y|n] "; + my $answer = ; + exit if ($answer !~ /^[yY]/); +} + +if ( $update_koord ) { + read_gpstool_map_file(); + read_koord_file($KOORD_FILE); +} + +print "\nDownloading files:\n"; + +# Ok start getting the maps +for my $scale ( sort {$b <=> $a} keys %{$desired_locations} ) { + print "Scale: $scale\n"; + for my $lati ( sort {$a <=> $b} keys %{$desired_locations->{$scale}} ) { + printf " %5.2f: ",$lati; + my @longs = sort {$a <=> $b} keys %{$desired_locations->{$scale}->{$lati}}; + print "(". scalar( @longs ) . ")\t"; + #print ":". join(" ", @longs ) . "\t"; + for my $long ( @longs ) { + print wget_map($scale,$lati,$long); + } + print "\n"; + } +#print "\n"; +} + + +print "\n"; + +print "Fail: $failcount\n"; +print "Exist: $existcount\n"; +print "New: $newcount\n"; + +################################################################################ +# +# Subroutines +# +################################################################################ + +############################################################################# +sub slurp($){ + my $fh=IO::File->new(shift); + return "" unless $fh; + return join("",$fh->getlines()); +} + +############################################################################# +sub get_gpsd_position(){ + # Connect to local gpsd + my $GPSD = "localhost:2947"; + my $gpsd = IO::Socket::INET->new($GPSD); + my ($lat,$lon) =(0,0); + if ( !$gpsd ) { + warn "No local gpsd found at $GPSD: $!\n"; + } else { + # Tell gpsd we want position, altitude, date, and status. + $gpsd->print("pads\n"); + $gpsd->print("p\n"); + while ( my $line = <$gpsd> ) { + debug("GPSD Line: $line"); + if ( $line =~ m/P=(-?\d+\.\d+)\s+(-?\d+\.\d+)/){ + ($lat,$lon) =($1,$2); + debug("gpsd reports: lat/lon ($lat,$lon)"); + return ($lat,$lon); + } else { + print "GPSD Line: $line"; + $gpsd->print("pads\n"); + sleep 1; + } + } + } + $gpsd->close(); +} + +############################################################################# +# get File with lwp-mirror +############################################################################# +sub mirror_file($$){ + my $url = shift; + my $local_filename = shift; + + my $file_existed = -s $local_filename; + + my $exist_string = $file_existed?"exists":"getting"; + debug("mirror_file($url --> $local_filename) $exist_string"); + + my $ok=1; + + my $dir = dirname($local_filename); + unless ( -s $dir || -l $dir ) { + debug("Create Directory '$dir'"); + mkpath($dir) + or warn "Could not create '$dir':$!\n";; + } + + my $response = $ua->mirror($url,$local_filename); +# debug(sprintf("success = %d <%s>",$response->is_success,$response->status_line)); + + if ( ! $response->is_success ) { + if ( $response->status_line =~ /^304/ ) { + print "$url --> $local_filename\tNOT MOD" if $debug ; + } else { + print sprintf("ERROR: %s\n",$response->message) + if $debug; + print sprintf("STATUS LINE: %s\n",$response->status_line) + if $debug; + print "COULD NOT GET\t$url\n\t\tfor --> $local_filename\n"; + unlink $local_filename unless $file_existed; + $ok=0; + } + } + debug("mirror_file($url --> $local_filename) error ") + unless $ok; + return $ok; +} + +###################################################################### +# Check if $filename is a valid map image +# for now we only check the size and existance +###################################################################### +sub is_map_file($){ + my $filename = shift; + my $full_filename = $filename; + $full_filename = "$mapdir/$filename" unless $filename =~ m,^/,; + if ( $debug ) { +# printf "is_map_file($full_filename) -> %d Bytes\n",-s $full_filename; + } + + return 1 if ( -s $full_filename || 0 ) > $MIN_MAP_BYTES ; + + return 0 if -s $full_filename; + + # Search in System + $full_filename = "/usr/local/share/gpsdrive/maps/$filename" unless $filename =~ m,^/,; + return 1 if ( -s $full_filename || 0 ) > $MIN_MAP_BYTES ; + + $full_filename = "/usr/share/gpsdrive/maps/$filename" unless $filename =~ m,^/,; + return 1 if ( -s $full_filename || 0 ) > $MIN_MAP_BYTES ; + + return 0; +} + + +###################################################################### +# get a single map +# Args: +# $url +# $local_filename +# Returns: +# 1 : Success +# 0 : Failure +###################################################################### +sub mirror_map($$){ + my $url = shift; + my $filename = shift; + + my $content = slurp($filename); + if ( $content =~ m,403 Forbidden,){ + unlink "$filename"; + sleep 10; # Yes this is on purpose. SInce you cannot download for the next hours anyway + debug($content); + die ("Access to the Site $url is denied\n"); + }; + my $ok = mirror_file($url,$filename); + if ( ! is_map_file($filename) ) { + # unlink($filename) if -s $filename; + #warn "no map downloaded ($filename)\n"; + $ok=0; + } + + $content = slurp($filename); + if ( $content =~ m,(403 .*),){ + my $message = $1; + $content =~ s,.*
,,s; + $content =~ s,
.*,,s; + warn "Found $filename $message Message\n"; + warn $content; + warn "Sleeping very long $long_sleep_time seconds\n"; + sleep $long_sleep_time; + $long_sleep_time*=2; + }; + + # sleep if polite is turned on to be nice to the webserver of the mapserver + sleep($polite) if ($polite =~ /\d+/); + + return $ok; +} + +###################################################################### +# get a single map (Old Version with wget) +# Args: +# $url +# $local_filename +# Returns: +# 1 : Success +# 0 : Failure +###################################################################### +sub mirror2_map($$){ + my $url = shift; + my $filename = shift; + + # sleep if polite is turned on to be nice to the webserver of the mapserver + sleep($polite) if ($polite =~ /\d+/); + sleep(1) if (!$polite); + + unlink('tmpmap.gif') if -f 'tmpmap.gif'; + `wget -nd -q -O tmpmap.gif "$url"`; + if ( is_map_file('tmpmap.gif') ) { + rename('tmpmap.gif',$filename); + return 1; + } + return 0; +} + + +###################################################################### +# returns the map filename for given $scale,$lati,$long +###################################################################### +sub map_filename($$$){ + my ($scale,$lati,$long) = @_; + + my $filename = "$mapserver/$scale" + ."/".int($lati) +# ."/".sprintf("%3.1f",$lati) + ."/".int($long) + ."/$FILEPREFIX$scale-$lati-$long.gif"; + printf("Filename(%.0f,%.5f,%.5f): $filename\n",$scale,$lati,$long) + if $debug; + return $filename; +} + +###################################################################### +# get a single map at defined position +###################################################################### +sub wget_map($$$){ + my ($scale,$lati,$long) = @_; + + my ($url,$mapscale); + my $result="?"; + +# my $plain_filename = "$FILEPREFIX$scale-$lati-$long.gif"; + # 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"; + my $filename = map_filename($scale,$lati,$long); + + if ( $mapserver =~ m/^eniro_(se|dk|no|fi)$/) + { + ($url,$mapscale)=eniro_url($lati,$long,$scale); + } + elsif ( $mapserver eq 'incrementp') + { + ($url,$mapscale)=incrementp_url($lati,$long,$scale); + } + elsif ( $mapserver eq 'gov_au') + { + ($url,$mapscale)=gov_au_url($lati,$long,$scale); + } + elsif ( $mapserver eq 'geoscience') + { + ($url,$mapscale)=geoscience_url($lati,$long,$scale); + } + elsif ( $mapserver eq 'landsat') + { + ($url,$mapscale)=landsat_url($lati,$long,$scale); + } + else + { + print "Unknown map server :", $mapserver, "\n"; + return "E"; + } + + return "E" unless $url; + + my $mirror_filename=$filename; + if ( $mapserver eq 'geoscience'){ + $mirror_filename="MIRROR/$filename"; + debug("mirror_filename=$mirror_filename"); + }; + + # create directories if not existent + for my $file ( ($filename , $mirror_filename ) ) { + my $dir = dirname("$mapdir$file"); + unless ( -s $dir || -l $dir ) { + debug("Create Directory '$dir'"); + mkpath($dir) + or warn "Could not create $dir:$!\n";; + } + } + + + if ( is_map_file( $filename ) ) { + $result= "_"; + if ( $update_koord + && !defined $MAP_FILES->{$filename} ) { + append_koords($filename, $lati, $long, $mapscale); + $result= "u"; + }; + $existcount++; + } else { + if ( $simulate_only ) { + $result="S"; + $newcount++; + } else { + debug("mirror $url"); + if ( $mapserver eq 'gov_au') { + if ( mirror_map($url,$filename) ) { + $result = gov_au_resize($lati,$long,$scale,5,4,"$mapdir$filename"); + append_koords($filename, $lati, $long, $mapscale); + $result= "+"; + print "\nWrote $filename\n" if $debug; + $newcount++; + } + } elsif ( mirror_map($url,$mirror_filename) ) { + if ( $mapserver eq 'geoscience'){ + $result = resize($mapdir.$mirror_filename,$mapdir.$filename); + } + append_koords($filename, $lati, $long, $mapscale); + $result= "+"; + print "\nWrote $filename\n" if $debug; + $newcount++; + } + else + { + $failcount++; + $result= "E"; + } + } + } + + return $result; +} + +###################################################################### +sub error_check { + my $status; + + return 0 if $check_koord_file; + return 0 if $check_coverage; + return 0 if $TRACK_FILE; + if ($cover_route) { + my $num = @ARGV; + if ($num < 2) { + print "ERROR: You must supply at least two waypoints\n\n"; + return 1; + } else { + return 0; + } + } + + # Check for a centerpoint + unless (($waypoint) || ($lat && $lon) || ($slat && $endlat && $slon && $endlon)) { + print "ERROR: You must supply a waypoint, latitude and longitude coordinates or starting and ending coordinates for both latitude and longitude\n\n"; + $status++; + } + + # Check for area + unless ($area || ($slat && $endlat && $slon && $endlon)) { + print "ERROR: You must define an area to cover or starting and ending coordinates for both latitude and longitude\n\n"; + $status++; + } + + return $status; +} + +###################################################################### +sub get_scales { + my ($scale_ref) = @_; + # OK lets figure out what scales they want + # + # '####' - just that scale + # '>####' - scales above and including the number given + # '<####' - scales below and including the number given + # '####,####,####' - a list of scales to download + # '####-####' - scales from first to last + # + my @scales_to_get; + for my $temp_scale (split /,/, $$scale_ref) { + if ($temp_scale =~ /^\d+$/) { + unless (grep (/$temp_scale/, @SCALES)){ + print STDERR "\n"; + print STDERR "Wrong scale $temp_scale\n"; + print STDERR "Allowed scales: ".join(", ",@SCALES)."\n"; + print STDERR "\n"; + pod2usage(1); + } + push(@scales_to_get,$temp_scale); + } elsif ($temp_scale =~ /^>\d+$/) { + $temp_scale =~ s/>//; + push(@scales_to_get, grep ($_ >= $temp_scale, @SCALES)); + } elsif ($temp_scale =~ /^<\d+$/) { + $temp_scale =~ s/ $b} @NUMS; + push(@scales_to_get, grep (($_ >= $NUMS[0]) && ($_ <= $NUMS[1]), @SCALES)); + } else { + pod2usage(1); + } + } + return \@scales_to_get; +} #End get_scales + +############################################################################# +sub eniro_url($$$){ + my $lati = shift; + my $long = shift; + my $scale = shift; + + my $mapscale = $scale; + + + my $zoom = undef; + my $url=''; + + my %factor = ( 1 => 18000000, # 480 Km + 2 => 3200000, # 80 Km + 3 => 400000, # 10 Km + 4 => 200000, # 4 Km + 5 => 100000, # 1.1 Km + 6 => 20000, # 400 m + 7 => 5000, # 160 m + ); + for my $f ( sort keys %factor ) { + my $test_scale = $factor{$f}; + if ( $debug) { +# print "testing $f: against $test_scale\n"; + } + if ( $test_scale <= $scale ) { + $zoom = $f; + $mapscale = $test_scale; + last; + } + } + unless ( $zoom ) { + print "Error calculating Zommlevel for Scale: $scale\n"; + return (undef,undef); + } + + if ($debug) { + printf "Eniro : lat: %.4f lon: %.4f\t",$lati,$long; + print "using zoom ", $zoom, " for requested scale ", $scale, ":1 actual scale ", $mapscale, ":1\n"; + } + + my ( $eniro_country ) = ($mapserver =~ m/^eniro_(se|dk|no|fi)$/); + + + if ( $eniro_country eq "dk" + || # Add real restriction for Denmark + ( $lati > 54.67694 ) && ( $lati < 56.71874 ) && + ( $long > 7.77864 ) && ( $long < 13.40111 ) + ) { + print "Daenmark ($lati,$long)\n" if $debug; + $url = "http://maps.eniro.$eniro_country/servlets/${eniro_country}_MapImageLocator?profile=Main"; + $url .= sprintf("¢er=%10.4f;%10.4f",($lati*10000),($long*10000)); + $url .= "&zoomlevel=$zoom"; + $url .= "&size=1280x1024"; + $url .= "&symbols="; + } else { # Add here restriction for Norway + print "Norway ($lati,$long)\n" if $debug; + $url = "http://maps.eniro.$eniro_country/servlets/${eniro_country}_MapImageLocator?profile=Main"; + $url .= sprintf("¢er=%.4f;%.4f",$long,$lati); + $url .= "&zoomlevel=$zoom"; + $url .= "&size=1280x1024"; + $url .= "&symbols"; + } + + return ($url,$mapscale); +} + +############################################################################# +sub incrementp_url($$$){ + my $lati = shift; + my $long = shift; + my $scale = shift; + + my $mapscale = $scale; + + my $zoom = undef; + my $url=''; + for my $s ( sort keys %{$Scale2Zoom->{incrementp}} ) { + next unless $s > $scale; + $zoom = $Scale2Zoom->{incrementp}->{$s}; + $mapscale = $s; + last; + } + + unless ( $zoom ) { + print "Error calculating Zoomlevel for Scale: $scale\n"; + return (undef,undef); + } + + if ($debug) { + printf "Incrementp : lat: %.4f lon: %.4f\t",$lati,$long; + print "using zoom ", $zoom, " for requested scale ", $scale, ":1 actual scale ", $mapscale, ":1\n"; + } + + $url = "http://mapserv.incrementp.co.jp/cgi-bin/map/mapserv.cgi?"; + +{ + my $lat1 = ($lati>0 ? "E" :"W" ); + $lat1 .= int($lati); + $lat1 .= sprintf(".%.0f",($lati-int($lati))/60); + + my $lon1 = ($lati>0 ? "N" :"S" ); + $lon1 .= int($long); + $lon1 .= sprintf(".%.0f",($long-int($long))/60); + # MAP=E127.48.26.8N26.19.49.3 + $url .= sprintf("MAP=%s%s",$lat1,$lon1); +} + +$url .= "&OPT=e0000011"; +$url .= "&ZM=$zoom"; +$url .= "&SZ=1200,1200"; +$url .= "&COL=1"; + +return ($url,$mapscale); +} + +############################################################################# +sub gov_au_url($$$){ + my $lati = shift; + my $long = shift; + my $scale = shift; + + my $mapscale = $scale; + my $zoom = undef; + my $url = ''; + for my $s ( sort keys %{$Scale2Zoom->{incrementp}} ) { + next unless $s > $scale; + $zoom = $Scale2Zoom->{incrementp}->{$s}; + $mapscale = $s; + last; + } + unless ( $zoom ) { + print "Error calculating Zommlevel for Scale: $scale\n"; + return (undef,undef); + } + + $url = "http://www.ga.gov.au/bin/mapserv36?". + "map=/public/http/www/docs/map/globalmap/global_36.map". + "\&mode=map". + "\&layer=outline". + "\&layer=waterbodies". + "\&layer=capitals". + "\&layer=permanentriverslargescale". + "\&layer=fluctuatingrivers". + "\&layer=dualcarriage". + "\&layer=PrimaryPavedRoad". + "\&layer=roadsecpav". + "\&layer=roadotherpav". + "\&mapsize=1000+800"; + + # OK I'm too lazy to calculate the real start and end + my $fac = 1000000000; + my $scale_fac = ($scale/$fac); + my $lat1= $lati - $scale_fac; + my $lat2= $lati + $scale_fac; + my $lon1= $long - $scale_fac; + my $lon2= $long + $scale_fac; + $url .= "\&mapext=$lon1+$lat2+$lon2+$lat1"; + + if ($debug) { + printf "Gov_Au : lat: %.4f lon: %.4f\t",$lati,$long; + print "using zoom $zoom for requested scale $scale\n"; + print "actual scale $mapscale with scalefac: $scale_fac\n"; + print "URL: \n$url\n"; + }; + + return ($url,$mapscale); +} + +############################################################################# +sub landsat_url($$$){ + my $lat = shift; + my $lon = shift; + my $scale = shift; + + my $factor = $Scale2Zoom->{'landsat'}->{$scale}; + + my $deltalat = 0.0005; + my $deltalon = 0.001; # Gives ratio 1.2 in meter + + my $lon1 = $lon-$deltalon*$factor/2; + my $lat1 = $lat-$deltalat*$factor/2; + my $lon2 = $lon+$deltalon*$factor/2; + my $lat2 = $lat+$deltalat*$factor/2; + + debug( "landsat_url(LAT=$lat,LON=$lon,SCALE=$scale,FACTOR=$factor)"); + + debug( "Calculated Lat1 $lat1"); + debug( "Calculated Lat2 $lat2"); + debug( "Calculated Lon1 $lon1"); + debug( "Calculated Lon2 $lon2"); + + # Build the URL + my $url=''; + $url .= "http://onearth.jpl.nasa.gov/wms.cgi"; + $url .= '?request=GetMap'; + $url .= '&width=1280'; + $url .= '&height=1024'; + $url .= '&layers=global_mosaic'; + $url .= '&styles='; + $url .= '&srs=EPSG:4326'; +# $url .= '&format=image/gif'; + $url .= '&format=image/jpeg'; + + # Add the 4 Coordinates. + $url .= '&bbox='; # '15.3,58.35,15.5,58.45'; + $url .= "$lon1,$lat1,$lon2,$lat2"; +# $url .= sprintf("%.5f",$lon1).","; +# $url .= sprintf("%.5f",$lat1).","; +# $url .= sprintf("%.5f",$lon2).","; +# $url .= sprintf("%.5f",$lat2); + + return ($url,$scale); +} + + +############################################################################# +sub geoscience_url($$$){ + my $gs_lati = shift; + my $gs_long = shift; + my $gs_scale = shift; + + debug( "geoscience_url(LATI=$gs_lati,LONG=$gs_long,SCALE=$gs_scale)"); + + my $url=''; + my $factor = $Scale2Zoom->{'geoscience'}->{$gs_scale}; + my $latioffset = 0.6*$factor; + my $longoffset = 0.8*$factor; + my $lati1 = $gs_lati + $latioffset; + my $lati2 = $gs_lati - $latioffset; + my $long1 = $gs_long - $longoffset; + my $long2 = $gs_long + $longoffset; + debug( "Calculated Lat1 $lati1"); + debug( "Calculated Lat2 $lati2"); + debug( "Calculated Long1 $long1"); + debug( "Calculated Long2 $long2"); + + # Build the URL + $url = "http://www.ga.gov.au/bin/mapserv36" + ."?map=/public/http/www/docs/map/globalmap/global_36.map"; + $url .= '&mode=map'; + # Add the 4 Coordinates. + $url .= '&mapext='; + $url .= sprintf("%.5f",$long1)."+"; + $url .= sprintf("%.5f",$lati1)."+"; + $url .= sprintf("%.5f",$long2)."+"; + $url .= sprintf("%.5f",$lati2); + + # Add all the different layers + $url .= '&layer=outline'; + $url .= '&layer=waterbodies'; + $url .= '&layer=capitals'; + $url .= '&layer=statenames'; + $url .= '&layer=permanentriverslargescale'; + $url .= '&layer=fluctuatingrivers'; + $url .= '&layer=streams'; + $url .= '&layer=builtup'; + $url .= '&layer=dualcarriage'; + $url .= '&layer=PrimaryPavedRoad'; + $url .= '&layer=PrimaryUnpavedRoad' unless $scale >665924; + $url .= '&layer=roadsecpav' unless $scale >665924; + $url .= '&layer=roadsecnotpav' unless $scale >665924; + $url .= '&layer=roadotherpav' unless $scale >665924; + $url .= '&layer=roadothernotpav' unless $scale >665924; + $url .= '&layer=bridge' unless $scale >665924; + $url .= '&layer=railways'; + $url .= '&layer=railyard' unless $scale >665924; + $url .= '&layer=airports'; + $url .= '&layer=localities'; + $url .= '&layer=index250k' if $debug; # 250K MapSheet Outlines + # Add the map size + $url .= "\&mapsize=1000+800"; +# $url .= "\&mapsize=1024+820"; + + return ($url,$gs_scale); +} +############################################################################# +# Note: The resize will only work if the image you want to resize has +# the same aspect ratio as 1280x1024 +# i.e. 1280/1024=1.25 +# 1000/800=1.25 +############################################################################# +sub resize($$){ + my $src_filename = shift; + my $dst_filename = shift; + + my $x=''; + my $image=''; + + debug( "resize( $src_filename --> $dst_filename)" ); + + $image = Image::Magick->new; + $x = $image->Read($src_filename); + if( $x ) { + undef $image; + warn "\npic_resize($src_filename,$dst_filename) open: $x\n" ; + return 0; + } + $x = $image->Sample(geometry => "1280x1024+10+10"); + if( $x ) { + undef $image; + warn "\npic_resize($src_filename,$dst_filename) _resize: $x\n" ; + return 0; + } + $x = $image->Write($dst_filename); + if( $x ) { + undef $image; + warn "\npic_resize($src_filename,$dst_filename)_write: $x\n" ; + return 0; + } + undef $image; +} + +############################################################################# +# This function only once calculates +# which lat/lon/scale Combinations are desired to download +# Args: +# $slat,$slon : Start latitude /longitude +# $elat,$elon : End latitude /longitude +# Returns: +# $desired_locations->{$scale}->{$lati}->{$long}='?'; +############################################################################# +sub desired_locations { + my $desired_locations = shift; + my ($slat,$slon,$elat,$elon) = @_; + my $count; + + my $local_debug = 0 && $debug; + + my $min_lat=-90; + my $max_lat= 90; + my $min_lon=-180; + my $max_lon= 180; + if ( $slat < $min_lat ) { warn ("Starting Latitude ($slat) set to $min_lat\n"); $slat=$min_lat; }; + if ( $elat > $max_lat ) { warn ("End Latitude ($elat) set to $max_lat\n"); $elat=$max_lat; }; + if ( $slon < $min_lon ) { warn ("Starting Longitude ($slon) set to $min_lon\n"); $slon=$min_lon; }; + if ( $elon > $max_lon ) { warn ("End Longitude ($elon) set to $max_lon\n"); $elon=$max_lon; }; + + foreach my $scale ( sort {$b <=> $a} @{$SCALES_TO_GET_ref} ) { + # Setup k + my $k = $DIFF * $scale; + my $delta_lat = $k - ($k / 2); ### FIX BY CAMEL + my $delta_lon = $k - ($k / 6); ### FIX BY CAMEL + #TODO: $delta_lon sollte von lat abhaengen + + # make the starting points for the loop $slat and $slon + # snap into a grid with a Size depending on the scale. + # The result is $snapped_start_lat and $snapped_start_lon + # The grid allows maps in each direction to + # overlapp by 1/$overlap of the size of one map + # With snap to grid we would have to download the exact same maps + # for slightly different starting points. This way we can + # circumvent downloads of almost completely overlaping maps + my $overlap = 1; + my $flat = $delta_lat / $overlap; + my $snapped_start_lat = int ( $slat / $flat ) * $flat; + my $flon = $delta_lon / $overlap; + my $snapped_start_lon = int ( $slon / $flon ) * $flon; + + print "Scale: $scale\t"; + printf " lati: %6.5f(%6.5f) +=%5.5f ... %6.5f\n", + $snapped_start_lat,$slat,$delta_lat,$elat; + + my $lati = $snapped_start_lat; + + while (($lati <= $elat) || (!$count)) { + my $long = $snapped_start_lon; + if ( $local_debug ) { + printf " %5.5f:",$lati; + printf "\tlong: %6.4f(%6.4f) +=%5.4f ... %6.4f" + ,$snapped_start_lon,$slon,$delta_lon,$elon; + printf "\t\t"; + } + while (($long <= $elon) || (!$count)) { + $desired_locations->{$scale}->{$lati}->{$long} ||='?'; + + if ( $local_debug ) { + my $filename = map_filename($scale,$lati,$long); + my $exist = ( is_map_file($filename) ) ? " ":"+"; + + printf " %6.3f %1s",$long,$exist; + } + $long += $delta_lon; ### FIX BY CAMEL + $count++; + } + print "\n" if $local_debug; + $lati += $delta_lat; ### FIX BY CAMEL + $long = $slon; ### FIX BY CAMEL + } + } +} + +###################################################################### +# Count the Number of Files to be retrieved +# Returns: ($existing,$wanted) +# $existing : Number of existing maps +# $wanted : Number of maps to be retrieved +###################################################################### +sub file_count($){ + my $desired_locations = shift; + my $existing=0; + my $wanted=0; + for my $scale ( keys %{$desired_locations} ) { + for my $lat ( keys %{$desired_locations->{$scale}} ) { + for my $lon ( keys %{$desired_locations->{$scale}->{$lat}} ) { + my $filename = map_filename($scale,$lat,$lon); + if ( is_map_file($filename) ) { + $existing++; + } else{ + $wanted++; + } + } + } + } + return($existing,$wanted); +} #end file_count + +###################################################################### +sub get_waypoint($) { + my $waypoint = shift; + + # If they give just a filename, we should assume they meant the CONFIG_DIR + $WAYPT_FILE = "$CONFIG_DIR/$WAYPT_FILE" unless ($WAYPT_FILE =~ /\//); + + open(WAYPT,"$WAYPT_FILE") || die "ERROR: get_waypoint Can't open: $WAYPT_FILE: $!\n"; + my ($name,$lat,$lon); + while () { + chomp; + next unless (/$waypoint/); + ($name,$lat,$lon) = split(/\s+/); + } + close(WAYPT); + unless (($lat) && ($lon)) { + print "Unable to find waypoint '$waypoint' in '$WAYPT_FILE'\n"; + exit; + } + return($lat,$lon); +} #End get_waypoint + + +###################################################################### +# Read the config File (~/.gpsdrive/gpsdriverc) +# and return all Config Keys as a Hash reference +sub read_config { + # If they give just a filename, we should assume they meant the CONFIG_DIR + $CONFIG_FILE = "$CONFIG_DIR/$CONFIG_FILE" unless ($CONFIG_FILE =~ /\//); + + # If not specified on the command line, we read from the config file + open(CONFIG,"$CONFIG_FILE") || die "ERROR: get_unit Can't open $CONFIG_FILE: $!\n"; + + my $cfg = {}; + while (my $line = ) { + chomp $line; + my ($key,$val) = split(/\s*=\s*/,$line); + $cfg->{lc($key)} = $val + if $key; + } + close(CONFIG); + return $cfg; +} #End read_config + +###################################################################### +sub get_coords { + my ($lat,$lon,$area,$unit) = @_; + + # Figure out if we are doing square area or a rectangle + my ($lat_dist,$lon_dist); + if ($area =~ /x/i) { + ($lat_dist,$lon_dist) = split(/x/i,$area); + } else { + $lat_dist = $area; + $lon_dist = $area; + } + print "Latitude distance: $lat_dist, Longitude distance: $lon_dist\n" if ($debug); + + my $lon_dist_km = calc_lon_dist($lat); + my $lat_offset = calc_offset($unit,$lat_dist,\$LAT_DIST_KM); + my $lon_offset = calc_offset($unit,$lon_dist,\$lon_dist_km); + +# print "LAT_OFFSET = $$lat_offset LON_OFFSET = $$lon_offset \n" if ($debug); + + # Ok subtract the offset for the start point + my $slat = $lat - $lat_offset; + my $slon = $lon - $lon_offset; + + # Ok add the offset for the start point + my $elat = $lat + $lat_offset; + my $elon = $lon + $lon_offset; + + return ($slat,$slon,$elat,$elon); +} #End get_coords + +###################################################################### +sub calc_offset { + my($unit,$area,$dist_per_degree) = @_; + # Adjust the dist_per_degree for the unit chosen by the user + if ($unit =~ /miles/) { + $$dist_per_degree *= $KM2MILES; + } elsif ($unit =~ /nautic/) { + $$dist_per_degree *= $KM2NAUTICAL; + } + + # The offset for the coordinate is the distance to travel divided by + # the dist per degree + my $offset = sprintf("%.7f", ($area / 2) / $$dist_per_degree); + + #print "-\n".Dumper($area,\$dist_per_degree,$offset); + return($offset); +} #End calc_offset + +###################################################################### +# Opens a track file and returns two identically sized arrays, +# one that contains the latitudes and other that contains the +# longitudes. +###################################################################### +sub get_coords_for_track($) { + my $filename = shift; + + my @lats; + my @lons; + print "Opening Track file: $filename\n" if $debug; + my $fh = IO::File->new("<$filename"); + $fh or die("Error: $!"); + + my ($la, $lo, $oldla, $oldlo, $line, $delta_la, $delta_lo, $rest); + my ($step_la, $step_lo, $ste_la, $ste_lo); + + my $max_lat= 180; + my $max_lon= 90; + + $oldla = 0; + $oldlo = 0; + $step_la = ($DIFF * $scale) - ($DIFF * $scale) / 2; + $step_lo = ($DIFF * $scale) - ($DIFF * $scale) / 1.5; + + # loop through each line of the track file + while ($line = $fh->getline()) { + $line =~ s/^\s+//; + chomp $line; + ($la,$lo,$rest) = split(/\s+/, $line, 3); + + # Disallow blank lines, as gpsreplay uses them. Also disallow + # blank (undefined) fields in case of other possible + # wierdnesses. + + next if (!defined($lo)); + next if (!defined($la)); + + debug("pre-regex: ($la|$lo|$rest)"); + # Now a regex (applied to both lat & long) to drop cruft like + # leading text or trailing commas. Skip over anything that is + # not a digit, minus sign or decimal point. Then extract + # either an optional minus sign, one or more digits, a decimal + # point, 0 or more digits, or an optional minus sign, a + # decimal point and one or more digits. Ignore the rest. + $la =~ s/([^\d\-\.]*)(\-?\d+\.?\d*|-?\.\d+)(.*)/$2/o; + $lo =~ s/([^\d\-\.]*)(\-?\d+\.?\d*|-?\.\d+)(.*)/$2/o; + debug("post-regex: ($la|$lo|$rest)"); + next if ( $la == 1001 ) && ( $lo == 1001) ; + if ((($la != $oldla) || ($lo != $oldlo)) && ($la < $max_lat) && ($lo < $max_lon)) { + $delta_la = abs($la - $oldla); + $delta_lo = abs($lo - $oldlo); + if (($delta_la > $step_la) || ($delta_lo > $step_lo)) { + push(@lats, $la); + push(@lons, $lo); + $oldla = $la; + $oldlo = $lo; + } + } + } + + # Close the file and release lock or die. + $fh->close() or die("Error: $!"); + return (\@lats, \@lons); +} # end get_coords_for_track + +###################################################################### +# Creates a track between given waypoints. Returns two identically +# sized arrays, one that contains the latitudes and other that +# contains the longitudes. +###################################################################### +sub get_coords_for_route { + my @lats; + my @lons; + my @waypoints = @ARGV; + foreach $waypoint (@waypoints) { + # check if all given waypoints exist + &get_waypoint($waypoint); + } + + my (@start, @end, @delta, @steps); + my ($la, $lo, $i, $j); + + my $step_la = ($DIFF * $scale) - ($DIFF * $scale) / 2; + my $step_lo = ($DIFF * $scale) - ($DIFF * $scale) / 1.5; + + while (@waypoints > 1) { + # download maps for each etap + print("$waypoints[0] - $waypoints[1]\n"); + @start = &get_waypoint($waypoints[0]); + @end = &get_waypoint($waypoints[1]); + shift(@waypoints); + + $delta[0] = $start[0] - $end[0]; + $delta[1] = $start[1] - $end[1]; + $steps[0] = $delta[0] / $step_la; + $steps[1] = $delta[1] / $step_lo; + if ($steps[0] > $steps[1]) { + $i = abs(ceil($steps[0])); + } else { + $i = abs(ceil($steps[1])); + } + for ($j=1; $j<=$i; $j++) { + $la = $start[0] - ($delta[0] / $i)*$j; + $lo = $start[1] - ($delta[1] / $i)*$j; + push(@lats, $la); + push(@lons, $lo); + } + } + return (\@lats, \@lons); +} #End get_coords_for_track + + +###################################################################### +# Return KM/degree for this latitude +###################################################################### +sub calc_lon_dist { + my $lat = shift; + + my $PI = 3.141592654; + my $dr = $PI / 180; + + # calculate the circumference of the small circle at latitude + my $cos = cos($lat * $dr); # convert degrees to radians + my $circ_km = sprintf("%.2f",($PI * 2 * $RADIUS_KM * $cos)); + + # divide that by 360 and you have kilometers per degree + my $km_deg = sprintf("%.2f",($circ_km / 360)); + + return ($km_deg); +} #End calc_longitude_dist + +###################################################################### +# Check if Map-image is valid and append one Entry to the map_koord File +# Returns: +# A for Appended +# E for Error +###################################################################### +sub append_koords($$$$) { + my $filename = shift; + my $lati = shift; + my $long = shift; + my $mapscale = shift; + + # eliminate map_Directory prefix + $filename =~ s,^$mapdir,,; + + die "Missing Params to append_koords($filename,$lati,$long,$mapscale)\n" + unless $filename && defined($lati) && defined($long) && $mapscale; + + + if ( is_map_file($filename) ) { + # print "$filename $lati $long $mapscale\n"; + } elsif ( ! -s "$mapdir/$filename" ) { + print "Fehler $filename leer/existiert nicht\n"; + return 'E'; + } else { + print "Fehler $filename ist kein mapfile\n"; + return 'E'; + } + + if ( ! defined $MAP_FILES->{$filename} ) { + debug("Appending $filename,$lati, $long, $mapscale to $KOORD_FILE"); + open(KOORD,">>$KOORD_FILE") || die "ERROR: append_koords can't open: $KOORD_FILE: $!\n"; + printf KOORD "$filename %17.13f %17.13f %17d\n",$lati, $long, $mapscale; + close KOORD; + $MAP_FILES->{$filename} = "$lati, $long, $mapscale"; + $MAP_KOORDS->{$mapscale}->{$lati}->{$long} = 1; + } + + if ( -s $GPSTOOL_MAP_FILE ) { + if ( ! defined $GPSTOOL_MAP_FILES->{$filename} ) { + open(KOORD,">>$GPSTOOL_MAP_FILE") || + die "ERROR: append_koords can't open: $GPSTOOL_MAP_FILE: $!\n"; + printf KOORD "$mapdir/$filename %17.13f %17.13f %4d 1280 1024\n",$lati, $long, $mapscale; + close KOORD; + $GPSTOOL_MAP_FILES->{$filename} = "$lati, $long, $mapscale"; + $GPSTOOL_MAP_KOORDS->{$mapscale}->{$lati}->{$long} = 1; + } + } + + return 'A'; +} # End append_koords + + +############################################################################# +# Read actual Koordinate File and memorize in $MAP_KOORDS and $MAP_FILES +sub read_koord_file($) { + my $koord_file = shift; + + $MAP_FILES={}; + + my $s_time=time(); + unless ( -s $koord_file ) { + warn "ERROR: read_koord_file sees empty file '$koord_file'\n"; + return; + }; + print "reading $koord_file\n"; + open(KOORD,"<$koord_file") || die "ERROR: read_kooord_file can't open: $koord_file: $!\n"; + my $anz_files = 0; + while ( my $line = ) { + my ($filename ,$lati, $long, $mapscale); + ($filename ,$lati, $long, $mapscale) = split( /\s+/ , $line ); + if ( is_map_file( $filename ) ) { + $MAP_KOORDS->{$mapscale}->{$lati}->{$long} = 1; + $MAP_FILES->{$filename} = "$lati, $long, $mapscale"; + $anz_files ++; + } else { + warn "ERROR: read_koord_file is missing File $filename\n"; + }; + } + close KOORD; + my $r_time = time()-$s_time; + print "$koord_file read $anz_files in $r_time sec.\n"; + +} + +############################################################################# +# Read actual Koordinate File and memorize in $GPSTOOL_MAP_KOORDS and $GPSTOOL_MAP_FILES +sub read_gpstool_map_file() { + my $koord_file = $GPSTOOL_MAP_FILE; + my $s_time=time(); + return unless -s $koord_file; + print "reading $koord_file\n"; + open(KOORD,"<$koord_file") || die "ERROR: read_gpstool_map_file can't open: $koord_file: $!\n"; + my $anz_files = 0; + while ( my $line = ) { + my ($filename ,$lati, $long, $mapscale); + ($filename ,$lati, $long, $mapscale) = split( /\s+/ , $line ); + if ( is_map_file( $filename) ) { + $GPSTOOL_MAP_KOORDS->{$mapscale}->{$lati}->{$long} = 1; + $GPSTOOL_MAP_FILES->{$filename} = "$lati, $long, $mapscale"; + $anz_files ++; + } + } + close KOORD; + my $r_time = time()-$s_time; + print "$koord_file read $anz_files in $r_time sec.\n"; + +} + +############################################################################# +# Read actual Koordinate File (gpstool) +# and check if all Files it references are existing +sub check_koord_file($) { + my $koord_file = shift; + # Change into the gpsdrive maps directory + + print "Checking all entries in $koord_file\n" if $debug; + $MAP_FILES={}; + my $anz_files = 0; + my $missing_files =0; + if ( -s $koord_file ) { + open(KOORD,"<$koord_file") || die "ERROR: check_koord_file can't open: $koord_file: $!\n"; + while ( my $line = ) { + my ($filename ,$lati, $long, $mapscale); + ($filename ,$lati, $long, $mapscale) = split( /\s+/ , $line ); + my $full_filename = "$CONFIG_DIR/maps/$filename"; + +# debug("Checking ($filename ,$lati, $long, $mapscale)"); + + if ( !is_map_file( $full_filename ) ) { + print "ERROR: File $full_filename not found\n"; + $missing_files ++; + } else { + debug("OK: File $full_filename found"); + $MAP_KOORDS->{$mapscale}->{$lati}->{$long} = 1; + if ( $MAP_FILES->{$filename} ) { + print "ERROR: Duplicate File $full_filename found\n"; + }; + $MAP_FILES->{$filename} = "$lati, $long, $mapscale"; + $anz_files ++; + } + } + close KOORD; + print "Good files: $anz_files\n"; + } + if ( $missing_files ) { + print "Missing Files: $missing_files\n"; + open(KOORD,">$koord_file.new") || die "Can't open: $koord_file.new: $!\n"; + foreach my $map_filename ( keys %$MAP_FILES ) { + printf KOORD "$map_filename %s\n", $MAP_FILES->{$map_filename}; + } + close KOORD; + print "wrote $koord_file.new\n"; + } +} + + +########################################################################### +# Update Maps found in Filesystem which cannot be found in map_koords.txt +########################################################################### +use File::Find; +sub update_file_in_map_koords(); # {} +sub update_gpsdrive_map_koord_file(){ + print "\n"; + print "\n"; + print "Check, if Files in Filesystem can be added to map_koord.txt\n"; + + debug("Searching for Files in '$mapdir'"); + find( + { wanted => \&update_file_in_map_koords, + follow_skip => 2, + follow => 1 + }, + $mapdir, ); +} + +sub update_file_in_map_koords(){ + my $filename = $File::Find::name; + return if -d $filename; + return unless $filename =~ m/\.gif$/; + my $short_filename = $filename; + $short_filename =~ s,$mapdir,,; +# debug("Check File: $short_filename"); + if ( $MAP_FILES->{$filename} || + $MAP_FILES->{$short_filename} ) { +# print "OK $filename\n"; + } + else { + #mapblast/1000/047/047.0232/9/map_1000-047.0232-0009.8140.gif 47.02320 9.81400 1000 + if ( $filename =~ m/map_(\d+)-(\d+\.\d+)-(\d+\.\d+)\.gif/ ) { + my $scale=$1; + my $lati=$2; + my $long=$3; +# my ($url,$mapscale)=expedia_url($lati,$long,$scale); + for my $s (sort keys %{$Scale2Zoom->{$mapserver}} ) { + next unless $s == $scale; + $scale = $s; + last; + } +# print "Appending File: $filename\n"; + append_koords($short_filename, $lati, $long, $scale); + debug("File:$filename lat:$lati lon:$long"); + } + + } +} + + +###################################################################### +# See which area the maps cover +###################################################################### +sub check_coverage($){ + my $koord_file = shift; + read_koord_file($koord_file); + my @scales= sort {$b <=> $a} keys %{$MAP_KOORDS}; + + for my $scale ( @scales ) { + print "$scale:\n";; + + my @all_lons; + my %all_lons; + my @lats = sort {$a <=> $b} keys %{$MAP_KOORDS->{$scale}}; + for my $lat ( @lats ) { + my @lons = keys %{$MAP_KOORDS->{$scale}->{$lat}}; + for my $lon ( @lons ) { + push (@all_lons, $lon) + unless $all_lons{$lon}++; + } + } + + my $first_lon = $all_lons[0]; + my $last_lon = $all_lons[-1]; + + print "lon: ($first_lon - $last_lon))\n"; + print "lat: (desiredDistance, minDistance - maxDistance) Km\n"; + + for my $lat ( @lats ) { + printf " %7.4f: ", $lat; + my @lons = sort {$a <=> $b} keys %{$MAP_KOORDS->{$scale}->{$lat}}; + my %lons; + map { $lons{$_}++ } @lons; + + + # Find out which is the desired Distance + my $lon_dist_km = calc_lon_dist($lat); + my $k = $DIFF * $scale; + my $delta_lat = $k - ($k / 2); my $dlat = $delta_lat * $LAT_DIST_KM; + my $delta_lon = $k - ($k / 6); my $dlon = $delta_lon * $lon_dist_km; + + # Find Min and Max Distance between 2 Maps + my $min_dist= $RADIUS_KM; + my $max_dist=0; + my $count_overlaps=0; + my $prev_lon; + my %gap; + my %overlap; + for my $lon ( sort {$a <=> $b} @all_lons ) { + if ( defined $prev_lon ) { + my $dist = abs($lon - $prev_lon) * $lon_dist_km; + if( $dist < ($dlon * 0.9)) { + $overlap{$lon}++; + $count_overlaps++; + } + + $gap{$lon}=$dist /$dlon if $dist > ($dlon * 1.2); + $min_dist = $dist if $dist < $min_dist; + $max_dist = $dist if $dist > $max_dist; + } + #print "Dist: ( $min_dist - $max_dist) Km ($prev_lon => $lon = ".($prev_lon -$lon).")\n"; + $prev_lon = $lon; + }; + + printf " (%.2f,%.2f - %.2f) Km\t",$dlon,$min_dist,$max_dist; + printf " %d Overlaps\t",$count_overlaps if $count_overlaps; + #*= $LAT_DIST_KM; + + + + # Print +/- for existing/non-existing Map + for my $lon ( @all_lons ) { +# printf "%7.4f ", $lon; + # Print Number of Tiles missing(gap) between last(left) map and this one + printf " -%.0f ",$gap{$lon} if $gap{$lon}; + + if ( $lons{$lon} ) { + if ( $overlap{$lon} ) { + print "o"; + } else { + print "+"; + } + } else { + print "-"; + } + } + print "\n"; + } + print "\n"; + } + print "\n"; +} + +############################################################################# +# Debug +############################################################################# +sub debug($){ + my $msg = shift; + return unless $debug; + print STDERR "DEBUG: $msg\n"; +} + +################################################################################# + +__END__ + +=head1 NAME + +B Version 1.04 + +=head1 DESCRIPTION + +B is a program to download maps from a mapserver for use with gpsdrive. + +=head1 SYNOPSIS + +B + +gpsfetchmap -w -sc -a <#> -p + +gpsfetchmap -la -lo -sc -a <#> -p + +gpsfetchmap -sla -endla -slo -endlo -sc -a <#> -p + +gpsfetchmap -sc -a <#> -r ... -p + +B + +gpsfetchmap [-w ] + [-la ] [-lo ] + [-sla ] [-endla ] + [-slo ] [-endlo ] + [-sc ] [-a <#>] [-p] [-m ] + [-u ] [-md ] [-W ] [-t ] [-r] + [-C ] [-P ] [-F] [-d] [-v] [-h] [-M] [-n] [-U] [-c] + +=head1 OPTIONS + +=over 8 + +=item B<-w, --waypoint > + +Takes a waypoint name and uses the latitude and longitude for that waypoint as +the centerpoint of the area to be covered. Waypoints are read from 'way.txt', +or file defined by '-W'. +the special name gpsd asks your local gpsd where your gps thinks you are and uses +this point as center. +This, '-la' and '-lo', '-sla', '-ela', '-slo' and '-elo' or '-a' is required. +A special name is gpsd this waypoint asks your gps where you currently are. + +=item B<-la, --lat > + +Takes a latitude in format DD.MMMM and uses that as the latitude for the centerpoint of the area +to be covered. Will be overriden by the latitude of waypoint if '-w' is used. This and '-lo', '-w' or '-sla', '-ela', '-slo', '-elo' is required. + +=item B<-lo, --lon > + +Takes a longitude in format DD.MMMM and uses that as the longitude for the centerpoint of the area +to be covered. Will be overriden by the longitude of waypoint if '-w' is used. This and '-la', '-w' or '-sla', '-ela', '-slo', '-elo' is required. + +=item B<-sla --start-lat > + +Takes a latitude in format DD.MMMM and uses that as the start latitude for the area to be covered. Will override '-la' and '-lo' but will be overriden by '-w'. This, '-ela', '-slo' and '-elo' or '-w' or '-la' and '-lo' is required. + +=item B<-ela --end-lat > + +Takes a latitude in format DD.MMMM and uses that as the end latitude for the area to be covered. Will override '-la' and '-lo' but will be overriden by '-w'. +This, '-sla', '-slo' and '-elo' or '-w' or '-la' and '-lo' is required. + +=item B<-slo --start-lon > + +Takes a longitude in format DD.MMMM and uses that as the start longitude for the area to be covered. Will override '-la' and '-lo' but will be overriden by '-w'. This, '-sla', '-ela' and '-elo' or '-w' or '-la' and '-lo' is required. + +=item B<-elo --end-lon > + +Takes a longitude in format DD.MMMM and uses that as the end longitude for the area to be covered. Will override '-la' and '-lo' but will be overriden by '-w'. This, '-sla', '-ela' and '-slo' or '-w' or '-la' and '-lo' is required. + +=item B<-sc, --scale > + +Scales of map(s) to download. Default: 50000. + +Formats: + + '####' + - Just this scale. + + '####,####,####' + - All scales in the list. May be combined with other formats. + + '>####' + - All scales above and including the number given. + + '<####' + - All scales below and including the number given. + + '####-####' + - All scales from first to last number given. + +=item B<-a, --area <#>> + +Area to cover. # of 'units' size square around the centerpoint. You can use a single number +for square area. Or you can use '#x#' to do a rectangle, where the first number is distance +latitude and the second number is distance of longitude. 'units' is read from the configuration +file (-C) or as defined by (-u). + +=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. + +=item B<--mapserver > + +Mapserver to download from. Default: 'landsat'. +Currently can use: landsat + +geoscience, gov_au, incrementp and eniro have download stubs, +but they are !!!NOT!!!! in the right scale. + + +geoscience + +landsat covers the whole world with satelite Photos + +gov_au is for Australia + +incrementp for japanese Maps + +eniro covers: + eniro_se Sweden + eniro_dk Denmark + eniro_no Norway + eniro_fi Finnland + +Overview of Area covered by eniro_fi: + http://maps.eniro.com/servlets/fi_MapImageLocator?profile=Main¢er=26.;62.&zoomlevel=1&size=800x600 + + +=item B<-u, --unit > + +The measurement system to use. Default is read from configuration file <-C>. Possibles are: +miles, nautical, kilometers. + +=item B<--mapdir > + +Override the configfiles mapdir with this value. + +=item B<-W, --WAYPOINT > + +File to read waypoints from. Default: '~/.gpsdrive/way.txt'. + +=item B<-t, --track > + +Download maps that are along a saved track. File is a standard track filed saved from GpsDrive. + +=item B<-r, --route> + +Download maps that are along a route defined by waypoints. You must give a list of waypoints as parameters separated with space. + +=item B<-C, --CONFIG> + +File to read for GPSDrive configuration information. Default: '~/.gpsdrive/gpsdriverc'. + +=item B<-P, --PREFIX > + +Takes a prefix string to be used as the start of all saved map files. Default: "map_". + +=item B<-F, --FORCE> + +Force program to download maps without asking you to confirm the download. + +=item B<-n> + +Dont download anything only tell which maps are missing + +=item B<-U> + +read map_koord.txt file at Start. Then also check for not downloaded map_*.gif Files +if they need to be appended to map_koords.txt. + +=item B<--check-koordfile> + +Update map_koord.txt: search map Tree if map_*.gif file exist, but cannot +be found in map_koords.txt file. This option first reads the +map_koord.txt file and checks every Map in the filesystem if it also is +found in the map_koord.txt file. +If not found it is appended into the map_koord.txt file. + +Check map_koord.txt File. This option checks, if every Map also exist +If any Map-File is missing, a file map_koord.txt.new will be created. +This file can be copied to the original file if checked. + +=item B<--check-coverage> + +See which areas the maps cover. +Output is simple ASCII Art + +=item B<--PROXY> + +Set proxy for mirroring image Files + +=item B<-d, --debug> + +Prints debugging information. + +=item B<-v, --version> + +Prints version information and exits. + +=item B<--help -h -x> + +Prints the usage page and exits. + +=item B<--MAN -M> + +Prints the manual page and exits. + +=item B + +When downloading Maps the output reads as folows: + + + _ Map already exists in Filesystem + E Error while downloading Map + + Map got downloaded + u updated map_koords.txt File + S Simulate only + +=back + +=cut + --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/10-mapnikdir.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/10-mapnikdir.dpatch @@ -0,0 +1,252 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10-mapnikdir.dpatch by Andreas Putzo +## +## 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 @@ + + 5000 + [amenity]='post_box' +- ++ + + + 5000 + [amenity]='post_office' +- ++ + + + + 250000 + 25000 + [railway]='station' +- ++ + + + 25000 + [railway]='station' +- ++ + + + 50000 +@@ -127,51 +127,51 @@ + + 10000 + [amenity]='pub' +- ++ + + + 100000 + [natural]='peak' +- ++ + + + 5000 + [man_made]='mast' +- ++ + + + 10000 + [amenity]='recycling' +- ++ + + + + 20000 + [amenity]='hospital' +- ++ + + + + 5000 + [amenity]='bus_stop' or [highway]='bus_stop' +- ++ + + + + 20000 + [amenity]='parking' +- ++ + + + + 10000 + [amenity]='place_of_worship' +- ++ + + + 10000 + [amenity]='airport' +- ++ + + + +@@ -203,7 +203,7 @@ + + 50000 + [landuse] = 'cemetery' +- ++ + + + +@@ -1086,7 +1086,7 @@ + 100000 + 1000 + [railway] = 'rail' +- ++ + + + +@@ -1567,7 +1567,7 @@ + 100000 + 1000 + [railway] = 'preserved' +- ++ + + + +@@ -1579,19 +1579,19 @@ + [highway] = 'motorway' and [length] = 2 + 500000 + 100 +- ++ + + + [highway] = 'motorway' and [length] = 3 + 500000 + 100 +- ++ + + + [highway] = 'motorway' and [length] = 4 + 500000 + 100 +- ++ + + + [highway] = 'trunk' or [highway] = 'primary' or [highway] = 'secondary' +@@ -1628,12 +1628,12 @@ + + [oneway] = 'yes' or [oneway] = 'true' + 25000 +- ++ + + + [oneway] = '-1' + 25000 +- ++ + + + +@@ -1641,7 +1641,7 @@ + world-1 + + shape +- @DATA_DIR@/mapnik/world_boundaries/world_boundaries_m ++ @DATA_DIR@/world_boundaries/world_boundaries_m + + + +@@ -1649,7 +1649,7 @@ + world + + shape +- @DATA_DIR@/mapnik/world_boundaries/world_bnd_m ++ @DATA_DIR@/world_boundaries/world_bnd_m + + + +@@ -1657,7 +1657,7 @@ + coast-poly + + shape +- @DATA_DIR@/mapnik/world_boundaries/shoreline_a ++ @DATA_DIR@/world_boundaries/shoreline_a + + + +@@ -1665,7 +1665,7 @@ + coast-line + + shape +- @DATA_DIR@/mapnik/world_boundaries/shoreline_l ++ @DATA_DIR@/world_boundaries/shoreline_l + + + +@@ -1674,7 +1674,7 @@ + builtup + + shape +- @DATA_DIR@/mapnik/world_boundaries/builtup_area ++ @DATA_DIR@/world_boundaries/builtup_area + + + +@@ -1786,7 +1786,7 @@ + places + + shape +- @DATA_DIR@/mapnik/world_boundaries/places ++ @DATA_DIR@/world_boundaries/places + + + +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) ) { --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/03-manpage.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/03-manpage.dpatch @@ -0,0 +1,446 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03-manpage.dpatch by Andreas Putzo +## +## 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 ++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 + 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 + 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 ++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 ++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 + 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 + Initial position for simulation mode. Specify a + .IR "waypoint name" + from your currently used waypoint list. + .TP ++.B \-M ++Set GUI 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 ++Set to 1 to switch WAAS/EGNOS on, set to 0 to switch it off. ++.TP ++.B \-H ++Correct altitude. ++.TP ++.B \-C ++Set config file to . ++ + .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] --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/00list +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/00list @@ -0,0 +1,20 @@ +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 --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/60-sql.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/60-sql.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 60-sql.dpatch by Andreas Putzo +## +## 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); --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/85-settings.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/85-settings.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 85-settings.dpatch by Andreas Putzo +## +## 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 + #include + #include ++#include + #include + #include + #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) --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/30-icons.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/30-icons.dpatch @@ -0,0 +1,52 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30-icons.dpatch by Andreas Putzo +## +## 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) --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/90-usage.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/90-usage.dpatch @@ -0,0 +1,48 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 90-usage.dpatch by Andreas Putzo +## +## 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")); + + } + --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/97-osmxml.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/97-osmxml.dpatch @@ -0,0 +1,82 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 97-osmxml.dpatch by Andreas Putzo +## +## 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 @@ + + ++ ++ ++ ++ + + + ++ ++ ++ ++ + + leisure + +@@ -1729,7 +1749,6 @@ + + + +- + roads + + postgis +@@ -1781,12 +1800,4 @@ + true + + +- +- +- places +- +- shape +- @DATA_DIR@/world_boundaries/places +- +- + --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/40-backported.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/40-backported.dpatch @@ -0,0 +1,80 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 40-backported.dpatch by Andreas Putzo +## +## 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, --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/01-make.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/01-make.dpatch @@ -0,0 +1,266 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01-make.dpatch by Andreas Putzo +## +## 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 \ --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/20-homedir.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/20-homedir.dpatch @@ -0,0 +1,44 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 20-homedir.dpatch by Andreas Putzo +## +## 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; + } --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/98-mapnik-exception.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/98-mapnik-exception.dpatch @@ -0,0 +1,51 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 98-mapnik-exception.dpatch by Andreas Putzo +## +## 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 + #include + #include ++#include + #include + #include + +@@ -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; ++ } + } + + /* --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/99-autobestmap.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/99-autobestmap.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 99-autobestmap.dpatch by Andreas Putzo +## +## 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; --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/70-perl.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/70-perl.dpatch @@ -0,0 +1,362 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 70-perl.dpatch by Andreas Putzo +## +## 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; --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/101-signalposreq.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/101-signalposreq.dpatch @@ -0,0 +1,70 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 101-signalposreq.dpatch by Andreas Putzo +## +## 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); +-} --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/102-unittest.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/102-unittest.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 102-unittest.dpatch by Andreas Putzo +## +## 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) --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/96-mapnik-plugins-dir.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/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 +## +## 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"); + --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/95-newapi.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/95-newapi.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 95-newapi.dpatch by Francesco Paolo Lovergine +## +## 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; --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/80-dbus.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/80-dbus.dpatch @@ -0,0 +1,109 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 80-dbus.dpatch by Andreas Putzo +## +## 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); --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/100-fix-insecure-tempfiles.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/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 +## +## DP: Fix insecure tempfile creation in geo-code. +## DP: Thanks Moritz Muehlenhoff . + +@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 --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/patches/50-scripts.dpatch +++ gpsdrive-2.10~pre4-6.dfsg/debian/patches/50-scripts.dpatch @@ -0,0 +1,38 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 50-scripts.dpatch by Andreas Putzo +## +## DP: Update shebang line of gpsdrive_mapnik_gentiles.py to use python 2.5 (needed by mapnik). +## 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 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python2.5 + """GpsDrive Generate Mapnik Tiles + + Generates 1280x1024 Mapniktiles for GpsDrive +@@ -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 ; --- gpsdrive-2.10~pre4-6.dfsg.orig/debian/man/gpsfetchmap.1 +++ gpsdrive-2.10~pre4-6.dfsg/debian/man/gpsfetchmap.1 @@ -0,0 +1,327 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "GPSFETCHMAP 1" +.TH GPSFETCHMAP 1 "2007-10-04" "perl v5.8.8" "User Contributed Perl Documentation" +.SH "NAME" +\&\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. +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBCommon usages:\fR +.PP +gpsfetchmap \-w <\s-1WAYPOINT\s0 \s-1NAME\s0> \-sc <\s-1SCALE\s0> \-a <#> \-p +.PP +gpsfetchmap \-la \-lo \-sc <\s-1SCALE\s0> \-a <#> \-p +.PP +gpsfetchmap \-sla \-endla \-slo \-endlo \-sc <\s-1SCALE\s0> \-a <#> \-p +.PP +gpsfetchmap \-sc <\s-1SCALE\s0> \-a <#> \-r <\s-1WAYPOINT\s0 1> <\s-1WAYPOINT\s0 2> ... <\s-1WAYPOINT\s0 n> \-p +.PP +\&\fBAll options:\fR +.PP +gpsfetchmap [\-w <\s-1WAYPOINT\s0 \s-1NAME\s0>] + [\-la ] [\-lo ] + [\-sla ] [\-endla ] + [\-slo ] [\-endlo ] + [\-sc <\s-1SCALE\s0>] [\-a <#>] [\-p] [\-m <\s-1MAPSERVER\s0>] + [\-u <\s-1UNIT\s0>] [\-md <\s-1DIR\s0>] [\-W <\s-1FILE\s0>] [\-t <\s-1FILE\s0>] [\-r] + [\-C <\s-1FILE\s0>] [\-P <\s-1PREFIX\s0>] [\-F] [\-d] [\-v] [\-h] [\-M] [\-n] [\-U] [\-c] +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-w, \-\-waypoint <\s-1WAYPOINT\s0 \s-1NAME\s0\fR>" 8 +.IX Item "-w, --waypoint " +Takes a waypoint name and uses the latitude and longitude for that waypoint as +the centerpoint of the area to be covered. Waypoints are read from 'way.txt', +or file defined by '\-W'. +the special name gpsd asks your local gpsd where your gps thinks you are and uses +this point as center. +This, '\-la' and '\-lo', '\-sla', '\-ela', '\-slo' and '\-elo' or '\-a' is required. +A special name is gpsd this waypoint asks your gps where you currently are. +.IP "\fB\-la, \-\-lat " 8 +.IX Item "-la, --lat " +Takes a latitude in format \s-1DD\s0.MMMM and uses that as the latitude for the centerpoint of the area +to be covered. Will be overriden by the latitude of waypoint if '\-w' is used. This and '\-lo', '\-w' or '\-sla', '\-ela', '\-slo', '\-elo' is required. +.IP "\fB\-lo, \-\-lon " 8 +.IX Item "-lo, --lon " +Takes a longitude in format \s-1DD\s0.MMMM and uses that as the longitude for the centerpoint of the area +to be covered. Will be overriden by the longitude of waypoint if '\-w' is used. This and '\-la', '\-w' or '\-sla', '\-ela', '\-slo', '\-elo' is required. +.IP "\fB\-sla \-\-start\-lat " 8 +.IX Item "-sla --start-lat " +Takes a latitude in format \s-1DD\s0.MMMM and uses that as the start latitude for the area to be covered. Will override '\-la' and '\-lo' but will be overriden by '\-w'. This, '\-ela', '\-slo' and '\-elo' or '\-w' or '\-la' and '\-lo' is required. +.IP "\fB\-ela \-\-end\-lat " 8 +.IX Item "-ela --end-lat " +Takes a latitude in format \s-1DD\s0.MMMM and uses that as the end latitude for the area to be covered. Will override '\-la' and '\-lo' but will be overriden by '\-w'. +This, '\-sla', '\-slo' and '\-elo' or '\-w' or '\-la' and '\-lo' is required. +.IP "\fB\-slo \-\-start\-lon " 8 +.IX Item "-slo --start-lon " +Takes a longitude in format \s-1DD\s0.MMMM and uses that as the start longitude for the area to be covered. Will override '\-la' and '\-lo' but will be overriden by '\-w'. This, '\-sla', '\-ela' and '\-elo' or '\-w' or '\-la' and '\-lo' is required. +.IP "\fB\-elo \-\-end\-lon " 8 +.IX Item "-elo --end-lon " +Takes a longitude in format \s-1DD\s0.MMMM and uses that as the end longitude for the area to be covered. Will override '\-la' and '\-lo' but will be overriden by '\-w'. This, '\-sla', '\-ela' and '\-slo' or '\-w' or '\-la' and '\-lo' is required. +.IP "\fB\-sc, \-\-scale <\s-1SCALE\s0\fR>" 8 +.IX Item "-sc, --scale " +Scales of map(s) to download. Default: 50000. +.Sp +Formats: +.Sp +.Vb 2 +\& \(aq####\(aq +\& \- Just this scale. +.Ve +.Sp +.Vb 2 +\& \(aq####,####,####\(aq +\& \- All scales in the list. May be combined with other formats. +.Ve +.Sp +.Vb 2 +\& \(aq>####\(aq +\& \- All scales above and including the number given. +.Ve +.Sp +.Vb 2 +\& \(aq<####\(aq +\& \- All scales below and including the number given. +.Ve +.Sp +.Vb 2 +\& \(aq####\-####\(aq +\& \- All scales from first to last number given. +.Ve +.IP "\fB\-a, \-\-area <#\fR>" 8 +.IX Item "-a, --area <#>" +Area to cover. # of 'units' size square around the centerpoint. You can use a single number +for square area. Or you can use '#x#' to do a rectangle, where the first number is distance +latitude and the second number is distance of longitude. 'units' is read from the configuration +file (\-C) or as defined by (\-u). +.IP "\fB\-p, \-\-polite\fR" 8 +.IX Item "-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. +.IP "\fB\-\-mapserver <\s-1MAPSERVER\s0\fR>" 8 +.IX Item "--mapserver " +Mapserver to download from. Default: 'landsat'. +Currently can use: landsat +.Sp +geoscience, gov_au, incrementp and eniro have download stubs, +but they are !!!NOT!!!! in the right scale. +.Sp +geoscience +.Sp +landsat covers the whole world with satelite Photos +.Sp +gov_au is for Australia +.Sp +incrementp for japanese Maps +.Sp +eniro covers: + eniro_se Sweden + eniro_dk Denmark + eniro_no Norway + eniro_fi Finnland +.Sp +Overview of Area covered by eniro_fi: + http://maps.eniro.com/servlets/fi_MapImageLocator?profile=Main¢er=26.;62.&zoomlevel=1&size=800x600 +.IP "\fB\-u, \-\-unit <\s-1UNIT\s0\fR>" 8 +.IX Item "-u, --unit " +The measurement system to use. Default is read from configuration file <\-C>. Possibles are: +miles, nautical, kilometers. +.IP "\fB\-\-mapdir <\s-1DIR\s0\fR>" 8 +.IX Item "--mapdir " +Override the configfiles mapdir with this value. +.IP "\fB\-W, \-\-WAYPOINT <\s-1FILE\s0\fR>" 8 +.IX Item "-W, --WAYPOINT " +File to read waypoints from. Default: '~/.gpsdrive/way.txt'. +.IP "\fB\-t, \-\-track <\s-1FILE\s0\fR>" 8 +.IX Item "-t, --track " +Download maps that are along a saved track. File is a standard track filed saved from GpsDrive. +.IP "\fB\-r, \-\-route\fR" 8 +.IX Item "-r, --route" +Download maps that are along a route defined by waypoints. You must give a list of waypoints as parameters separated with space. +.IP "\fB\-C, \-\-CONFIG\fR" 8 +.IX Item "-C, --CONFIG" +File to read for GPSDrive configuration information. Default: '~/.gpsdrive/gpsdriverc'. +.IP "\fB\-P, \-\-PREFIX <\s-1PREFIX\s0\fR>" 8 +.IX Item "-P, --PREFIX " +Takes a prefix string to be used as the start of all saved map files. Default: \*(L"map_\*(R". +.IP "\fB\-F, \-\-FORCE\fR" 8 +.IX Item "-F, --FORCE" +Force program to download maps without asking you to confirm the download. +.IP "\fB\-n\fR" 8 +.IX Item "-n" +Dont download anything only tell which maps are missing +.IP "\fB\-U\fR" 8 +.IX Item "-U" +read map_koord.txt file at Start. Then also check for not downloaded map_*.gif Files +if they need to be appended to map_koords.txt. +.IP "\fB\-\-check\-koordfile\fR" 8 +.IX Item "--check-koordfile" +Update map_koord.txt: search map Tree if map_*.gif file exist, but cannot +be found in map_koords.txt file. This option first reads the +map_koord.txt file and checks every Map in the filesystem if it also is +found in the map_koord.txt file. +If not found it is appended into the map_koord.txt file. +.Sp +Check map_koord.txt File. This option checks, if every Map also exist +If any Map-File is missing, a file map_koord.txt.new will be created. +This file can be copied to the original file if checked. +.IP "\fB\-\-check\-coverage\fR" 8 +.IX Item "--check-coverage" +See which areas the maps cover. +Output is simple \s-1ASCII\s0 Art +.IP "\fB\-\-PROXY\fR" 8 +.IX Item "--PROXY" +Set proxy for mirroring image Files +.IP "\fB\-d, \-\-debug\fR" 8 +.IX Item "-d, --debug" +Prints debugging information. +.IP "\fB\-v, \-\-version\fR" 8 +.IX Item "-v, --version" +Prints version information and exits. +.IP "\fB\-\-help \-h \-x\fR" 8 +.IX Item "--help -h -x" +Prints the usage page and exits. +.IP "\fB\-\-MAN \-M\fR" 8 +.IX Item "--MAN -M" +Prints the manual page and exits. +.IP "\fBDownload\fR" 8 +.IX Item "Download" +When downloading Maps the output reads as folows: +.Sp +.Vb 5 +\& _ Map already exists in Filesystem +\& E Error while downloading Map +\& + Map got downloaded +\& u updated map_koords.txt File +\& S Simulate only +.Ve