Merge media-sound/spotify: Fix homepage URL
[gentoo.git] / dev-libs / libdivecomputer / libdivecomputer-0.4.1.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 if [[ ${PV} = *9999* ]]; then
8         EGIT_REPO_URI="git://libdivecomputer.git.sourceforge.net/gitroot/libdivecomputer/libdivecomputer"
9         GIT_ECLASS="git-2"
10         AUTOTOOLIZE=yes
11         KEYWORDS=""
12 else
13         KEYWORDS="~amd64 ~x86"
14 fi
15
16 AUTOTOOLS_IN_SOURCE_BUILD=1
17 inherit eutils autotools-utils ${GIT_ECLASS}
18
19 if [[ ${PV} = *9999* ]]; then
20         SRC_URI=""
21 else
22         SRC_URI="http://www.divesoftware.org/libdc/releases/${P}.tar.gz"
23 fi
24
25 DESCRIPTION="Library for communication with dive computers from various manufacturers"
26 HOMEPAGE="http://www.divesoftware.org/libdc"
27 LICENSE="LGPL-2.1"
28
29 SLOT="0"
30 IUSE="usb +static-libs -tools"
31
32 RDEPEND="usb? ( virtual/libusb:1 )"
33 DEPEND="${RDEPEND}
34         virtual/pkgconfig"
35
36 src_prepare() {
37         if [[ -n ${AUTOTOOLIZE} ]]; then
38                 autotools-utils_src_prepare
39         else
40                 epatch_user
41         fi
42 }
43
44 src_configure() {
45         autotools-utils_src_configure
46
47         if ! use tools ; then
48                 sed -i 's|examples||' Makefile || die "sed failed"
49         fi
50 }
51
52 src_compile() {
53         autotools-utils_src_compile
54 }
55
56 src_install() {
57         autotools-utils_src_install
58
59         if use tools ; then
60                 einfo "prefixing tools with 'dctool_'"
61                 pushd "${D}/usr/bin/"
62                 for file in * ; do
63                         mv "${file}" "dctool_${file}" || die "prefixing tools failed"
64                 done
65                 popd
66         fi
67 }
68
69 pkg_postinst() {
70         if use tools ; then
71                 elog "The 'tools' USE flag has been enabled,"
72                 elog "to avoid file collisions, all ${PN}"
73                 elog "related tools have been prefixed with 'dctool_'"
74         fi
75 }