# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs DESCRIPTION="GPSBabel is a waypoints, tracks and routes converter in variety of form" HOMEPAGE="http://www.gpsbabel.org/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="usb debug" DEPEND="dev-libs/expat app-text/tetex usb? (dev-libs/libusb) debug? (dev-util/efence)" src_compile() { cd "${S}" if use debug; then # ewarn "Efence support" # epatch ${FILESDIR}/efence.patch sed "s/# -lefence/-lefence/" -i Makefile fi if use usb; then einfo "Usb support will be enabled" else sed "s/LIBUSB=/INHIBIT_USB=-DNO_USB\nLIBUSB=#/" -i Makefile fi sed "s/OPTIMIZATION=-O/OPTIMIZATION=${CFLAGS} /" -i Makefile emake CC="$(tc-getCC)" || die "emake failed" cd "${S}"/doc/ make || die "Documentation generation failed" } src_install() { cd "${S}" dobin gpsbabel dodoc README* COPYING ChangeLog local DDIR DDIR="/usr/share/doc/${PF}/samples" sed -e "s:\./gpsbabel:gpsbabel:" \ -e "s:reference:${DDIR}/reference:" \ -i testc insinto ${DDIR}/scripts doins testc contrib/gpx2xfig chmod 0755 "${D}"/${DDIR}/scripts/testc for i in reference reference/route reference/track reference/gc; do insinto ${DDIR}/${i} doins ${i}/* || die "Unable to install samples from ${i} directory" done insinto /usr/share/doc/${PF}/manual doins doc.dvi babelfront2.eps }