summaryrefslogtreecommitdiff
blob: 1dbd36d86b6e3862ce2543665bab1db666df8d57 (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
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/libdivecomputer/libdivecomputer-0.4.0.ebuild,v 1.1 2013/05/15 13:04:59 tomwij Exp $

EAPI="5"

if [[ ${PV} = *9999* ]]; then
	EGIT_REPO_URI="git://libdivecomputer.git.sourceforge.net/gitroot/libdivecomputer/libdivecomputer"
	GIT_ECLASS="git-2"
	AUTOTOOLIZE=yes
fi

inherit eutils autotools-utils ${GIT_ECLASS}

if [[ ${PV} = *9999* ]]; then
	SRC_URI=""
else
	SRC_URI="http://www.divesoftware.org/libdc/releases/${P}.tar.gz"
fi

DESCRIPTION="Library for communication with dive computers from various manufacturers."
HOMEPAGE="http://www.divesoftware.org/libdc"
LICENSE="LGPL-2.1"

KEYWORDS="~amd64 ~x86"
SLOT="0"
IUSE="usb examples +static-libs"

RDEPEND="usb? ( virtual/libusb:1 )"
DEPEND="${RDEPEND}
	virtual/pkgconfig"

AUTOTOOLS_IN_SOURCE_BUILD=1

src_prepare() {
	if [[ -n ${AUTOTOOLIZE} ]]; then
		eautoreconf
	fi
}

src_configure() {
	autotools-utils_src_configure

	if use usb ; then
		sed -i 's|#define HAVE_LIBUSB 1||' config.h || die "sed failed"
	fi

	if use examples ; then
		sed -i 's|examples||' Makefile || die "sed failed"
	fi
}

src_compile() {
	autotools-utils_src_compile
}

src_install() {
	autotools-utils_src_install
}