summaryrefslogtreecommitdiff
blob: 4e222ea76ba5edea284f1d008cb13f65c369ff75 (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI="5"

PYTHON_COMPAT=( python2_7 python3_4 )

inherit apache-module eutils python-single-r1

DESCRIPTION="An Apache2 module providing an embedded Python interpreter"
HOMEPAGE="http://modpython.org/"
SRC_URI="http://dist.modpython.org/dist/${P}.tgz"

LICENSE="Apache-2.0"
KEYWORDS="~alpha ~amd64 ~ia64 ~mips ~ppc ~sparc ~x86"
IUSE="doc test"
SLOT="0"

APACHE2_MOD_CONF="16_${PN}"
APACHE2_MOD_DEFINE="PYTHON"
need_apache2

RDEPEND="${RDEPEND}"
DEPEND="${DEPEND}
	test? (
		app-admin/apache-tools
		net-misc/curl
	)"

src_prepare() {
	epatch "${FILESDIR}"/${P}-buildsystem.patch
	epatch "${FILESDIR}"/${P}-version.patch #531154

	export CFLAGS="$(apxs2 -q CFLAGS)"
	export LDFLAGS="$(apxs2 -q LDFLAGS)"
}

src_compile() {
	default
}

src_test() {
	cd test || die
	PYTHONPATH="$(ls -d ${S}/dist/build/lib.*)" ${PYTHON} test.py || die
}

src_install() {
	default

	use doc && dohtml -r doc-html/*

	apache-module_src_install
}