summaryrefslogtreecommitdiff
blob: 4c2c7f40a6f2773e0e68e67023ec7f2f1056e757 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-apache/libapreq2/libapreq2-2.08-r2.ebuild,v 1.9 2008/03/22 17:02:13 maekke Exp $

inherit apache-module perl-module multilib

DESCRIPTION="A library for manipulating client request data via the Apache API"
SRC_URI="mirror://apache/apreq/${P}.tar.gz"
HOMEPAGE="http://httpd.apache.org/apreq/"

LICENSE="Apache-2.0"
SLOT="2"
KEYWORDS="alpha amd64 ppc ppc64 sparc x86"
IUSE="perl"

DEPEND="${DEPEND}
	perl? (
		>=dev-perl/ExtUtils-XSBuilder-0.23
		dev-perl/version
		>=www-apache/mod_perl-2
	)"
RDEPEND="${DEPEND}"

APACHE2_MOD_FILE="module/apache2/.libs/mod_apreq2.so"
APACHE2_MOD_CONF="76_mod_apreq"
APACHE2_MOD_DEFINE="APREQ"
DOCFILES="docs/html/*.html CHANGES README INSTALL MANIFEST"

need_apache2

src_unpack() {
	unpack ${A}
	cd "${S}"

	epatch "${FILESDIR}"/libapreq2-2.08-doc.patch

	sed -i -e "s/PERL \$PERL_OPTS/PERL/" "${S}"/acinclude.m4
	sed -i -e "s/PERL \$PERL_OPTS/PERL/" "${S}"/aclocal.m4
	sed -i -e "s/PERL \$PERL_OPTS/PERL/" "${S}"/configure
}

src_compile() {
	econf \
		--with-apache2-apxs=${APXS} \
		$(use_enable perl perl-glue) \
		|| die "econf failed"
	emake || die "emake failed"
}

src_install() {
	apache-module_src_install

	make DESTDIR="${D}" install || die "make install failed"
	doman docs/man/man3/*.3

	fixlocalpod

	for i in $(find "${D}" -type f -not -name '*.so'); do
		if file ${i} | grep -i " text"; then
			sed -i -e "s:${D}:/:g" ${i}
		fi
	done
}