diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest index b068c87..9d6feb5 100644 --- a/dev-lang/php/Manifest +++ b/dev-lang/php/Manifest @@ -6,12 +6,12 @@ AUX 70_mod_php5_concurr.conf-apache2 414 RMD160 1783b6c830119f021c3fb6cb35a631f4 AUX 70_mod_php5_concurr.conf-apache2-r1 376 RMD160 4f7de5c0784b6191450b5c1a7de7ad941620e199 SHA1 c42a23bd7a1d3e8c7e0ac906f50f180116349f76 SHA256 c05f499d9c8927391c586b94716a9f59d63767165552ea527ec7ff63c36eaa40 AUX php-5.2.10-fpm-0.5.13.diff-ext.patch 616 RMD160 f2c7404a06106bbea4f25c684730549f0738adf1 SHA1 dcebc68c4367caa2b62a9df460ec28f1bfdd3a8e SHA256 73097d238ae907408c4affacc5478818f3a4b877e29e7490de6ac8e7c071b4d6 AUX php-5.2.10-pdo_dblib.patch 559 RMD160 062604e291113b2bb86044b5eeffb72fad210fbc SHA1 d59d26e6557dac86e582e1a6ed7bb4795cf150c6 SHA256 0548d63d7379cd19f7ade6ca1222b1b577f684b142ff6b0e8e23742b1f7f9794 -AUX php-fpm.init 554 RMD160 6a76e3f743f6f57de721e91fe15c7dbef0f6bf28 SHA1 e7e28412128f7fe0cbd224a50634041e19e09667 SHA256 8ebfc7bb50d4374c6571121193105f3d43bcdb358949b77c2f84f2a1a0a67118 +AUX php-fpm.init 545 RMD160 cf1f1325282a4ef4ce9832b3363c14ca773fe6a9 SHA1 35bf2b987169d3847d21e252f1d1d3367b66d2ed SHA256 db8347cac1ce24555711be27cf28d25449aa25862b562fe4f86c466b48154a95 AUX php4-ldvs 22 RMD160 e70c565b3930d9d9e3253062b7c633346cb99a63 SHA1 8c66355dfb80e2ecc6ee6faae30bf7dbb1727651 SHA256 4aee18478b09cda7e925ccde157db6099ea0122b5c4efb0868e3761b65688dde AUX php5-ldvs 22 RMD160 5846dab2745b68a88175dd4e72d0b8cf4756dd46 SHA1 592398c92575adb14ec972847ce2aca28a7b9c2c SHA256 b79d0e52b1b3b4543b31ad45525ae1c2814a27ea8e676772ab10bf6fb12dfe79 -DIST php-5.2.11-fpm-0.5.13.diff.gz 202722 RMD160 c5b3bd9135b712ec62aaa49a6de1f926a02469c5 SHA1 6168ddc2806ea8403517c5ea8c8db90136d857e3 SHA256 d000bad0d09eea3a721fe001a32e3910725508dfa6ef5a33dd1b412c90e14e26 -DIST php-5.2.11.tar.bz2 9030787 RMD160 6aad53dee864ab89f794a9d3c2aa32d435ed5654 SHA1 819c853ce657ef260d4a73b5a21f961115b97eef SHA256 9bcd14ceda2b4bd7abcc7eb59bd74bae490d9335e4207580de783b48aa7e8f23 -DIST php-patchset-5.2.11-r1.tar.bz2 10403 RMD160 53ce1a43697db2cf79eba89a548f52efa64c0d20 SHA1 905e1fc34be10b5ed0abe816cbce2524933559f4 SHA256 fd4f95de091cbe7d52ee3008b45a189f2158bbf861e2017b92a8a3b7a8abb32c +DIST php-5.2.12.tar.bz2 9075161 RMD160 027f3597fd961d2a95682e2f0738415f8a911371 SHA1 6605f23b70e3db824047830f08d636e09ec10ff3 SHA256 e65756a8412726a491ca48da1e0693eaeb3f38f19fb6cbc8f53005cab1f2491a +DIST php-fpm-0.6~5.2.patch 285105 RMD160 297db9b433233abb0ee38a3e2d3744db36082e65 SHA1 3a8d0825cb6f728f5c9b9e956eb2221a9c07845c SHA256 569f07eb95cf258c655b0dcab2bf75b1b2ccc38d17f31b44d804790f5c2f0c54 +DIST php-patchset-5.2.12-r0.tar.bz2 10181 RMD160 e78dc3a500838e163da4eb5853dfe539430486c3 SHA1 91244c62af3ef3a0ebd1a396dbe22d2732512c89 SHA256 ca0cb19e98cb073fa0dd9157c728a9285b97198f1b522727e040f0f00dd8255f DIST suhosin-patch-5.2.11-0.9.7.patch.gz 23050 RMD160 0f6d442aace34c221f9fbff42a63e7f3b4489f15 SHA1 248419332131efc53f3306c2a57a4b1a9dc92cc1 SHA256 392f10c9b7d9c47f30e989fb7775cc46d36153b933bf7ac9ccd8826b2954584b -EBUILD php-5.2.11-r1.ebuild 18658 RMD160 dc13ddee992f7062fbdc0fa9c0723300f99bf3fc SHA1 7a986623d89a5929eb3438bf6af42f48855bb144 SHA256 0ddeb348033c7c0cc9059714418de81bd3528225f1fbcadb4480e06b8bad5697 +EBUILD php-5.2.12.ebuild 19835 RMD160 1c95bc96bf8697dbfd85ecefdfd9737591f66ace SHA1 74961857993ea620bb70b7348cf5c9f02beaa44a SHA256 f9cfd6998afce5bb633c100afb427e2bcca9bc713896e6251e03ce0096decc10 MISC metadata.xml 1609 RMD160 d38bf6db4068985b22b93e8d0d7f813b6598456f SHA1 c58a51a1286a0b9960ddd1511a16ca79f00b556e SHA256 949a48d14d9f2b5898c46e733b165802b52dbff9f146fe2cd7d562bc3b0075db diff --git a/dev-lang/php/files/php-fpm.init b/dev-lang/php/files/php-fpm.init index 586b914..d4ae1d7 100644 --- a/dev-lang/php/files/php-fpm.init +++ b/dev-lang/php/files/php-fpm.init @@ -9,7 +9,7 @@ depend() { start() { ebegin "Starting PHP FastCGI server" start-stop-daemon --start --pidfile=/var/run/php-fpm.pid \ - --exec /usr/bin/php-cgi -- --fpm + --exec /usr/bin/php-fpm eend $? } diff --git a/dev-lang/php/php-5.2.11-r1.ebuild b/dev-lang/php/php-5.2.12.ebuild similarity index 83% rename from dev-lang/php/php-5.2.11-r1.ebuild rename to dev-lang/php/php-5.2.12.ebuild index eea71b0..3534046 100644 --- a/dev-lang/php/php-5.2.11-r1.ebuild +++ b/dev-lang/php/php-5.2.12.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.2.10-r2.ebuild,v 1.1 2009/09/24 23:36:54 cla Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.2.12.ebuild,v 1.8 2010/01/05 19:56:43 armin76 Exp $ CGI_SAPI_USE="discard-path force-cgi-redirect" APACHE2_SAPI_USE="concurrentmodphp threads" @@ -18,15 +18,11 @@ SLOT="5" MY_PHP_PV="${PV}" MY_PHP_P="php-${MY_PHP_PV}" PHP_PACKAGE="1" - -RESTRICT="nomirror" - # php patch settings, general -PHP_PATCHSET_URI="http://dev.gentoo.org/~cla/distfiles/php-patchset-${PVR}.tar.bz2" PHP_PATCHSET_REV="${PR/r/}" -PHP_PATCHSET_REV="${PHP_PATCHSET_REV/2/1}" -SUHOSIN_PATCH="suhosin-patch-${MY_PHP_PV}-0.9.7.patch.gz" -FPM_PATCH="php-5.2.11-fpm-0.5.13.diff" +PHP_PATCHSET_URI="http://dev.gentoo.org/~hoffie/distfiles/php-patchset-${PV}-r${PHP_PATCHSET_REV}.tar.bz2" +SUHOSIN_PATCH="suhosin-patch-5.2.11-0.9.7.patch.gz" +FPM_PATCH="php-fpm-0.6~5.2.patch" MULTILIB_PATCH="${MY_PHP_PV}/opt/multilib-search-path.patch" # php patch settings, ebuild specific FASTBUILD_PATCH="${MY_PHP_PV}/opt/fastbuild.patch" @@ -40,18 +36,17 @@ inherit versionator php5_2-sapi apache-module # Suhosin patch support [[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? ( http://gentoo.longitekk.com/${SUHOSIN_PATCH} )" -# php-fpm patch support -[[ -n "${FPM_PATCH}" ]] && SRC_URI="${SRC_URI} fpm? ( http://php-fpm.org/downloads/${FPM_PATCH}.gz )" +# FPM patch support +[[ -n "${FPM_PATCH}" ]] && SRC_URI="${SRC_URI} fpm? ( http://launchpad.net/php-fpm/master/0.6/+download/${FPM_PATCH} )" DESCRIPTION="The PHP language runtime engine: CLI, CGI and Apache2 SAPIs." -DEPEND="app-admin/php-toolkit - fpm? ( >=dev-libs/libxml2-2.6.8 ) +DEPEND=">=app-admin/php-toolkit-1.0.2 + fpm? ( >=dev-libs/libxml2-2.7.2-r2 >=dev-libs/libevent-1.4.11 ) imap? ( >=virtual/imap-c-client-2006k ) pcre? ( >=dev-libs/libpcre-7.8 ) xml? ( >=dev-libs/libxml2-2.7.2-r2 ) - xmlrpc? ( >=dev-libs/libxml2-2.7.2-r2 virtual/libiconv ) - suhosin? ( >=dev-php5/suhosin-0.9.29 )" + xmlrpc? ( >=dev-libs/libxml2-2.7.2-r2 virtual/libiconv )" RDEPEND="${DEPEND}" if [[ -n "${KOLAB_PATCH}" ]] ; then @@ -60,6 +55,8 @@ if [[ -n "${KOLAB_PATCH}" ]] ; then kolab? ( >=net-libs/c-client-2004g-r1 )" fi +PDEPEND="suhosin? ( >=dev-php5/suhosin-0.9.29 )" + want_apache pkg_setup() { @@ -69,7 +66,7 @@ pkg_setup() { einfo "Determining SAPI(s) to build" phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache2 - # php-fpm patch support + # php-fpm patch support if use fpm && ! use cgi ; then eerror eerror "You must enable CGI SAPI for php-fpm patch to work" @@ -140,6 +137,10 @@ php_determine_sapis() { PHPSAPIS="${PHPSAPIS} cgi" fi + if use fpm ; then + PHPSAPIS="${PHPSAPIS} fpm" + fi + # note - apache SAPI comes after the simpler cli/cgi sapis if use apache2 ; then PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}" @@ -153,10 +154,9 @@ src_unpack() { cd "${S}" - # enable php-fpm support + # php-fpm support if use fpm ; then - EPATCH_OPTS="-p1 -d ${S}" epatch "${WORKDIR}/${FPM_PATCH}" - epatch "${FILESDIR}/php-5.2.10-fpm-0.5.13.diff-ext.patch" + EPATCH_OPTS="-p1 -d ${S}" epatch "${DISTDIR}/${FPM_PATCH}" fi # Concurrent PHP Apache2 modules support @@ -184,9 +184,6 @@ src_unpack() { use kolab && epatch "${WORKDIR}/${KOLAB_PATCH}" fi - # Security bug #292132 - epatch "${WORKDIR}"/${MY_PHP_PV}/gd-maxcolors.patch - # pretend to not have flex, bug 221357 sed -re 's:( +)PHP_SUBST\(LEX\):\1LEX="exit 0;"\n\0:' -i acinclude.m4 @@ -210,7 +207,7 @@ src_unpack() { rm ext/standard/tests/general_functions/phpinfo.phpt # never worked properly, no easy fix - rm ext/iconv/tests/bug16069.phpt ext/iconv/tests/iconv_stream_filter.phpt + rm ext/iconv/tests/iconv_stream_filter.phpt # needs write access to /tmp and others rm ext/session/tests/session_save_path_variation5.phpt @@ -259,6 +256,7 @@ src_compile_fastbuild() { build_cli=0 build_cgi=0 + build_fpm=0 build_apache2=0 my_conf="" @@ -270,6 +268,9 @@ src_compile_fastbuild() { cgi) build_cgi=1 ;; + fpm) + build_fpm=1 + ;; apache2) build_apache2=1 ;; @@ -284,18 +285,23 @@ src_compile_fastbuild() { if [[ ${build_cgi} = 1 ]] ; then my_conf="${my_conf} --enable-cgi --enable-fastcgi" - - # php-fpm patch support - if use fpm ; then - my_conf="${my_conf} --enable-fpm --with-fpm-conf=/etc/php/cgi-php5/php-fpm.conf --with-fpm-log=/var/log/php-fpm.log --with-fpm-pid=/var/run/php-fpm.pid" - fi - phpconfutils_extension_enable "discard-path" "discard-path" 0 phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0 else my_conf="${my_conf} --disable-cgi" fi + if [[ ${build_fpm} = 1 ]] ; then + my_conf="${my_conf} \ + --with-fpm \ + --with-libevent=shared,/usr/lib \ + --with-fpm-conf=/etc/php/fpm-php5/php-fpm.conf \ + --with-fpm-user=php-fpm \ + --with-fpm-group=php-fpm \ + --with-fpm-log=/var/log/php-fpm.log \ + --with-fpm-pid=/var/run/php-fpm.pid" + fi + if [[ ${build_apache2} = 1 ]] ; then my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2" @@ -350,6 +356,20 @@ src_compile_fastbuild() { cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI" fi + if [[ ${build_fpm} = 1 ]] ; then + einfo + einfo "Building FPM SAPI" + einfo + + sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/fpm-php5"|g;' -i main/build-defs.h + sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/fpm-php5/ext-active"|g;' -i main/build-defs.h + for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do + [[ -f ${x} ]] && rm -f ${x} + done + make sapi/fpm/php-fpm || die "Unable to make FPM SAPI" + cp sapi/fpm/php-fpm php-fpm || die "Unable to copy FPM SAPI" + fi + if [[ ${build_apache2} = 1 ]] ; then einfo einfo "Building apache${APACHE_VERSION} SAPI" @@ -409,17 +429,25 @@ src_compile_normal() { ;; cgi) my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi" - - # enable php-fpm support - if use fpm ; then - my_conf="${my_conf} --enable-fpm --with-fpm-conf=/etc/php/cgi-php5/php-fpm.conf --with-fpm-log=/var/log/php-fpm.log --with-fpm-pid=/var/run/php-fpm.pid" - fi - phpconfutils_extension_enable "discard-path" "discard-path" 0 phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0 php5_2-sapi_src_compile cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI" ;; + fpm) + my_conf="${my_conf} \ + --with-fpm \ + --with-libevent=shared,/usr/lib \ + --with-fpm-conf=/etc/php/fpm-php5/php-fpm.conf \ + --with-fpm-user=php-fpm \ + --with-fpm-group=php-fpm \ + --with-fpm-log=/var/log/php-fpm.log \ + --with-fpm-pid=/var/run/php-fpm.pid" + phpconfutils_extension_enable "discard-path" "discard-path" 0 + phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0 + php5_2-sapi_src_compile + cp sapi/fpm/php-fpm php-fpm || die "Unable to copy CGI SAPI" + ;; apache2) my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2" php5_2-sapi_src_compile @@ -459,17 +487,17 @@ src_install() { into ${destdir} dobin php-cgi || die "Unable to install ${x} sapi" php5_2-sapi_install_ini - - # php-fpm patch support - if use fpm ; then - einfo "Installing php-fpm config" - FPMSRCDIR="${WORKDIR}/${P}/sapi/cgi/fpm" - insinto ${PHP_INI_DIR} - doins "${FPMSRCDIR}/php-fpm.conf" - newins "${FPMSRCDIR}/php-fpm.conf" "php-fpm.conf.dist" - einfo "Installing php-fpm initscript" - newinitd "${FILESDIR}/php-fpm.init" "php-fpm" - fi + ;; + fpm) + einfo "Installing FPM SAPI" + into ${destdir} + dobin php-fpm || die "Unable to install ${x} sapi" + php5_2-sapi_install_ini + insinto ${PHP_INI_DIR} + newins "${S}/sapi/fpm/php_fpm.conf" "php-fpm.conf" || die "Failed to install php-fpm.conf" + newins "${S}/sapi/fpm/php_fpm.conf" "php-fpm.conf.dist" || die "Failed to install php-fpm.conf.dist" + einfo "Installing php-fpm init.d" + newinitd "${FILESDIR}/php-fpm.init" "php-fpm" ;; apache2) einfo "Installing Apache${APACHE_VERSION} SAPI" @@ -558,20 +586,20 @@ pkg_postinst() { ewarn " php-select php-cgi php5" ewarn fi + fi - # php-fpm patch support - if use fpm ; then - ebegin "Creating php-fpm user and group" - enewgroup php-fpm - enewuser php-fpm -1 -1 /dev/null php-fpm - eend ${?} - - einfo - einfo "php-fpm config installed to /etc/php/cgi-php5/php-fpm.conf" - #einfo "In current state php-fpm patch supports only static pm, not apache-like" - einfo + # Create the symlinks and user for php-fpm + if use fpm ; then + "${ROOT}/usr/sbin/php-select" -t php-fpm php5 > /dev/null 2>&1 + exitStatus=$? + if [[ ${exitStatus} == 5 ]] ; then + php-select php-fpm php5 fi - + ebegin "Creating php-fpm user and group" + enewgroup php-fpm + enewuser php-fpm -1 -1 /dev/null php-fpm + eend ${?} + einfo "php-fpm config installed to /etc/php/fpm-php5/php-fpm.conf" fi # Create the symlinks for php-devel