summaryrefslogtreecommitdiff
blob: 3733bf70f0102eb41dbcd6253ebafb3d85c050ff (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
62
63
64
65
66
67
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/graphy/graphy-1.0.ebuild,v 1.2 2009/12/24 15:37:30 arfrever Exp $

EAPI="2"
SUPPORT_PYTHON_ABIS="1"

inherit python

MY_P=${PN}_${PV}

DESCRIPTION="Simple Chart Library for Python"
HOMEPAGE="http://code.google.com/p/graphy/"
SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.tar.bz2"

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

DEPEND=""
RDEPEND=""
RESTRICT_PYTHON_ABIS="3.*"

S=${WORKDIR}/${MY_P}

src_prepare() {
	python_convert_shebangs -r 2 .
}

src_test() {
	testing() {
		PYTHONPATH=. "$(PYTHON)" ${PN}/all_tests.py
	}
	python_execute_function testing
}

src_install() {
	# we don't want to install tests, removing them
	rm ${PN}/*_test.py ${PN}/all_tests.py || die "rm failed"

	# installing everything
	installation() {
		insinto $(python_get_sitedir)/${PN}
		doins ${PN}/*.py || die "doins failed"
		insinto $(python_get_sitedir)/${PN}/backends
		doins ${PN}/backends/*.py || die "doins failed"
		insinto $(python_get_sitedir)/${PN}/backends/google_chart_api
		doins ${PN}/backends/google_chart_api/*.py || die "doins failed"
	}
	python_execute_function installation

	dodoc README || die "dodoc failed"

	if use examples; then
		insinto /usr/share/doc/${PF}/examples
		doins examples/*.py || die "doins failed"
	fi
}

pkg_postinst() {
	python_mod_optimize ${PN}
}

pkg_postrm() {
	python_mod_cleanup ${PN}
}