summaryrefslogtreecommitdiff
blob: c1cb58cd08f69ec4fd77161be21a446e80b0df0b (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
56
57
58
59
60
61
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit distutils

MY_PV="${PV/_beta/b}"
MY_PN="${PN/-/_}"
MY_P="${MY_PN}-${MY_PV}"

DESCRIPTION="suite of Python packages and data for natural language processing"
HOMEPAGE="http://nltk.sourceforge.net/"
SRC_URI="mirror://sourceforge/nltk/${MY_P}.tar.gz
	!lite? ( mirror://sourceforge/nltk/${MY_PN}-corpora-${MY_PV}.zip )
	doc? ( mirror://sourceforge/nltk/${MY_PN}-doc-${MY_PV}.zip )
	examples? ( mirror://sourceforge/nltk/${MY_PN}-examples-${MY_PV}.zip )"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="doc examples linguas_pt_BR lite"

DEPEND=""
RDEPEND="dev-python/numpy"

S="${WORKDIR}/${MY_P}"

src_install() {
	if ! use lite ; then
		ebegin "Installing corpora"
		insinto /usr/share/${MY_PN}
		doins -r "${WORKDIR}/corpora"
		doenvd "${FILESDIR}/99nltk-lite"
		eend 0
	fi
	if use doc ; then
		ebegin "Installing doc"
		if ! use linguas_pt_BR ; then
			rm -rf "${WORKDIR}/doc/pt-br"
		fi
		insinto /usr/share/${MY_PN}
		doins -r "${WORKDIR}/doc"
		eend 0
	fi
	if use examples ; then
		insinto /usr/share/${MY_PN}
		doins -r "${WORKDIR}/examples"
	fi

	dodoc README.txt

	distutils_src_install
}

pkg_postinst() {
	if use lite ; then
		elog "You installed ${PN} with 'lite' USE flag enabled,"
		elog "that doesn't install the corpora which may be needed for"
		elog "the examples and the apps developed using ${PN}."
	fi
}