Stable for ppc, wrt bug #450174
[wtk-overlay.git] / webtest-1.4.0.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4
5 EAPI="3"
6 PYTHON_DEPEND="2:2.6 3:3.2"
7 SUPPORT_PYTHON_ABIS="1"
8 RESTRICT_PYTHON_ABIS="2.5 3.1"
9 PYTHON_TESTS_RESTRICTED_ABIS="*-pypy-*"
10 DISTUTILS_SRC_TEST="nosetests"
11
12 inherit distutils
13
14 MY_PN="WebTest"
15 MY_P="${MY_PN}-${PV}"
16
17 DESCRIPTION="Helper to test WSGI applications"
18 HOMEPAGE="http://pythonpaste.org/webtest/ http://pypi.python.org/pypi/WebTest"
19 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
20
21 LICENSE="MIT"
22 SLOT="0"
23 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
24 IUSE="doc"
25
26 RDEPEND=">=dev-python/webob-0.9.2"
27 DEPEND="${RDEPEND}
28         dev-python/setuptools
29         doc? ( dev-python/sphinx )
30         test? ( dev-python/pyquery )"
31
32 S="${WORKDIR}/${MY_P}"
33
34 src_compile() {
35         distutils_src_compile
36
37         if use doc; then
38                 einfo "Generation of documentation"
39                 sphinx-build docs html || die "Building of documentation failed"
40         fi
41 }
42
43 src_install() {
44         distutils_src_install
45
46         # Avoid future-import bug on py2.5.* - lint3 is py3 anyway
47         delete_lint3() {
48                 [[ "${PYTHON_ABI}" == 3.* ]] && return
49                 rm "${ED}$(python_get_sitedir)/webtest/lint3.py"
50         }
51         python_execute_function -q delete_lint3
52
53         if use doc; then
54                 dohtml -r html/*
55         fi
56 }