summaryrefslogtreecommitdiff
blob: be78519109992d40cefa4b631b6d50772e9901ee (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/pygooglevoice/pygooglevoice-0.5-r1.ebuild,v 1.2 2012/02/23 15:10:20 radhermit Exp $

EAPI="4"
PYTHON_DEPEND="2:2.6"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.*"
PYTHON_MODNAME="googlevoice"

inherit distutils eutils

DESCRIPTION="Python Bindings for the Google Voice API"
HOMEPAGE="http://code.google.com/p/pygooglevoice/"
SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.gz
	http://${PN}.googlecode.com/files/${P}-extras.zip"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc examples"

DEPEND="app-arch/unzip"

# Requires interactive login
RESTRICT="test"

src_prepare() {
	epatch "${FILESDIR}"/${P}-auth.patch
}

src_test() {
	testing() {
		PYTHONPATH="build-${PYTHON_ABI}/lib" "$(PYTHON)" googlevoice/tests.py
	}
	python_execute_function testing
}

src_install() {
	distutils_src_install

	if use doc ; then
		dohtml -r "${WORKDIR}"/doc/*
	fi

	if use examples ; then
		exeinto /usr/share/doc/${PF}/examples
		doexe "${WORKDIR}"/examples/[a-z]*.py
	fi
}