debian/0000755000000000000000000000000012206723617007174 5ustar debian/NEWS.Debian0000644000000000000000000000070212206723617011053 0ustar garmin-forerunner-tools (0.09-2) unstable; urgency=low * The package now installs udev rules to make the garmin device accessible to any member of the "plugdev" group. -- Ralf Treinen Thu, 28 Aug 2008 22:24:52 +0200 garmin-forerunner-tools (0.09-1) unstable; urgency=low * This package now contains the new tools garmin_gpx and garmin_gchart. -- Ralf Treinen Sun, 03 Aug 2008 19:33:25 +0200 debian/changelog0000644000000000000000000001057012206723617011051 0ustar garmin-forerunner-tools (0.10repacked-4) unstable; urgency=low * patch gcc4.8: Fix Segmentation Fault when compiled with gcc4.8 (closes: #720710). Patch by Jared Casper downloaded from the upstream issue tracker. -- Ralf Treinen Mon, 26 Aug 2013 21:06:50 +0200 garmin-forerunner-tools (0.10repacked-3) unstable; urgency=low * patch exit_on_unpack_failure: make the function garmin_unpack_chunk exit the program when the input file name has an unknown suffix, or when the length of an input chunk is not as expected. (closes: #715938,#715939,#715940,#715941) -- Ralf Treinen Thu, 11 Jul 2013 22:00:44 +0200 garmin-forerunner-tools (0.10repacked-2) unstable; urgency=low * debian/copyright: machine-readable format 1.0 -- Ralf Treinen Mon, 20 May 2013 13:48:11 +0200 garmin-forerunner-tools (0.10repacked-1) experimental; urgency=low [ Christian Perrier ] * Add build-arch and build-indep build targets [ Ralf Treinen ] * debian/watch: drop the googlecode redirector which is no longer needed, use instead a direct url following the instructions on http://wiki.debian.org/debian/watch. * add patch hurd_no_path_max: Do not use PATH_MAX on hurd (closes: #693285) * Standards-Version 3.9.4 (no change) * debian/rules: pass dpkg buildflags to ./configure * blacklisting the garmin_gps kernel module (closes: #696147): - add debian/garmin-forerunner-tools.modprobe - debian/rules: call dh_installmodules - Remove the README.Debian file which is now redundant. * add debian/gbp.conf to enforce use of pristine-tar. Rebuild orig.tar.gz with pristine tar. -- Ralf Treinen Sun, 23 Dec 2012 19:40:38 +0100 garmin-forerunner-tools (0.10-3) unstable; urgency=low [ Ralf Treinen ] * debian/watch: use the googlecode.debian.net redirector service. * debian/copyright: fix licence, one may choose later versions of GPL. * Standards-Version 3.9.2 (no change) * Add dependency on ${misc:Depends} [ Christian Perrier ] * Drop .la file from /usr/lib. Closes: #621287 * output laps, hr and cad (heart rate and cadence) into gpx file Closes: #589948 -- Ralf Treinen Wed, 11 May 2011 23:31:26 +0200 garmin-forerunner-tools (0.10-2) unstable; urgency=low * Debian/watch: use complete path for download url (closes: #550736). Thanks a lot to Yan Morin for the patch! * Converted to source format 3.0 (quilt): - added debian/source/format * Standards-Version 3.8.3 (no change) -- Ralf Treinen Thu, 03 Dec 2009 21:12:31 +0100 garmin-forerunner-tools (0.10-1) unstable; urgency=low [ Noèl Köthe ] * debian/control added Vcs-Git and Vcs-Browser [ Ralf Treinen ] * New upstream release (closes: #521490). * Standards-Version 3.8.1 (no change) * debian/copyright: point to GPL-2 * Renamed files in debian/: {dirs,docs} -> garmin-forerunner-tools.{dirs,docs} -- Ralf Treinen Sat, 28 Mar 2009 15:36:37 +0100 garmin-forerunner-tools (0.09-2) unstable; urgency=low * Libtoolize with newer version of libtools (closes: #493696). * Add Uploader Noèl Köthe. * Install udev rule for foreunner devices. * Long description: explain difference to gpsbabel. -- Ralf Treinen Sun, 31 Aug 2008 17:07:20 +0200 garmin-forerunner-tools (0.09-1) unstable; urgency=low * New upstream release (closes: #491639). This release now contains the new tools garmin_gpx (closes: #483992) and garmin_gchart. * Added a NEWS.Debian file. * Updated package description to include the Edge series, and conversion to gpx. * Standards-Version 3.8.0 (no change). * debian/rules clean target: use upstream's distclean, not clean * configure: pass explicit --mandir to fix a bug in upstream's configure -- Ralf Treinen Sun, 03 Aug 2008 20:06:50 +0200 garmin-forerunner-tools (0.07-2) unstable; urgency=low * debian/rules: fix bashism (Closes: #478384). -- Ralf Treinen Wed, 30 Apr 2008 23:04:52 +0200 garmin-forerunner-tools (0.07-1) unstable; urgency=low * New upstream release -- Ralf Treinen Wed, 02 Apr 2008 18:57:44 +0200 garmin-forerunner-tools (0.05-1) unstable; urgency=low * Initial release (Closes: #467039) -- Ralf Treinen Sun, 30 Mar 2008 22:17:34 +0200 debian/garmin-forerunner-tools.udev0000644000000000000000000000010312206723617014651 0ustar ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", GROUP="plugdev" debian/source/0000755000000000000000000000000012206723617010474 5ustar debian/source/format0000644000000000000000000000001412206723617011702 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000426212206723617010260 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) INSTALLDIR = $(CURDIR)/debian/garmin-forerunner-tools config.status: configure dh_testdir [ -h config.guess ] || { mv config.guess config.guess.upstream; \ ln -s /usr/share/misc/config.guess; } [ -h config.sub ] || { mv config.sub config.sub.upstream; \ ln -s /usr/share/misc/config.sub; } ./configure --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --mandir=/usr/share/man \ $(shell dpkg-buildflags --export=configure) # LDFLAGS="-Wl,-z,defs" build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: config.status dh_testdir $(MAKE) touch $@ clean: dh_testdir dh_testroot rm -f build-stamp [ ! -e Makefile ] || $(MAKE) distclean [ ! -h config.guess ] || mv config.guess.upstream config.guess [ ! -h config.sub ] || mv config.sub.upstream config.sub -rm config.status config.log Makefile dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) DESTDIR=$(INSTALLDIR) install cd doc/man; $(MAKE) DESTDIR=$(INSTALLDIR) install # *.la files dropped: see #621287 rm $(INSTALLDIR)/usr/lib/libgarmintools.la cp debian/lintian-overrides \ $(INSTALLDIR)/usr/share/lintian/overrides/garmin-forerunner-tools binary-indep: build install binary-arch: build install dh_testdir dh_testroot dh_installchangelogs ChangeLog dh_installdocs dh_installexamples dh_installmodules dh_installudev dh_link dh_makeshlibs dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debian/watch0000644000000000000000000000015112206723617010222 0ustar version=3 http://code.google.com/p/garmintools/downloads/list?can=1 \ .*/garmintools-(\d[\d.]*)\.tar\.gz debian/copyright0000644000000000000000000000133712206723617011133 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: garmintools Upstream-Contact: Dave Bailey Source: http://code.google.com/p/garmintools/downloads/list Files: * Copyright: (C) 2006-2008 Dave Bailey License: GPL2+ Files: debian/* Copyright: (C) 2008-2013 Ralf Treinen License: GPL2+ License: GPL2+ 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. . On Debian systems, the complete text of the GNU General Public License can be found in the /usr/share/common-licenses/GPL-2 file. debian/patches/0000755000000000000000000000000012206723617010623 5ustar debian/patches/exit_on_unpack_failure0000644000000000000000000000167112206723617015270 0ustar Author: Ralf Treinen Description: garmin_unpack_chunk exits when unexpected data is found. Debian-bug: #715938, #715939, #715940, #715941 Index: garmin-forerunner-tools/src/unpack.c =================================================================== --- garmin-forerunner-tools.orig/src/unpack.c 2013-07-11 21:52:51.000000000 +0200 +++ garmin-forerunner-tools/src/unpack.c 2013-07-11 21:55:18.000000000 +0200 @@ -1139,13 +1139,15 @@ if ( unpacked != chunk ) { /* unpacked the wrong number of bytes! */ - printf("garmin_unpack_chunk: unpacked %d bytes (expecting %d)\n", + printf("garmin_unpack_chunk: unpacked %d bytes (expecting %d). Exiting.\n", unpacked,chunk); + exit(1); } } else { /* unknown file format */ - printf("garmin_unpack_chunk: not a .gmn file\n"); + printf("garmin_unpack_chunk: not a .gmn file. Exiting.\n"); + exit(1); } return data; debian/patches/hurd_no_path_max0000644000000000000000000000225212206723617014066 0ustar Author: Ralf Treinen Description: Do not use PATH_MAX on hurd Index: garmin-forerunner-tools/src/run.c =================================================================== --- garmin-forerunner-tools.orig/src/run.c 2012-11-19 20:29:13.000000000 +0100 +++ garmin-forerunner-tools/src/run.c 2012-11-19 20:42:27.000000000 +0100 @@ -199,19 +199,31 @@ time_t start_time; char filename[BUFSIZ]; char * filedir = NULL; +#ifdef __GNU__ + char * path = NULL; +#else char path[PATH_MAX]; +#endif /* __GNU__ */ char filepath[BUFSIZ]; struct tm * tbuf; if ( (filedir = getenv("GARMIN_SAVE_RUNS")) != NULL ) { +#ifdef __GNU__ + filedir = realpath(filedir,NULL); +#else filedir = realpath(filedir,path); +#endif /* __GNU__ */ if ( filedir == NULL ) { printf("GARMIN_SAVE_RUNS: %s: %s\n", getenv("GARMIN_SAVE_RUNS"),strerror(errno)); } } if ( filedir == NULL ) { +#ifdef __GNU__ + filedir = getcwd(path,0); +#else filedir = getcwd(path,sizeof(path)); +#endif /* __GNU__ */ } printf("Extracting data from Garmin %s\n", debian/patches/series0000644000000000000000000000011712206723617012037 0ustar output_laps_hr_cad_in_gpx.patch hurd_no_path_max exit_on_unpack_failure gcc4.8 debian/patches/gcc4.80000644000000000000000000000110312206723617011527 0ustar Description: Fix the size of data in garmin_packet. This caused a segmentation fault when compiled with gcc4.8 Author: Jared Casper Debian-Bug: #720710 --- garmin-forerunner-tools.orig/src/garmin.h +++ garmin-forerunner-tools/src/garmin.h @@ -1509,7 +1509,7 @@ uint8 reserved4; uint8 reserved5; uint8 size[4]; /* bytes 8-11 */ - uint8 data[1]; /* bytes 12+ */ + uint8 data[1012]; /* bytes 12+ */ } packet; char data[1024]; } garmin_packet; debian/patches/output_laps_hr_cad_in_gpx.patch0000644000000000000000000001736012206723617017076 0ustar Description: output laps, hr and cad (heart rate and cadence) into gpx file Origin: http://garmintools.googlecode.com/issues/attachment?aid=753452771107486670&name=gpx_laps_hr_cad-02.diff&token=3687b3d9e5e5f0f3d55e4131ce69eb3d Bug: https://code.google.com/p/garmintools/issues/detail?id=15 Bug-Debian: http://bugs.debian.org/589948 Forwarded: not-needed Index: garmin-forerunner-tools/src/garmin_gpx.c =================================================================== --- garmin-forerunner-tools.orig/src/garmin_gpx.c +++ garmin-forerunner-tools/src/garmin_gpx.c @@ -20,6 +20,7 @@ #include "config.h" #include #include +#include #include #include "garmin.h" @@ -34,16 +35,21 @@ { float lat, lon, elev; time_t t; + int lap; + int pause; + uint8 hr; + uint8 cad; } route_point; int -get_gpx_data ( garmin_data * data, - route_point ** points, +get_gpx_data ( garmin_data * fulldata, + route_point *** tracks, position_type * sw, position_type * ne ) { garmin_list * dlist; garmin_list_node * node; + garmin_list_node * lapnode; garmin_data * point; D304 * d304; route_point * rp; @@ -52,9 +58,28 @@ float minlon = 180.0; float maxlon = -180.0; int ok = 0; + garmin_data * data; + garmin_list * glaps; + garmin_data* points; - if ( data != NULL ) { - data = garmin_list_data(data,2); + if ( fulldata != NULL ) { + + // lists: 1=laps, 2=points + + glaps=garmin_list_data(fulldata,1)->data; // get lap information + + // fixme: crash if we didn't get it + int laps=glaps->elements+1; + + *tracks = malloc(sizeof(route_point) * (laps)); + memset(*tracks,0,laps*sizeof(route_point)); + + int curlapnum=0; + + lapnode=glaps->head; + D1015* lapdata=lapnode->data->data; + + data = garmin_list_data(fulldata, 2); // get track points if ( data == NULL ) { @@ -64,30 +89,81 @@ dlist = data->data; - *points = malloc(sizeof(route_point) * (dlist->elements+1)); - rp = *points; + points = malloc(sizeof(route_point) * (dlist->elements+1+(laps*2))); + (*tracks)[curlapnum]=points; + rp = points; - for ( node = dlist->head; node != NULL; node = node->next ) { - point = node->data; - if ( point->type == data_D304 ) { + int pause=0; - d304 = point->data; + for ( node = dlist->head; node != NULL; node = node->next ) { + point = node->data; - if ( d304->posn.lat == 0x7fffffff && d304->posn.lon == 0x7fffffff ) - continue; + switch (point->type) { + case data_D304: // position point - rp->lat = SEMI2DEG(d304->posn.lat); - rp->lon = SEMI2DEG(d304->posn.lon); - rp->elev = d304->alt; - rp->t = d304->time; - - if ( rp->lat < minlat ) minlat = rp->lat; - if ( rp->lat > maxlat ) maxlat = rp->lat; - if ( rp->lon < minlon ) minlon = rp->lon; - if ( rp->lon > maxlon ) maxlon = rp->lon; + d304 = point->data; - ++rp; - } + if ( d304->posn.lat == 0x7fffffff && d304->posn.lon == 0x7fffffff ) { + pause++; + continue; + } + + rp->lap=0; + if (lapdata!=NULL) { + if (d304->time >= lapdata->start_time) { + if (curlapnum>0) { + rp->t=0; // end previous lap + rp++; + (*tracks)[curlapnum]=rp; // new track + } + curlapnum++; + + rp->lap=curlapnum; + if (d304->time != lapdata->start_time) { + // if lap start point doesn't exist, create it + rp->lat = SEMI2DEG(lapdata->begin.lat); + rp->lon = SEMI2DEG(lapdata->begin.lon); + + rp->elev = d304->alt; // lap data doesn't contain alt :( + rp->hr=d304->heart_rate; + rp->cad=d304->cadence; + + rp->t = lapdata->start_time; + rp++; + rp->lap=0; + rp->pause=0; + } + lapnode=lapnode->next; + if (lapnode!=NULL) + lapdata=lapnode->data->data; + else + lapdata=NULL; // last lap + } + } + + rp->lat = SEMI2DEG(d304->posn.lat); + rp->lon = SEMI2DEG(d304->posn.lon); + rp->elev = d304->alt; + rp->t = d304->time; + rp->hr=d304->heart_rate; + rp->cad=d304->cadence; + + + if (pause==2) { + rp->pause=1; + pause=0; + } else rp->pause=0; + + if ( rp->lat < minlat ) minlat = rp->lat; + if ( rp->lat > maxlat ) maxlat = rp->lat; + if ( rp->lon < minlon ) minlon = rp->lon; + if ( rp->lon > maxlon ) maxlon = rp->lon; + + ++rp; + break; + default: //printf("unknown frame %i\n", point->type); + ; + } } rp->t = 0; @@ -152,11 +228,15 @@ { print_spaces(fp,spaces); fprintf(fp,"\n"); - fprintf(fp,"\n"); + "xmlns:gpxtpx=\"http://www.garmin.com/xmlschemas/TrackPointExtension/v1\"\n" + "xmlns=\"http://www.topografix.com/GPX/1/1\"\n" + "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 " + "http://www.topografix.com/GPX/1/1/gpx.xsd " + "http://www.garmin.com/xmlschemas/TrackPointExtension/v1 " + "http://www8.garmin.com/xmlschemas/TrackPointExtensionv1.xsd\">\n"); } static void @@ -192,11 +272,37 @@ route_point * rp = points; while (rp->t > 0) { print_spaces(fp, spaces); - fprintf(fp, "\n", rp->lat, rp->lon); + fprintf(fp, "\n", rp->lat, rp->lon); print_spaces(fp, spaces+2); fprintf(fp, "%f\n", rp->elev); print_time_tag(rp->t + TIME_OFFSET, fp, spaces+2); - print_close_tag("rtept", fp, spaces); + if (rp->lap) { + print_spaces(fp, spaces+2); + fprintf(fp,"Lap %i\n",rp->lap); + } else if (rp->pause) { + print_spaces(fp, spaces+2); + fprintf(fp,"Pause\n"); + } + + if ((rp->hr != 0) || (rp->cad != 0xff)) { + print_spaces(fp, spaces+2); + fprintf(fp,"\n"); + print_spaces(fp, spaces+2); + fprintf(fp,"\n"); + if (rp->hr != 0) { + print_spaces(fp, spaces+4); + fprintf(fp,"%i\n",rp->hr); + } + if (rp->cad != 0xff) { + print_spaces(fp, spaces+4); + fprintf(fp,"%i\n",rp->cad); + } + + print_close_tag("gpxtpx:TrackPointExtension", fp, spaces+2); + print_close_tag("extensions", fp, spaces+2); + } + + print_close_tag("trkpt", fp, spaces); ++rp; } } @@ -204,20 +310,29 @@ void print_gpx_data ( garmin_data * data, FILE * fp, int spaces ) { - route_point * points = NULL; + route_point ** laps = NULL; + route_point * points; position_type sw; position_type ne; - - if ( get_gpx_data(data,&points,&sw,&ne) != 0 ) { + + if ( get_gpx_data(data,&laps,&sw,&ne) != 0 ) { print_gpx_header(fp,spaces); print_time_tag(time(NULL),fp,spaces); print_bounds_tag(&sw,&ne,fp,spaces); - print_open_tag("rte",fp,spaces); - print_route_points(points,fp,spaces+2); - print_close_tag("rte",fp,spaces); + + int i; + print_open_tag("trk",fp,spaces); + for (i=0; laps[i]!=NULL; i++) { + points=laps[i]; + print_open_tag("trkseg",fp,spaces); + print_route_points(points,fp,spaces+2); + print_close_tag("trkseg",fp,spaces); + } + print_close_tag("trk",fp,spaces); print_close_tag("gpx",fp,spaces); - - if ( points != NULL ) free(points); + + free(laps[i]); + free(laps); } } debian/gbp.conf0000644000000000000000000000003612206723617010612 0ustar [DEFAULT] pristine-tar = True debian/garmin-forerunner-tools.manpages0000644000000000000000000000013512206723617015506 0ustar debian/garmin_dump.1 debian/garmin_get_info.1 debian/garmin_gmap.1 debian/garmin_save_runs.1 debian/lintian-overrides0000644000000000000000000000017412206723617012557 0ustar non-dev-pkg-with-shlib-symlink usr/lib/libgarmin.so.4.2.0 usr/lib/libgarmin.so package-name-doesnt-match-sonames libgarmin4 debian/garmin-forerunner-tools.docs0000644000000000000000000000002612206723617014642 0ustar BUGS NEWS README TODO debian/compat0000644000000000000000000000000212206723617010372 0ustar 5 debian/control0000644000000000000000000000256112206723617010603 0ustar Source: garmin-forerunner-tools Section: utils Priority: extra Maintainer: Debian running develpment group Uploaders: Noèl Köthe , Ralf Treinen , Christian Perrier Build-Depends: debhelper (>= 5.0.45), autotools-dev, libusb-dev Standards-Version: 3.9.4 Homepage: http://garmintools.googlecode.com Vcs-Git: git://git.debian.org/git/pkg-running/garmin-forerunner-tools.git Vcs-Browser: http://git.debian.org/?p=pkg-running/garmin-forerunner-tools.git;a=summary Package: garmin-forerunner-tools Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: retrieve data from Garmin Forerunner/Edge GPS devices This package contains command-line tools to retrieve data from GPS devices from the Garmin Forerunner series (these are wristwatch-like devices that allow you to register your exact itinerary when doing outdoor sports) or the Garmin Edge series (the same for cycling computers). It works with the Forerunner 205 and 305 models and with the Edge 305 model, and possibly others. Track data can be translated into an XML format and into gpx, and into a polyline format for use with Google maps. . In contrast to the gpsbabel software, this software also downloads data specific to usage in sports like maximal speed, lap summary, calorie consumption, etc. debian/garmin-forerunner-tools.dirs0000644000000000000000000000004512206723617014654 0ustar usr/bin usr/share/lintian/overrides debian/garmin-forerunner-tools.modprobe0000644000000000000000000000010612206723617015520 0ustar # garmin_gps gets in the way of forerunner-tools blacklist garmin_gps