blob: 174b9b0ba8157c48de7887f1688af448ee66683c (
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
85
86
|
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-php/mod_php/mod_php-5.0.3-r2.ebuild,v 1.3 2005/05/19 20:23:05 robbat2 Exp $
IUSE="${IUSE} apache2"
# this duplicates the code from depend.apache.eclass, but it's the
# only way to do this here
if useq apache2 ; then
APACHE_VERSION=2
else
APACHE_VERSION=1
fi
KEYWORDS="~x86 ~amd64"
PROVIDE="virtual/httpd-php"
SLOT="${APACHE_VERSION}"
PHPSAPI="apache${APACHE_VERSION}"
MY_P="php-${PV}"
# BIG FAT WARNING!
# the php eclass requires the PHPSAPI setting!
inherit eutils php5-sapi-r1 apache-module
need_apache
DESCRIPTION="Apache module for PHP 5"
pkg_setup() {
# the list of safe MPM's may need revising
if ! useq threads ; then
APACHE2_SAFE_MPMS="prefork"
else
APACHE2_SAFE_MPMS="event metuxmpm peruser worker threadpool"
fi
apache-module_pkg_setup
php5-sapi_pkg_setup
}
src_unpack() {
php5-sapi_src_unpack
# if we're not using threads, we need to force them to be switched
# off by patching php's configure script
cd ${S}
if ! useq threads ; then
epatch ${FILESDIR}/php5-prefork.patch || die "Unable to patch for prefork support"
einfo "Rebuilding configure script"
WANT_AUTOCONF=2.5 \
autoconf -W no-cross || die "Unable to regenerate configure script"
uclibctoolize
fi
}
src_compile() {
if [ "${APACHE_VERSION}" = "2" ]; then
if useq threads ; then
my_conf="${my_conf} --enable-experimental-zts"
ewarn "Enabling ZTS for Apache2 MPM"
fi
fi
my_conf="${my_conf} --with-apxs${USE_APACHE2}=/usr/sbin/apxs${USE_APACHE2}"
php5-sapi_src_compile
}
src_install() {
PHP_INSTALLTARGETS="install"
php5-sapi_src_install
if [ -n "${USE_APACHE2}" ] ; then
einfo "Installing a Apache2 config for PHP (70_mod_php5.conf)"
insinto ${APACHE_MODULES_CONFDIR}
doins "${FILESDIR}/5.0.2-r1/70_mod_php5.conf"
else
einfo "Installing a Apache config for PHP (mod_php5.conf)"
insinto ${APACHE_MODULES_CONFDIR}
doins ${FILESDIR}/mod_php5.conf
fi
}
|