summaryrefslogtreecommitdiff
blob: cb82a6fd3b641871120b28b0e9475399b4029e30 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/mantissa/mantissa-0.7.0.ebuild,v 1.4 2010/03/07 10:20:27 arfrever Exp $

EAPI="2"
DISTUTILS_SRC_TEST="trial xmantissa"
DISTUTILS_DISABLE_TEST_DEPENDENCY="1"
SUPPORT_PYTHON_ABIS="1"

# setup.py uses epsilon.setuphelper.autosetup(), which tries to use
# build-${PYTHON_ABI} directories as packages.
DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="1"

inherit distutils twisted

MY_PN="Mantissa"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="An extensible, multi-protocol, multi-user, interactive application server"
HOMEPAGE="http://divmod.org/trac/wiki/DivmodMantissa http://pypi.python.org/pypi/Mantissa"
SRC_URI="http://pypi.python.org/packages/source/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND=">=dev-python/axiom-0.5.7
	>=dev-python/cssutils-0.9.5.1
	>=dev-python/imaging-1.1.6
	>=dev-python/nevow-0.9.5
	>=dev-python/pytz-2005m
	>=dev-python/twisted-8.0.1
	dev-python/twisted-mail
	>=dev-python/vertex-0.2.0"
RDEPEND="${DEPEND}"
RESTRICT_PYTHON_ABIS="3.*"

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

DOCS="NAME.txt NEWS.txt"
PYTHON_MODNAME="axiom nevow xmantissa"

src_compile() {
	# Skip distutils_src_compile to avoid installation of $(python_get_sitedir)/build directory.
	:
}

src_test() {
	TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE="1" distutils_src_test
}

src_install() {
	PORTAGE_PLUGINCACHE_NOOP="1" distutils_src_install
}

update_axiom_plugin_cache() {
	einfo "Updating axiom plugin cache..."
	"$(PYTHON)" -c 'from twisted.plugin import IPlugin, getPlugins;from axiom import plugins; list(getPlugins(IPlugin, plugins))'
}

update_mantissa_plugin_cache() {
	einfo "Updating mantissa plugin cache..."
	"$(PYTHON)" -c 'from twisted.plugin import IPlugin, getPlugins;from xmantissa import plugins; list(getPlugins(IPlugin, plugins))'
}

update_nevow_plugin_cache() {
	einfo "Updating nevow plugin cache..."
	"$(PYTHON)" -c 'from twisted.plugin import IPlugin, getPlugins;from nevow import plugins; list(getPlugins(IPlugin, plugins))'
}

pkg_postinst() {
	twisted_pkg_postinst
	python_execute_function update_axiom_plugin_cache
	python_execute_function update_nevow_plugin_cache
	python_execute_function update_mantissa_plugin_cache
}

pkg_postrm() {
	twisted_pkg_postrm
	python_execute_function update_axiom_plugin_cache
	python_execute_function update_nevow_plugin_cache
	python_execute_function update_mantissa_plugin_cache
}