summaryrefslogtreecommitdiff
blob: 5cf2b3dc53b34346a060d48f5c67ff3f0ee8aa4e (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-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/bsddb3/bsddb3-4.7.0.ebuild,v 1.1 2008/06/25 14:10:19 dev-zero Exp $

EAPI="1"

NEED_PYTHON=2.5

inherit distutils db-use multilib

DESCRIPTION="Python bindings for BerkeleyDB"
HOMEPAGE="http://www.jcea.es/programacion/pybsddb.htm"
SRC_URI="http://pypi.python.org/packages/source/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="doc"

RDEPEND="sys-libs/db:4.3"
DEPEND="${RDEPEND}
	dev-python/setuptools
	doc? ( dev-python/sphinx )"

src_compile() {
	DB_VER="4.6"

	sed -i \
		-e "s/dblib = 'db'/dblib = '$(db_libname ${DB_VER})'/" \
		setup.py

	distutils_src_compile \
		"--berkeley-db=/usr" \
		"--berkeley-db-incdir=$(db_includedir ${DB_VER})" \
		"--berkeley-db-libdir=/usr/$(get_libdir)"

	if use doc ; then
		mkdir html
		sphinx-build docs html || die "building docs failed"
	fi
}

src_install() {
	DOCS="TODO.txt"
	distutils_src_install

	distutils_python_version
	rm -rf "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/${PN}/tests"

	use doc && dohtml -r html/*
}

src_test() {
	distutils_python_version
	"${python}" test.py || die "tests failed"
}