diff options
-rw-r--r-- | eclass/php-ext-base.eclass | 129 | ||||
-rw-r--r-- | eclass/php-ext-pecl-r1.eclass | 9 | ||||
-rw-r--r-- | eclass/php-ext-pecl.eclass | 40 | ||||
-rw-r--r-- | eclass/php-ext-source-r1.eclass | 11 | ||||
-rw-r--r-- | eclass/php-ext.eclass | 114 | ||||
-rw-r--r-- | eclass/php-lib.eclass | 39 | ||||
-rw-r--r-- | eclass/php-pear-lib-r1.eclass | 19 | ||||
-rw-r--r-- | eclass/php-pear.eclass | 39 | ||||
-rw-r--r-- | eclass/php-sapi.eclass | 683 | ||||
-rw-r--r-- | eclass/php4_4-sapi.eclass | 81 | ||||
-rw-r--r-- | eclass/php5-sapi-r1.eclass | 494 | ||||
-rw-r--r-- | eclass/php5-sapi-r2.eclass | 579 | ||||
-rw-r--r-- | eclass/php5-sapi-r3.eclass | 557 | ||||
-rw-r--r-- | eclass/php5-sapi.eclass | 497 | ||||
-rw-r--r-- | eclass/php5_2-sapi.eclass | 79 |
15 files changed, 288 insertions, 3082 deletions
diff --git a/eclass/php-ext-base.eclass b/eclass/php-ext-base.eclass index b69e9406655f..dc6c8b96a2e1 100644 --- a/eclass/php-ext-base.eclass +++ b/eclass/php-ext-base.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-base.eclass,v 1.20 2007/05/12 02:54:35 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-base.eclass,v 1.21 2007/09/02 17:49:20 jokey Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # Author: Stuart Herbert <stuart@gentoo.org> @@ -11,131 +11,36 @@ # Combined with php-ext-source, we have a standardised solution for supporting # PHP extensions +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php-ext-base-r1.eclass instead! -EXPORT_FUNCTIONS src_install +inherit php-ext-base-r1 -# ---begin ebuild configurable settings - -# The extension name, this must be set, otherwise we die. -[ -z "$PHP_EXT_NAME" ] && die "No module name specified for the php-ext eclass." - -# Wether the extensions is a Zend Engine extension -#(defaults to "no" and if you don't know what is it, you don't need it.) -[ -z "$PHP_EXT_ZENDEXT" ] && PHP_EXT_ZENDEXT="no" - -# Wether or not to add a line in the php.ini for the extension -# (defaults to "yes" and shouldn't be changed in most cases) -[ -z "$PHP_EXT_INI" ] && PHP_EXT_INI="yes" - -# find out where to install extensions -EXT_DIR="`php-config --extension-dir 2>/dev/null`" - -# ---end ebuild configurable settings - -DEPEND="${DEPEND} - dev-php/php - >=sys-devel/m4-1.4 - >=sys-devel/libtool-1.4.3" - -RDEPEND="${RDEPEND} - virtual/php" +deprecation_warning() { + eerror "Please upgrade ${PF} to use php-ext-base-r1.eclass!" +} php-ext-base_buildinilist () { - # work out the list of .ini files to edit/add to - - if [ -z "${PHPSAPILIST}" ]; then - PHPSAPILIST="apache2 cli cgi" - fi - - PHPINIFILELIST= - - for x in ${PHPSAPILIST} ; do - if [ -f /etc/php/${x}-php4/php.ini ]; then - PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-php4/php.ini" - fi - - if [ -f /etc/php/${x}-php5/php.ini ]; then - PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-php5/php.ini" - fi - done - - if [ "${PHPINIFILELIST}+" = "+" ] ; then - # backwards support for the old location - - if [ -f /etc/php4/php.ini ] ; then - PHPINIFILELIST="etc/php4/php.ini" - else - msg="No PHP ini files found for this extension" - eerror ${msg} - die ${msg} - fi - fi - -# einfo "php.ini files found in $PHPINIFILELIST" + deprecation_warning + php-ext-base-r1_buildinilist } php-ext-base_src_install() { - addpredict /usr/share/snmp/mibs/.index - php-ext-base_buildinilist - if [ "$PHP_EXT_INI" = "yes" ] ; then - php-ext-base_addextension "${PHP_EXT_NAME}.so" - fi + deprecation_warning + php-ext-base-r1_src_install } php-ext-base_addextension () { - if [ "${PHP_EXT_ZENDEXT}" = "yes" ]; then - ext_type="zend_extension" - ext_file="${EXT_DIR}/$1" - else - # we do *not* add the full path for the extension! - ext_type="extension" - ext_file="$1" - fi - - php-ext-base_addtoinifiles "$ext_type" "$ext_file" "Extension added" -} - -php-ext-base_setting_is_present () { - grep "^$1=$2" /$3 > /dev/null 2>&1 -} - -php-ext-base_inifileinimage () { - if [ ! -f $1 ]; then - mkdir -p `dirname $1` - cp /$1 $1 - fi + deprecation_warning + php-ext-base-r1_addextension } -# $1 - setting name -# $2 - setting value -# $3 - file to add to -# $4 - sanitised text to output - php-ext-base_addtoinifile () { - if [ "$1" != "extension" ] && [ "$1" != "zend_extension" ]; then - php-ext-base_setting_is_present $1 "" $3 && return - else - php-ext-base_setting_is_present "$1" "$2" "$3" && return - fi - - php-ext-base_inifileinimage $3 - - echo "$1=$2" >> $3 - - if [ -z "$4" ]; then - einfo "Added '$1=$2' to /$3" - else - einfo "$4 to /$3" - fi - - # yes, this is inefficient - but it works every time ;-) - - insinto /`dirname $3` - doins $3 + deprecation_warning + php-ext-base-r1_addtoinifile } php-ext-base_addtoinifiles () { - for x in ${PHPINIFILELIST} ; do - php-ext-base_addtoinifile $1 $2 $x "$3" - done + deprecation_warning + php-ext-base-r1_addtoinifiles } diff --git a/eclass/php-ext-pecl-r1.eclass b/eclass/php-ext-pecl-r1.eclass index 8204a6f5b27d..c636e8f5f9e0 100644 --- a/eclass/php-ext-pecl-r1.eclass +++ b/eclass/php-ext-pecl-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-pecl-r1.eclass,v 1.8 2007/09/01 15:58:17 jokey Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-pecl-r1.eclass,v 1.9 2007/09/02 17:49:20 jokey Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # Author: Luca Longinotti <chtekk@gentoo.org> @@ -34,9 +34,6 @@ # Unlike PHP_EXT_PECL_PKG, setting this variable does not affect # HOMEPAGE, PHP_EXT_NAME or ${S}. -# @VARIABLE: DOCS -# @DESCRIPTION: -# Set in ebuild if you wish to install additional, package-specific documentation. [[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}" @@ -74,6 +71,10 @@ php-ext-pecl-r1_src_compile() { # Takes care of standard install for PECL packages. # You can also simply add examples to IUSE to automagically install # examples supplied with the package. + +# @VARIABLE: DOCS +# @DESCRIPTION: +# Set in ebuild if you wish to install additional, package-specific documentation. php-ext-pecl-r1_src_install() { has_php php-ext-source-r1_src_install diff --git a/eclass/php-ext-pecl.eclass b/eclass/php-ext-pecl.eclass index a1a12a32e962..2464f9aa8c4f 100644 --- a/eclass/php-ext-pecl.eclass +++ b/eclass/php-ext-pecl.eclass @@ -1,45 +1,27 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-pecl.eclass,v 1.5 2005/07/06 20:23:20 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-pecl.eclass,v 1.6 2007/09/02 17:49:20 jokey Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # # This eclass should be used by all dev-php/PECL-* ebuilds, as a uniform way of installing PECL extensions. # For more information about PECL, see: http://pecl.php.net -[ -z "$PHP_EXT_PECL_PKG" ] && PHP_EXT_PECL_PKG=${PN/PECL-/} -PECL_PKG=$PHP_EXT_PECL_PKG -PECL_PKG_V=$PECL_PKG-$PV +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php-ext-pecl-r1.eclass instead! -[ -z "$PHP_EXT_NAME" ] && PHP_EXT_NAME=$PECL_PKG +inherit php-ext-pecl-r1 -inherit php-ext-source - - -EXPORT_FUNCTIONS src_compile src_install - -# ---begin ebuild configurable settings - -# Needs to be set if the filename is other than the package name -if [ -n "$PHP_EXT_PECL_FILENAME" ]; then - FILENAME="${PHP_EXT_PECL_FILENAME}-${PV}.tgz" -else - FILENAME="${PECL_PKG_V}.tgz" -fi - -# ---end ebuild configurable settings - -SRC_URI="http://pecl.php.net/get/${FILENAME}" -HOMEPAGE="http://pecl.php.net/${PECL_PKG}" -S=${WORKDIR}/${PECL_PKG_V} +deprecation_warning() { + eerror "Please upgrade ${PF} to use php-ext-pecl-r1.eclass!" +} php-ext-pecl_src_compile() { - php-ext-source_src_compile + deprecation_warning + php-ext-pecl-r1_src_compile } php-ext-pecl_src_install() { - php-ext-source_src_install - - # Those two are always present - dodoc $WORKDIR/package.xml CREDITS + deprecation_warning + php-ext-pecl-r1_src_install } diff --git a/eclass/php-ext-source-r1.eclass b/eclass/php-ext-source-r1.eclass index eaf45898ca7c..edf133046fb7 100644 --- a/eclass/php-ext-source-r1.eclass +++ b/eclass/php-ext-source-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.13 2007/09/01 15:58:17 jokey Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.14 2007/09/02 17:49:20 jokey Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # Author: Stuart Herbert <stuart@gentoo.org> @@ -34,6 +34,11 @@ DEPEND=">=sys-devel/m4-1.4.3 >=sys-devel/libtool-1.5.18" RDEPEND="" + +# @FUNCTION: php-ext-source-r1_src_compile +# @DESCRIPTION: +# Takes care of standard compile for PHP extensions (modules). + # @VARIABLE: PHP_EXT_SKIP_PHPIZE # @DESCRIPTION: # phpize will be run by default for all ebuilds that use php-ext-source-r1_src_compile. @@ -42,10 +47,6 @@ RDEPEND="" # @VARIABLE: my_conf # @DESCRIPTION: # Set this in the ebuild to pass configure options to econf. - -# @FUNCTION: php-ext-source-r1_src_compile -# @DESCRIPTION: -# Takes care of standard compile for PHP extensions (modules). php-ext-source-r1_src_compile() { # Pull in the PHP settings has_php diff --git a/eclass/php-ext.eclass b/eclass/php-ext.eclass index 916e5c299493..1e72feb48a4d 100644 --- a/eclass/php-ext.eclass +++ b/eclass/php-ext.eclass @@ -1,126 +1,56 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext.eclass,v 1.11 2006/10/14 20:27:21 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext.eclass,v 1.12 2007/09/02 17:49:20 jokey Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # # The php-ext eclass provides a unified interface for compiling and # installing standalone PHP extensions ('modules'). +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php-ext-source-r1.eclass instead! -EXPORT_FUNCTIONS src_compile src_install pkg_postinst +inherit php-ext-source-r1 php-ext-base-r1 -# ---begin ebuild configurable settings - -# The extension name, this must be set, otherwise we die. -[ -z "$PHP_EXT_NAME" ] && die "No module name specified for the php-ext eclass." - -# Wether the extensions is a Zend Engine extension -#(defaults to "no" and if you don't know what is it, you don't need it.) -[ -z "$PHP_EXT_ZENDEXT" ] && PHP_EXT_ZENDEXT="no" - -# Wether or not to add a line in the php.ini for the extension -# (defaults to "yes" and shouldn't be changed in most cases) -[ -z "$PHP_EXT_INI" ] && PHP_EXT_INI="yes" - -# ---end ebuild configurable settings - -DEPEND="${DEPEND} - virtual/php - >=sys-devel/m4-1.4 - >=sys-devel/libtool-1.4.3" - -RDEPEND="${RDEPEND} - virtual/php" +deprecation_warning() { + eerror "Please upgrade ${PF} to use php-ext-source-r1.eclass!" +} php-ext_buildinilist () { - # work out the list of .ini files to edit/add to - - if [ -z "${PHPSAPILIST}" ]; then - PHPSAPILIST="apache1 apache2 cli" - fi - - PHPINIFILELIST="" - - for x in ${PHPSAPILIST} ; do - if [ -f /etc/php/${x}-php4/php.ini ]; then - PHPINIFILELIST="${PHPINIFILELIST} /etc/php/${x}-php4/php.ini" - fi - done - - if [[ ${PHPINIFILELIST} = "" ]]; then - msg="No PHP ini files found for this extension" - eerror ${msg} - die ${msg} - fi - -# einfo "php.ini files found in $PHPINIFILELIST" + deprecation_warning + php-ext-base-r1_buildinilist } php-ext_src_compile() { - addpredict /usr/share/snmp/mibs/.index - #phpize creates configure out of config.m4 - phpize - econf $myconf - emake || die + deprecation_warning + php-ext-source-r1_src_compile } php-ext_src_install() { - chmod +x build/shtool - #this will usually be /usr/lib/php/extensions/no-debug-no-zts-20020409/ - #but i prefer not taking this risk - EXT_DIR="`php-config --extension-dir 2>/dev/null`" - insinto $EXT_DIR - doins modules/$PHP_EXT_NAME.so + deprecation_warning + php-ext-source-r1_src_install } php-ext_pkg_postinst() { - if [ "$PHP_EXT_INI" = "yes" ] ; then - php-ext_buildinilist - php-ext_addextension "${EXT_DIR}/${PHP_EXT_NAME}.so" - fi -} - -php-ext_extension_is_present () { - grep "^$1=$2" $3 > /dev/null 2>&1 + deprecation_warning } php-ext_addextensiontoinifile () { - php-ext_extension_is_present $1 $2 $3 && return - - einfo "Extension added to $3" - echo "$1=$2" >> $3 + deprecation_warning + php-ext-base-r1_addtoinifiles } php-ext_addextension () { - if [ "${PHP_EXT_ZENDEXT}" = "yes" ]; then - ext="zend_extension" - else - ext="extension" - fi - - for x in ${PHPINIFILELIST} ; do - php-ext_addextensiontoinifile "$ext" "$1" "$x" - done -} - -php-ext_setting_is_present () { - grep "^$1=" $2 > /dev/null 2>&1 + deprecation_warning + php-ext-base-r1_addextension } -# $1 - setting name -# $2 - setting value -# $3 - file to add to - php-ext_addtoinifile () { - php-ext_setting_is_present $1 $3 && return - - einfo "Added '$1=$2' to $3" - echo "$1=$2" >> $3 + deprecation_warning + php-ext-base-r1_addtoinifile } php-ext_addtoinifiles () { - for x in ${PHPINIFILELIST} ; do - php-ext_addtoinifile $1 $2 $x - done + deprecation_warning + php-ext-base-r1_addtoinifiles } diff --git a/eclass/php-lib.eclass b/eclass/php-lib.eclass index 8a0e87ab82ba..e9915c2f2185 100644 --- a/eclass/php-lib.eclass +++ b/eclass/php-lib.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-lib.eclass,v 1.5 2007/07/02 14:24:27 peper Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-lib.eclass,v 1.6 2007/09/02 17:49:20 jokey Exp $ # # Author: Stuart Herbert <stuart@gentoo.org> # @@ -10,37 +10,16 @@ # # This eclass doesn't do a lot (yet) -RESTRICT="${RESTRICT} strip" +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php-lib-r1.eclass instead! -EXPORT_FUNCTIONS src_install +inherit php-lib-r1 -# ---begin ebuild configurable settings - -# provide default extension name if necessary -[ -z "$PHP_LIB_NAME" ] && PHP_LIB_NAME="${PN}" - -PHP_LIB_DIR="/usr/lib/php/${PHP_LIB_NAME}" - -# ---end ebuild configurable settings - -DEPEND="${DEPEND} - virtual/php" - -# you have to pass in a list of the PHP files to install -# -# $1 - directory in ${S} to insert from -# $2 ... list of files to install +deprecation_warning() { + eerror "Please upgrade ${PF} to use php-lib-r1.eclass!" +} php-lib_src_install() { - local x - - S_DIR="$1" - shift - - for x in $@ ; do - SUBDIR="`dirname $x`" - insinto ${PHP_LIB_DIR}/${SUBDIR} - doins ${S_DIR}/$x - done + deprecation_warning + php-lib-r1_src_install } - diff --git a/eclass/php-pear-lib-r1.eclass b/eclass/php-pear-lib-r1.eclass index 95b95ec85adf..430edceab02f 100644 --- a/eclass/php-pear-lib-r1.eclass +++ b/eclass/php-pear-lib-r1.eclass @@ -1,13 +1,17 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-lib-r1.eclass,v 1.11 2007/03/22 20:12:56 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-lib-r1.eclass,v 1.12 2007/09/02 17:49:20 jokey Exp $ # # Author: Luca Longinotti <chtekk@gentoo.org> -# Maintained by the PHP Team <php-bugs@gentoo.org> -# -# The php-pear-lib-r1 eclass provides means for an easy installation of PEAR -# based libraries, such as Creole, Jargon, Phing etc., while retaining -# the functionality to put the libraries into version-dependant directories. + +# @ECLASS: php-pear-lib-r1.eclass +# @MAINTAINER: +# Gentoo PHP team <php-bugs@gentoo.org> +# @BLURB: Provides means for an easy installation of PEAR-based libraries. +# @DESCRIPTION: +# This class provides means for an easy installation of PEAR-based libraries, +# such as Creole, Jargon, Phing etc., while retaining the functionality to put +# the libraries into version-dependant directories. inherit depend.php @@ -16,6 +20,9 @@ EXPORT_FUNCTIONS src_install DEPEND="dev-lang/php >=dev-php/PEAR-PEAR-1.4.6" RDEPEND="${DEPEND}" +# @FUNCTION: php-pear-lib-r1_src_install +# @DESCRIPTION: +# Takes care of standard install for PEAR-based libraries. php-pear-lib-r1_src_install() { has_php diff --git a/eclass/php-pear.eclass b/eclass/php-pear.eclass index 34a70d769ced..9b55d5b6e250 100644 --- a/eclass/php-pear.eclass +++ b/eclass/php-pear.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear.eclass,v 1.13 2005/09/04 12:57:44 stuart Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear.eclass,v 1.14 2007/09/02 17:49:20 jokey Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # @@ -10,39 +10,16 @@ # Note that this eclass doesn't handle PEAR packages' dependencies on # purpose, please use (R)DEPEND to define them. -EXPORT_FUNCTIONS src_install +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php-pear-r1.eclass instead! -# Set this is the the package name on PEAR is different than the one in -# portage (generally shouldn't be the case). -[ -z "$PHP_PEAR_PKG_NAME" ] && PHP_PEAR_PKG_NAME=${PN/PEAR-/} +inherit php-pear-r1 -# We must depend on the virtual as well as the base package as we need it to do -# install tasks (it provides the pear binary). -DEPEND="$DEPEND virtual/php dev-php/php" -RDEPEND="$RDEPEND $DEPEND" - -fix_PEAR_PV() { - tmp=$PV - tmp=${tmp/_/} - tmp=${tmp/rc/RC} - tmp=${tmp/beta/b} - PEAR_PV=$tmp +deprecation_warning() { + eerror "Please upgrade ${PF} to use php-pear-r1.eclass!" } -PEAR_PV="" -fix_PEAR_PV -PEAR_PN=${PHP_PEAR_PKG_NAME}-${PEAR_PV} - -[ -z "$SRC_URI" ] && SRC_URI="http://pear.php.net/get/${PEAR_PN}.tgz" -[ -z "$HOMEPAGE" ] && HOMEPAGE="http://pear.php.net/${PHP_PEAR_PKG_NAME}" -S="${WORKDIR}/${PEAR_PN}" - php-pear_src_install () { - # SNMP is nuts sometimes - addpredict /usr/share/snmp/mibs/.index - addpredict /var/lib/net-snmp/ - - cd ${S} - mv ${WORKDIR}/package.xml ${S} - pear install --nodeps -R ${D} ${S}/package.xml || die + deprecation_warning + php-pear-r1_src_install } diff --git a/eclass/php-sapi.eclass b/eclass/php-sapi.eclass index cc2e062074d3..0e38d362ea62 100644 --- a/eclass/php-sapi.eclass +++ b/eclass/php-sapi.eclass @@ -1,700 +1,43 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-sapi.eclass,v 1.92 2007/03/26 20:19:22 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-sapi.eclass,v 1.93 2007/09/02 17:49:20 jokey Exp $ # Author: Robin H. Johnson <robbat2@gentoo.org> -inherit eutils flag-o-matic multilib libtool +# DEPRECATED!!! +# STOP USING THIS ECLASS, use one of the php?_?-sapi eclasses instead! -DESCRIPTION="PHP generic SAPI ebuild" - -EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_preinst - -[ -z "${MY_PN}" ] && MY_PN=php -if [ -z "${MY_PV}" ]; then - MY_PV=${PV/_rc/RC} - # maybe do stuff for beta/alpha/pre here too? -fi - -# our major ver number -PHPMAJORVER=${MY_PV//\.*} - -[ -z "${MY_P}" ] && MY_P=${MY_PN}-${MY_PV} -[ -z "${MY_PF}" ] && MY_PF=${MY_P}-${PR} -[ -z "${HOMEPAGE}" ] && HOMEPAGE="http://www.php.net/" -[ -z "${LICENSE}" ] && LICENSE="PHP-3" -[ -z "${PROVIDE}" ] && PROVIDE="virtual/php" -# PHP.net does automatic mirroring from this URI -[ -z "${SRC_URI_BASE}" ] && SRC_URI_BASE="http://www.php.net/distributions" -if [ -z "${SRC_URI}" ]; then - SRC_URI="${SRC_URI_BASE}/${MY_P}.tar.bz2" -fi -# A patch for PHP for security. PHP-CLI interface is exempt, as it cannot be -# fed bad data from outside. -if [ "${PHPSAPI}" != "cli" ]; then - SRC_URI="${SRC_URI} mirror://gentoo/php-4.3.2-fopen-url-secure.patch" -fi - -# Patch for bug 50991, 49420 -# Make sure the correct include_path is used. -SRC_URI="${SRC_URI} mirror://gentoo/php-4.3.6-includepath.diff http://dev.gentoo.org/~robbat2/distfiles/php-4.3.6-includepath.diff" - -[ "${PV//4.3.6}" != "${PV}" ] && SRC_URI="${SRC_URI} http://www.apache.org/~jorton/php-4.3.6-pcrealloc.patch" - -# Where we work -S=${WORKDIR}/${MY_P} - -IUSE="X crypt curl firebird flash freetds gd gd-external gdbm imap informix ipv6 java jpeg ldap mcal memlimit mysql nls oci8 odbc pam png postgres snmp spell ssl tiff truetype xml2 yaz fdftk doc gmp kerberos hardenedphp mssql debug" - -# Hardened-PHP support -# -# I've done it like this, so that we can support different versions of -# the patch for different versions of PHP - -case "$PV" in - 4.3.11) HARDENEDPHP_PATCH="hardening-patch-$PV-0.3.2.patch.gz" ;; - 4.4.0) HARDENEDPHP_PATCH="hardening-patch-$PV-0.3.2.patch.gz" ;; -esac - -[ -n "$HARDENEDPHP_PATCH" ] && SRC_URI="${SRC_URI} hardenedphp? ( http://www.hardened-php.net/$HARDENEDPHP_PATCH )" - -# berkdb stuff is complicated -# we need db-1.* for ndbm -# and then either of db3 or db4 -IUSE="${IUSE} berkdb" -RDEPEND="${RDEPEND} berkdb? ( =sys-libs/db-1* - || ( >=sys-libs/db-4.0.14-r2 - >=sys-libs/db-3.2.9-r9 - ) - )" - -# Everything is in this list is dynamically linked agaist or needed at runtime -# in some other way -# -# 2004/03/28 - stuart - added dependency on the php manual snapshot - -RDEPEND="${RDEPEND} - !dev-lang/php - app-arch/bzip2 - X? ( x11-libs/libXpm ) - crypt? ( >=dev-libs/libmcrypt-2.4 >=app-crypt/mhash-0.8 ) - curl? ( >=net-misc/curl-7.10.2 ) - x86? ( firebird? ( >=dev-db/firebird-1.0 ) ) - freetds? ( >=dev-db/freetds-0.53 ) - gd-external? ( media-libs/gd >=media-libs/jpeg-6b - >=media-libs/libpng-1.2.5 ) - gd? ( >=media-libs/jpeg-6b >=media-libs/libpng-1.2.5 ) - gdbm? ( >=sys-libs/gdbm-1.8.0 ) - !alpha? ( !amd64? ( java? ( =virtual/jdk-1.4* dev-java/java-config ) ) ) - jpeg? ( >=media-libs/jpeg-6b ) - ldap? ( >=net-nds/openldap-1.2.11 ) - mysql? ( virtual/mysql ) - nls? ( sys-devel/gettext ) - odbc? ( >=dev-db/unixODBC-1.8.13 ) - pam? ( >=sys-libs/pam-0.75 ) - png? ( >=media-libs/libpng-1.2.5 ) - postgres? ( >=dev-db/postgresql-7.1 ) - snmp? ( net-analyzer/net-snmp ) - spell? ( app-text/aspell ) - ssl? ( >=dev-libs/openssl-0.9.5 ) - tiff? ( >=media-libs/tiff-3.5.5 ) - xml2? ( dev-libs/libxml2 >=dev-libs/libxslt-1.0.30 ) - truetype? ( =media-libs/freetype-2* =media-libs/freetype-1* - media-libs/t1lib ) - >=net-libs/libwww-5.3.2 - >=app-text/sablotron-0.97 - dev-libs/expat - sys-libs/zlib - virtual/mta - >=sys-apps/file-4.02 - yaz? ( dev-libs/yaz ) - doc? ( app-doc/php-docs ) - gmp? ( dev-libs/gmp ) - mssql? ( dev-db/freetds ) - kerberos? ( virtual/krb5 )" - -# USE structure doesn't support ~x86 -#if hasq '~x86' $ACCEPT_KEYWORDS; then - # FDFTK only available for x86 type hardware - #RDEPEND="${RDEPEND} x86? ( fdftk? ( app-text/fdftk ) )" -#fi - -# libswf is ONLY available on x86 -RDEPEND="${RDEPEND} flash? ( - x86? ( media-libs/libswf ) - >=media-libs/ming-0.2a )" - -#The new XML extension in PHP5 requires libxml2-2.5.10 -if [ "${PHPMAJORVER}" -ge 5 ]; then - RDEPEND="${RDEPEND} >=dev-libs/libxml2-2.5.10" -fi - -# ncurses and readline are only valid on the CLI php -if [ "${PN}" = "php" ]; then - RDEPEND="${RDEPEND} - readline? ( >=sys-libs/ncurses-5.1 >=sys-libs/readline-4.1 ) - ncurses? ( >=sys-libs/ncurses-5.1 )" - IUSE="${IUSE} ncurses readline" -fi - - -# These are extra bits we need only at compile time -DEPEND="${RDEPEND} ${DEPEND} - imap? ( virtual/imap-c-client ) - mcal? ( dev-libs/libmcal !=dev-libs/libmcal-0.7-r2 )" -#9libs causes a configure error -DEPEND="${DEPEND} !dev-libs/9libs" -#dev-libs/libiconv causes a compile failure -DEPEND="${DEPEND} !dev-libs/libiconv" - -#Waiting for somebody to want this: -#cyrus? ( net-mail/cyrus-imapd net-mail/cyrus-imap-admin dev-libs/cyrus-imap-dev ) - -# this is because dev-php/php provides all of the PEAR stuff and some other -# required odds and ends, and only as of this version number. -PHP_PROVIDER_PKG="dev-php/php" -PHP_PROVIDER_PKG_MINPVR="4.3.4-r2" -php-sapi_is_providerbuild() { - if [ "${CATEGORY}/${PN}" == "${PHP_PROVIDER_PKG}" ]; then - return 0 - else - return 1 - fi +deprecation_warning() { + eerror "Please upgrade ${PF} to use one of the php?_?-sapi eclasses instead!" } -php-sapi_is_providerbuild || PDEPEND="${PDEPEND} >=${PHP_PROVIDER_PKG}-${PHP_PROVIDER_PKG_MINPVR}" - -#export this here so we can use it -myconf="${myconf}" - -# These are the standard targets that we want to for the install stage since we -# can't do the full 'make install' You may need to add your own items here for -# SAPIs etc. -PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules install-programs" -# provided by PHP Provider: -# install-pear install-build install-headers install-programs -# for use by other ebuilds: -# install-sapi install-modules install-programs -# -# all ebuilds should have install-programs, and then delete everything except -# php-config.${PN} - -# These are quick fixups for older ebuilds that didn't have PHPSAPI defined. -[ -z "${PHPSAPI}" -a "${PN}" = "php" ] && PHPSAPI="cli" -if [ -z "${PHPSAPI}" -a "${PN}" = "mod_php" ]; then - use apache2 && PHPSAPI="apache2" || PHPSAPI="apache1" -fi - -# Now enforce existance of PHPSAPI -if [ -z "${PHPSAPI}" ]; then - msg="The PHP eclass needs a PHPSAPI setting!" - eerror "${msg}" - die "${msg}" -fi - -# build the destination and php.ini detail -PHPINIDIRECTORY="/etc/php/${PHPSAPI}-php${PHPMAJORVER}" -PHPINIFILENAME="php.ini" php-sapi_check_java_config() { - JDKHOME="`java-config --jdk-home`" - NOJDKERROR="You need to use java-config to set your JVM to a JDK!" - if [ -z "${JDKHOME}" ] || [ ! -d "${JDKHOME}" ]; then - eerror "${NOJDKERROR}" - die "${NOJDKERROR}" - fi - - # stuart@gentoo.org - 2003/05/18 - # Kaffe JVM is not a drop-in replacement for the Sun JDK at this time - - if echo $JDKHOME | grep kaffe > /dev/null 2>&1 ; then - eerror - eerror "PHP will not build using the Kaffe Java Virtual Machine." - eerror "Please change your JVM to either Blackdown or Sun's." - eerror - eerror "To build PHP without Java support, please re-run this emerge" - eerror "and place the line:" - eerror " USE='-java'" - eerror "in front of your emerge command; e.g." - eerror " USE='-java' emerge mod_php" - eerror - eerror "or edit your USE flags in /etc/make.conf" - die - fi - - JDKVER=$(java-config --java-version 2>&1 | awk '/^java version/ { print $3 }' | xargs ) - einfo "Active JDK version: ${JDKVER}" - case ${JDKVER} in - 1.4.*) ;; - 1.5.*) ewarn "Java 1.5 is NOT supported at this time, and might not work." ;; - *) eerror "A Java 1.4 JDK is required for Java support in PHP." ; die ;; - esac + deprecation_warning } php-sapi_src_unpack() { - php-sapi_warning_mssql_freetds - # this is obsolete - # use xml || \ - # ( ewarn "You have the xml USE flag turned off. Previously this" - # ewarn "disabled XML support in PHP. However PEAR has a hard" - # ewarn "dependancy on it, so they are now enabled." ) - - if use fdftk; then - has_version app-text/fdftk || \ - die "app-text/fdftk is required for FDF support! Portage isn't up to the DEPEND structure for it yet" - fi - - unpack ${MY_P}.tar.bz2 - cd ${S} - - # Configure Patch for hard-wired uname -a - sed "s/PHP_UNAME=\`uname -a\`/PHP_UNAME=\`uname -s -n -r -v\`/g" -i configure - # ensure correct perms on configure - chmod 755 configure - - uclibctoolize - - # no longer needed and breaks pear - Tal, 20031223 - - # fix PEAR installer for our packaging - # we keep a backup of it as we need it at the end of the install - #cp pear/PEAR/Registry.php pear/PEAR/Registry.old - #sed -e "s:\$pear_install_dir\.:\'${D}/usr/lib/php/\' . :g" -i pear/PEAR/Registry.php - - sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i configure - - # Bug 47498 - [ "${PV//4.3.6}" != "${PV}" ] && EPATCH_OPTS="-d ${S} -p1" epatch ${DISTDIR}/php-4.3.6-pcrealloc.patch - - # Bug 46768 - use kerberos && sed -i "s:-lgssapi_krb5:-lgssapi:" configure - - use hardenedphp && [ -n "$HARDENEDPHP_PATCH" ] && epatch ${DISTDIR}/${HARDENEDPHP_PATCH} + deprecation_warning } - php-sapi_src_compile() { - # cache this - libdir="$(get_libdir)" - - # sanity checks - if [ ! -x "/usr/sbin/sendmail" ]; then - msg="You need a virtual/mta that provides /usr/sbin/sendmail!" - eerror "${msg}" - die "${msg}" - fi - - if [ ! -f "/proc/self/stat" ]; then - msg="You need /proc mounted for configure to complete correctly!" - eerror "${msg}" - die "${msg}" - fi - - use java && use !alpha && use !amd64 && php-sapi_check_java_config - - if use berkdb; then - einfo "Enabling NBDM" - myconf="${myconf} --with-ndbm=/usr" - #Hack to use db4 - if has_version '=sys-libs/db-4*' && grep -q -- '--with-db4' configure; then - einfo "Enabling DB4" - myconf="${myconf} --with-db4=/usr" - elif has_version '=sys-libs/db-3*' && grep -q -- '--with-db3' configure; then - einfo "Enabling DB3" - myconf="${myconf} --with-db3=/usr" - else - einfo "Enabling DB2" - myconf="${myconf} --with-db2=/usr" - fi - else - einfo "Skipping DB2, DB3, DB4, NDBM support" - myconf="${myconf} --without-db3 --without-db4 --without-db2 --without-ndbm" - fi - - myconf="${myconf} `use_with crypt mcrypt /usr` `use_with crypt mhash /usr`" - use x86 && myconf="${myconf} `use_with firebird interbase /opt/interbase`" - myconf="${myconf} `use_with flash ming /usr`" - use x86 && myconf="${myconf} `use_with flash swf /usr`" - myconf="${myconf} `use_with freetds sybase /usr`" - myconf="${myconf} `use_with gdbm gdbm /usr`" - use x86 && myconf="${myconf} `use_with fdftk fdftk /opt/fdftk-6.0`" - use !alpha && myconf="${myconf} `use_with java java ${JAVA_HOME}`" - myconf="${myconf} `use_with mcal mcal /usr`" - # fix bug 55150, our mcal is PAM-enabled - use mcal && use pam && ! use imap && LDFLAGS="${LDFLAGS} -lpam" - [ -n "${INFORMIXDIR}" ] && myconf="${myconf} `use_with informix informix ${INFORMIXDIR}`" - [ -n "${ORACLE_HOME}" ] && myconf="${myconf} `use_with oci8 oci8 ${ORACLE_HOME}`" - myconf="${myconf} `use_with odbc unixODBC /usr`" - myconf="${myconf} `use_with postgres pgsql /usr`" - myconf="${myconf} `use_with snmp snmp /usr`" - use snmp && myconf="${myconf} --enable-ucd-snmp-hack" - use X && myconf="${myconf} --with-xpm-dir=/usr/X11R6" LDFLAGS="${LDFLAGS} -L/usr/X11R6/lib" - myconf="${myconf} `use_with gmp`" - myconf="${myconf} `use_with mssql mssql /usr`" - - myconf="${myconf} --without-crack --without-pdflib" - - # This chunk is intended for png/tiff/jpg, as there are several things that need them, indepentandly! - REQUIREPNG= - REQUIREJPG= - REQUIRETIFF= - if use gd-external; then - myconf="${myconf} --with-gd=/usr" - REQUIREPNG=1 - if has_version '>=media-libs/gd-2.0.17'; then - einfo "Fixing PHP for gd function name changes" - sed -i 's:gdFreeFontCache:gdFontCacheShutdown:' ${S}/ext/gd/gd.c - fi - elif use gd; then - myconf="${myconf} --with-gd" - REQUIREPNG=1 REQUIREJPG=1 - else - myconf="${myconf} --without-gd" - fi - use gd-external || use gd && myconf="${myconf} `use_enable truetype gd-native-ttf`" - - use png && REQUIREPNG=1 - use jpeg && REQUIREJPG=1 - use tiff && REQUIRETIFF=1 - if [ -n "${REQUIREPNG}" ]; then - myconf="${myconf} --with-png=/usr --with-png-dir=/usr" - else - myconf="${myconf} --without-png" - fi - if [ -n "${REQUIREJPG}" ]; then - myconf="${myconf} --with-jpeg=/usr --with-jpeg-dir=/usr --enable-exif" - else - myconf="${myconf} --without-jpeg" - fi - if [ -n "${REQUIRETIFF}" ]; then - myconf="${myconf} --with-tiff=/usr --with-tiff-dir=/usr" - LDFLAGS="${LDFLAGS} -ltiff" - else - myconf="${myconf} --without-tiff" - fi - - if use mysql; then - # check for mysql4.1 and mysql4.1 support in this php - if [ -n "`mysql_config | grep '4.1'`" ] && grep -q -- '--with-mysqli' configure; then - myconf="${myconf} --with-mysqli=/usr" - else - myconf="${myconf} --with-mysql=/usr" - myconf="${myconf} --with-mysql-sock=`mysql_config --socket`" - fi - else - myconf="${myconf} --without-mysql" - fi - - if use truetype; then - myconf="${myconf} --with-freetype-dir=/usr" - myconf="${myconf} --with-ttf=/usr" - myconf="${myconf} --with-t1lib=/usr" - else - myconf="${myconf} --without-ttf --without-t1lib" - fi - - myconf="${myconf} `use_with nls gettext`" - myconf="${myconf} `use_with spell pspell /usr` `use_with ssl openssl /usr`" - myconf="${myconf} `use_with imap imap /usr` `use_with ldap ldap /usr`" - myconf="${myconf} `use_with xml2 dom /usr` `use_with xml2 dom-xslt /usr`" - myconf="${myconf} `use_with xml2 dom-exslt /usr`" - myconf="${myconf} `use_with kerberos` `use_with pam`" - myconf="${myconf} `use_enable memlimit memory-limit`" - myconf="${myconf} `use_enable ipv6`" - myconf="${myconf} `use_with yaz` `use_enable debug`" - if use curl; then - myconf="${myconf} --with-curlwrappers --with-curl=/usr" - else - myconf="${myconf} --without-curl" - fi - - #Waiting for somebody to want Cyrus support :-) - #myconf="${myconf} `use_with cyrus`" - - # dbx AT LEAST one of mysql/odbc/postgres/oci8/mssql - use mysql || use odbc || use postgres || use oci8 || use mssql \ - && myconf="${myconf} --enable-dbx" \ - || myconf="${myconf} --disable-dbx" - - use imap && use ssl && \ - if [ -n "`strings ${ROOT}/usr/${libdir}/c-client.a 2>/dev/null | grep ssl_onceonlyinit`" ]; then - myconf="${myconf} --with-imap-ssl" - einfo "Building IMAP with SSL support." - else - ewarn "USE=\"imap ssl\" specified but IMAP is built WITHOUT ssl support." - ewarn "Skipping IMAP-SSL support." - fi - - - # These were previously optional, but are now included directly as PEAR needs them. - # Zlib is needed for XML - myconf="${myconf} --with-zlib=/usr --with-zlib-dir=/usr" - LIBS="${LIBS} -lxmlparse -lxmltok" - myconf="${myconf} --with-sablot=/usr" - myconf="${myconf} --enable-xslt" - myconf="${myconf} --with-xslt-sablot" - myconf="${myconf} --with-xmlrpc" - myconf="${myconf} --enable-wddx" - myconf="${myconf} --with-xml" - - #Some extensions need mbstring statically built - myconf="${myconf} --enable-mbstring=all --enable-mbregex" - - # Somebody might want safe mode, but it causes some problems, so I disable it by default - #myconf="${myconf} --enable-safe-mode" - - # These are some things that we don't really need use flags for, we just - # throw them in for functionality. Somebody could turn them off if their - # heart so desired - # DEPEND - app-arch/bzip2 - myconf="${myconf} --with-bz2=/usr" - # DEPEND - nothing - myconf="${myconf} --with-cdb" - - # No DEPENDancies - myconf="${myconf} --enable-pcntl" - myconf="${myconf} --enable-bcmath" - myconf="${myconf} --enable-calendar" - myconf="${myconf} --enable-dbase" - myconf="${myconf} --enable-filepro" - myconf="${myconf} --enable-ftp" - myconf="${myconf} --with-mime-magic=/usr/share/misc/file/magic.mime" - myconf="${myconf} --enable-sockets" - myconf="${myconf} --enable-sysvsem --enable-sysvshm --enable-sysvmsg" - myconf="${myconf} --with-iconv" - myconf="${myconf} --enable-shmop" - myconf="${myconf} --enable-dio" - myconf="${myconf} --enable-yp" - - # recode is NOT used as it conflicts with IMAP - # iconv is better anyway - - # there is absolutely no reason to build ncurses/readline support on - # anything other than the CLI sapi - if [ "${PN}" = "php" ]; then - myconf="${myconf} `use_with readline readline /usr`" - # Readline and Ncurses are CLI PHP only - # readline needs ncurses - use ncurses || use readline \ - && myconf="${myconf} --with-ncurses=/usr" \ - || myconf="${myconf} --without-ncurses" - else - # both of these are not needed - myconf="${myconf} --without-ncurses --without-readline" - fi - - # Now actual base PHP settings - myconf="${myconf} \ - --enable-inline-optimization \ - --enable-track-vars \ - --enable-trans-sid \ - --enable-versioning" - - einfo "Using INI file: ${PHPINIDIRECTORY}/${PHPINIFILENAME}" - myconf="${myconf} \ - --with-config-file-path=${PHPINIDIRECTORY}" - - myconf="${myconf} --libdir=/usr/${libdir}/php" - - # only provide pear is we are a provider build, and if we do, put it in - # /usr/lib/php. - if php-sapi_is_providerbuild; then - myconf="${myconf} --with-pear=/usr/lib/php" - else - myconf="${myconf} --without-pear" - fi - - - # fix ELF-related problems - if has_pic ; then - myconf="${myconf} --with-pic" - fi - - # filter the following from C[XX]FLAGS regardless, as apache won't be - # supporting LFS until 2.2 is released and in the tree. Fixes bug #24373. - filter-flags "-D_FILE_OFFSET_BITS=64" - filter-flags "-D_FILE_OFFSET_BITS=32" - filter-flags "-D_LARGEFILE_SOURCE=1" - filter-flags "-D_LARGEFILE_SOURCE" - - #fixes bug #14067 - # changed order to run it in reverse for bug #32022 and #12021 - replace-flags "-march=k6-3" "-march=i586" - replace-flags "-march=k6-2" "-march=i586" - replace-flags "-march=k6" "-march=i586" - - # Bug 98694 - addpredict /etc/krb5.conf - - if [ -z "${PHP_SKIP_CONFIGURE}" ]; then - LDFLAGS="${LDFLAGS} -L/usr/${libdir}" LIBS="${LIBS}" econf \ - ${myconf} || die "bad ./configure, please include ${MY_P}/config.log in any bug reports." - fi - - if [ -z "${PHP_SKIP_MAKE}" ]; then - emake || die "compile problem" - fi + deprecation_warning } php-sapi_src_install() { - # cache this - libdir="$(get_libdir)" - - addpredict /usr/share/snmp/mibs/.index - addpredict /var/lib/net-snmp/ - dodir /usr/bin - dodir /usr/${libdir}/php - dodir /usr/include/php - - # parallel make breaks it - # so no emake here - einfo "Running make INSTALL_ROOT=${D} ${PHP_INSTALLTARGETS}" - make INSTALL_ROOT=${D} ${PHP_INSTALLTARGETS} || die - - # install a php-config for EACH instance of php - # the PHP provider $PHP_PROVIDER_PKG one is the default - mv ${D}/usr/bin/php-config ${D}/usr/bin/php-config.${PN} - # these files are provided solely by the PHP provider ebuild - if php-sapi_is_providerbuild ; then - dosym /usr/bin/php-config.${PN} /usr/bin/php-config - else - rm -rf ${D}/usr/bin/{phpize,phpextdist,php} ${D}/usr/${libdir}/php/build - fi - - # get the extension dir - PHPEXTDIR="`${D}/usr/bin/php-config.${PN} --extension-dir`" - - for doc in LICENSE EXTENSIONS CREDITS INSTALL README.* TODO* NEWS; do - [ -s "$doc" ] && dodoc $doc - done - - #install scripts - exeinto /usr/bin - - # Support for Java extension - # 1. install php_java.jar file into ${EXT_DIR} - # 2. edit the php.ini file ready for installation - # - stuart@gentoo.org - local phpinisrc=php.ini-dist - einfo "Setting extension_dir in php.ini" - sed -e "s|extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc} - - if use java && use !alpha; then - # we put these into /usr/lib so that they cannot conflict with - # other versions of PHP (e.g. PHP 4 & PHP 5) - insinto ${PHPEXTDIR} - einfo "Installing JAR for PHP" - doins ext/java/php_java.jar - - einfo "Installing Java test page" - newins ext/java/except.php java-test.php - - JAVA_LIBRARY="`grep -- '-DJAVALIB' Makefile | sed -e 's,.\+-DJAVALIB=\"\([^"]*\)\".*$,\1,g;'| sort | uniq `" - sed -e "s|;java.library .*$|java.library = ${JAVA_LIBRARY}|g" -i ${phpinisrc} - sed -e "s|;java.class.path .*$|java.class.path = ${PHPEXTDIR}/php_java.jar|g" -i ${phpinisrc} - sed -e "s|;java.library.path .*$|java.library.path = ${PHPEXTDIR}|g" -i ${phpinisrc} - sed -e "s|;extension=php_java.dll.*$|extension = java.so|g" -i ${phpinisrc} - dosym ${PHPEXTDIR}/java.so ${PHPEXTDIR}/libphp_java.so - fi - - # A patch for PHP for security. PHP-CLI interface is exempt, as it cannot be - # fed bad data from outside. - if [ "${PHPSAPI}" != "cli" ]; then - einfo "Securing fopen wrappers" - patch ${phpinisrc} <${DISTDIR}/php-4.3.2-fopen-url-secure.patch - fi - - # Patch for bug 50991, 49420 - # Make sure the correct include_path is used. - einfo "Setting correct include_path" - patch ${phpinisrc} <${DISTDIR}/php-4.3.6-includepath.diff - - # A lot of ini file funkiness - insinto ${PHPINIDIRECTORY} - newins ${phpinisrc} ${PHPINIFILENAME} - - # 2004/03/28 - stuart@gentoo.org - # - # This is where we install header files that PHP itself doesn't install, - # but which PECL packages depend on - if php-sapi_is_providerbuild; then - for x in ext/gd/gdcache.h ext/gd/gdttf.h ext/gd/php_gd.h ext/gd/libgd/gd.h ext/gd/libgd/gd_io.h ext/gd/libgd/gdcache.h ext/gd/libgd/gdfontg.h ext/gd/libgd/gdfontl.h ext/gd/libgd/gdfontmb.h ext/gd/libgd/gdfonts.h ext/gd/libgd/gdfontt.h ext/gd/libgd/gdhelpers.h ext/gd/libgd/jisx0208.h ext/gd/libgd/wbmp.h ext/mbstring/libmbfl/mbfl/mbfilter.h ext/mbstring/libmbfl/mbfl/mbfl_defs.h ext/mbstring/libmbfl/mbfl/mbfl_consts.h ext/mbstring/libmbfl/mbfl/mbfl_allocators.h ext/mbstring/libmbfl/mbfl/mbfl_encoding.h ext/mbstring/libmbfl/mbfl/mbfl_language.h ext/mbstring/libmbfl/mbfl/mbfl_string.h ext/mbstring/libmbfl/mbfl/mbfl_convert.h ext/mbstring/libmbfl/mbfl/mbfl_ident.h ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h; do - my_headerdir="/usr/include/php/`dirname $x`" - #echo "$my_headerdir" - if [ ! -d "${D}$my_headerdir" ]; then - mkdir -p ${D}$my_headerdir - fi - cp $x ${D}/usr/include/php/$x - done - else - rm -rf ${D}/usr/include/php/ - fi - - if php-sapi_is_providerbuild; then - insinto /usr/${libdir}/php - doins ${S}/run-tests.php - fperms 644 /usr/${libdir}/php/run-tests.php - einfo "Fixing PEAR cache location" - local oldloc="${T}/pear/cache" - local old="s:${#oldloc}:\"${oldloc}\"" - local newloc="/tmp/pear/cache" - local new="s:${#newloc}:\"${newloc}\"" - sed "s|${old}|${new}|" -i ${D}/etc/pear.conf - keepdir /tmp/pear/cache - else - einfo "Removing duplicate PEAR conf file" - rm -f ${D}/etc/pear.conf 2>/dev/null - fi - - # clean up documentation - php-sapi_is_providerbuild || rm -rf ${D}/usr/share/man/man1/php.1* + deprecation_warning } php-sapi_pkg_preinst() { - # obsolete - einfo "Checking if we need to preserve a really old /etc/php4/php.ini file" - if [ -e /etc/php4/php.ini ] && [ ! -L /etc/php4/php.ini ]; then - ewarn "Old setup /etc/php4/php.ini file detected, moving to new location (${PHPINIDIRECTORY}/${PHPINIFILENAME})" - mkdir -p ${PHPINIDIRECTORY} - mv -f /etc/php4/php.ini ${PHPINIDIRECTORY}/${PHPINIFILENAME} - else - einfo "/etc/php4/php.ini doesn't exist or is a symlink, nothing wrong here" - fi + deprecation_warning } php-sapi_pkg_postinst() { - einfo "The INI file for this build is ${PHPINIDIRECTORY}/php.ini" - php-sapi_warning_mssql_freetds - if has_version 'dev-php/php-core'; then - ewarn "The dev-php/php-core package is now obsolete. You should unmerge" - ewarn "it, and re-merge >=dev-php/php-4.3.4-r2 afterwards to ensure" - ewarn "your PHP installation is consistant." - fi - if has_version "<${PV}"; then - ewarn "The php, php-cgi, and mod_php ebuilds no longer supply the" - ewarn "crack and pdflib extensions. If you need these, please use" - ewarn "the corresponding PECL packages by emerging PECL-crack or" - ewarn "PECL-pdflib, respectively." - fi - ewarn "If you have additional third party PHP extensions (such as" - ewarn "dev-php/eaccelerator) you may need to recompile them now." - if use curl; then - ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions." - fi + deprecation_warning } php-sapi_securityupgrade() { - if has_version "<${PF}"; then - ewarn "This is a security upgrade for PHP!" - ewarn "Please ensure that you apply any changes to the apache and PHP" - ewarn "configutation files!" - else - einfo "This is a security upgrade for PHP!" - einfo "However it is not critical for your machine" - fi + deprecation_warning } php-sapi_warning_mssql_freetds() { - ewarn "If you have both freetds and mssql in your USE flags, parts of PHP" - ewarn "may not behave correctly, or may give strange warnings. You have" - ewarn "been warned! It's recommended that you pick ONE of them. For sybase" - ewarn "support, chose 'freetds'. For mssql support choose 'mssql'." + deprecation_warning } diff --git a/eclass/php4_4-sapi.eclass b/eclass/php4_4-sapi.eclass index 94cca0f542a8..a36c9c33c3e6 100644 --- a/eclass/php4_4-sapi.eclass +++ b/eclass/php4_4-sapi.eclass @@ -1,24 +1,24 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php4_4-sapi.eclass,v 1.39 2007/08/28 20:25:18 hoffie Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php4_4-sapi.eclass,v 1.40 2007/09/02 17:49:20 jokey Exp $ # ======================================================================== +# Based on robbat2's work on the php4 sapi eclass # -# php4_4-sapi.eclass -# Eclass for building different php4 SAPI instances -# -# USE THIS ECLASS FOR THE "CONCENTRATED" PACKAGES -# -# Based on robbat2's work on the php4 sapi eclass -# -# Author: Stuart Herbert -# <stuart@gentoo.org> -# -# Author: Luca Longinotti -# <chtekk@gentoo.org> +# Author: Stuart Herbert <stuart@gentoo.org> +# Author: Luca Longinotti <chtekk@gentoo.org> # # ======================================================================== +# @ECLASS: php4_4-sapi.eclass +# @MAINTAINER: +# Gentoo PHP team <php-bugs@gentoo.org> +# @BLURB: Eclass for building different php4 SAPI instances. +# @DESCRIPTION: +# Eclass for building different php4 SAPI instances. Use it for the new-style +# =dev-lang/php-4* ebuilds. + + PHPCONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix interbase mnogosearch msql oci8 oracle7 pfpro sapdb solid sybase sybase-ct" WANT_AUTOCONF="latest" @@ -26,14 +26,16 @@ WANT_AUTOMAKE="latest" inherit flag-o-matic autotools toolchain-funcs libtool eutils phpconfutils php-common-r1 -# set MY_PHP_P in the ebuild - -# we only set these variables if we're building a copy of php which can be -# installed as a package in its own right -# -# copies of php which are compiled into other packages (e.g. php support -# for the thttpd web server) don't need these variables +# @ECLASS-VARIABLE: MY_PHP_P +# @DESCRIPTION: +# Set MY_PHP_P in the ebuild as needed to match tarball version. +# @ECLASS-VARIABLE: PHP_PACKAGE +# @DESCRIPTION: +# We only set this variable if we are building a copy of php which can be +# installed as a package in its own. +# Copies of php which are compiled into other packages (e.g. php support +# for the thttpd web server) don't need this variable. if [[ "${PHP_PACKAGE}" == 1 ]] ; then HOMEPAGE="http://www.php.net/" LICENSE="PHP-3" @@ -123,11 +125,10 @@ PDEPEND="doc? ( app-doc/php-docs ) java-external? ( dev-php4/php-java-bridge ) java-internal? ( !dev-php4/php-java-bridge ) sqlite? ( dev-php4/pecl-sqlite ) + suhosin? ( dev-php4/suhosin ) yaz? ( dev-php4/pecl-yaz ) zip? ( dev-php4/pecl-zip )" -# Until Suhosin is stable on all archs -[[ "${PV}" == "4.4.6" ]] && PDEPEND="${PDEPEND} suhosin? ( dev-php4/suhosin )" # ======================================================================== # php.ini Support @@ -138,10 +139,15 @@ PHP_INI_UPSTREAM="php.ini-dist" # ======================================================================== -# PHP patchsets support +# @ECLASS-VARIABLE: PHP_PATCHSET_REV +# @DESCRIPTION: +# Provides PHP patchsets support. SRC_URI="${SRC_URI} http://gentoo.longitekk.com/php-patchset-${MY_PHP_PV}-r${PHP_PATCHSET_REV}.tar.bz2" -# Suhosin patch support +# @ECLASS-VARIABLE: SUHOSIN_PATCH +# @DESCRIPTION: +# Tarball name for Suhosin patch (see http://www.suhosin.org/). +# This feature will not be available in php if unset. [[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? ( http://gentoo.longitekk.com/${SUHOSIN_PATCH} )" # ======================================================================== @@ -288,17 +294,26 @@ php4_4-sapi_install_ini() { # EXPORTED FUNCTIONS # ======================================================================== +# @FUNCTION: php4_4-sapi_pkg_setup +# @DESCRIPTION: +# Performs all the USE flag testing and magic before we do anything else. +# This way saves a lot of time. php4_4-sapi_pkg_setup() { - # let's do all the USE flag testing before we do anything else - # this way saves a lot of time php4_4-sapi_check_use_flags } +# @FUNCTION: php4_4-sapi_src_unpack +# @DESCRIPTION: +# Takes care of unpacking, patching and autotools magic and disables +# interactive tests. + +# @VARIABLE: PHP_EXTRA_BRANDING +# @DESCRIPTION: +# This variable allows an ebuild to add additional information like +# snapshot dates to the version line. php4_4-sapi_src_unpack() { cd "${S}" - # This variable allows an ebuild to add additional information like - # snapshot dates to the version line [[ -z "${PHP_EXTRA_BRANDING}" ]] && PHP_EXTRA_BRANDING="" # Change PHP branding @@ -371,6 +386,10 @@ php4_4-sapi_src_unpack() { chmod 0755 configure || die "Failed to chmod configure to 0755" } +# @FUNCTION: php4_4-sapi_src_compile +# @DESCRIPTION: +# Takes care of compiling php according to USE flags set by user (and those automagically +# enabled via phpconfutils eclass if unavoidable). php4_4-sapi_src_compile() { destdir=/usr/$(get_libdir)/php4 @@ -571,6 +590,9 @@ php4_4-sapi_src_compile() { emake || die "make failed" } +# @FUNCTION: php4_4-sapi_src_install +# @DESCRIPTION: +# Takes care of installing php (and its shared extensions if enabled). php4_4-sapi_src_install() { destdir=/usr/$(get_libdir)/php4 @@ -612,6 +634,9 @@ php4_4-sapi_src_install() { keepdir /usr/share/php4 } +# @FUNCTION: php4_4-sapi_pkg_postinst +# @DESCRIPTION: +# Provides important information to users after install is finished. php4_4-sapi_pkg_postinst() { ewarn ewarn "If you have additional third party PHP extensions (such as" diff --git a/eclass/php5-sapi-r1.eclass b/eclass/php5-sapi-r1.eclass index 03be7802b2c8..602269f3d6d4 100644 --- a/eclass/php5-sapi-r1.eclass +++ b/eclass/php5-sapi-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php5-sapi-r1.eclass,v 1.24 2007/03/26 20:19:22 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php5-sapi-r1.eclass,v 1.25 2007/09/02 17:49:20 jokey Exp $ # # eclass/php5-sapi-r1.eclass # Eclass for building different php5 SAPI instances @@ -12,497 +12,41 @@ # # ======================================================================== -inherit eutils confutils libtool +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php5_2-sapi eclass instead! +inherit php5_2-sapi -# set MY_P in the ebuild - -HOMEPAGE="http://www.php.net/" -LICENSE="PHP-3" -SRC_URI="http://www.php.net/distributions/${MY_P}.tar.bz2" -S="${WORKDIR}/${MY_P}" -IUSE="adabas bcmath berkdb birdstep bzip2 calendar cdb pdf crypt ctype curl curlwrappers db2 dba dbase dbm dbmaker dbx debug dio empress empress-bcs esoob exif fam frontbase fdftk flatfile filepro firebird ftp gd gd-external gdbm gmp hyperwave-api imap inifile iconv informix ingres iodbc jpeg kerberos ldap libedit mcve memlimit mhash mime ming mnogosearch msession msql mssql mysql mysqli ncurses nls nis oci8 odbc oracle7 ovrimos pcntl pcre pfpro png postgres posix qdbm readline recode sapdb sasl session sharedext sharedmem simplexml snmp soap sockets solid spell spl sqlite ssl sybase sybase-ct sysvipc threads tidy tiff tokenizer truetype wddx xsl xml2 xmlrpc xpm zlib" - -# these USE flags should have the correct dependencies -DEPEND="$DEPEND - !<=dev-php/php-4.99.99 - berkdb? ( =sys-libs/db-4* ) - bzip2? ( app-arch/bzip2 ) - pdf? ( >=media-libs/clibpdf-2 ) - crypt? ( >=dev-libs/libmcrypt-2.4 ) - curl? ( >=net-misc/curl-7.10.5 ) - fam? ( virtual/fam ) - fdftk? ( app-text/fdftk ) - firebird? ( dev-db/firebird ) - gd-external? ( media-libs/gd ) - gdbm? ( >=sys-libs/gdbm-1.8.0 ) - gmp? ( dev-libs/gmp ) - imap? ( virtual/imap-c-client ) - jpeg? ( >=media-libs/jpeg-6b ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11 ) - libedit? ( dev-libs/libedit ) - mcve? ( net-libs/libmonetra ) - mhash? ( app-crypt/mhash ) - mime? ( sys-apps/file ) - ming? ( media-libs/ming ) - mssql? ( dev-db/freetds ) - mysql? ( virtual/mysql ) - ncurses? ( sys-libs/ncurses ) - nls? ( sys-devel/gettext ) - odbc? ( >=dev-db/unixODBC-1.8.13 ) - postgres? ( >=dev-db/postgresql-7.1 ) - png? ( media-libs/libpng ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline ) - recode? ( app-text/recode ) - sharedmem? ( dev-libs/mm ) - simplexml? ( dev-libs/libxml2 ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) - soap? ( dev-libs/libxml2 ) - spell? ( app-text/aspell ) - sqlite? ( =dev-db/sqlite-2* ) - ssl? ( >=dev-libs/openssl-0.9.7 ) - sybase? ( dev-db/freetds ) - tidy? ( app-text/htmltidy ) - tiff? ( media-libs/tiff ) - truetype? ( =media-libs/freetype-1* =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 ) - wddx? ( dev-libs/expat ) - xpm? ( x11-libs/libXpm ) - xsl? ( dev-libs/libxslt ) - zlib? ( sys-libs/zlib )" - -# this would be xml2?, but PEAR requires XML support -# and we always want to build PEAR. -DEPEND="$DEPEND - dev-libs/libxml2" - -# ======================================================================== - -PHP_BUILDTARGETS="${PHP_BUILDTARGETS} build-modules" -PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install" - -# ======================================================================== - -PHP_INI_DIR="/etc/php/${PHPSAPI}-php5" -PHP_INI_FILE="php.ini" - -# ======================================================================== - -EXPORT_FUNCTIONS pkg_setup src_compile src_install src_unpack pkg_postinst - -# ======================================================================== -# INTERNAL FUNCTIONS -# ======================================================================== +deprecation_warning() { + eerror "Please upgrade ${PF} to use php5_2-sapi eclass instead!" +} php5-sapi-r1_check_awkward_uses() { - - # snmp support seems broken, haven't looked into a fix for it yet - - if useq snmp && [ "$PV" = "5.0.3" ] ; then - eerror - eerror "The snmp support in PHP 5 is currently broken." - eerror "Please disable the snmp USE flag" - eerror - die "snmp support doesn't compile" - fi - - # mysqli support isn't possible yet - - if useq mysqli ; then - eerror - eerror "We currently do not support the mysqli extension" - eerror "Support will be added once MySQL 4.1 has been added to Portage" - eerror - die "mysqli not supported yet" - fi - - # recode not available in 5.0.0; upstream bug - if useq recode && [ "$PV" == "5.0.0" ]; then - eerror - eerror "Support for the 'recode' extension is currently broken UPSTREAM" - eerror "See http://bugs.php.net/bug.php?id=28700 for details" - eerror - die "recode broken, upstream bug" - fi - - # iodbc not available; upstream web site down - if useq iodbc ; then - eerror - eerror "We have not been able to add iodbc support to Gentoo yet, as we" - eerror "have experienced difficulties in reaching www.iodbc.org." - eerror - eerror "For now, please use the 'odbc' USE flag instead." - eerror - die "iodbc support incomplete; gentoo bug" - fi - - # Sanity check for Oracle - if useq oci8 && [ -z "${ORACLE_HOME}" ]; then - eerror - eerror "You must have the ORACLE_HOME variable in your environment!" - eerror - die "Oracle configuration incorrect; user error" - fi - - if useq oci8 || useq oracle7; then - if has_version 'dev-db/oracle-instantclient-basic'; then - ewarn "Please ensure you have a full install of the Oracle client." - ewarn "dev-db/oracle-instantclient* is NOT sufficent." - fi - fi - - if useq dba ; then - # extension USE flag shared support? - enable_extension_with "cdb" "cdb" 1 - enable_extension_with "db4" "berkdb" 1 - enable_extension_with "dbm" "dbm" 1 - enable_extension_with "flatfile" "flatfile" 1 - enable_extension_with "gdbm" "gdbm" 1 - enable_extension_with "inifile" "inifile" 1 - enable_extension_with "qdbm" "qdbm" 1 - fi - - if useq dbx ; then - confutils_use_depend_any "dbx" "frontbase" "mssql" "odbc" "postgres" "sybase-ct" "oci8" "sqlite" - enable_extension_enable "dbx" "dbx" 1 - fi - - enable_extension_with "jpeg-dir" "jpeg" 0 "/usr" - if useq gd-external ; then - enable_extension_with "gd" "gd-external" 1 "/usr" - enable_extension_enable "gd-jis-conf" "nls" 0 - enable_extension_enable "gd-native-ttf" "truetype" 0 - else - enable_extension_with "freetype-dir" "truetype" 0 "/usr" - enable_extension_with "t1lib" "truetype" 0 "/usr" - enable_extension_with "ttf" "truetype" 0 "/usr" - enable_extension_enable "gd-jis-conf" "nls" 0 - enable_extension_enable "gd-native-ttf" "truetype" 0 - enable_extension_with "png-dir" "png" 0 "/usr" - enable_extension_with "tiff-dir" "tiff" 0 "/usr" - enable_extension_with "xpm-dir" "xpm" 0 "/usr/X11R6" - # enable gd last, so configure can pick up the previous settings - enable_extension_with "gd" "gd" 0 - fi - - confutils_use_depend_any "jpeg" "gd" "gd-external" "pdf" - confutils_use_depend_any "png" "gd" "gd-external" - confutils_use_depend_any "tiff" "gd" "gd-external" - confutils_use_depend_any "xpm" "gd" "gd-external" - confutils_use_depend_all "png" "zlib" - - if useq imap ; then - enable_extension_with "imap" "imap" 1 - # this is a PITA to deal with - if useq ssl ; then - #if [ -n "`strings ${ROOT}/usr/$(get_libdir)/c-client.* 2>/dev/null | grep ssl_onceonlyinit`" ]; then - if built_with_use virtual/imap-c-client ssl ; then - # the IMAP-SSL arg doesn't parse 'shared,/usr/lib' right - enable_extension_with "imap-ssl" "ssl" 0 - else - msg="IMAP+SSL requested, but your IMAP libraries are built without SSL!" - eerror "${msg}" - die "${msg}" - fi - fi - fi - - if useq ldap ; then - enable_extension_with "ldap" "ldap" 1 - enable_extension_with "ldap-sasl" "sasl" 0 - fi - - if useq odbc ; then - enable_extension_with "unixODBC" "odbc" 1 "/usr" - - enable_extension_with "adabas" "adabas" 1 - enable_extension_with "birdstep" "birdstep" 1 - enable_extension_with "dbmaker" "dbmaker" 1 - enable_extension_with "empress" "empress" 1 - if useq empress ; then - enable_extension_with "empress-bcs" "empress-bcs" 0 - fi - enable_extension_with "esoob" "esoob" 1 - enable_extension_with "ibm-db2" "db2" 1 - enable_extension_with "iodbc" "iodbc" 1 "/usr" - enable_extension_with "sapdb" "sapdb" 1 - enable_extension_with "solid" "solid" 1 - fi - - if useq mysql; then - enable_extension_with "mysql" "mysql" 1 - enable_extension_with "mysql-sock" "mysql" 0 "/var/run/mysqld/mysqld.sock" - fi - if useq mysqli; then - enable_extension_with "mysqli" "mysqli" 1 - fi - - # QDBM doesn't play nicely with GDBM _or_ DBM - confutils_use_conflict "qdbm" "gdbm" "dbm" - # both provide the same functionality - confutils_use_conflict "readline" "libedit" - # Recode is not liked. - confutils_use_conflict "recode" "mysql" "imap" "nis" #"yaz" - - if ! useq session ; then - enable_extension_disable "session" "session" 1 - else - enable_extension_with "mm" "sharedmem" 0 - enable_extension_with "msession" "msession" 1 - fi - - if ! useq sqlite ; then - enable_extension_without "sqlite" "sqlite" 0 - else - enable_extension_enable "sqlite-utf8" "nls" 0 - fi - - # MCVE needs openSSL - confutils_use_depend_all "mcve" "ssl" - # A variety of extensions need DBA - confutils_use_depend_all "cdb" "dba" - confutils_use_depend_all "berkdb" "dba" - confutils_use_depend_all "flatfile" "dba" - confutils_use_depend_all "gdbm" "dba" - confutils_use_depend_all "inifile" "dba" - confutils_use_depend_all "qdbm" "dba" - - # build EXIF support if we support a file format that uses it - confutils_use_depend_any "exif" "jpeg" "tiff" - - # GD library support - confutils_use_depend_any "truetype" "gd" "gd-external" - - # ldap support - confutils_use_depend_all "sasl" "ldap" - - # mysql support - # This shouldn't conflict actually - #confutils_use_conflict "mysqli" "mysql" - - # odbc support - confutils_use_depend_all "adabas" "odbc" - confutils_use_depend_all "birdstep" "odbc" - confutils_use_depend_all "dbmaker" "odbc" - confutils_use_depend_all "empress" "odbc" - confutils_use_depend_all "empress-bcs" "odbc" "empress" - confutils_use_depend_all "esoob" "odbc" - confutils_use_depend_all "db2" "odbc" - confutils_use_depend_all "sapdb" "odbc" - confutils_use_depend_all "solid" "odbc" - - # session support - confutils_use_depend_all "msession" "session" - - confutils_warn_about_missing_deps + deprecation_warning + php5_2-sapi_check_use_flags } -# ======================================================================== -# EXPORTED FUNCTIONS -# ======================================================================== - php5-sapi-r1_pkg_setup() { - # let's do all the USE flag testing before we do anything else - # this way saves a lot of time - - php5-sapi-r1_check_awkward_uses + deprecation_warning + php5_2-sapi_pkg_setup } php5-sapi-r1_src_unpack() { - unpack ${A} - # Fix for HTTP auth bug, #59755 - [ "x${PV}" == "x5.0.0" ] && epatch ${FILESDIR}/php-5.0.0-httpauthfix.patch - - cd ${S} - - # Patch PHP to show Gentoo as the server platform - sed -i "s/PHP_UNAME=\`uname -a\`/PHP_UNAME=\`uname -s -n -r -v\`/g" configure - # Patch for PostgreSQL support - sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i configure - - # Patch for session persistence bug - epatch ${FILESDIR}/php5_soap_persistence_session.diff - - # stop php from activating the apache config, as we will do that ourselves - for i in configure sapi/apache/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 ; do - sed -i.orig -e 's,-i -a -n php5,-i -n php5,g' $i - done - - # fix configure scripts to recognize uClibc - uclibctoolize - - # Just in case ;-) - chmod 755 configure - - [ "${ARCH}" == "sparc" ] && epatch ${FILESDIR}/stdint.diff - epatch ${FILESDIR}/${P}-missing-arches.patch + deprecation_warning + php5_2-sapi_src_unpack } php5-sapi-r1_src_compile() { - confutils_init - - my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}" - my_conf="${my_conf} --without-pear" - - # extension USE flag shared support? - enable_extension_enable "bcmath" "bcmath" 1 - enable_extension_with "bz2" "bzip2" 1 - enable_extension_enable "calendar" "calendar" 1 - enable_extension_with "cpdflib" "pdf" 1 # depends on jpeg - enable_extension_disable "ctype" "ctype" 0 - enable_extension_with "curl" "curl" 1 - enable_extension_with "curlwrappers" "curlwrappers" 1 - enable_extension_enable "dbase" "dbase" 1 - enable_extension_enable "dio" "dio" 1 - enable_extension_disable "dom" "xml2" 0 - enable_extension_enable "exif" "exif" 1 - enable_extension_with "fam" "fam" 1 - enable_extension_with "fbsql" "frontbase" 1 - enable_extension_with "fdftk" "fdftk" 1 "/opt/fdftk-6.0" - enable_extension_enable "filepro" "filepro" 1 - enable_extension_enable "ftp" "ftp" 1 - enable_extension_with "gettext" "nls" 1 - enable_extension_with "gmp" "gmp" 1 - enable_extension_with "hwapi" "hyperwave-api" 1 - enable_extension_with "iconv" "iconv" 1 - enable_extension_with "informix" "informix" 1 - enable_extension_with "ingres" "ingres" 1 - enable_extension_with "interbase" "firebird" 1 - # ircg extension not supported on Gentoo at this time - enable_extension_with "kerberos" "kerberos" 0 - enable_extension_disable "libxml" "xml2" 0 - enable_extension_enable "mbstring" "nls" 1 - enable_extension_with "mcrypt" "crypt" 1 - enable_extension_with "mcve" "mcve" 1 - enable_extension_enable "memory-limit" "memlimit" 0 - enable_extension_with "mhash" "mhash" 1 - enable_extension_with "mime-magic" "mime" 0 "/usr/share/misc/file/magic.mime" - enable_extension_with "ming" "ming" 1 - enable_extension_with "mnogosearch" "mnogosearch" 1 - enable_extension_with "msql" "msql" 1 - enable_extension_with "mssql" "mssql" 1 - enable_extension_with "ncurses" "ncurses" 1 - enable_extension_with "oci8" "oci8" 1 - enable_extension_with "oracle" "oracle7" 1 - enable_extension_with "openssl" "ssl" 1 - enable_extension_with "openssl-dir" "ssl" 0 "/usr" - enable_extension_with "ovrimos" "ovrimos" 1 - enable_extension_enable "pcntl" "pcntl" 1 - enable_extension_without "pcre-regx" "pcre" 1 - enable_extension_with "pfpro" "pfpro" 1 - enable_extension_with "pgsql" "postgres" 1 - enable_extension_disable "posix" "posix" 1 - enable_extension_with "pspell" "spell" 1 - enable_extension_with "recode" "recode" 1 - enable_extension_disable "simplexml" "simplexml" 1 - enable_extension_enable "shmop" "sharedmem" 0 - enable_extension_with "snmp" "snmp" 1 - enable_extension_enable "soap" "soap" 1 - enable_extension_enable "sockets" "sockets" 1 - enable_extension_disable "spl" "spl" 1 - enable_extension_with "sybase" "sybase" 1 - enable_extension_with "sybase-ct" "sybase-ct" 1 - enable_extension_enable "sysvmsg" "sysvipc" 1 - enable_extension_enable "sysvsem" "sysvipc" 1 - enable_extension_enable "sysvshm" "sysvipc" 1 - enable_extension_with "tidy" "tidy" 1 - enable_extension_disable "tokenizer" "tokenizer" 1 - enable_extension_enable "wddx" "wddx" 1 - enable_extension_with "xsl" "xsl" 1 - #enable_extension_disable "xml" "xml2" 1 # PEAR needs --enable-xml - enable_extension_with "xmlrpc" "xmlrpc" 1 - enable_extension_enable "yp" "nis" 1 - enable_extension_with "zlib" "zlib" 1 - enable_extension_enable "debug" "debug" 0 - - php5-sapi-r1_check_awkward_uses - - # DBA support - enable_extension_enable "dba" "dba" 1 - - # readline support - # - # you can use readline or libedit, but you can't use both - enable_extension_with "readline" "readline" 0 - enable_extension_with "libedit" "libedit" 1 - - # optimization/setting stuff - my_conf="${my_conf} --enable-versioning" - - if [ "${PHPSAPI}" != "cli" ]; then - my_conf="${my_conf} --disable-cli" - fi - - # Bug 98694 - addpredict /etc/krb5.conf - - # all done - - econf ${my_conf} || die "configure failed" - emake || die "make failed" + deprecation_warning + php5_2-sapi_src_compile } php5-sapi-r1_src_install() { - addpredict /usr/share/snmp/mibs/.index - - useq sharedext && PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules" - make INSTALL_ROOT=${D} $PHP_INSTALLTARGETS || die "install failed" - - # annoyingly, we have to install the CLI by hand - if [ "$PHPSAPI" = "cli" ]; then - dobin sapi/cli/php - fi - - # get the extension dir - PHPEXTDIR="`${D}/usr/bin/php-config --extension-dir`" - - # don't forget the php.ini file - local phpinisrc=php.ini-dist - einfo "Setting extension_dir in php.ini" - sed -e "s|^extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc} - - # A patch for PHP for security. PHP-CLI interface is exempt, as it cannot be - # fed bad data from outside. - if [ "${PHPSAPI}" != "cli" ]; then - einfo "Securing fopen wrappers" - sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} - fi - - einfo "Setting correct include_path" - sed -e 's|^;include_path .*|include_path = ".:/usr/share/php"|' -i ${phpinisrc} - - if useq sharedext; then - for x in `ls ${D}${PHPEXTDIR}/*.so | sort`; do - echo "extension=`basename ${x}`" >> ${phpinisrc} - done; - fi - - dodir ${PHP_INI_DIR} - insinto ${PHP_INI_DIR} - newins ${phpinisrc} ${PHP_INI_FILE} - - # PEAR-Installer and phpconfig install the following, so we - # don't have to - - rm -rf ${D}/usr/bin/{php,phpextdist,phpize,php-config,pear} - rm -rf ${D}/usr/lib/php/build - rm -rf ${D}/usr/include/php - - # we let each SAPI install the man page - # this does mean that the packages are in conflict for now - - if [ "$PHPSAPI" != "cli" ]; then - rm -rf ${D}/usr/share/man/man1/php.1* - fi + deprecation_warning + php5_2-sapi_src_install } php5-sapi-r1_pkg_postinst() { - ewarn "If you have additional third party PHP extensions (such as" - ewarn "dev-php/eaccelerator) you may need to recompile them now." - - if useq curl; then - ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions." - fi + deprecation_warning + php5_2-sapi_pkg_postinst } - diff --git a/eclass/php5-sapi-r2.eclass b/eclass/php5-sapi-r2.eclass index b3e22072b23c..d5de6a61c688 100644 --- a/eclass/php5-sapi-r2.eclass +++ b/eclass/php5-sapi-r2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php5-sapi-r2.eclass,v 1.43 2007/03/26 20:19:22 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php5-sapi-r2.eclass,v 1.44 2007/09/02 17:49:20 jokey Exp $ # # eclass/php5-sapi-r2.eclass # Eclass for building different php5 SAPI instances @@ -12,578 +12,41 @@ # # ======================================================================== -# a list of the USE flags which PHP supports, but which we don't have -# required packages in the tree - -CONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix ingres mnogosearch msession msql oci8 oracle7 ovrimos pfpro sapdb solid sybase sybase-ct" - -inherit flag-o-matic eutils confutils libtool - - -# set MY_PHP_P in the ebuild - -# we only set these variables if we're building a copy of php which can be -# installed as a package in its own right -# -# copies of php which are compiled into other packages (e.g. php support -# for the thttpd web server) don't need these variables - -if [ "${PHP_PACKAGE}" = 1 ]; then - HOMEPAGE="http://www.php.net/" - LICENSE="PHP-3" - SRC_URI="http://www.php.net/distributions/${MY_PHP_P}.tar.bz2" - S="${WORKDIR}/${MY_PHP_P}" -fi - -IUSE="adabas bcmath berkdb birdstep bzip2 calendar cdb pdf crypt -ctype curl curlwrappers db2 dba dbase dbm dbmaker dbx debug dio empress -empress-bcs esoob exif fam firebird frontbase fdftk flatfile filepro ftp gd gd-external gdbm gmp hardenedphp hyperwave-api imap inifile iconv informix ingres interbase iodbc jpeg kerberos ldap libedit mcve memlimit mhash mime ming mkconfig mnogosearch msession msql mssql mysql mysqli ncurses nls nis oci8 odbc oracle7 ovrimos pcntl pcre pfpro png postgres posix qdbm readline recode sapdb sasl session sharedext sharedmem simplexml snmp soap sockets solid spell spl sqlite ssl sybase sybase-ct sysvipc threads tidy tiff tokenizer truetype wddx xsl xml xmlrpc xpm zlib" - -# these USE flags should have the correct dependencies -DEPEND="$DEPEND - !<=dev-php/php-4.99.99 - berkdb? ( =sys-libs/db-4* ) - bzip2? ( app-arch/bzip2 ) - pdf? ( >=media-libs/clibpdf-2 ) - crypt? ( >=dev-libs/libmcrypt-2.4 ) - curl? ( >=net-misc/curl-7.10.5 ) - fam? ( virtual/fam ) - fdftk? ( app-text/fdftk ) - firebird? ( dev-db/firebird ) - gd-external? ( media-libs/gd ) - gdbm? ( >=sys-libs/gdbm-1.8.0 ) - gmp? ( dev-libs/gmp ) - imap? ( virtual/imap-c-client ) - iodbc? ( dev-db/libiodbc ) - jpeg? ( >=media-libs/jpeg-6b ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11 ) - libedit? ( dev-libs/libedit ) - mcve? ( net-libs/libmonetra ) - mhash? ( app-crypt/mhash ) - mime? ( sys-apps/file ) - ming? ( media-libs/ming ) - mssql? ( dev-db/freetds ) - mysql? ( virtual/mysql ) - ncurses? ( sys-libs/ncurses ) - nls? ( sys-devel/gettext ) - odbc? ( >=dev-db/unixODBC-1.8.13 ) - postgres? ( >=dev-db/postgresql-7.1 ) - png? ( media-libs/libpng ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline ) - recode? ( app-text/recode ) - sharedmem? ( dev-libs/mm ) - simplexml? ( dev-libs/libxml2 ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) - soap? ( dev-libs/libxml2 ) - spell? ( app-text/aspell ) - sqlite? ( =dev-db/sqlite-2* ) - ssl? ( >=dev-libs/openssl-0.9.7 ) - sybase? ( dev-db/freetds ) - tidy? ( app-text/htmltidy ) - tiff? ( media-libs/tiff ) - truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 ) - wddx? ( dev-libs/expat ) - xpm? ( x11-libs/libXpm ) - xsl? ( dev-libs/libxslt ) - zlib? ( sys-libs/zlib ) " - -# this would be xml?, but PEAR requires XML support -# this can become a USE flag when Gentoo bug #2272 has been resolved -DEPEND="$DEPEND - dev-libs/libxml2" - -# ======================================================================== - -PHP_BUILDTARGETS="${PHP_BUILDTARGETS} build-modules" -PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install" - -# ======================================================================== - -PHP_INI_DIR="/etc/php/${PHPSAPI}-php5" -PHP_INI_FILE="php.ini" - -# ======================================================================== -# Hardened-PHP Support -# ======================================================================== -# -# I've done it like this so that we can support different versions of -# the patch for different versions of PHP - -case "$PV" in - 5.0.4) HARDENEDPHP_PATCH="hardening-patch-$PV-0.3.2.patch.gz" ;; -esac - -[ -n "$HARDENEDPHP_PATCH" ] && SRC_URI="${SRC_URI} hardenedphp? ( http://www.hardened-php.net/$HARDENEDPHP_PATCH )" - -# ======================================================================== - -EXPORT_FUNCTIONS pkg_setup src_compile src_install src_unpack pkg_postinst - -# ======================================================================== -# INTERNAL FUNCTIONS -# ======================================================================== +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php5_2-sapi eclass instead! + +inherit php5_2-sapi + +deprecation_warning() { + eerror "Please upgrade ${PF} to use php5_2-sapi eclass instead!" +} php5-sapi-r2_check_awkward_uses() { - - # disabled hardenedphp after many reports of problems w/ apache - # need to look into this at some point - - if useq hardenedphp ; then - eerror - eerror "hardenedphp is reported to break php for some users." - eerror "We've disabled this feature for now until it has been" - eerror "thoroughly investigated." - eerror - eerror "Please disable the hardenedphp USE flag" - die "hardenedphp support disabled" - fi - - # snmp support seems broken, haven't looked into a fix for it yet - - if useq snmp && [ "$PHP_PV" = "5.0.3" ] ; then - eerror - eerror "The snmp support in PHP 5 is currently broken." - eerror "Please disable the snmp USE flag" - eerror - die "snmp support doesn't compile" - fi - - # mysqli support is disabled; see bug #53886 - - if useq mysqli ; then - eerror - eerror "We currently do not support the mysqli extension" - eerror "Support will be added once MySQL 4.1 is no longer package-masked" - eerror - die "mysqli not supported yet" - fi - - # recode not available in 5.0.0; upstream bug - if useq recode && [ "$PHP_PV" == "5.0.0" ]; then - eerror - eerror "Support for the 'recode' extension is currently broken UPSTREAM" - eerror "See http://bugs.php.net/bug.php?id=28700 for details" - eerror - die "recode broken, upstream bug" - fi - - # Sanity check for Oracle - if useq oci8 && [ -z "${ORACLE_HOME}" ]; then - eerror - eerror "You must have the ORACLE_HOME variable in your environment!" - eerror - die "Oracle configuration incorrect; user error" - fi - - if useq oci8 || useq oracle7; then - if has_version 'dev-db/oracle-instantclient-basic'; then - ewarn "Please ensure you have a full install of the Oracle client." - ewarn "dev-db/oracle-instantclient* is NOT sufficent." - fi - fi - - if useq dba ; then - # extension USE flag shared support? - enable_extension_with "cdb" "cdb" 1 - enable_extension_with "db4" "berkdb" 1 - enable_extension_with "dbm" "dbm" 1 - enable_extension_with "flatfile" "flatfile" 1 - enable_extension_with "gdbm" "gdbm" 1 - enable_extension_with "inifile" "inifile" 1 - enable_extension_with "qdbm" "qdbm" 1 - fi - - if useq dbx ; then - confutils_use_depend_any "dbx" "frontbase" "mssql" "odbc" "postgres" "sybase-ct" "oci8" "sqlite" - enable_extension_enable "dbx" "dbx" 1 - fi - - enable_extension_with "jpeg-dir" "jpeg" 0 "/usr" - if useq gd-external ; then - enable_extension_with "freetype-dir" "truetype" 0 "/usr" - enable_extension_with "t1lib" "truetype" 0 "/usr" - enable_extension_enable "gd-native-ttf" "truetype" 0 - enable_extension_enable "gd-jis-conf" "nls" 0 - enable_extension_enable "gd-native-ttf" "truetype" 0 - enable_extension_with "gd" "gd-external" 1 "/usr" - else - enable_extension_with "freetype-dir" "truetype" 0 "/usr" - enable_extension_with "t1lib" "truetype" 0 "/usr" - enable_extension_enable "gd-jis-conf" "nls" 0 - enable_extension_enable "gd-native-ttf" "truetype" 0 - enable_extension_with "png-dir" "png" 0 "/usr" - enable_extension_with "tiff-dir" "tiff" 0 "/usr" - enable_extension_with "xpm-dir" "xpm" 0 "/usr/X11R6" - # enable gd last, so configure can pick up the previous settings - enable_extension_with "gd" "gd" 0 - fi - - confutils_use_depend_any "jpeg" "gd" "gd-external" "pdf" - confutils_use_depend_any "png" "gd" "gd-external" - confutils_use_depend_any "tiff" "gd" "gd-external" - confutils_use_depend_any "xpm" "gd" "gd-external" - confutils_use_depend_all "png" "zlib" - - if useq imap ; then - enable_extension_with "imap" "imap" 1 - # this is a PITA to deal with - if useq ssl ; then - #if [ -n "`strings ${ROOT}/usr/$(get_libdir)/c-client.* 2>/dev/null | grep ssl_onceonlyinit`" ]; then - if built_with_use virtual/imap-c-client ssl ; then - # the IMAP-SSL arg doesn't parse 'shared,/usr/lib' right - enable_extension_with "imap-ssl" "ssl" 0 - else - msg="IMAP+SSL requested, but your IMAP libraries are built without SSL!" - eerror "${msg}" - die "${msg}" - fi - fi - fi - - if useq ldap ; then - enable_extension_with "ldap" "ldap" 1 - enable_extension_with "ldap-sasl" "sasl" 0 - fi - - if useq odbc ; then - enable_extension_with "unixODBC" "odbc" 1 "/usr" - - enable_extension_with "adabas" "adabas" 1 - enable_extension_with "birdstep" "birdstep" 1 - enable_extension_with "dbmaker" "dbmaker" 1 - enable_extension_with "empress" "empress" 1 - if useq empress ; then - enable_extension_with "empress-bcs" "empress-bcs" 0 - fi - enable_extension_with "esoob" "esoob" 1 - enable_extension_with "ibm-db2" "db2" 1 - enable_extension_with "iodbc" "iodbc" 1 "/usr" - enable_extension_with "sapdb" "sapdb" 1 - enable_extension_with "solid" "solid" 1 - fi - - if useq mysql; then - enable_extension_with "mysql" "mysql" 1 "/usr/lib/mysql" - enable_extension_with "mysql-sock" "mysql" 0 "/var/run/mysqld/mysqld.sock" - fi - if useq mysqli; then - enable_extension_with "mysqli" "mysqli" 1 "/usr/bin/mysql_config" - fi - - # QDBM doesn't play nicely with GDBM _or_ DBM - confutils_use_conflict "qdbm" "gdbm" "dbm" - # both provide the same functionality - confutils_use_conflict "readline" "libedit" - # Recode is not liked. - confutils_use_conflict "recode" "mysql" "imap" "nis" #"yaz" - - if ! useq session ; then - enable_extension_disable "session" "session" 1 - else - enable_extension_with "mm" "sharedmem" 0 - enable_extension_with "msession" "msession" 1 - fi - - if ! useq sqlite ; then - enable_extension_without "sqlite" "sqlite" 0 - else - enable_extension_enable "sqlite-utf8" "nls" 0 - fi - - # MCVE needs openSSL - confutils_use_depend_all "mcve" "ssl" - # A variety of extensions need DBA - confutils_use_depend_all "cdb" "dba" - confutils_use_depend_all "berkdb" "dba" - confutils_use_depend_all "flatfile" "dba" - confutils_use_depend_all "gdbm" "dba" - confutils_use_depend_all "inifile" "dba" - confutils_use_depend_all "qdbm" "dba" - - # build EXIF support if we support a file format that uses it - confutils_use_depend_any "exif" "jpeg" "tiff" - - # GD library support - confutils_use_depend_any "truetype" "gd" "gd-external" - - # ldap support - confutils_use_depend_all "sasl" "ldap" - - # mysql support - # This shouldn't conflict actually - #confutils_use_conflict "mysqli" "mysql" - - # odbc support - confutils_use_depend_all "adabas" "odbc" - confutils_use_depend_all "birdstep" "odbc" - confutils_use_depend_all "dbmaker" "odbc" - confutils_use_depend_all "empress" "odbc" - confutils_use_depend_all "empress-bcs" "odbc" "empress" - confutils_use_depend_all "esoob" "odbc" - confutils_use_depend_all "db2" "odbc" - confutils_use_depend_all "sapdb" "odbc" - confutils_use_depend_all "solid" "odbc" - - # session support - confutils_use_depend_all "msession" "session" - - confutils_warn_about_missing_deps + deprecation_warning + php5_2-sapi_check_use_flags } -# ======================================================================== -# EXPORTED FUNCTIONS -# ======================================================================== - php5-sapi-r2_pkg_setup() { - # let's do all the USE flag testing before we do anything else - # this way saves a lot of time - - php5-sapi-r2_check_awkward_uses + deprecation_warning + php5_2-sapi_pkg_setup } php5-sapi-r2_src_unpack() { - if [ "${PHP_PACKAGE}" == 1 ]; then - unpack ${A} - fi - - cd ${PHP_S} - - # Patch PHP to show Gentoo as the server platform - sed -i "s/PHP_UNAME=\`uname -a\`/PHP_UNAME=\`uname -s -n -r -v\`/g" configure - # Patch for PostgreSQL support - sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i configure - - # Patch for session persistence bug - epatch ${FILESDIR}/php5_soap_persistence_session.diff - - # stop php from activating the apache config, as we will do that ourselves - for i in configure sapi/apache/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 ; do - sed -i.orig -e 's,-i -a -n php5,-i -n php5,g' $i - done - - # hardenedphp support - - use hardenedphp && [ -n "$HARDENEDPHP_PATCH" ] && epatch ${DISTDIR}/${HARDENEDPHP_PATCH} - - # iodbc support - use iodbc && epatch ${FILESDIR}/with-iodbc.diff - - # fix configure scripts to recognize uClibc - uclibctoolize - - # Just in case ;-) - chmod 755 configure - - # [ "${ARCH}" == "sparc" ] && epatch ${FILESDIR}/php-5.0-stdint.diff - # epatch ${FILESDIR}/${MY_PHP_P}-missing-arches.patch + deprecation_warning + php5_2-sapi_src_unpack } php5-sapi-r2_src_compile() { - cd ${PHP_S} - confutils_init - - my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}" - if [ "$PHPSAPI" == "cli" ]; then - my_conf="${my_conf} --with-pear=/usr/share/php" - else - my_conf="${my_conf} --disable-cli --without-pear" - fi - - # extension USE flag shared support? - enable_extension_enable "bcmath" "bcmath" 1 - enable_extension_with "bz2" "bzip2" 1 - enable_extension_enable "calendar" "calendar" 1 - enable_extension_with "cpdflib" "pdf" 1 # depends on jpeg - enable_extension_disable "ctype" "ctype" 0 - enable_extension_with "curl" "curl" 1 - enable_extension_with "curlwrappers" "curlwrappers" 1 - enable_extension_enable "dbase" "dbase" 1 - enable_extension_enable "dio" "dio" 1 - enable_extension_disable "dom" "xml" 0 - enable_extension_enable "exif" "exif" 1 - enable_extension_with "fam" "fam" 1 - enable_extension_with "fbsql" "frontbase" 1 - enable_extension_with "fdftk" "fdftk" 1 "/opt/fdftk-6.0" - enable_extension_enable "filepro" "filepro" 1 - enable_extension_enable "ftp" "ftp" 1 - enable_extension_with "gettext" "nls" 1 - enable_extension_with "gmp" "gmp" 1 - enable_extension_with "hwapi" "hyperwave-api" 1 - enable_extension_with "iconv" "iconv" 1 - enable_extension_with "informix" "informix" 1 - enable_extension_with "ingres" "ingres" 1 - enable_extension_with "interbase" "firebird" 1 - # iodbc support added by Tim Haynes <gentoo@stirfried.vegetable.org.uk> - enable_extension_with "iodbc" "iodbc" 0 "/usr" - # ircg extension not supported on Gentoo at this time - enable_extension_with "kerberos" "kerberos" 0 - enable_extension_disable "libxml" "xml" 0 - enable_extension_enable "mbstring" "nls" 1 - enable_extension_with "mcrypt" "crypt" 1 - enable_extension_with "mcve" "mcve" 1 - enable_extension_enable "memory-limit" "memlimit" 0 - enable_extension_with "mhash" "mhash" 1 - enable_extension_with "mime-magic" "mime" 0 "/usr/share/misc/file/magic.mime" - enable_extension_with "ming" "ming" 1 - enable_extension_with "mnogosearch" "mnogosearch" 1 - enable_extension_with "msql" "msql" 1 - enable_extension_with "mssql" "mssql" 1 - enable_extension_with "ncurses" "ncurses" 1 - enable_extension_with "oci8" "oci8" 1 - enable_extension_with "oracle" "oracle7" 1 - enable_extension_with "openssl" "ssl" 1 - enable_extension_with "openssl-dir" "ssl" 0 "/usr" - enable_extension_with "ovrimos" "ovrimos" 1 - enable_extension_enable "pcntl" "pcntl" 1 - enable_extension_without "pcre-regx" "pcre" 1 - enable_extension_with "pfpro" "pfpro" 1 - enable_extension_with "pgsql" "postgres" 1 - enable_extension_disable "posix" "posix" 1 - enable_extension_with "pspell" "spell" 1 - enable_extension_with "recode" "recode" 1 - enable_extension_disable "simplexml" "simplexml" 1 - enable_extension_enable "shmop" "sharedmem" 0 - enable_extension_with "snmp" "snmp" 1 - enable_extension_enable "soap" "soap" 1 - enable_extension_enable "sockets" "sockets" 1 - enable_extension_disable "spl" "spl" 1 - enable_extension_with "sybase" "sybase" 1 - enable_extension_with "sybase-ct" "sybase-ct" 1 - enable_extension_enable "sysvmsg" "sysvipc" 1 - enable_extension_enable "sysvsem" "sysvipc" 1 - enable_extension_enable "sysvshm" "sysvipc" 1 - enable_extension_with "tidy" "tidy" 1 - enable_extension_disable "tokenizer" "tokenizer" 1 - enable_extension_enable "wddx" "wddx" 1 - enable_extension_with "xsl" "xsl" 1 - #enable_extension_disable "xml" "xml" 1 # PEAR needs --enable-xml - enable_extension_with "xmlrpc" "xmlrpc" 1 - enable_extension_enable "yp" "nis" 1 - enable_extension_with "zlib" "zlib" 1 - enable_extension_enable "debug" "debug" 0 - - php5-sapi-r2_check_awkward_uses - - # DBA support - enable_extension_enable "dba" "dba" 1 - - # readline support - # - # you can use readline or libedit, but you can't use both - enable_extension_with "readline" "readline" 0 - enable_extension_with "libedit" "libedit" 1 - - # fix ELF-related problems - if has_pic ; then - einfo "Enabling PIC support" - my_conf="${my_conf} --with-pic" - fi - - # Bug 98694 - addpredict /etc/krb5.conf - - # all done - - econf ${my_conf} || die "configure failed" - emake || die "make failed" + deprecation_warning + php5_2-sapi_src_compile } php5-sapi-r2_src_install() { - cd ${PHP_S} - addpredict /usr/share/snmp/mibs/.index - - useq sharedext && PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules" - make INSTALL_ROOT=${D} $PHP_INSTALLTARGETS || die "install failed" - - # get the extension dir - PHPEXTDIR="`${D}/usr/bin/php-config --extension-dir`" - - # don't forget the php.ini file - local phpinisrc=php.ini-dist - einfo "Setting extension_dir in php.ini" - sed -e "s|^extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc} - - # A patch for PHP for security. PHP-CLI interface is exempt, as it cannot be - # fed bad data from outside. - if [ "${PHPSAPI}" != "cli" ]; then - einfo "Securing fopen wrappers" - sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} - fi - - einfo "Setting correct include_path" - sed -e 's|^;include_path .*|include_path = ".:/usr/share/php"|' -i ${phpinisrc} - - if useq sharedext; then - for x in `ls ${D}${PHPEXTDIR}/*.so | sort`; do - echo "extension=`basename ${x}`" >> ${phpinisrc} - done; - fi - - dodir ${PHP_INI_DIR} - insinto ${PHP_INI_DIR} - newins ${phpinisrc} ${PHP_INI_FILE} - - # php-config install the following, so we don't have to - # - # if 'mkconfig' USE flag is set, we create the phpconfig - # source tarball ... this makes it easy for us to bump the - # phpconfig package whenever we bump php - - if useq mkconfig ; then - CONFIG_NAME=phpconfig-$PV - CONFIG_DESTDIR=${T}/${CONFIG_NAME} - - einfo "Building source tarball for ${CONFIG_NAME}" - - mkdir -p ${CONFIG_DESTDIR}/usr/bin - cp ${D}/usr/bin/{phpextdist,phpize,php-config} ${CONFIG_DESTDIR}/usr/bin/ - - mkdir -p ${CONFIG_DESTDIR}/usr/lib/php - cp -r ${D}/usr/lib/php/build ${CONFIG_DESTDIR}/usr/lib/php - - mkdir -p ${CONFIG_DESTDIR}/usr/include - cp -r ${D}/usr/include/php ${CONFIG_DESTDIR}/usr/include - - cd ${T} - tar -cf - ${CONFIG_NAME} | bzip2 -9 > ${CONFIG_NAME}.tar.bz2 - cd - - - einfo "Done; tarball is ${T}/${CONFIG_NAME}.tar.bz2" - fi - - # move all the PEAR stuff from /usr/lib/php to /usr/share/php - - rm -rf ${D}/usr/lib/php/build - dodir /usr/share/php - - for x in ${D}/usr/lib/php/* ; do - if [ "`basename $x`" != 'extensions' ]; then - mv $x ${D}/usr/share/php - fi - done - - # only the cli SAPI is allowed to install PEAR - - if [ "$PHPSAPI" != "cli" ]; then - rm -f ${D}/usr/bin/pear - rm -f ${D}/usr/share/php - fi - - rm -rf ${D}/usr/bin/{phpextdist,phpize,php-config} - rm -rf ${D}/usr/include/php - - # we let each SAPI install the man page - # this does mean that the packages are in conflict for now + deprecation_warning + php5_2-sapi_src_install } php5-sapi-r2_pkg_postinst() { - ewarn "If you have additional third party PHP extensions (such as" - ewarn "dev-php/eaccelerator) you may need to recompile them now." - - if useq curl; then - ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions." - fi + deprecation_warning + php5_2-sapi_pkg_postinst } - diff --git a/eclass/php5-sapi-r3.eclass b/eclass/php5-sapi-r3.eclass index 4c7fa074aaed..d0fcd55115a2 100644 --- a/eclass/php5-sapi-r3.eclass +++ b/eclass/php5-sapi-r3.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php5-sapi-r3.eclass,v 1.25 2007/03/26 20:19:22 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php5-sapi-r3.eclass,v 1.26 2007/09/02 17:49:20 jokey Exp $ # # ######################################################################## # @@ -17,560 +17,41 @@ # # ======================================================================== -CONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix msession msql oci8 oracle7 ovrimos pfpro sapdb solid sybase sybase-ct" +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php5_2-sapi eclass instead! -inherit flag-o-matic eutils confutils libtool +inherit php5_2-sapi - -# set MY_PHP_P in the ebuild - -# we only set these variables if we're building a copy of php which can be -# installed as a package in its own right -# -# copies of php which are compiled into other packages (e.g. php support -# for the thttpd web server) don't need these variables - -if [ "${PHP_PACKAGE}" = 1 ]; then - HOMEPAGE="http://www.php.net/" - LICENSE="PHP-3" - SRC_URI="http://www.php.net/distributions/${MY_PHP_P}.tar.bz2" - S="${WORKDIR}/${MY_PHP_P}" -fi - -IUSE="adabas bcmath berkdb birdstep bzip2 calendar cdb crypt ctype curl -curlwrappers db2 dba dbase dbm dbmaker dbx debug empress empress-bcs esoob exif -frontbase fdftk flatfile filepro firebird ftp gd gd-external gdbm gmp hardenedphp hyperwave-api imap inifile iconv informix interbase iodbc jpeg kerberos ldap libedit mcve memlimit mhash mime ming mkconfig msession msql mssql mysql mysqli ncurses nls oci8 odbc oracle7 ovrimos pcntl pcre pfpro png postgres posix qdbm readline recode sapdb sasl session sharedext sharedmem simplexml snmp soap sockets solid spell spl sqlite ssl sybase sybase-ct sysvipc threads tidy tiff tokenizer truetype wddx xsl xml2 xmlrpc xpm zlib" - -# these USE flags should have the correct dependencies -DEPEND="$DEPEND - !<=dev-php/php-4.99.99 - berkdb? ( =sys-libs/db-4* ) - bzip2? ( app-arch/bzip2 ) - crypt? ( >=dev-libs/libmcrypt-2.4 ) - curl? ( >=net-misc/curl-7.10.5 ) - fdftk? ( app-text/fdftk ) - firebird? ( dev-db/firebird ) - gd-external? ( media-libs/gd ) - gdbm? ( >=sys-libs/gdbm-1.8.0 ) - gmp? ( dev-libs/gmp ) - imap? ( virtual/imap-c-client ) - iodbc? ( dev-db/libiodbc ) - jpeg? ( >=media-libs/jpeg-6b ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11 ) - libedit? ( dev-libs/libedit ) - mcve? ( net-libs/libmonetra ) - mhash? ( app-crypt/mhash ) - mime? ( sys-apps/file ) - ming? ( media-libs/ming ) - mssql? ( dev-db/freetds ) - mysql? ( virtual/mysql ) - mysqli? ( >=virtual/mysql-4.1 ) - ncurses? ( sys-libs/ncurses ) - nls? ( sys-devel/gettext ) - odbc? ( >=dev-db/unixODBC-1.8.13 ) - postgres? ( >=dev-db/postgresql-7.1 ) - png? ( media-libs/libpng ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline ) - recode? ( app-text/recode ) - sharedmem? ( dev-libs/mm ) - simplexml? ( dev-libs/libxml2 ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) - soap? ( dev-libs/libxml2 ) - spell? ( app-text/aspell ) - sqlite? ( =dev-db/sqlite-2* ) - ssl? ( >=dev-libs/openssl-0.9.7 ) - sybase? ( dev-db/freetds ) - tidy? ( app-text/htmltidy ) - tiff? ( media-libs/tiff ) - truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 ) - wddx? ( dev-libs/expat ) - xpm? ( x11-libs/libXpm ) - xsl? ( dev-libs/libxslt ) - zlib? ( sys-libs/zlib ) " - -# this would be xml2?, but PEAR requires XML support -# this can become a USE flag when Gentoo bug #2272 has been resolved -DEPEND="$DEPEND - dev-libs/libxml2" - -# ======================================================================== - -PHP_BUILDTARGETS="${PHP_BUILDTARGETS} build-modules" -PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install" - -# ======================================================================== - -PHP_INI_DIR="/etc/php/${PHPSAPI}-php5" -PHP_INI_FILE="php.ini" - -# ======================================================================== -# Hardened-PHP Support -# ======================================================================== -# -# I've done it like this so that we can support different versions of -# the patch for different versions of PHP - -case "$PV" in - 5.0.4) HARDENEDPHP_PATCH="hardening-patch-$PV-0.3.2.patch.gz" ;; -esac - -[ -n "$HARDENEDPHP_PATCH" ] && SRC_URI="${SRC_URI} hardenedphp? ( http://www.hardened-php.net/$HARDENEDPHP_PATCH )" - -# ======================================================================== - -EXPORT_FUNCTIONS pkg_setup src_compile src_install src_unpack pkg_postinst - -# ======================================================================== -# INTERNAL FUNCTIONS -# ======================================================================== +deprecation_warning() { + eerror "Please upgrade ${PF} to use php5_2-sapi eclass instead!" +} php5-sapi-r3_check_awkward_uses() { - - # unfortunately, libedit support is broken atm - - if useq libedit ; then - eerror - eerror "php-5.1-beta doesn't link successfully if you use libedit" - eerror "Please switch to using readline instead for now." - die "libedit support broken" - fi - - # disabled hardenedphp after many reports of problems w/ apache - # need to look into this at some point - - if useq hardenedphp ; then - eerror - eerror "hardenedphp is reported to break php for some users." - eerror "We've disabled this feature for now until it has been" - eerror "thoroughly investigated." - eerror - eerror "Please disable the hardenedphp USE flag" - die "hardenedphp support disabled" - fi - - # snmp support seems broken, haven't looked into a fix for it yet - - if useq snmp && [ "$PHP_PV" = "5.0.3" ] ; then - eerror - eerror "The snmp support in PHP 5 is currently broken." - eerror "Please disable the snmp USE flag" - eerror - die "snmp support doesn't compile" - fi - - # mysqli support is disabled; see bug #53886 - # - # if useq mysqli ; then - # eerror - # eerror "We currently do not support the mysqli extension" - # eerror "Support will be added once MySQL 4.1 is no longer package-masked" - # eerror - # die "mysqli not supported yet" - # fi - - # recode not available in 5.0.0; upstream bug - if useq recode && [ "$PHP_PV" == "5.0.0" ]; then - eerror - eerror "Support for the 'recode' extension is currently broken UPSTREAM" - eerror "See http://bugs.php.net/bug.php?id=28700 for details" - eerror - die "recode broken, upstream bug" - fi - - # Sanity check for Oracle - if useq oci8 && [ -z "${ORACLE_HOME}" ]; then - eerror - eerror "You must have the ORACLE_HOME variable in your environment!" - eerror - die "Oracle configuration incorrect; user error" - fi - - if useq oci8 || useq oracle7; then - if has_version 'dev-db/oracle-instantclient-basic'; then - ewarn "Please ensure you have a full install of the Oracle client." - ewarn "dev-db/oracle-instantclient* is NOT sufficent." - fi - fi - - if useq dba ; then - # extension USE flag shared support? - enable_extension_with "cdb" "cdb" 1 - enable_extension_with "db4" "berkdb" 1 - enable_extension_with "dbm" "dbm" 1 - enable_extension_with "flatfile" "flatfile" 1 - enable_extension_with "gdbm" "gdbm" 1 - enable_extension_with "inifile" "inifile" 1 - enable_extension_with "qdbm" "qdbm" 1 - fi - - if useq dbx ; then - confutils_use_depend_any "dbx" "frontbase" "mssql" "odbc" "postgres" "sybase-ct" "oci8" "sqlite" - enable_extension_enable "dbx" "dbx" 1 - fi - - enable_extension_with "jpeg-dir" "jpeg" 0 "/usr" - if useq gd-external ; then - enable_extension_with "freetype-dir" "truetype" 0 "/usr" - enable_extension_with "t1lib" "truetype" 0 "/usr" - enable_extension_enable "gd-native-ttf" "truetype" 0 - enable_extension_enable "gd-jis-conf" "nls" 0 - enable_extension_enable "gd-native-ttf" "truetype" 0 - enable_extension_with "gd" "gd-external" 1 "/usr" - else - enable_extension_with "freetype-dir" "truetype" 0 "/usr" - enable_extension_with "t1lib" "truetype" 0 "/usr" - enable_extension_enable "gd-jis-conf" "nls" 0 - enable_extension_enable "gd-native-ttf" "truetype" 0 - enable_extension_with "png-dir" "png" 0 "/usr" - enable_extension_with "tiff-dir" "tiff" 0 "/usr" - enable_extension_with "xpm-dir" "xpm" 0 "/usr/X11R6" - # enable gd last, so configure can pick up the previous settings - enable_extension_with "gd" "gd" 0 - fi - - confutils_use_depend_any "jpeg" "gd" "gd-external" - confutils_use_depend_any "png" "gd" "gd-external" - confutils_use_depend_any "tiff" "gd" "gd-external" - confutils_use_depend_any "xpm" "gd" "gd-external" - confutils_use_depend_all "png" "zlib" - - if useq imap ; then - enable_extension_with "imap" "imap" 1 - # this is a PITA to deal with - if useq ssl ; then - #if [ -n "`strings ${ROOT}/usr/$(get_libdir)/c-client.* 2>/dev/null | grep ssl_onceonlyinit`" ]; then - if built_with_use virtual/imap-c-client ssl ; then - # the IMAP-SSL arg doesn't parse 'shared,/usr/lib' right - enable_extension_with "imap-ssl" "ssl" 0 - else - msg="IMAP+SSL requested, but your IMAP libraries are built without SSL!" - eerror "${msg}" - die "${msg}" - fi - fi - fi - - if useq ldap ; then - enable_extension_with "ldap" "ldap" 1 - enable_extension_with "ldap-sasl" "sasl" 0 - fi - - if useq odbc ; then - enable_extension_with "unixODBC" "odbc" 1 "/usr" - - enable_extension_with "adabas" "adabas" 1 - enable_extension_with "birdstep" "birdstep" 1 - enable_extension_with "dbmaker" "dbmaker" 1 - enable_extension_with "empress" "empress" 1 - if useq empress ; then - enable_extension_with "empress-bcs" "empress-bcs" 0 - fi - enable_extension_with "esoob" "esoob" 1 - enable_extension_with "ibm-db2" "db2" 1 - enable_extension_with "iodbc" "iodbc" 1 "/usr" - enable_extension_with "sapdb" "sapdb" 1 - enable_extension_with "solid" "solid" 1 - fi - - if useq mysql; then - enable_extension_with "mysql" "mysql" 1 "/usr/lib/mysql" - enable_extension_with "mysql-sock" "mysql" 0 "/var/run/mysqld/mysqld.sock" - fi - enable_extension_with "mysqli" "mysqli" 1 "/usr/bin/mysql_config" - - # QDBM doesn't play nicely with GDBM _or_ DBM - confutils_use_conflict "qdbm" "gdbm" "dbm" - # both provide the same functionality - confutils_use_conflict "readline" "libedit" - # Recode is not liked. - confutils_use_conflict "recode" "mysql" "imap" "nis" #"yaz" - - if ! useq session ; then - enable_extension_disable "session" "session" 1 - else - enable_extension_with "mm" "sharedmem" 0 - enable_extension_with "msession" "msession" 1 - fi - - if ! useq sqlite ; then - enable_extension_without "sqlite" "sqlite" 0 - else - enable_extension_enable "sqlite-utf8" "nls" 0 - fi - - # MCVE needs openSSL - confutils_use_depend_all "mcve" "ssl" - # A variety of extensions need DBA - confutils_use_depend_all "cdb" "dba" - confutils_use_depend_all "berkdb" "dba" - confutils_use_depend_all "flatfile" "dba" - confutils_use_depend_all "gdbm" "dba" - confutils_use_depend_all "inifile" "dba" - confutils_use_depend_all "qdbm" "dba" - - # build EXIF support if we support a file format that uses it - confutils_use_depend_any "exif" "jpeg" "tiff" - - # GD library support - confutils_use_depend_any "truetype" "gd" "gd-external" - - # ldap support - confutils_use_depend_all "sasl" "ldap" - - # mysql support - # This shouldn't conflict actually - #confutils_use_conflict "mysqli" "mysql" - - # odbc support - confutils_use_depend_all "adabas" "odbc" - confutils_use_depend_all "birdstep" "odbc" - confutils_use_depend_all "dbmaker" "odbc" - confutils_use_depend_all "empress" "odbc" - confutils_use_depend_all "empress-bcs" "odbc" "empress" - confutils_use_depend_all "esoob" "odbc" - confutils_use_depend_all "db2" "odbc" - confutils_use_depend_all "sapdb" "odbc" - confutils_use_depend_all "solid" "odbc" - - # session support - confutils_use_depend_all "msession" "session" - - confutils_warn_about_missing_deps + deprecation_warning + php5_2-sapi_check_use_flags } -# ======================================================================== -# EXPORTED FUNCTIONS -# ======================================================================== - php5-sapi-r3_pkg_setup() { - # let's do all the USE flag testing before we do anything else - # this way saves a lot of time - - php5-sapi-r3_check_awkward_uses + deprecation_warning + php5_2-sapi_pkg_setup } php5-sapi-r3_src_unpack() { - if [ "${PHP_PACKAGE}" == 1 ]; then - unpack ${A} - fi - - cd ${PHP_S} - - # Patch PHP to show Gentoo as the server platform - sed -i "s/PHP_UNAME=\`uname -a\`/PHP_UNAME=\`uname -s -n -r -v\`/g" configure - # Patch for PostgreSQL support - sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i configure - - # Patch for session persistence bug - epatch ${FILESDIR}/php5_soap_persistence_session.diff - - # stop php from activating the apache config, as we will do that ourselves - for i in configure sapi/apache/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 ; do - sed -i.orig -e 's,-i -a -n php5,-i -n php5,g' $i - done - - # hardenedphp support - - use hardenedphp && [ -n "$HARDENEDPHP_PATCH" ] && epatch ${DISTDIR}/${HARDENEDPHP_PATCH} - - # iodbc support - use iodbc && epatch ${FILESDIR}/with-iodbc.diff - - # fix configure scripts to recognize uClibc - uclibctoolize - - # Just in case ;-) - chmod 755 configure - - # [ "${ARCH}" == "sparc" ] && epatch ${FILESDIR}/php-5.0-stdint.diff - # epatch ${FILESDIR}/${MY_PHP_P}-missing-arches.patch + deprecation_warning + php5_2-sapi_src_unpack } php5-sapi-r3_src_compile() { - cd ${PHP_S} - confutils_init - - my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}" - my_conf="${my_conf} --without-pear" - - # extension USE flag shared support? - enable_extension_enable "bcmath" "bcmath" 1 - enable_extension_with "bz2" "bzip2" 1 - enable_extension_enable "calendar" "calendar" 1 - enable_extension_disable "ctype" "ctype" 0 - enable_extension_with "curl" "curl" 1 - enable_extension_with "curlwrappers" "curlwrappers" 1 - enable_extension_enable "dbase" "dbase" 1 - enable_extension_disable "dom" "xml2" 0 - enable_extension_enable "exif" "exif" 1 - enable_extension_with "fbsql" "frontbase" 1 - enable_extension_with "fdftk" "fdftk" 1 "/opt/fdftk-6.0" - enable_extension_enable "filepro" "filepro" 1 - enable_extension_enable "ftp" "ftp" 1 - enable_extension_with "gettext" "nls" 1 - enable_extension_with "gmp" "gmp" 1 - enable_extension_with "hwapi" "hyperwave-api" 1 - enable_extension_with "iconv" "iconv" 1 - enable_extension_with "informix" "informix" 1 - enable_extension_with "interbase" "firebird" 1 - # iodbc support added by Tim Haynes <gentoo@stirfried.vegetable.org.uk> - enable_extension_with "iodbc" "iodbc" 0 "/usr" - # ircg extension not supported on Gentoo at this time - enable_extension_with "kerberos" "kerberos" 0 - enable_extension_disable "libxml" "xml2" 0 - enable_extension_enable "mbstring" "nls" 1 - enable_extension_with "mcrypt" "crypt" 1 - enable_extension_with "mcve" "mcve" 1 - enable_extension_enable "memory-limit" "memlimit" 0 - enable_extension_with "mhash" "mhash" 1 - enable_extension_with "mime-magic" "mime" 0 "/usr/share/misc/file/magic.mime" - enable_extension_with "ming" "ming" 1 - enable_extension_with "msql" "msql" 1 - enable_extension_with "mssql" "mssql" 1 - enable_extension_with "ncurses" "ncurses" 1 - enable_extension_with "oci8" "oci8" 1 - enable_extension_with "oracle" "oracle7" 1 - enable_extension_with "openssl" "ssl" 1 - enable_extension_with "openssl-dir" "ssl" 0 "/usr" - enable_extension_with "ovrimos" "ovrimos" 1 - enable_extension_enable "pcntl" "pcntl" 1 - enable_extension_without "pcre-regx" "pcre" 1 - enable_extension_with "pfpro" "pfpro" 1 - enable_extension_with "pgsql" "postgres" 1 - enable_extension_disable "posix" "posix" 1 - enable_extension_with "pspell" "spell" 1 - enable_extension_with "recode" "recode" 1 - enable_extension_disable "simplexml" "simplexml" 1 - enable_extension_enable "shmop" "sharedmem" 0 - enable_extension_with "snmp" "snmp" 1 - enable_extension_enable "soap" "soap" 1 - enable_extension_enable "sockets" "sockets" 1 - enable_extension_disable "spl" "spl" 1 - enable_extension_with "sybase" "sybase" 1 - enable_extension_with "sybase-ct" "sybase-ct" 1 - enable_extension_enable "sysvmsg" "sysvipc" 1 - enable_extension_enable "sysvsem" "sysvipc" 1 - enable_extension_enable "sysvshm" "sysvipc" 1 - enable_extension_with "tidy" "tidy" 1 - enable_extension_disable "tokenizer" "tokenizer" 1 - enable_extension_enable "wddx" "wddx" 1 - enable_extension_with "xsl" "xsl" 1 - #enable_extension_disable "xml" "xml2" 1 # PEAR needs --enable-xml - enable_extension_with "xmlrpc" "xmlrpc" 1 - enable_extension_with "zlib" "zlib" 1 - enable_extension_enable "debug" "debug" 0 - - php5-sapi-r3_check_awkward_uses - - # DBA support - enable_extension_enable "dba" "dba" 1 - - # readline support - # - # you can use readline or libedit, but you can't use both - enable_extension_with "readline" "readline" 0 - enable_extension_with "libedit" "libedit" 1 - - # fix ELF-related problems - if has_pic ; then - einfo "Enabling PIC support" - my_conf="${my_conf} --with-pic" - fi - - if [ "${PHPSAPI}" != "cli" ]; then - my_conf="${my_conf} --disable-cli" - fi - - # Bug 98694 - addpredict /etc/krb5.conf - - # all done - - econf ${my_conf} || die "configure failed" - emake || die "make failed" + deprecation_warning + php5_2-sapi_src_compile } php5-sapi-r3_src_install() { - cd ${PHP_S} - addpredict /usr/share/snmp/mibs/.index - - useq sharedext && PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules" - make INSTALL_ROOT=${D} $PHP_INSTALLTARGETS || die "install failed" - - # get the extension dir - PHPEXTDIR="`${D}/usr/bin/php-config --extension-dir`" - - # don't forget the php.ini file - local phpinisrc=php.ini-dist - einfo "Setting extension_dir in php.ini" - sed -e "s|^extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc} - - # A patch for PHP for security. PHP-CLI interface is exempt, as it cannot be - # fed bad data from outside. - if [ "${PHPSAPI}" != "cli" ]; then - einfo "Securing fopen wrappers" - sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} - fi - - einfo "Setting correct include_path" - sed -e 's|^;include_path .*|include_path = ".:/usr/share/php"|' -i ${phpinisrc} - - if useq sharedext; then - for x in `ls ${D}${PHPEXTDIR}/*.so | sort`; do - echo "extension=`basename ${x}`" >> ${phpinisrc} - done; - fi - - dodir ${PHP_INI_DIR} - insinto ${PHP_INI_DIR} - newins ${phpinisrc} ${PHP_INI_FILE} - - # PEAR-Installer and phpconfig install the following, so we - # don't have to - # - # if 'mkconfig' USE flag is set, we create the phpconfig source - # tarball ... this makes it easy for us to bump the phpconfig - # package whenever we bump php - - if useq mkconfig ; then - CONFIG_NAME=phpconfig-$PV - CONFIG_DESTDIR=${T}/${CONFIG_NAME} - - einfo "Building source tarball for ${CONFIG_NAME}" - - mkdir -p ${CONFIG_DESTDIR}/usr/bin - cp ${D}/usr/bin/{phpize,php-config} ${CONFIG_DESTDIR}/usr/bin/ - cp scripts/dev/phpextdist ${CONFIG_DESTDIR}/usr/bin/ - - mkdir -p ${CONFIG_DESTDIR}/usr/lib/php - cp -r ${D}/usr/lib/php/build ${CONFIG_DESTDIR}/usr/lib/php - - mkdir -p ${CONFIG_DESTDIR}/usr/include - cp -r ${D}/usr/include/php ${CONFIG_DESTDIR}/usr/include - - cd ${T} - tar -cf - ${CONFIG_NAME} | bzip2 -9 > ${CONFIG_NAME}.tar.bz2 - cd - - - einfo "Done; tarball is ${T}/${CONFIG_NAME}.tar.bz" - fi - - rm -rf ${D}/usr/bin/{phpize,php-config,pear} - rm -rf ${D}/usr/lib/php/build - rm -rf ${D}/usr/include/php - - # we let each SAPI install the man page - # this does mean that the packages are in conflict for now + deprecation_warning + php5_2-sapi_src_install } php5-sapi-r3_pkg_postinst() { - ewarn "If you have additional third party PHP extensions (such as" - ewarn "dev-php/eaccelerator) you may need to recompile them now." - - if useq curl; then - ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions." - fi + deprecation_warning + php5_2-sapi_pkg_postinst } - diff --git a/eclass/php5-sapi.eclass b/eclass/php5-sapi.eclass index 1c5bcb402573..c813b0fbd756 100644 --- a/eclass/php5-sapi.eclass +++ b/eclass/php5-sapi.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php5-sapi.eclass,v 1.58 2007/03/26 20:19:22 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php5-sapi.eclass,v 1.59 2007/09/02 17:49:20 jokey Exp $ # # eclass/php5-sapi.eclass # Eclass for building different php5 SAPI instances @@ -12,500 +12,41 @@ # # ======================================================================== -inherit eutils confutils libtool +# DEPRECATED!!! +# STOP USING THIS ECLASS, use php5_2-sapi eclass instead! +inherit php5_2-sapi -# set MY_P in the ebuild - -HOMEPAGE="http://www.php.net/" -LICENSE="PHP-3" -SRC_URI="http://www.php.net/distributions/${MY_P}.tar.bz2" -S="${WORKDIR}/${MY_P}" -IUSE="adabas bcmath berkdb birdstep bzip2 calendar cdb pdf crypt ctype curl curlwrappers db2 dba dbase dbm dbmaker dbx debug dio empress empress-bcs esoob exif fam frontbase fdftk firebird flatfile filepro ftp gd gd-external gdbm gmp hyperwave-api imap inifile iconv informix ingres iodbc jpeg kerberos ldap libedit mcve memlimit mhash mime ming mnogosearch msession msql mssql mysql mysqli ncurses nls nis oci8 odbc oracle7 ovrimos pcntl pcre pfpro png postgres posix qdbm readline recode sapdb sasl session sharedext sharedmem simplexml snmp soap sockets solid spell spl sqlite ssl sybase sybase-ct sysvipc tidy tiff tokenizer truetype wddx xsl xml2 xmlrpc xpm zlib" - -# these USE flags should have the correct dependencies -DEPEND="$DEPEND - !<=dev-php/php-4.99.99 - berkdb? ( =sys-libs/db-4* ) - bzip2? ( app-arch/bzip2 ) - pdf? ( >=media-libs/clibpdf-2 ) - crypt? ( >=dev-libs/libmcrypt-2.4 ) - curl? ( >=net-misc/curl-7.10.5 ) - fam? ( virtual/fam ) - fdftk? ( app-text/fdftk ) - firebird? ( dev-db/firebird ) - gd-external? ( media-libs/gd ) - gdbm? ( >=sys-libs/gdbm-1.8.0 ) - gmp? ( dev-libs/gmp ) - imap? ( virtual/imap-c-client ) - jpeg? ( >=media-libs/jpeg-6b ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11 ) - libedit? ( dev-libs/libedit ) - mcve? ( net-libs/libmonetra ) - mhash? ( app-crypt/mhash ) - mime? ( sys-apps/file ) - ming? ( media-libs/ming ) - mssql? ( dev-db/freetds ) - mysql? ( virtual/mysql ) - ncurses? ( sys-libs/ncurses ) - nls? ( sys-devel/gettext ) - odbc? ( >=dev-db/unixODBC-1.8.13 ) - postgres? ( >=dev-db/postgresql-7.1 ) - png? ( media-libs/libpng ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline ) - recode? ( app-text/recode ) - sharedmem? ( dev-libs/mm ) - simplexml? ( dev-libs/libxml2 ) - snmp? ( net-analyzer/net-snmp ) - soap? ( dev-libs/libxml2 ) - spell? ( app-text/aspell ) - sqlite? ( =dev-db/sqlite-2* ) - ssl? ( >=dev-libs/openssl-0.9.7 ) - sybase? ( dev-db/freetds ) - tidy? ( app-text/htmltidy ) - tiff? ( media-libs/tiff ) - truetype? ( =media-libs/freetype-1* =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 ) - wddx? ( dev-libs/expat ) - xpm? ( x11-libs/libXpm ) - xsl? ( dev-libs/libxslt ) - zlib? ( sys-libs/zlib ) " - -# this would be xml2?, but PEAR requires XML support -# and we always want to build PEAR. -DEPEND="$DEPEND - dev-libs/libxml2" - -# ======================================================================== - -PHP_BUILDTARGETS="${PHP_BUILDTARGETS} build-modules" -PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install" -PEAR_CACHE="/var/tmp/pear-cache" - -# ======================================================================== - -# we make the CLI version of PHP responsible for a few things, -# such as the files required by PEAR - -PHP_PROVIDER_PKG="dev-php/php" -PHP_PROVIDER_PKG_MINPVR="5.0.0" - -# ======================================================================== - -PHP_INI_DIR="/etc/php/${PHPSAPI}-php5" -PHP_INI_FILE="php.ini" - -# ======================================================================== - -EXPORT_FUNCTIONS pkg_setup src_compile src_install src_unpack pkg_postinst - -# ======================================================================== -# INTERNAL FUNCTIONS -# ======================================================================== - -php5-sapi_check_awkward_uses() { - - # recode not available in 5.0.0; upstream bug - if useq recode && [ "$PV" == "5.0.0" ]; then - eerror - eerror "Support for the 'recode' extension is currently broken UPSTREAM" - eerror "See http://bugs.php.net/bug.php?id=28700 for details" - eerror - die "recode broken, upstream bug" - fi - - # iodbc not available; upstream web site down - if useq iodbc ; then - eerror - eerror "We have not been able to add iodbc support to Gentoo yet, as we" - eerror "have experienced difficulties in reaching www.iodbc.org." - eerror - eerror "For now, please use the 'odbc' USE flag instead." - eerror - die "iodbc support incomplete; gentoo bug" - fi - - # Sanity check for Oracle - if useq oci8 && [ -z "${ORACLE_HOME}" ]; then - eerror - eerror "You must have the ORACLE_HOME variable in your environment!" - eerror - die "Oracle configuration incorrect; user error" - fi - - if useq oci8 || useq oracle7; then - if has_version 'dev-db/oracle-instantclient-basic'; then - ewarn "Please ensure you have a full install of the Oracle client." - ewarn "dev-db/oracle-instantclient* is NOT sufficent." - fi - fi - - if useq dba ; then - # extension USE flag shared support? - enable_extension_with "cdb" "cdb" 1 - enable_extension_with "db4" "berkdb" 1 - enable_extension_with "dbm" "dbm" 1 - enable_extension_with "flatfile" "flatfile" 1 - enable_extension_with "gdbm" "gdbm" 1 - enable_extension_with "inifile" "inifile" 1 - enable_extension_with "qdbm" "qdbm" 1 - fi - - if useq dbx ; then - confutils_use_depend_any "dbx" "frontbase" "mssql" "odbc" "postgres" "sybase-ct" "oci8" "sqlite" - enable_extension_enable "dbx" "dbx" 1 - fi - - enable_extension_with "jpeg-dir" "jpeg" 0 "/usr" - if useq gd-external ; then - enable_extension_with "gd" "gd-external" 1 "/usr" - enable_extension_enable "gd-jis-conf" "nls" 0 - enable_extension_enable "gd-native-ttf" "truetype" 0 - else - enable_extension_with "freetype-dir" "truetype" 0 "/usr" - enable_extension_with "t1lib" "truetype" 0 "/usr" - enable_extension_with "ttf" "truetype" 0 "/usr" - enable_extension_enable "gd-jis-conf" "nls" 0 - enable_extension_enable "gd-native-ttf" "truetype" 0 - enable_extension_with "png-dir" "png" 0 "/usr" - enable_extension_with "tiff-dir" "tiff" 0 "/usr" - enable_extension_with "xpm-dir" "xpm" 0 "/usr/X11R6" - # enable gd last, so configure can pick up the previous settings - enable_extension_with "gd" "gd" 0 - fi - - confutils_use_depend_any "jpeg" "gd" "gd-external" "pdf" - confutils_use_depend_any "png" "gd" "gd-external" - confutils_use_depend_any "tiff" "gd" "gd-external" - confutils_use_depend_any "xpm" "gd" "gd-external" - confutils_use_depend_all "png" "zlib" - - if useq imap ; then - enable_extension_with "imap" "imap" 1 - # this is a PITA to deal with - if useq ssl ; then - #if [ -n "`strings ${ROOT}/usr/$(get_libdir)/c-client.* 2>/dev/null | grep ssl_onceonlyinit`" ]; then - if built_with_use virtual/imap-c-client ssl ; then - # the IMAP-SSL arg doesn't parse 'shared,/usr/lib' right - enable_extension_with "imap-ssl" "ssl" 0 - else - msg="IMAP+SSL requested, but your IMAP libraries are built without SSL!" - eerror "${msg}" - die "${msg}" - fi - fi - fi - - if useq ldap ; then - enable_extension_with "ldap" "ldap" 1 - enable_extension_with "ldap-sasl" "sasl" 0 - fi - - if useq odbc ; then - enable_extension_with "unixODBC" "odbc" 1 - - enable_extension_with "adabas" "adabas" 1 - enable_extension_with "birdstep" "birdstep" 1 - enable_extension_with "dbmaker" "dbmaker" 1 - enable_extension_with "empress" "empress" 1 - if useq empress ; then - enable_extension_with "empress-bcs" "empress-bcs" 0 - fi - enable_extension_with "esoob" "esoob" 1 - enable_extension_with "ibm-db2" "db2" 1 - enable_extension_with "iodbc" "iodbc" 1 - enable_extension_with "sapdb" "sapdb" 1 - enable_extension_with "solid" "solid" 1 - fi - - if useq mysql; then - enable_extension_with "mysql" "mysql" 1 - enable_extension_with "mysql-sock" "mysql" 0 "/var/run/mysqld/mysqld.sock" - fi - if useq mysqli; then - enable_extension_with "mysqli" "mysqli" 1 - fi - - # QDBM doesn't play nicely with GDBM _or_ DBM - confutils_use_conflict "qdbm" "gdbm" "dbm" - # both provide the same functionality - confutils_use_conflict "readline" "libedit" - # Recode is not liked. - confutils_use_conflict "recode" "mysql" "imap" "nis" #"yaz" - - if ! useq session ; then - enable_extension_disable "session" "session" 1 - else - enable_extension_with "mm" "sharedmem" 0 - enable_extension_with "msession" "msession" 1 - fi - - if ! useq sqlite ; then - enable_extension_without "sqlite" "sqlite" 0 - else - enable_extension_enable "sqlite-utf8" "nls" 0 - fi - - # MCVE needs openSSL - confutils_use_depend_all "mcve" "ssl" - # A variety of extensions need DBA - confutils_use_depend_all "cdb" "dba" - confutils_use_depend_all "berkdb" "dba" - confutils_use_depend_all "flatfile" "dba" - confutils_use_depend_all "gdbm" "dba" - confutils_use_depend_all "inifile" "dba" - confutils_use_depend_all "qdbm" "dba" - - # build EXIF support if we support a file format that uses it - confutils_use_depend_any "exif" "jpeg" "tiff" - - # GD library support - confutils_use_depend_any "truetype" "gd" "gd-external" - - # ldap support - confutils_use_depend_all "sasl" "ldap" - - # mysql support - # This shouldn't conflict actually - #confutils_use_conflict "mysqli" "mysql" - - # odbc support - confutils_use_depend_all "adabas" "odbc" - confutils_use_depend_all "birdstep" "odbc" - confutils_use_depend_all "dbmaker" "odbc" - confutils_use_depend_all "empress" "odbc" - confutils_use_depend_all "empress-bcs" "odbc" "empress" - confutils_use_depend_all "esoob" "odbc" - confutils_use_depend_all "db2" "odbc" - confutils_use_depend_all "sapdb" "odbc" - confutils_use_depend_all "solid" "odbc" - - # session support - confutils_use_depend_all "msession" "session" - - confutils_warn_about_missing_deps +deprecation_warning() { + eerror "Please upgrade ${PF} to use php5_2-sapi eclass instead!" } -# are we the CLI ebuild or not? -# used to conditionally install a few things - -php5-sapi_is_providerbuild() { - if [ "${CATEGORY}/${PN}" == "${PHP_PROVIDER_PKG}" ]; then - return 0 - else - return 1 - fi +php5-sapi_check_awkward_uses() { + deprecation_warning + php5_2-sapi_check_use_flags } -# ======================================================================== -# EXPORTED FUNCTIONS -# ======================================================================== - php5-sapi_pkg_setup() { - # let's do all the USE flag testing before we do anything else - # this way saves a lot of time - - php5-sapi_check_awkward_uses + deprecation_warning + php5_2-sapi_pkg_setup } php5-sapi_src_unpack() { - unpack ${A} - # Fix for HTTP auth bug, #59755 - [ "x${PV}" == "x5.0.0" ] && epatch ${FILESDIR}/php-5.0.0-httpauthfix.patch - - cd ${S} - - # Patch PHP to show Gentoo as the server platform - sed -i "s/PHP_UNAME=\`uname -a\`/PHP_UNAME=\`uname -s -n -r -v\`/g" configure - # Patch for PostgreSQL support - sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i configure - - # Patch for session persistence bug - epatch ${FILESDIR}/php5_soap_persistence_session.diff - - # stop php from activating the apache config, as we will do that ourselves - for i in configure sapi/apache/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 ; do - sed -i.orig -e 's,-i -a -n php5,-i -n php5,g' $i - done - - # fix configure scripts to recognize uClibc - uclibctoolize - - # Just in case ;-) - chmod 755 configure + deprecation_warning + php5_2-sapi_src_unpack } php5-sapi_src_compile() { - confutils_init - - my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}" - php5-sapi_is_providerbuild || my_conf="${my_conf} --without-pear" - - # extension USE flag shared support? - enable_extension_enable "bcmath" "bcmath" 1 - enable_extension_with "bz2" "bzip2" 1 - enable_extension_enable "calendar" "calendar" 1 - enable_extension_with "cpdflib" "pdf" 1 # depends on jpeg - enable_extension_disable "ctype" "ctype" 0 - enable_extension_with "curl" "curl" 1 - enable_extension_with "curlwrappers" "curlwrappers" 1 - enable_extension_enable "dbase" "dbase" 1 - enable_extension_enable "dio" "dio" 1 - enable_extension_disable "dom" "xml2" 0 - enable_extension_enable "exif" "exif" 1 - enable_extension_with "fam" "fam" 1 - enable_extension_with "fbsql" "frontbase" 1 - enable_extension_with "fdftk" "fdftk" 1 "/opt/fdftk-6.0" - enable_extension_enable "filepro" "filepro" 1 - enable_extension_enable "ftp" "ftp" 1 - enable_extension_with "gettext" "nls" 1 - enable_extension_with "gmp" "gmp" 1 - enable_extension_with "hwapi" "hyperwave-api" 1 - enable_extension_with "iconv" "iconv" 1 - enable_extension_with "informix" "informix" 1 - enable_extension_with "ingres" "ingres" 1 - enable_extension_with "interbase" "firebird" 1 - # ircg extension not supported on Gentoo at this time - enable_extension_with "kerberos" "kerberos" 0 "/usr" - enable_extension_disable "libxml" "xml2" 0 - enable_extension_enable "mbstring" "nls" 1 - enable_extension_with "mcrypt" "crypt" 1 - enable_extension_with "mcve" "mcve" 1 - enable_extension_enable "memory-limit" "memlimit" 0 - enable_extension_with "mhash" "mhash" 1 - enable_extension_with "mime-magic" "mime" 0 "/usr/share/misc/file/magic.mime" - enable_extension_with "ming" "ming" 1 - enable_extension_with "mnogosearch" "mnogosearch" 1 - enable_extension_with "msql" "msql" 1 - enable_extension_with "mssql" "mssql" 1 - enable_extension_with "ncurses" "ncurses" 1 - enable_extension_with "oci8" "oci8" 1 - enable_extension_with "oracle" "oracle7" 1 - enable_extension_with "openssl" "ssl" 1 - enable_extension_with "openssl-dir" "ssl" 0 "/usr" - enable_extension_with "ovrimos" "ovrimos" 1 - enable_extension_enable "pcntl" "pcntl" 1 - enable_extension_without "pcre-regx" "pcre" 1 - enable_extension_with "pfpro" "pfpro" 1 - enable_extension_with "pgsql" "postgres" 1 - enable_extension_disable "posix" "posix" 1 - enable_extension_with "pspell" "spell" 1 - enable_extension_with "recode" "recode" 1 - enable_extension_disable "simplexml" "simplexml" 1 - enable_extension_enable "shmop" "sharedmem" 0 - enable_extension_with "snmp" "snmp" 1 - enable_extension_enable "soap" "soap" 1 - enable_extension_enable "sockets" "sockets" 1 - enable_extension_disable "spl" "spl" 1 - enable_extension_with "sybase" "sybase" 1 - enable_extension_with "sybase-ct" "sybase-ct" 1 - enable_extension_enable "sysvmsg" "sysvipc" 1 - enable_extension_enable "sysvsem" "sysvipc" 1 - enable_extension_enable "sysvshm" "sysvipc" 1 - enable_extension_with "tidy" "tidy" 1 - enable_extension_disable "tokenizer" "tokenizer" 1 - enable_extension_enable "wddx" "wddx" 1 - enable_extension_with "xsl" "xsl" 1 - #enable_extension_disable "xml" "xml2" 1 # PEAR needs --enable-xml - enable_extension_with "xmlrpc" "xmlrpc" 1 - enable_extension_enable "yp" "nis" 1 - enable_extension_with "zlib" "zlib" 1 - enable_extension_enable "debug" "debug" 0 - - php5-sapi_check_awkward_uses - - # DBA support - enable_extension_enable "dba" "dba" 1 - - # readline support - # - # you can use readline or libedit, but you can't use both - enable_extension_with "readline" "readline" 0 - enable_extension_with "libedit" "libedit" 1 - - # optimization/setting stuff - my_conf="${my_conf} --enable-versioning" - - # all done - - echo "${my_conf}" - - econf ${my_conf} || die "configure failed" - emake || die "make failed" + deprecation_warning + php5_2-sapi_src_compile } php5-sapi_src_install() { - addpredict /usr/share/snmp/mibs/.index - - useq sharedext && PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules" - make INSTALL_ROOT=${D} $PHP_INSTALLTARGETS || die "install failed" - - # annoyingly, we have to install the CLI by hand - if [ "$PHPSAPI" = "cli" ]; then - dobin sapi/cli/php - fi - - # get the extension dir - PHPEXTDIR="`${D}/usr/bin/php-config --extension-dir`" - - # don't forget the php.ini file - local phpinisrc=php.ini-dist - einfo "Setting extension_dir in php.ini" - sed -e "s|^extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc} - - # A patch for PHP for security. PHP-CLI interface is exempt, as it cannot be - # fed bad data from outside. - if [ "${PHPSAPI}" != "cli" ]; then - einfo "Securing fopen wrappers" - sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} - fi - - einfo "Setting correct include_path" - sed -e 's|^;include_path .*|include_path = ".:/usr/lib/php"|' -i ${phpinisrc} - - if useq sharedext; then - for x in `ls ${D}${PHPEXTDIR}/*.so | sort`; do - echo "extension=`basename ${x}`" >> ${phpinisrc} - done; - fi - - dodir ${PHP_INI_DIR} - insinto ${PHP_INI_DIR} - newins ${phpinisrc} ${PHP_INI_FILE} - - # Fix PEAR stuff - if php5-sapi_is_providerbuild ; then - einfo "Fixing PEAR cache location" - local oldloc="${T}/pear/cache" - local old="s:${#oldloc}:\"${oldloc}\"" - local newloc="${PEAR_CACHE}" - local new="s:${#newloc}:\"${newloc}\"" - sed "s|${old}|${new}|" -i ${D}/etc/pear.conf - keepdir ${PEAR_CACHE} - fperms 1777 ${PEAR_CACHE} - fi - - # we only install the following for the PHP_PROVIDER_PKG ebuild - if ! php5-sapi_is_providerbuild ; then - rm -rf ${D}/usr/bin/{php,phpextdist,phpize,php-config} - rm -rf ${D}/usr/lib/php/build - rm -rf ${D}/usr/include/php - rm -rf ${D}/usr/share/man/man1/php.1* - fi + deprecation_warning + php5_2-sapi_src_install } php5-sapi_pkg_postinst() { - # make sure the directory exists - # and is usable - mkdir -p ${PEAR_CACHE} - chmod 1777 ${PEAR_CACHE} - - ewarn "If you have additional third party PHP extensions (such as" - ewarn "dev-php/eaccelerator) you may need to recompile them now." - - if use curl; then - ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions." - fi + deprecation_warning + php5_2-sapi_pkg_postinst } - diff --git a/eclass/php5_2-sapi.eclass b/eclass/php5_2-sapi.eclass index 17c96df543a8..d97ae57b16b2 100644 --- a/eclass/php5_2-sapi.eclass +++ b/eclass/php5_2-sapi.eclass @@ -1,24 +1,24 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php5_2-sapi.eclass,v 1.11 2007/08/28 19:07:34 hoffie Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php5_2-sapi.eclass,v 1.12 2007/09/02 17:49:20 jokey Exp $ # ======================================================================== +# Based on robbat2's work on the php4 sapi eclass # -# php5_2-sapi.eclass -# Eclass for building different php5.2 SAPI instances -# -# USE THIS ECLASS FOR THE "CONCENTRATED" PACKAGES -# -# Based on robbat2's work on the php4 sapi eclass -# -# Author: Stuart Herbert -# <stuart@gentoo.org> -# -# Author: Luca Longinotti -# <chtekk@gentoo.org> +# Author: Stuart Herbert <stuart@gentoo.org> +# Author: Luca Longinotti <chtekk@gentoo.org> # # ======================================================================== +# @ECLASS: php5_2-sapi.eclass +# @MAINTAINER: +# Gentoo PHP team <php-bugs@gentoo.org> +# @BLURB: Eclass for building different php-5.2 SAPI instances. +# @DESCRIPTION: +# Eclass for building different php-5.2 SAPI instances. Use it for the +# new-style =dev-lang/php-5.2* ebuilds. + + PHPCONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase interbase msql oci8 sapdb solid sybase sybase-ct" WANT_AUTOCONF="latest" @@ -26,14 +26,16 @@ WANT_AUTOMAKE="latest" inherit db-use flag-o-matic autotools toolchain-funcs libtool eutils phpconfutils php-common-r1 -# set MY_PHP_P in the ebuild - -# we only set these variables if we're building a copy of php which can be -# installed as a package in its own right -# -# copies of php which are compiled into other packages (e.g. php support -# for the thttpd web server) don't need these variables +# @ECLASS-VARIABLE: MY_PHP_P +# @DESCRIPTION: +# Set MY_PHP_P in the ebuild as needed to match tarball version. +# @ECLASS-VARIABLE: PHP_PACKAGE +# @DESCRIPTION: +# We only set this variable if we are building a copy of php which can be +# installed as a package in its own. +# Copies of php which are compiled into other packages (e.g. php support +# for the thttpd web server) don't need this variable. if [[ "${PHP_PACKAGE}" == 1 ]] ; then HOMEPAGE="http://www.php.net/" LICENSE="PHP-3" @@ -150,12 +152,18 @@ PHP_INI_UPSTREAM="php.ini-dist" # ======================================================================== -# PHP patchsets support +# @ECLASS-VARIABLE: PHP_PATCHSET_REV +# @DESCRIPTION: +# Provides PHP patchsets support. SRC_URI="${SRC_URI} http://gentoo.longitekk.com/php-patchset-${MY_PHP_PV}-r${PHP_PATCHSET_REV}.tar.bz2" -# Suhosin patch support +# @ECLASS-VARIABLE: SUHOSIN_PATCH +# @DESCRIPTION: +# Tarball name for Suhosin patch (see http://www.suhosin.org/). +# This feature will not be available in php if unset. [[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? ( http://gentoo.longitekk.com/${SUHOSIN_PATCH} )" + # ======================================================================== EXPORT_FUNCTIONS pkg_setup src_compile src_install src_unpack pkg_postinst @@ -308,17 +316,26 @@ php5_2-sapi_install_ini() { # EXPORTED FUNCTIONS # ======================================================================== +# @FUNCTION: php5_2-sapi_pkg_setup +# @DESCRIPTION: +# Performs all the USE flag testing and magic before we do anything else. +# This way saves a lot of time. php5_2-sapi_pkg_setup() { - # let's do all the USE flag testing before we do anything else - # this way saves a lot of time php5_2-sapi_check_use_flags } +# @FUNCTION: php5_2-sapi_src_unpack +# @DESCRIPTION: +# Takes care of unpacking, patching and autotools magic and disables +# interactive tests. + +# @VARIABLE: PHP_EXTRA_BRANDING +# @DESCRIPTION: +# This variable allows an ebuild to add additional information like +# snapshot dates to the version line. php5_2-sapi_src_unpack() { cd "${S}" - # This variable allows an ebuild to add additional information like - # snapshot dates to the version line [[ -z "${PHP_EXTRA_BRANDING}" ]] && PHP_EXTRA_BRANDING="" # Change PHP branding @@ -393,6 +410,10 @@ php5_2-sapi_src_unpack() { chmod 0755 configure || die "Failed to chmod configure to 0755" } +# @FUNCTION: php5_2-sapi_src_compile +# @DESCRIPTION: +# Takes care of compiling php according to USE flags set by user (and those automagically +# enabled via phpconfutils eclass if unavoidable). php5_2-sapi_src_compile() { destdir=/usr/$(get_libdir)/php5 @@ -622,6 +643,9 @@ php5_2-sapi_src_compile() { emake || die "make failed" } +# @FUNCTION: php5_2-sapi_src_install +# @DESCRIPTION: +# Takes care of installing php (and its shared extensions if enabled). php5_2-sapi_src_install() { destdir=/usr/$(get_libdir)/php5 @@ -675,6 +699,9 @@ php5_2-sapi_src_install() { keepdir /usr/share/php5 } +# @FUNCTION: php5_2-sapi_pkg_postinst +# @DESCRIPTION: +# Provides important information to users after install is finished. php5_2-sapi_pkg_postinst() { ewarn ewarn "If you have additional third party PHP extensions (such as" |