summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Bickel <mabi@gentoo.org>2010-07-26 13:42:13 +0000
committerMatti Bickel <mabi@gentoo.org>2010-07-26 13:42:13 +0000
commit0b89d573b595196982b41a27e7a961c7ccec263e (patch)
treea8d089c5e2f9fdd8abc7e24d91baf91309f19466 /dev-lang/php
parentstable x86, bug 323745 (diff)
downloadgentoo-2-0b89d573b595196982b41a27e7a961c7ccec263e.tar.gz
gentoo-2-0b89d573b595196982b41a27e7a961c7ccec263e.tar.bz2
gentoo-2-0b89d573b595196982b41a27e7a961c7ccec263e.zip
add fpm support
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang/php')
-rw-r--r--dev-lang/php/ChangeLog8
-rw-r--r--dev-lang/php/files/eblits/src_compile-v1.eblit7
-rw-r--r--dev-lang/php/files/eblits/src_configure-v1.eblit7
-rw-r--r--dev-lang/php/files/eblits/src_install-v1.eblit14
-rw-r--r--dev-lang/php/files/php-fpm-gentooified.patch55
-rwxr-xr-xdev-lang/php/files/php-fpm.init22
-rw-r--r--dev-lang/php/metadata.xml2
7 files changed, 109 insertions, 6 deletions
diff --git a/dev-lang/php/ChangeLog b/dev-lang/php/ChangeLog
index 4c2e9ef3fbe1..34c38c8ac513 100644
--- a/dev-lang/php/ChangeLog
+++ b/dev-lang/php/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-lang/php
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.394 2010/07/26 12:26:41 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.395 2010/07/26 13:42:13 mabi Exp $
+
+ 26 Jul 2010; Matti Bickel <mabi@gentoo.org>
+ files/eblits/src_compile-v1.eblit, files/eblits/src_configure-v1.eblit,
+ files/eblits/src_install-v1.eblit, +files/php-fpm.init,
+ +files/php-fpm-gentooified.patch, metadata.xml:
+ update fpm description, actually support fpm in the eblits
*php-5.3.3 (26 Jul 2010)
diff --git a/dev-lang/php/files/eblits/src_compile-v1.eblit b/dev-lang/php/files/eblits/src_compile-v1.eblit
index 290123c9036d..24a86e24b6eb 100644
--- a/dev-lang/php/files/eblits/src_compile-v1.eblit
+++ b/dev-lang/php/files/eblits/src_compile-v1.eblit
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_compile-v1.eblit,v 1.3 2010/06/11 17:15:29 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_compile-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
eblit-php-src_compile() {
SAPI_DIR="${WORKDIR}/sapis"
@@ -30,7 +30,7 @@ php_sapi_build() {
for one_sapi in $SAPIS ; do
case "$one_sapi" in
- cli|cgi|embed)
+ cli|cgi|embed|fpm)
if [[ "${one_sapi}" == "${sapi}" ]] ; then
sapi_conf="${sapi_conf} --enable-${one_sapi}"
else
@@ -64,6 +64,9 @@ php_sapi_copy() {
cgi)
source="sapi/cgi/php-cgi"
;;
+ fpm)
+ source="sapi/fpm/php-fpm"
+ ;;
embed)
source="libs/libphp${PHP_MV}.so"
;;
diff --git a/dev-lang/php/files/eblits/src_configure-v1.eblit b/dev-lang/php/files/eblits/src_configure-v1.eblit
index f3984c4b6521..0a581ca14cf3 100644
--- a/dev-lang/php/files/eblits/src_configure-v1.eblit
+++ b/dev-lang/php/files/eblits/src_configure-v1.eblit
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_configure-v1.eblit,v 1.3 2010/07/05 23:22:43 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_configure-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
eblit-php-src_configure() {
PHP_DESTDIR="/usr/$(get_libdir)/php${PHP_MV}"
@@ -217,6 +217,11 @@ eblit-php-src_configure() {
my_conf="${my_conf} --with-pic"
fi
+ if has fpm ${IUSE//+} && use fpm ; then
+ my_conf="${my_conf} --with-libevent-dir=/usr/lib"
+ fi
+
+
# we use the system copy of pcre
# --with-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
diff --git a/dev-lang/php/files/eblits/src_install-v1.eblit b/dev-lang/php/files/eblits/src_install-v1.eblit
index d3312579f171..c30d5444764a 100644
--- a/dev-lang/php/files/eblits/src_install-v1.eblit
+++ b/dev-lang/php/files/eblits/src_install-v1.eblit
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_install-v1.eblit,v 1.3 2010/06/14 17:03:22 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_install-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
eblit-php-src_install() {
# Makefile forgets to create this before trying to write to it...
@@ -125,4 +125,16 @@ php_install_ini() {
"70_mod_php${PHP_MV}.conf"
fi
fi
+
+ if [[ "${sapi}" == "fpm" ]] ; then
+ einfo "Installing FPM CGI config file php-fpm.conf"
+ epatch "${FILESDIR}/php-fpm-gentooified.patch"
+ insinto ${PHP_INI_DIR}
+ doins "${S}/sapi/fpm/php-fpm.conf"
+ dodir "/etc/init.d"
+ insinto "/etc/init.d"
+ newins "${FILESDIR}/php-fpm.init" "php-fpm"
+ fperms 755 "/etc/init.d/php-fpm"
+ dosym "${PHP_DESTDIR}/bin/php-fpm" "/usr/bin/php-fpm"
+ fi
}
diff --git a/dev-lang/php/files/php-fpm-gentooified.patch b/dev-lang/php/files/php-fpm-gentooified.patch
new file mode 100644
index 000000000000..3d7b9fe48c7d
--- /dev/null
+++ b/dev-lang/php/files/php-fpm-gentooified.patch
@@ -0,0 +1,55 @@
+--- sapi/fpm/php-fpm.conf.orig 2010-06-03 21:04:30.000000000 +0200
++++ sapi/fpm/php-fpm.conf 2010-06-03 22:40:41.000000000 +0200
+@@ -8,7 +8,7 @@
+ ; Include one or more files. If glob(3) exists, it is used to include a bunch of
+ ; files from a glob(3) pattern. This directive can be used everywhere in the
+ ; file.
+-;include=/etc/fpm.d/*.conf
++;include=/etc/php/fpm-php5/fpm.d/*.conf
+
+ ;;;;;;;;;;;;;;;;;;
+ ; Global Options ;
+@@ -17,11 +17,11 @@
+ [global]
+ ; Pid file
+ ; Default Value: none
+-;pid = /var/lib/run/php-fpm.pid
++;pid = /var/run/php-fpm.pid
+
+ ; Error log file
+ ; Default Value: /var/lib/log/php-fpm.log
+-;error_log = /var/lib/log/php-fpm.log
++error_log = /var/log/php-fpm.log
+
+ ; Log level
+ ; Possible Values: alert, error, warning, notice, debug
+@@ -133,17 +133,17 @@
+ ; The number of child processes created on startup.
+ ; Note: Used only when pm is set to 'dynamic'
+ ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+-;pm.start_servers = 20
++pm.start_servers = 20
+
+ ; The desired minimum number of idle server processes.
+ ; Note: Used only when pm is set to 'dynamic'
+ ; Note: Mandatory when pm is set to 'dynamic'
+-;pm.min_spare_servers = 5
++pm.min_spare_servers = 5
+
+ ; The desired maximum number of idle server processes.
+ ; Note: Used only when pm is set to 'dynamic'
+ ; Note: Mandatory when pm is set to 'dynamic'
+-;pm.max_spare_servers = 35
++pm.max_spare_servers = 35
+
+ ; The number of requests each child process should execute before respawning.
+ ; This can be useful to work around memory leaks in 3rd party libraries. For
+@@ -213,7 +213,7 @@
+
+ ; The log file for slow requests
+ ; Default Value: /var/lib/log/php-fpm.log.slow
+-;slowlog = /var/lib/log/php-fpm.log.slow
++;slowlog = /var/log/php-fpm.log.slow
+
+ ; Set open file descriptor rlimit.
+ ; Default Value: system defined value
diff --git a/dev-lang/php/files/php-fpm.init b/dev-lang/php/files/php-fpm.init
new file mode 100755
index 000000000000..adcfd3275bbb
--- /dev/null
+++ b/dev-lang/php/files/php-fpm.init
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+
+PHP_FPM_CONF="/etc/php/fpm-php5/php-fpm.conf"
+
+opts="depend start stop reload"
+
+depend() {
+ need net
+ use apache2 lighttpd nginx
+}
+
+start() {
+ ebegin "Starting PHP FastCGI server"
+ start-stop-daemon --start --exec /usr/bin/php-fpm -- -y "${PHP_FPM_CONF}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PHP FastCGI server"
+ start-stop-daemon --stop --name php-fpm
+ eend $?
+}
diff --git a/dev-lang/php/metadata.xml b/dev-lang/php/metadata.xml
index 414c670367eb..f5fd193e069d 100644
--- a/dev-lang/php/metadata.xml
+++ b/dev-lang/php/metadata.xml
@@ -13,7 +13,7 @@
<flag name='fileinfo'>Add fileinfo extension support</flag>
<flag name='filter'>Add filter extension support</flag>
<flag name='force-cgi-redirect'>Switch on common security setting for CGI SAPI</flag>
- <flag name='fpm'>Enable fpm SAPI</flag>
+ <flag name='fpm'>Enable the FastCGI Process Manager SAPI</flag>
<flag name='hash'>Enable the hash extension</flag>
<flag name='intl'>Enables the intl extension for extended internalization support</flag>
<flag name='java-external'>Use the external java extension rather than the bundled one</flag>