File garmintools.spec of Package garmintools

#
# spec file for package garmintools
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild

Name:           garmintools
BuildRequires:  gcc libusb-devel

Version:        0.09
%define         libgarminmajor 4
%define         libgarminversion %{libgarminmajor}.2.0
Release:        0
Summary:        A Linux interface to the Garmin Forerunner GPS units
Group:          Hardware/Other
License:        GPL
URL:            http://code.google.com/p/garmintools/
Source0:        %{name}-%{version}.tar.bz2
Source1:        51-garmin.rules
Source2:        garmintools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       libgarmin%{libgarminmajor} = %{libgarminversion}
Packager:       Daniel Bornkessel

%description
This software provides Linux users with the ability to communicate with the Garmin Forerunner 305 via the USB interface. While this is the only Garmin unit that I own, I did implement all of the documented Garmin protocols as of Rev C (May 19, 2006) over the USB physical link. This means that if you have a Garmin with a USB connection to a PC, you ought to be able to use this software to communicate with it.

If you're looking for a complete solution to all of your Linux Garmin GPS needs, this is not it. I own a Garmin Forerunner 305 and wrote this code specifically so I could download and save data from that particular GPS unit to my Linux machine. I tried gpsbabel, but found that it did not have command line options specific to the Forerunner run and lap data - all I could do was get the tracklog. That's how all of this got started. I also wanted a few other things, like the ability to convert a track log into a Google maps encoded polyline, and (eventually) the ability to generate PNG images of heart rate and elevation data.

%package -n libgarmin%{libgarminmajor}
Summary: Garmin lib
Version: %{libgarminversion}
Group:   Hardware/Other
Packager:       Daniel Bornkessel
%description -n libgarmin%{libgarminmajor}
garmin lib


%package -n libgarmin%{libgarminmajor}-devel
Summary: Garmin lib devel files
Version: %{libgarminversion}
Group:   Development/Hardware/Other
Requires: libgarmin%{libgarminmajor} = %{libgarminversion}
Packager:       Daniel Bornkessel
%description -n libgarmin%{libgarminmajor}-devel
garmin lib devel


%prep
%setup

%build
%configure

%install
%makeinstall
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{udev/rules.d/,modprobe.d}
cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
cp %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/
strip $RPM_BUILD_ROOT/%{_bindir}/* $RPM_BUILD_ROOT/%{_libdir}/libgarmin.so.%{libgarminversion}

%clean
rm -rf $RPM_BUILD_ROOT

%post
# remove garmin_gps module if loaded
rmmod garmin_gps &>/dev/null || true


%post -n libgarmin%{libgarminmajor}
ldconfig

%postun -n libgarmin%{libgarminmajor}
ldconfig


%files 
%defattr(-,root,root,-)
%{_bindir}/*
%{_mandir}/man1/*
%{_sysconfdir}/udev/rules.d/*
%{_sysconfdir}/modprobe.d/*

%files -n libgarmin%{libgarminmajor}
%defattr(-,root,root,-)
%{_libdir}/libgarmin.so.%{libgarminmajor}
%{_libdir}/libgarmin.so.%{libgarminversion}

%files -n libgarmin%{libgarminmajor}-devel
%defattr(-,root,root,-)
%{_libdir}/libgarmin.so
%{_libdir}/libgarmin.*a
%{_includedir}/*

%changelog 
openSUSE Build Service is sponsored by