aboutsummaryrefslogtreecommitdiff
blob: 0307bc9d0dbc21435d2d46206d0acdb7ed03706a (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

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

DESCRIPTION="an LDAP database backend for Django"
HOMEPAGE="http://opensource.bolloretelecom.eu/projects/django-ldapdb/"
SRC_URI="http://dev.gentoo.org/~tampakrap/tarballs/${P}.tar.bz2"

KEYWORDS="~amd64 ~x86"
IUSE="examples test"
LICENSE="MIT"
SLOT="0"
PYTHON_MODNAME="ldapdb"
S="${WORKDIR}/${PN}"

REDEPEND=""
DEPEND="${REDEPEND}
	dev-python/setuptools
	dev-python/django
	test? ( dev-python/python-ldap )"

src_test() {
	export DJANGO_SETTINGS_MODULE="django.conf"
	# Exclude examples from test phase
	mv examples/tests.py examples/tests

	testing() {
		"$(PYTHON)" manage.py test
	}

	python_execute_function testing
	mv examples/tests examples/tests.py
}

src_install() {
	distutils_src_install
	samples() {
		insinto $(python_get_libdir)/site-packages/${PYTHON_MODNAME}/
		doins -r examples/
	}

	if use examples; then
		python_execute_function samples
	fi
}