summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Longinotti <chtekk@gentoo.org>2006-05-05 10:28:58 +0000
committerLuca Longinotti <chtekk@gentoo.org>2006-05-05 10:28:58 +0000
commitaba951810b18271cf6270116c72d82dac319217d (patch)
tree4d7fd3fa4c6280bab9af0e3c946e212453452d78 /dev-lang/php
parentversion bump (diff)
downloadgentoo-2-aba951810b18271cf6270116c72d82dac319217d.tar.gz
gentoo-2-aba951810b18271cf6270116c72d82dac319217d.tar.bz2
gentoo-2-aba951810b18271cf6270116c72d82dac319217d.zip
Sync with overlay, fix security issues and other bugs.
(Portage version: 2.1_pre10-r2)
Diffstat (limited to 'dev-lang/php')
-rw-r--r--dev-lang/php/ChangeLog10
-rw-r--r--dev-lang/php/files/digest-php-4.4.2-r29
-rw-r--r--dev-lang/php/files/digest-php-5.1.49
-rw-r--r--dev-lang/php/php-4.4.2-r2.ebuild288
-rw-r--r--dev-lang/php/php-5.1.4.ebuild288
5 files changed, 603 insertions, 1 deletions
diff --git a/dev-lang/php/ChangeLog b/dev-lang/php/ChangeLog
index 0debd57804be..ea41876d456a 100644
--- a/dev-lang/php/ChangeLog
+++ b/dev-lang/php/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-lang/php
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.86 2006/04/23 00:24:09 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.87 2006/05/05 10:28:58 chtekk Exp $
+
+*php-5.1.4 (05 May 2006)
+*php-4.4.2-r2 (05 May 2006)
+
+ 05 May 2006; Luca Longinotti <chtekk@gentoo.org> -php-4.4.2-r1.ebuild,
+ +php-4.4.2-r2.ebuild, -php-5.1.2-r1.ebuild, +php-5.1.4.ebuild:
+ Sync with PHP overlay, fixes various bugs and security bugs, see bug #131135
+ for more details.
23 Apr 2006; Diego Pettenò <flameeyes@gentoo.org> php-5.1.2-r1.ebuild:
Add ~x86-fbsd keyword.
diff --git a/dev-lang/php/files/digest-php-4.4.2-r2 b/dev-lang/php/files/digest-php-4.4.2-r2
new file mode 100644
index 000000000000..97bbe1382ab7
--- /dev/null
+++ b/dev-lang/php/files/digest-php-4.4.2-r2
@@ -0,0 +1,9 @@
+MD5 3a841a96d8d57d9bfa39344750f54f0a hardening-patch-4.4.2-0.4.9-gentoo.patch.gz 59219
+RMD160 6802aa02189489cf1e713dfde02039f888992507 hardening-patch-4.4.2-0.4.9-gentoo.patch.gz 59219
+SHA256 1a1affd04f234567cf049265fe62e9a2c3bde99193e6e17d5f8c010b04075760 hardening-patch-4.4.2-0.4.9-gentoo.patch.gz 59219
+MD5 28051cd9ef43490dd9727a4d442011b5 php-4.4.2.tar.bz2 4371185
+RMD160 cbef0fa4e233529422bc0944dcfb79d866013f5e php-4.4.2.tar.bz2 4371185
+SHA256 a2024d665125a41611eb64451648d37a81e3579594c8810bb41ac8b2b63f81eb php-4.4.2.tar.bz2 4371185
+MD5 52331faef17753dae2932966c6abcae1 php-patchset-4.4.2-r3.tar.bz2 18050
+RMD160 8c4309da5bd260536bce7523c30bbca7d9283ee6 php-patchset-4.4.2-r3.tar.bz2 18050
+SHA256 c755311adff209e488b4ebce14ed900c9c9f0d518ada7280953df4ddbb301e0e php-patchset-4.4.2-r3.tar.bz2 18050
diff --git a/dev-lang/php/files/digest-php-5.1.4 b/dev-lang/php/files/digest-php-5.1.4
new file mode 100644
index 000000000000..92be8cddb9bb
--- /dev/null
+++ b/dev-lang/php/files/digest-php-5.1.4
@@ -0,0 +1,9 @@
+MD5 6d0b7d563e5c18bc9cdd612737fc6982 hardening-patch-5.1.4-0.4.9-gentoo.patch.gz 57671
+RMD160 c9e16019388d55a17d1c198f24492d7d07d68847 hardening-patch-5.1.4-0.4.9-gentoo.patch.gz 57671
+SHA256 f877989c03d13bb3b51e9af4e9a67d535da35784ceabd19dcd85be64ff6b9efa hardening-patch-5.1.4-0.4.9-gentoo.patch.gz 57671
+MD5 b55e633bdc80ab30da7c92f760fc4b58 php-5.1.4.tar.bz2 5992825
+RMD160 5468a7d544285438c78a8f68f1169dc22e4e8a2b php-5.1.4.tar.bz2 5992825
+SHA256 43d323b1730e2bc77ec16ee374effb38ec5be0f22e906c55c2e30dfaf22bb865 php-5.1.4.tar.bz2 5992825
+MD5 5e1e40f3f7fecf45d30f599cd3c17529 php-patchset-5.1.4-r1.tar.bz2 7330
+RMD160 ed33ee236286539a0614709d944ac636b84bca45 php-patchset-5.1.4-r1.tar.bz2 7330
+SHA256 5a780b331343fa1fb6c3c4a76bf87e24e586ca2f41c5cd3824291f1b0037e961 php-patchset-5.1.4-r1.tar.bz2 7330
diff --git a/dev-lang/php/php-4.4.2-r2.ebuild b/dev-lang/php/php-4.4.2-r2.ebuild
new file mode 100644
index 000000000000..9785a73deab9
--- /dev/null
+++ b/dev-lang/php/php-4.4.2-r2.ebuild
@@ -0,0 +1,288 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-4.4.2-r2.ebuild,v 1.1 2006/05/05 10:28:58 chtekk Exp $
+
+IUSE="cgi cli discard-path force-cgi-redirect"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+# NOTE: Portage doesn't support setting PROVIDE based on the USE flags
+# that have been enabled, so we have to PROVIDE everything for now
+# and hope for the best
+PROVIDE="virtual/php virtual/httpd-php"
+
+# php package settings
+SLOT="4"
+MY_PHP_PV="${PV}"
+MY_PHP_P="php-${MY_PHP_PV}"
+PHP_PACKAGE=1
+
+# php patch settings
+PHP_PATCHSET_REV="3"
+HARDENEDPHP_PATCH="hardening-patch-${MY_PHP_PV}-0.4.9-gentoo.patch.gz"
+MULTILIB_PATCH="${MY_PHP_PV}/opt/php${MY_PHP_PV}-multilib-search-path.patch"
+FASTBUILD_PATCH="${MY_PHP_PV}/opt/php${MY_PHP_PV}-fastbuild.patch"
+
+inherit php4_4-sapi apache-module
+
+want_apache
+
+DESCRIPTION="The PHP language runtime engine."
+
+DEPEND="${DEPEND} app-admin/php-toolkit"
+RDEPEND="${RDEPEND} app-admin/php-toolkit"
+
+# PHP patchsets
+SRC_URI="${SRC_URI} http://gentoo.longitekk.com/php-patchset-${MY_PHP_PV}-r${PHP_PATCHSET_REV}.tar.bz2"
+
+# Hardened-PHP patch
+[[ -n "${HARDENEDPHP_PATCH}" ]] && SRC_URI="${SRC_URI} hardenedphp? ( http://gentoo.longitekk.com/${HARDENEDPHP_PATCH} )"
+
+pkg_setup() {
+ PHPCONFUTILS_AUTO_USE=""
+
+ # make sure the user has specified a SAPI
+ einfo "Determining SAPI(s) to build"
+ phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache apache2
+
+ if useq apache2 ; then
+ if [[ "${APACHE_VERSION}" != "0" ]] ; then
+ if ! useq threads ; then
+ APACHE2_SAFE_MPMS="peruser prefork"
+ else
+ APACHE2_SAFE_MPMS="event leader metuxmpm perchild threadpool worker"
+ fi
+
+ ewarn
+ ewarn "If this package fails with a fatal error about Apache2 not having"
+ ewarn "been compiled with a compatible MPM, this is normally because you"
+ ewarn "need to toggle the 'threads' USE flag."
+ ewarn
+ ewarn "If 'threads' is off, try switching it on."
+ ewarn "If 'threads' is on, try switching it off."
+ ewarn
+
+ apache-module_pkg_setup
+ fi
+ fi
+
+ if useq fastbuild ; then
+ ewarn
+ ewarn "'fastbuild' attempts to build all SAPIs in a single pass."
+ ewarn "This is an experimental feature, which may fail to compile"
+ ewarn "and may produce PHP binaries which are broken."
+ ewarn
+ ewarn "Rebuild without 'fastbuild' and reproduce any bugs before filing"
+ ewarn "any bugs in Gentoo's Bugzilla or bugs.php.net."
+ ewarn
+ fi
+
+ php4_4-sapi_pkg_setup
+}
+
+php_determine_sapis() {
+ # holds the list of sapis that we want to build
+ PHPSAPIS=
+
+ if useq cli || phpconfutils_usecheck cli ; then
+ PHPSAPIS="${PHPSAPIS} cli"
+ fi
+
+ if useq cgi ; then
+ PHPSAPIS="${PHPSAPIS} cgi"
+ fi
+
+ # note - we can only build one apache sapi for now
+ # note - apache SAPI comes after the simpler cli/cgi sapis
+ if useq apache || useq apache2 ; then
+ if [[ "${APACHE_VERSION}" != "0" ]] ; then
+ PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}"
+ fi
+ fi
+}
+
+src_compile() {
+ if useq fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then
+ src_compile_fastbuild
+ else
+ src_compile_normal
+ fi
+}
+
+src_compile_fastbuild() {
+ php_determine_sapis
+
+ build_cli=0
+ build_cgi=0
+ build_apache=0
+
+ for x in ${PHPSAPIS} ; do
+ case ${x} in
+ cli)
+ build_cli=1
+ ;;
+ cgi)
+ build_cgi=1
+ ;;
+ apache*)
+ build_apache=1
+ ;;
+ esac
+ done
+
+ if [[ ${build_cli} = 1 ]] ; then
+ my_conf="${my_conf} --enable-cli"
+ else
+ my_conf="${my_conf} --disable-cli"
+ fi
+
+ if [[ ${build_cgi} = 1 ]] ; then
+ my_conf="${my_conf} --enable-cgi --enable-fastcgi"
+ 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_apache} = 1 ]] ; then
+ my_conf="${my_conf} --with-apxs${USE_APACHE2}=/usr/sbin/apxs${USE_APACHE2}"
+ fi
+
+ # now we know what we are building, build it
+ php4_4-sapi_src_compile
+
+ # to keep the separate php.ini files for each SAPI, we change the
+ # build-defs.h and recompile
+
+ if [[ ${build_cli} = 1 ]] ; then
+ einfo
+ einfo "Building CLI SAPI"
+ einfo
+
+ sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php4"|g;' -i main/build-defs.h
+ sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/cli-php4/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/cli/php || die "Unable to make CLI SAPI"
+ cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
+ fi
+
+ if [[ ${build_cgi} = 1 ]] ; then
+ einfo
+ einfo "Building CGI SAPI"
+ einfo
+
+ sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php4"|g;' -i main/build-defs.h
+ sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/cgi-php4/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/cgi/php || die "Unable to make CGI SAPI"
+ cp sapi/cgi/php php-cgi || die "Unable to copy CGI SAPI"
+ fi
+
+ if [[ ${build_apache} = 1 ]] ; then
+ einfo
+ einfo "Building apache${USE_APACHE2} SAPI"
+ einfo
+
+ sed -e "s|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH \"/etc/php/apache${APACHE_VERSION}-php4\"|g;" -i main/build-defs.h
+ sed -e "s|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR \"/etc/php/apache${APACHE_VERSION}-php4/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 || die "Unable to build mod_php"
+ fi
+}
+
+src_compile_normal() {
+ php_determine_sapis
+
+ CLEAN_REQUIRED=0
+
+ for x in ${PHPSAPIS} ; do
+ if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then
+ make clean
+ fi
+
+ PHPSAPI=${x}
+
+ case ${x} in
+ cli)
+ my_conf="--enable-cli --disable-cgi"
+ php4_4-sapi_src_compile
+ cp sapi/cli/php php-cli
+ ;;
+ cgi)
+ my_conf="--disable-cli --enable-cgi --enable-fastcgi"
+ phpconfutils_extension_enable "discard-path" "discard-path" 0
+ phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
+ php4_4-sapi_src_compile
+ cp sapi/cgi/php php-cgi
+ ;;
+ apache*)
+ my_conf="--disable-cli --with-apxs${USE_APACHE2}=/usr/sbin/apxs${USE_APACHE2}"
+ php4_4-sapi_src_compile
+ ;;
+ esac
+
+ CLEAN_REQUIRED=1
+ done
+}
+
+src_install() {
+ php_determine_sapis
+
+ destdir=/usr/$(get_libdir)/php4
+
+ # let the eclass do the heavy lifting
+ php4_4-sapi_src_install
+
+ einfo
+ einfo "Installing SAPI(s) ${PHPSAPIS}"
+ einfo
+
+ for x in ${PHPSAPIS} ; do
+ PHPSAPI=${x}
+ case ${x} in
+ cli)
+ einfo "Installing CLI SAPI"
+ into ${destdir}
+ newbin php-cli php || die "Unable to install ${x} sapi"
+ php4_4-sapi_install_ini
+ ;;
+ cgi)
+ einfo "Installing CGI SAPI"
+ into ${destdir}
+ dobin php-cgi || die "Unable to install ${x} sapi"
+ php4_4-sapi_install_ini
+ ;;
+ apache*)
+ einfo "Installing apache${USE_APACHE2} SAPI"
+ make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"
+ if [[ -n "${USE_APACHE2}" ]] ; then
+ einfo "Installing Apache2 config file for PHP4 (70_mod_php.conf)"
+ insinto ${APACHE_MODULES_CONFDIR}
+ newins "${FILESDIR}/70_mod_php.conf-apache2" "70_mod_php.conf"
+ else
+ einfo "Installing Apache config file for PHP4 (70_mod_php.conf)"
+ insinto ${APACHE_MODULES_CONFDIR}
+ newins "${FILESDIR}/70_mod_php.conf-apache1" "70_mod_php.conf"
+ fi
+ php4_4-sapi_install_ini
+ ;;
+ esac
+ done
+}
+
+pkg_postinst() {
+ # Output some general info to the user
+ if useq apache || useq apache2 ; then
+ APACHE1_MOD_DEFINE="PHP4"
+ APACHE1_MOD_CONF="70_mod_php"
+ APACHE2_MOD_DEFINE="PHP4"
+ APACHE2_MOD_CONF="70_mod_php"
+ apache-module_pkg_postinst
+ fi
+ php4_4-sapi_pkg_postinst
+}
diff --git a/dev-lang/php/php-5.1.4.ebuild b/dev-lang/php/php-5.1.4.ebuild
new file mode 100644
index 000000000000..15663a070e20
--- /dev/null
+++ b/dev-lang/php/php-5.1.4.ebuild
@@ -0,0 +1,288 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.1.4.ebuild,v 1.1 2006/05/05 10:28:58 chtekk Exp $
+
+IUSE="cgi cli discard-path force-cgi-redirect"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+# NOTE: Portage doesn't support setting PROVIDE based on the USE flags
+# that have been enabled, so we have to PROVIDE everything for now
+# and hope for the best
+PROVIDE="virtual/php virtual/httpd-php"
+
+# php package settings
+SLOT="5"
+MY_PHP_PV="${PV}"
+MY_PHP_P="php-${MY_PHP_PV}"
+PHP_PACKAGE=1
+
+# php patch settings
+PHP_PATCHSET_REV="1"
+HARDENEDPHP_PATCH="hardening-patch-${MY_PHP_PV}-0.4.9-gentoo.patch.gz"
+MULTILIB_PATCH="${MY_PHP_PV}/opt/php${MY_PHP_PV}-multilib-search-path.patch"
+FASTBUILD_PATCH="${MY_PHP_PV}/opt/php${MY_PHP_PV}-fastbuild.patch"
+
+inherit php5_1-sapi apache-module
+
+want_apache
+
+DESCRIPTION="The PHP language runtime engine."
+
+DEPEND="${DEPEND} app-admin/php-toolkit"
+RDEPEND="${RDEPEND} app-admin/php-toolkit"
+
+# PHP patchsets
+SRC_URI="${SRC_URI} http://gentoo.longitekk.com/php-patchset-${MY_PHP_PV}-r${PHP_PATCHSET_REV}.tar.bz2"
+
+# Hardened-PHP patch
+[[ -n "${HARDENEDPHP_PATCH}" ]] && SRC_URI="${SRC_URI} hardenedphp? ( http://gentoo.longitekk.com/${HARDENEDPHP_PATCH} )"
+
+pkg_setup() {
+ PHPCONFUTILS_AUTO_USE=""
+
+ # make sure the user has specified a SAPI
+ einfo "Determining SAPI(s) to build"
+ phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache apache2
+
+ if useq apache2 ; then
+ if [[ "${APACHE_VERSION}" != "0" ]] ; then
+ if ! useq threads ; then
+ APACHE2_SAFE_MPMS="peruser prefork"
+ else
+ APACHE2_SAFE_MPMS="event leader metuxmpm perchild threadpool worker"
+ fi
+
+ ewarn
+ ewarn "If this package fails with a fatal error about Apache2 not having"
+ ewarn "been compiled with a compatible MPM, this is normally because you"
+ ewarn "need to toggle the 'threads' USE flag."
+ ewarn
+ ewarn "If 'threads' is off, try switching it on."
+ ewarn "If 'threads' is on, try switching it off."
+ ewarn
+
+ apache-module_pkg_setup
+ fi
+ fi
+
+ if useq fastbuild ; then
+ ewarn
+ ewarn "'fastbuild' attempts to build all SAPIs in a single pass."
+ ewarn "This is an experimental feature, which may fail to compile"
+ ewarn "and may produce PHP binaries which are broken."
+ ewarn
+ ewarn "Rebuild without 'fastbuild' and reproduce any bugs before filing"
+ ewarn "any bugs in Gentoo's Bugzilla or bugs.php.net."
+ ewarn
+ fi
+
+ php5_1-sapi_pkg_setup
+}
+
+php_determine_sapis() {
+ # holds the list of sapis that we want to build
+ PHPSAPIS=
+
+ if useq cli || phpconfutils_usecheck cli ; then
+ PHPSAPIS="${PHPSAPIS} cli"
+ fi
+
+ if useq cgi ; then
+ PHPSAPIS="${PHPSAPIS} cgi"
+ fi
+
+ # note - we can only build one apache sapi for now
+ # note - apache SAPI comes after the simpler cli/cgi sapis
+ if useq apache || useq apache2 ; then
+ if [[ "${APACHE_VERSION}" != "0" ]] ; then
+ PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}"
+ fi
+ fi
+}
+
+src_compile() {
+ if useq fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then
+ src_compile_fastbuild
+ else
+ src_compile_normal
+ fi
+}
+
+src_compile_fastbuild() {
+ php_determine_sapis
+
+ build_cli=0
+ build_cgi=0
+ build_apache=0
+
+ for x in ${PHPSAPIS} ; do
+ case ${x} in
+ cli)
+ build_cli=1
+ ;;
+ cgi)
+ build_cgi=1
+ ;;
+ apache*)
+ build_apache=1
+ ;;
+ esac
+ done
+
+ if [[ ${build_cli} = 1 ]] ; then
+ my_conf="${my_conf} --enable-cli"
+ else
+ my_conf="${my_conf} --disable-cli"
+ fi
+
+ if [[ ${build_cgi} = 1 ]] ; then
+ my_conf="${my_conf} --enable-cgi --enable-fastcgi"
+ 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_apache} = 1 ]] ; then
+ my_conf="${my_conf} --with-apxs${USE_APACHE2}=/usr/sbin/apxs${USE_APACHE2}"
+ fi
+
+ # now we know what we are building, build it
+ php5_1-sapi_src_compile
+
+ # to keep the separate php.ini files for each SAPI, we change the
+ # build-defs.h and recompile
+
+ if [[ ${build_cli} = 1 ]] ; then
+ einfo
+ einfo "Building CLI SAPI"
+ einfo
+
+ sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php5"|g;' -i main/build-defs.h
+ sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/cli-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/cli/php || die "Unable to make CLI SAPI"
+ cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
+ fi
+
+ if [[ ${build_cgi} = 1 ]] ; then
+ einfo
+ einfo "Building CGI SAPI"
+ einfo
+
+ sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php5"|g;' -i main/build-defs.h
+ sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/cgi-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/cgi/php || die "Unable to make CGI SAPI"
+ cp sapi/cgi/php php-cgi || die "Unable to copy CGI SAPI"
+ fi
+
+ if [[ ${build_apache} = 1 ]] ; then
+ einfo
+ einfo "Building apache${USE_APACHE2} SAPI"
+ einfo
+
+ sed -e "s|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH \"/etc/php/apache${APACHE_VERSION}-php5\"|g;" -i main/build-defs.h
+ sed -e "s|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR \"/etc/php/apache${APACHE_VERSION}-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 || die "Unable to build mod_php"
+ fi
+}
+
+src_compile_normal() {
+ php_determine_sapis
+
+ CLEAN_REQUIRED=0
+
+ for x in ${PHPSAPIS} ; do
+ if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then
+ make clean
+ fi
+
+ PHPSAPI=${x}
+
+ case ${x} in
+ cli)
+ my_conf="--enable-cli --disable-cgi"
+ php5_1-sapi_src_compile
+ cp sapi/cli/php php-cli
+ ;;
+ cgi)
+ my_conf="--disable-cli --enable-cgi --enable-fastcgi"
+ phpconfutils_extension_enable "discard-path" "discard-path" 0
+ phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
+ php5_1-sapi_src_compile
+ cp sapi/cgi/php php-cgi
+ ;;
+ apache*)
+ my_conf="--disable-cli --with-apxs${USE_APACHE2}=/usr/sbin/apxs${USE_APACHE2}"
+ php5_1-sapi_src_compile
+ ;;
+ esac
+
+ CLEAN_REQUIRED=1
+ done
+}
+
+src_install() {
+ php_determine_sapis
+
+ destdir=/usr/$(get_libdir)/php5
+
+ # let the eclass do the heavy lifting
+ php5_1-sapi_src_install
+
+ einfo
+ einfo "Installing SAPI(s) ${PHPSAPIS}"
+ einfo
+
+ for x in ${PHPSAPIS} ; do
+ PHPSAPI=${x}
+ case ${x} in
+ cli)
+ einfo "Installing CLI SAPI"
+ into ${destdir}
+ newbin php-cli php || die "Unable to install ${x} sapi"
+ php5_1-sapi_install_ini
+ ;;
+ cgi)
+ einfo "Installing CGI SAPI"
+ into ${destdir}
+ dobin php-cgi || die "Unable to install ${x} sapi"
+ php5_1-sapi_install_ini
+ ;;
+ apache*)
+ einfo "Installing apache${USE_APACHE2} SAPI"
+ make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"
+ if [[ -n "${USE_APACHE2}" ]] ; then
+ einfo "Installing Apache2 config file for PHP5 (70_mod_php5.conf)"
+ insinto ${APACHE_MODULES_CONFDIR}
+ newins "${FILESDIR}/70_mod_php5.conf-apache2" "70_mod_php5.conf"
+ else
+ einfo "Installing Apache config file for PHP5 (70_mod_php5.conf)"
+ insinto ${APACHE_MODULES_CONFDIR}
+ newins "${FILESDIR}/70_mod_php5.conf-apache1" "70_mod_php5.conf"
+ fi
+ php5_1-sapi_install_ini
+ ;;
+ esac
+ done
+}
+
+pkg_postinst() {
+ # Output some general info to the user
+ if useq apache || useq apache2 ; then
+ APACHE1_MOD_DEFINE="PHP5"
+ APACHE1_MOD_CONF="70_mod_php5"
+ APACHE2_MOD_DEFINE="PHP5"
+ APACHE2_MOD_CONF="70_mod_php5"
+ apache-module_pkg_postinst
+ fi
+ php5_1-sapi_pkg_postinst
+}