summaryrefslogtreecommitdiff
blob: 0595b6a5c23e11dcb9e13a104cafc42cebc0259d (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"
inherit distutils

DESCRIPTION="Parse human-readable date/time expressions"
HOMEPAGE="http://code-bear.com/code/parsedatetime/"
SRC_URI="http://code-bear.com/code/${PN}/${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc"

DEPEND="doc? ( dev-python/epydoc )"
RDEPEND="dev-python/pyicu"

DOCS="THANKS.txt README.txt AUTHORS.txt CHANGES.txt"

src_prepare() {
	# A broken and unnecessary test script made it into the release. delete it.
	if [[ -f "${S}/${PN}/t2.py" ]]; then
		rm -f "${S}/${PN}/t2.py" || die "Removing t2.py failed!"
	fi
}

src_compile() {
	if use doc; then
		${python} setup.py doc || die "Making the docs failed"
	fi
	distutils_src_compile
}

src_test() {
	PYTHON_PATH="build/lib/" ${python} run_tests.py || die "Running tests failed!"
}

src_install() {
	if use doc; then
		dohtml -r docs/* || die "Installing the docs failed!"
	fi
	distutils_src_install
}