aboutsummaryrefslogtreecommitdiff
blob: 6fd8e8787f1d25dce8b31d346cb14d4098394083 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/django-auth-ldap/django-auth-ldap-1.1.ebuild,v 1.2 2012/04/25 12:55:49 tampakrap Exp $

EAPI=4
PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS=1
RESTRICT_PYTHON_ABIS="3.*"

inherit distutils

DESCRIPTION="A flexible and capable API layer for Django utilising serialisers"
HOMEPAGE="http://pypi.python.org/pypi/django-auth-ldap http://bitbucket.org/psagers/django-auth-ldap/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
IUSE="doc"

LICENSE="BSD"
SLOT="0"
PYTHON_MODNAME="django_auth_ldap"

RDEPEND=""
DEPEND="${RDEPEND} >=dev-python/django-1.0
	dev-python/python-ldap
	doc? ( dev-python/sphinx )"

src_compile() {
	distutils_src_compile

	# BuildDocs is not essential. just an extra 'touch'
	use doc && emake -C docs html
}

src_test() {
	export DJANGO_SETTINGS_MODULE="django.conf"

	# Test && demo that the tests are run; 
	# Python.[56] trigger a harmless depracation warning
	testing() {
		local exit_status=0
		PYTHONPATH=build-${PYTHON_ABI}/lib
		"$(PYTHON)" -m django_auth_ldap.tests || exit_status=1
		einfo "All tests completed OK for python"$(python_get_version)
		return ${exit_status}
	}
	python_execute_function testing
}

src_install() {
	distutils_src_install

	if use doc; then
		dohtml -r docs/_build/html/
	fi
}