# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs DESCRIPTION="GPSBabel reads and writes GPS waypoints in a variety of forms. \ Backends include GPX, Magellan and Garmin serial protocols, Geocaching.com \ *.loc, GPSMan, Garmin Mapsource *.mps, Magellan Mapsend *.wpt, and many \ others." HOMEPAGE="http://www.gpsbabel.org/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="usb doc debug" DEPEND="dev-libs/expat usb? (dev-libs/libusb) debug? (dev-util/efence) doc? (app-text/tetex)" S="${WORKDIR}/${P}" src_compile() { cd ${S} if use usb; then einfo "Usb support will be enabled" else sed "s/LIBUSB=/INHIBIT_USB=-DNO_USB\nLIBUSB=#/" -i Makefile fi if use debug; then sed "s/# -lefence/-lefence/" -i Makefile fi # I let the default -0 flags cause the last optimization # if it exists will be used. sed "s/OPTIMIZATION=-O/OPTIMIZATION=-O ${CFLAGS} /" -i Makefile emake CC="$(tc-getCC)" || die "emake failed" } src_install() { cd ${S} dobin gpsbabel if use doc ; then cd ${S}/doc/ make dodoc doc.dvi fi cd ${S} dodoc README* COPYING ChangeLog local MY_DOCS MY_DOCS="contrib reference reference/route reference/track" for i in ${MY_DOCS}; do insinto /usr/share/doc/${PF}/${i} doins ${i}/* || die "${i} doc creation failed" done }