summaryrefslogtreecommitdiff
blob: 6b035853b80ce0de5f3fe67c2c49df5bf9d161fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gpsbabel/gpsbabel-1.4.3.ebuild,v 1.3 2012/05/24 16:34:36 scarabeus Exp $

EAPI=4

inherit eutils qt4-r2 base autotools

DESCRIPTION="GPS waypoints, tracks and routes converter"
HOMEPAGE="http://www.gpsbabel.org/"
SRC_URI="mirror://gentoo/${P}.tar.gz
	doc? ( http://www.gpsbabel.org/style3.css -> gpsbabel.org-style3.css )"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="amd64 ~ppc x86"
IUSE="doc qt4"

RDEPEND="
	dev-libs/expat
	sci-libs/shapelib
	virtual/libusb:0
	qt4? (
		x11-libs/qt-gui:4
		x11-libs/qt-webkit:4
	)
"
DEPEND="${RDEPEND}
	doc? (
		dev-lang/perl
		dev-libs/libxslt
		app-text/docbook-xml-dtd:4.1.2
	)
"

PATCHES=(
	"${FILESDIR}/${PN}-disable_statistic_uploading.patch"
	"${FILESDIR}/${PN}-disable_update_check.patch"
	"${FILESDIR}/${PN}-disable_version_check.patch"
	"${FILESDIR}/${P}-fix_binary_name.patch"
	"${FILESDIR}/${PN}-freebsd.patch"
	"${FILESDIR}/${PN}-use_system_shapelib.patch"
	"${FILESDIR}/${PN}-xmldoc.patch"
)

src_prepare() {
	base_src_prepare
	rm -rf shapelib || die

	use doc && cp "${DISTDIR}/gpsbabel.org-style3.css" "${S}"

	eautoreconf
}

src_configure() {
	econf \
		$(use_with doc doc "${S}"/doc/manual) \
		--with-zlib=system

	if use qt4; then
		pushd "${S}/gui" > /dev/null
		lrelease *.ts || die
		eqmake4
		popd > /dev/null
	fi
}

src_compile() {
	emake
	if use qt4; then
		pushd "${S}/gui" > /dev/null
		emake
		popd > /dev/null
	fi

	if use doc; then
		perl xmldoc/makedoc
		emake gpsbabel.html
	fi
}

src_install() {
	default
	dodoc README*

	if use qt4; then
		dobin gui/objects/gpsbabelfe
		insinto /usr/share/qt4/translations/
		doins gui/gpsbabel*_*.qm
		newicon gui/images/appicon.png ${PN}.png
		make_desktop_entry gpsbabelfe ${PN} ${PN} "Science;Geoscience"
	fi

	if use doc; then
		dohtml gpsbabel.*
	fi
}