New-style PHP update, see dev-lang/php ChangeLog for detailed list of changes.
authorLuca Longinotti <chtekk@gentoo.org>
Mon, 31 Oct 2005 14:08:42 +0000 (14:08 +0000)
committerLuca Longinotti <chtekk@gentoo.org>
Mon, 31 Oct 2005 14:08:42 +0000 (14:08 +0000)
eclass/depend.php.eclass
eclass/php-common-r1.eclass
eclass/php-ext-base-r1.eclass
eclass/php-ext-pecl-r1.eclass
eclass/php-ext-source-r1.eclass
eclass/php-lib-r1.eclass
eclass/php-pear-lib-r1.eclass [new file with mode: 0644]
eclass/php-pear-r1.eclass
eclass/php4_4-sapi.eclass
eclass/php5_0-sapi.eclass
eclass/php5_1-sapi.eclass

index baa1a564604de4256596f6415b7f311ac60eaeaf..67f74a72a439a9d179923881fa1d36156d80a1a8 100644 (file)
@@ -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/depend.php.eclass,v 1.5 2005/09/25 12:30:26 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.6 2005/10/31 14:08:42 chtekk Exp $
 #
 # ========================================================================
 #
@@ -133,7 +133,7 @@ need_php_by_category()
 # Portage
 #
 # $1 ... a list of SAPI USE flags (eg cli, cgi, apache2)
-#
+# 
 # returns if any one of the listed SAPIs has been installed
 # dies if none of the listed SAPIs has been installed
 
@@ -173,7 +173,7 @@ require_php_sapi_from()
 # Portage
 #
 # $1 ... a list of USE flags
-#
+# 
 # returns if all of the listed USE flags are set
 # dies if any of the listed USE flags are not set
 
@@ -220,10 +220,10 @@ has_php()
 
        if [[ -z ${PHP_VERSION} ]]; then
                # detect which PHP version installed
-               if has_version '=dev-lang/php-5*' ; then
-                       PHP_VERSION=5
-               elif has_version '=dev-lang/php-4*' ; then
+               if has_version '=dev-lang/php-4*' ; then
                        PHP_VERSION=4
+               elif has_version '=dev-lang/php-5*' ; then
+                       PHP_VERSION=5
                else
                        die "Unable to find an installed dev-lang/php package"
                fi
@@ -337,16 +337,16 @@ require_php_cli()
        fi
 
        # detect which PHP version installed
-       if has_version '=dev-lang/php-5*' ; then
-               pkg="`best_version '=dev-lang/php-5*'`"
-               if built_with_use =${pkg} cli ; then
-                       PHP_VERSION=5
-               fi
-       elif has_version '=dev-lang/php-4*' ; then
+       if has_version '=dev-lang/php-4*' ; then
                pkg="`best_version '=dev-lang/php-4*'`"
                if built_with_use =${pkg} cli ; then
                        PHP_VERSION=4
                fi
+       elif has_version '=dev-lang/php-5*' ; then
+               pkg="`best_version '=dev-lang/php-5*'`"
+               if built_with_use =${pkg} cli ; then
+                       PHP_VERSION=5
+               fi
        else
                die "Unable to find an installed dev-lang/php package"
        fi
@@ -375,16 +375,16 @@ require_php_cgi()
        fi
 
        # detect which PHP version installed
-       if has_version '=dev-lang/php-5*' ; then
-               pkg="`best_version '=dev-lang/php-5*'`"
-               if built_with_use =${pkg} cgi ; then
-                       PHP_VERSION=5
-               fi
-       elif has_version '=dev-lang/php-4*' ; then
+       if has_version '=dev-lang/php-4*' ; then
                pkg="`best_version '=dev-lang/php-4*'`"
                if built_with_use =${pkg} cgi ; then
                        PHP_VERSION=4
                fi
+       elif has_version '=dev-lang/php-5*' ; then
+               pkg="`best_version '=dev-lang/php-5*'`"
+               if built_with_use =${pkg} cgi ; then
+                       PHP_VERSION=5
+               fi
        else
                die "Unable to find an installed dev-lang/php package"
        fi
@@ -430,6 +430,8 @@ require_sqlite()
        die "No sqlite extension for PHP found"
 }
 
+# require a PHP built with GD support
+
 require_gd()
 {
        has_php
@@ -457,3 +459,68 @@ require_gd()
        eerror
        die "No GD support found for PHP"
 }
+
+# ========================================================================
+# Misc functions
+#
+# These functions provide miscellaneous checks and functionality.
+# ========================================================================
+
+# executes some checks needed when installing a binary PHP extension
+
+php_binary_extension() {
+       has_php
+
+       # binary extensions do not support the change of PHP
+       # API version, so they can't be installed when USE flags
+       # are enabled wich change the PHP API version
+
+       if built_with_use =${PHP_PKG} hardenedphp ; then
+               eerror
+               eerror "You cannot install binary PHP extensions"
+               eerror "when the 'hardenedphp' USE flag is enabled!"
+               eerror "Please reemerge dev-lang/php with the"
+               eerror "'hardenedphp' USE flag turned off."
+               eerror
+               die "'hardenedphp' USE flag turned on"
+       fi
+
+       if built_with_use =${PHP_PKG} debug ; then
+               eerror
+               eerror "You cannot install binary PHP extensions"
+               eerror "when the 'debug' USE flag is enabled!"
+               eerror "Please reemerge dev-lang/php with the"
+               eerror "'debug' USE flag turned off."
+               eerror
+               die "'debug' USE flag turned on"
+       fi
+}
+
+# alternative to dodoc for use in our php eclasses and ebuilds
+# stored here because depend.php gets always sourced everywhere
+# in the PHP ebuilds and eclasses
+# it simply is dodoc with a changed path to the docs
+# no support for docinto is given!
+
+dodoc-php()
+{
+if [ $# -lt 1 ] ; then
+       echo "$0: at least one argument needed" 1>&2
+       exit 1
+fi
+
+phpdocdir="${D}/usr/share/doc/${CATEGORY}/${PF}/"
+
+if [ ! -d "${phpdocdir}" ] ; then
+       install -d "${phpdocdir}"
+fi
+
+for x in "$@" ; do
+       if [ -s "${x}" ] ; then
+               install -m0644 "${x}" "${phpdocdir}"
+               gzip -f -9 "${phpdocdir}/${x##*/}"
+       elif [ ! -e "${x}" ] ; then
+               echo "dodoc-php: ${x} does not exist" 1>&2
+       fi
+done
+}
index 44feb4f5ef5db3238dc38f82d8ee6c67e4d48a52..f10302cc655ec2503d985305d8be532f3e94a9e8 100644 (file)
@@ -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/php-common-r1.eclass,v 1.2 2005/09/18 12:57:22 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-common-r1.eclass,v 1.3 2005/10/31 14:08:42 chtekk Exp $
 
 # ########################################################################
 #
@@ -94,7 +94,7 @@ php_check_java() {
 
        JDKVER=$(java-config --java-version 2>&1 | awk '/^java version/ { print $3 }' | xargs )
        einfo "Active JDK version: ${JDKVER}"
-       case ${JDKVER} in
+       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 ;;
@@ -115,18 +115,23 @@ php_install_java() {
        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}
-
        einfo "Installing Java extension for PHP"
        doins modules/java.so
 
        dosym ${PHPEXTDIR}/java.so ${PHPEXTDIR}/libphp_java.so
 }
 
+php_install_java_inifile() {
+       JAVA_LIBRARY="`grep -- '-DJAVALIB' Makefile | sed -e 's,.\+-DJAVALIB=\"\([^"]*\)\".*$,\1,g;'| sort | uniq `"
+
+       echo "extension = java.so" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
+       echo "java.library = ${JAVA_LIBRARY}" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
+       echo "java.class.path = ${PHPEXTDIR}/php_java.jar" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
+       echo "java.library.path = ${PHPEXTDIR}" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
+
+       dosym "${PHP_EXT_INI_DIR}/java.ini" "${PHP_EXT_INI_DIR_ACTIVE}/java.ini"
+}
+
 # ########################################################################
 # MTA SUPPORT
 # ########################################################################
index 392b3746f9b99406a5b7e2268390abe380e9e522..09151740121fbfdf18003ba64042803c35735e9d 100644 (file)
@@ -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/php-ext-base-r1.eclass,v 1.2 2005/09/25 15:21:22 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-base-r1.eclass,v 1.3 2005/10/31 14:08:42 chtekk Exp $
 #
 # Author: Tal Peer <coredumb@gentoo.org>
 # Author: Stuart Herbert <stuart@gentoo.org>
@@ -63,6 +63,12 @@ php-ext-base-r1_src_install() {
        if [ "${PHP_EXT_INI}" = "yes" ] ; then
                php-ext-base-r1_addextension "${PHP_EXT_NAME}.so"
        fi
+       for inifile in ${PHPINIFILELIST} ; do
+               inidir=${inifile/${PHP_EXT_NAME}.ini/}
+               inidir=${inidir/ext/ext-active}
+               dodir "/${inidir}"
+               dosym "/${inifile}" "/${inifile/ext/ext-active}"
+       done
        # add support for installing php files into a version dependant directory
        PHP_EXT_SHARED_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_EXT_NAME}"
 }
index 371f47f938caadb8ce70ea994bb7d9275cadd1b6..a7ee36783c3a02b973366b2ba3b6b17e18f9f528 100644 (file)
@@ -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/php-ext-pecl-r1.eclass,v 1.1 2005/09/04 10:54:53 stuart Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-pecl-r1.eclass,v 1.2 2005/10/31 14:08:42 chtekk Exp $
 #
 # Author: Tal Peer <coredumb@gentoo.org>
 #
@@ -30,7 +30,8 @@ fi
 
 SRC_URI="http://pecl.php.net/get/${FILENAME}"
 HOMEPAGE="http://pecl.php.net/${PECL_PKG}"
-S=${WORKDIR}/${PECL_PKG_V}
+
+S="${WORKDIR}/${PECL_PKG_V}"
 
 php-ext-pecl-r1_src_compile() {
        has_php
@@ -42,5 +43,5 @@ php-ext-pecl-r1_src_install() {
        php-ext-source-r1_src_install
 
        # Those two are always present
-       dodoc ${WORKDIR}/package.xml CREDITS
+       dodoc-php "${WORKDIR}/package.xml" CREDITS
 }
index ad442aae7623e750d470856f630c085a87c0a84f..ceb78902b88d643b4299190a91435a2681c05c10 100644 (file)
@@ -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/php-ext-source-r1.eclass,v 1.2 2005/09/25 15:21:22 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.3 2005/10/31 14:08:42 chtekk Exp $
 #
 # Author: Tal Peer <coredumb@gentoo.org>
 # Author: Stuart Herbert <stuart@gentoo.org>
@@ -37,7 +37,7 @@ php-ext-source-r1_src_compile() {
        has_php
        my_conf="${my_conf} --prefix=${PHPPREFIX} --with-php-config=${PHPCONFIG}"
        addpredict /usr/share/snmp/mibs/.index
-       #phpize creates configure out of config.m4
+       # phpize creates configure out of config.m4
        export WANT_AUTOMAKE=1.9 WANT_AUTOCONF=2.5
        ${PHPIZE}
        ./configure ${my_conf} || die "Unable to configure code to compile"
index faef92ecff287ebba624b3f65ae455a50ea2d6da..f5b626ed5f132dfae5e9ce658e507ad26cc6d89c 100644 (file)
@@ -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/php-lib-r1.eclass,v 1.2 2005/09/11 16:39:10 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-lib-r1.eclass,v 1.3 2005/10/31 14:08:42 chtekk Exp $
 #
 # Author: Stuart Herbert <stuart@gentoo.org>
 #
@@ -49,6 +49,6 @@ php-lib-r1_src_install() {
        for x in $@ ; do
                SUBDIR="`dirname ${x}`"
                insinto ${PHP_LIB_DIR}/${SUBDIR}
-               doins ${S_DIR}/${x}
+               doins "${S_DIR}/${x}"
        done
 }
diff --git a/eclass/php-pear-lib-r1.eclass b/eclass/php-pear-lib-r1.eclass
new file mode 100644 (file)
index 0000000..0f0c276
--- /dev/null
@@ -0,0 +1,54 @@
+# Copyright 1999-2005 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.1 2005/10/31 14:08:42 chtekk Exp $
+#
+# Author: Luca Longinotti <chtekk@gentoo.org>
+#
+# Based on Tal Peer's <coredumb@gentoo.org> work on php-pear.eclass.
+#
+# The php-pear-lib eclass provides means for easy installation of PEAR
+# based libraries, such as Creole, Jargon, Phing etc., while retaining
+# the functionality to put the libraries into version-dependant dirs.
+
+inherit depend.php
+
+EXPORT_FUNCTIONS src_install
+
+# Set this is the the package name on PEAR is different than the one in
+# portage (generally shouldn't be the case).
+
+# We must depend on the base package as we need it to let
+# PEAR work, as well as PEAR itself.
+DEPEND="${DEPEND} dev-lang/php >=dev-php/PEAR-PEAR-1.3.6"
+RDEPEND="${RDEPEND} ${DEPEND}"
+
+php-pear-lib-r1_src_install() {
+       has_php
+
+       # SNMP support
+       addpredict /usr/share/snmp/mibs/.index
+       addpredict /var/lib/net-snmp/
+
+       cd "${S}"
+       mv "${WORKDIR}/package.xml" "${S}"
+       pear install --nodeps --installroot="${D}" "${S}/package.xml" || die "Unable to install PEAR package"
+
+       rm -rf "${D}/usr/share/php/.filemap" \
+       "${D}/usr/share/php/.lock" \
+       "${D}/usr/share/php/.registry"
+
+       # install to the correct phpX folder, if not specified
+       # /usr/share/php will be kept, also sedding to sobstitute
+       # the path, many files can specify it wrongly
+       if [ -n "${PHP_SHARED_CAT}" ] && [ "${PHP_SHARED_CAT}" != "php" ] ; then
+               mv -f "${D}/usr/share/php" "${D}/usr/share/${PHP_SHARED_CAT}" || die "Unable to move files"
+               find "${D}/" -type f -exec sed -e "s|/usr/share/php|/usr/share/${PHP_SHARED_CAT}|g" -i {} \; || die "Unable to change PHP path"
+               einfo
+               einfo "Installing to /usr/share/${PHP_SHARED_CAT} ..."
+               einfo
+       else
+               einfo
+               einfo "Installing to /usr/share/php ..."
+               einfo
+       fi
+}
index 33f4037236230a7b8ccfed469674c22c230cc73d..06d8f3b6529b6642c362f6b427d1f238463dca7e 100644 (file)
@@ -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/php-pear-r1.eclass,v 1.5 2005/09/13 16:07:50 sebastian Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-r1.eclass,v 1.6 2005/10/31 14:08:42 chtekk Exp $
 #
 # Author: Tal Peer <coredumb@gentoo.org>
 #
@@ -38,13 +38,13 @@ PEAR_PN=${PHP_PEAR_PKG_NAME}-${PEAR_PV}
 S="${WORKDIR}/${PEAR_PN}"
 
 php-pear-r1_src_install() {
-       # SNMP is nuts sometimes
+       # SNMP support
        addpredict /usr/share/snmp/mibs/.index
        addpredict /var/lib/net-snmp/
 
-       cd ${S}
-       mv ${WORKDIR}/package.xml ${S}
-       pear install --nodeps --installroot=${D} ${S}/package.xml || die "Unable to install PEAR package"
-       rm ${D}/usr/share/php/.filemap
-       rm ${D}/usr/share/php/.lock
+       cd "${S}"
+       mv "${WORKDIR}/package.xml" "${S}"
+       pear install --nodeps --installroot="${D}" "${S}/package.xml" || die "Unable to install PEAR package"
+       rm -rf "${D}/usr/share/php/.filemap" \
+       "${D}/usr/share/php/.lock"
 }
index cec62b780c34125403f4e0f199cfc926c53616a1..ea568fecbbb76e7edd097796c6c39948832fd87e 100644 (file)
@@ -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/php4_4-sapi.eclass,v 1.4 2005/09/25 15:21:22 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php4_4-sapi.eclass,v 1.5 2005/10/31 14:08:42 chtekk Exp $
 #
 # ########################################################################
 #
 # Author(s)            Stuart Herbert
 #                              <stuart@gentoo.org>
 #
-#                              CHTEKK
-#                              <chtekk@longitekk.org>
+#                              Luca Longinotti
+#                              <chtekk@gentoo.org>
 #
 # ========================================================================
 
-CONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix interbase msql oci8 oracle7 ovrimos pfpro sapdb solid sybase sybase-ct"
+CONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix interbase mnogosearch msql oci8 oracle7 ovrimos pfpro sapdb solid sybase sybase-ct"
 EBUILD_SUPPORTS_SHAREDEXT=1
 
 inherit flag-o-matic eutils confutils libtool php-common-r1
@@ -39,7 +39,7 @@ if [ "${PHP_PACKAGE}" = 1 ]; then
        S="${WORKDIR}/${MY_PHP_P}"
 fi
 
-IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb crypt ctype curl curlwrappers db2 dba dbase dbmaker dbx debug doc empress empress-bcs esoob exif fastbuild frontbase fdftk filepro firebird flatfile ftp gd gd-external gdbm gmp hardenedphp hyperwave-api iconv imap informix inifile interbase iodbc ipv6 java-internal java-external jpeg kerberos ldap libedit mcal mcve memlimit mhash ming msql mssql mysql ncurses nls oci8 odbc oracle7 overload ovrimos pcntl pcre pear pfpro png posix postgres readline recode sapdb sasl session sharedext sharedmem snmp sockets solid spell sqlite ssl sybase sybase-ct sysvipc threads tiff tokenizer truetype wddx xml xml2 xmlrpc xpm xsl yaz zip zlib"
+IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl curlwrappers db2 dba dbase dbmaker dbx debug doc empress empress-bcs esoob exif fastbuild frontbase fdftk filepro firebird flatfile ftp gd gd-external gdbm gmp hardenedphp hyperwave-api iconv imap informix inifile interbase iodbc ipv6 java-internal java-external kerberos ldap libedit mcal mcve memlimit mhash ming mnogosearch msql mssql mysql ncurses nls oci8 oci8-instant-client odbc oracle7 overload ovrimos pcntl pcre pear pfpro pic posix postgres readline recode sapdb sasl session sharedext sharedmem snmp sockets solid spell sqlite ssl sybase sybase-ct sysvipc threads tiff tokenizer truetype wddx xml xml2 xmlrpc xpm xsl yaz zip zlib"
 
 # these USE flags should have the correct dependencies
 DEPEND="${DEPEND}
@@ -58,14 +58,14 @@ DEPEND="${DEPEND}
        crypt? ( >=dev-libs/libmcrypt-2.4 )
        curl? ( >=net-misc/curl-7.10.5 )
        fdftk? ( app-text/fdftk )
-       firebird? ( dev-db/firebird  )
+       firebird? ( dev-db/firebird )
+       gd? ( >=media-libs/jpeg-6b media-libs/libpng )
        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 )
        java-internal? ( =virtual/jdk-1.4* dev-java/java-config !dev-php4/php-java-bridge )
-       jpeg? ( >=media-libs/jpeg-6b )
        kerberos? ( virtual/krb5 )
        ldap? ( >=net-nds/openldap-1.2.11 )
        libedit? ( dev-libs/libedit )
@@ -77,15 +77,15 @@ DEPEND="${DEPEND}
        mysql? ( dev-db/mysql )
        ncurses? ( sys-libs/ncurses )
        nls? ( sys-devel/gettext )
+       oci8-instant-client? ( dev-db/oracle-instantclient-basic )
        odbc? ( >=dev-db/unixODBC-1.8.13 )
-       png? ( media-libs/libpng )
        postgres? ( >=dev-db/postgresql-7.1 )
        readline? ( sys-libs/readline )
        recode? ( app-text/recode )
        sasl? ( dev-libs/cyrus-sasl )
        sharedmem? ( dev-libs/mm )
        snmp? ( >=net-analyzer/net-snmp-5.2 )
-       spell? ( >=app-text/aspell-0.60 )
+       spell? ( >=app-text/aspell-0.50 )
        ssl? ( >=dev-libs/openssl-0.9.7 )
        sybase? ( dev-db/freetds )
        tiff? ( media-libs/tiff )
@@ -171,22 +171,21 @@ php4_4-sapi_check_awkward_uses() {
        confutils_use_depend_all "inifile"      "dba"
 
        # DBX checks
-       confutils_use_depend_any "dbx" "frontbase" "mssql" "odbc" "postgres" "sybase-ct" "oci8"
+       confutils_use_depend_any "dbx" "frontbase" "mssql" "odbc" "postgres" "sybase-ct" "oci8" "oci8-instant-client"
 
        # DOM XML support
        confutils_use_depend_all "xml2"         "zlib"
 
        # EXIF only gets built if we support a file format that uses it
-       confutils_use_depend_any "exif" "jpeg" "tiff"
+       confutils_use_depend_any "exif" "gd" "tiff"
 
        # support for the GD graphics library
        confutils_use_conflict "gd" "gd-external"
        confutils_use_depend_any "truetype" "gd" "gd-external"
-       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"
+       confutils_use_depend_any "cjk"  "gd" "gd-external"
+       confutils_use_depend_all "tiff" "gd"
+       confutils_use_depend_all "xpm"  "gd"
+       confutils_use_depend_all "gd"   "zlib"
 
        # IMAP support
        php_check_imap
@@ -202,6 +201,7 @@ php4_4-sapi_check_awkward_uses() {
        php_check_mta
 
        # Oracle support
+       confutils_use_conflict "oci8" "oci8-instant-client"
        php_check_oracle
 
        # LDAP-sasl support
@@ -253,13 +253,13 @@ php4_4-sapi_src_unpack() {
                unpack ${A}
        fi
 
-       cd ${S}
+       cd "${S}"
 
        # Patch PHP to show Gentoo as the server platform
        sed -e "s/PHP_UNAME=\`uname -a | xargs\`/PHP_UNAME=\`uname -s -n -r -v | xargs\`/g" -i configure.in
 
        # Patch for PostgreSQL support
-       sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i ext/pgsql/config.m4
+       use postgres && sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i ext/pgsql/config.m4
 
        # 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
@@ -268,30 +268,32 @@ php4_4-sapi_src_unpack() {
        done
 
        # imap support
-       use imap && epatch ${FILESDIR}/4.4.0/php4-imap-symlink.diff
+       use imap && epatch "${FILESDIR}/4-any/php4-imap-symlink.diff"
 
        # iodbc support
-       use iodbc && epatch ${FILESDIR}/4.4.0/php4-iodbc-config.diff
-       use iodbc && epatch ${FILESDIR}/4.4.0/php4-with-iodbc.diff
+       use iodbc && epatch "${FILESDIR}/4-any/php4-iodbc-config.diff"
+       use iodbc && epatch "${FILESDIR}/4-any/php4-with-iodbc.diff"
 
        # hardenedphp support
        if use hardenedphp ; then
                if [ -n "${HARDENEDPHP_PATCH}" ] ; then
-                       epatch ${DISTDIR}/${HARDENEDPHP_PATCH}
+                       epatch "${DISTDIR}/${HARDENEDPHP_PATCH}"
                else
                        ewarn "There is no Hardened-PHP available for this PHP release yet!"
                fi
        fi
 
        # fastbuild support
-       use fastbuild && epatch ${FILESDIR}/4.4.0/fastbuild.patch
+       use fastbuild && epatch "${FILESDIR}/4-any/php4-fastbuild.patch"
 
-       # fix configure scripts to recognize uClibc, now done with elibtoolize,
+       # fix uClibc support, as it does not have the dn_skipname() function
+       epatch "${FILESDIR}/4-any/php4-uClibc-have_dn_skipname.patch"
+
+       # fix configure scripts to correctly support HardenedPHP
        # and patch PHP to support libtool 1.5
-       epatch ${FILESDIR}/4.4.0/php4-libtool-1.5.patch
+       epatch "${FILESDIR}/4-any/php4-libtool-1.5.patch"
        einfo "Running aclocal"
        WANT_AUTOMAKE=1.9 aclocal --force || die "Unable to run aclocal successfully"
-       elibtoolize
        einfo "Running libtoolize"
        libtoolize --copy --force || die "Unable to run libtoolize successfully"
 
@@ -299,6 +301,9 @@ php4_4-sapi_src_unpack() {
        einfo "Rebuilding configure script"
        WANT_AUTOCONF=2.5 autoreconf --force -W no-cross || die "Unable to regenerate configure script"
 
+       # run elibtoolize
+       elibtoolize
+
        # Just in case ;-)
        chmod 755 configure
 }
@@ -306,16 +311,17 @@ php4_4-sapi_src_unpack() {
 set_php_ini_dir() {
        PHP_INI_DIR="/etc/php/${PHPSAPI}-php4"
        PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+       PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
 }
 
 php4_4-sapi_src_compile() {
        destdir=/usr/$(get_libdir)/php4
        set_php_ini_dir
 
-       cd ${S}
+       cd "${S}"
        confutils_init
 
-       my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR} --without-pear"
+       my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE} --without-pear"
 
        #                               extension               USE flag                shared support?
        enable_extension_enable         "bcmath"                "bcmath"                1
@@ -338,7 +344,6 @@ php4_4-sapi_src_compile() {
        enable_extension_with           "informix"              "informix"              1
        enable_extension_disable        "ipv6"                  "ipv6"                  0
        # ircg extension not supported on Gentoo at this time
-       enable_extension_with           "jpeg-dir"              "jpeg"                  0 "/usr"
        enable_extension_with           "kerberos"              "kerberos"              0 "/usr"
        enable_extension_enable         "mbstring"              "nls"                   1
        enable_extension_with           "mcal"                  "mcal"                  1 "/usr"
@@ -347,10 +352,12 @@ php4_4-sapi_src_compile() {
        enable_extension_enable         "memory-limit"  "memlimit"              0
        enable_extension_with           "mhash"                 "mhash"                 1
        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           "oci8-instant-client"   "oci8-instant-client"   1
        enable_extension_with           "oracle"                "oracle7"               1
        enable_extension_with           "openssl"               "ssl"                   1
        enable_extension_with           "openssl-dir"   "ssl"                   0 "/usr"
@@ -398,15 +405,16 @@ php4_4-sapi_src_compile() {
        if useq gd-external ; then
                enable_extension_with   "freetype-dir"  "truetype"              0 "/usr"
                enable_extension_with   "t1lib"                 "truetype"              0 "/usr"
-               enable_extension_enable "gd-jis-conv"   "nls"                   0
+               enable_extension_enable "gd-jis-conv"   "cjk"                   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-conv"   "nls"                   0
+               enable_extension_enable "gd-jis-conv"   "cjk"                   0
                enable_extension_enable "gd-native-ttf" "truetype"              0
-               enable_extension_with   "png-dir"               "png"                   0 "/usr"
+               enable_extension_with   "jpeg-dir"              "gd"                    0 "/usr"
+               enable_extension_with   "png-dir"               "gd"                    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
@@ -485,7 +493,7 @@ php4_4-sapi_src_compile() {
        fi
 
        # fix ELF-related problems
-       if has_pic ; then
+       if useq pic ; then
                einfo "Enabling PIC support"
                my_conf="${my_conf} --with-pic"
        fi
@@ -514,15 +522,15 @@ php4_4-sapi_src_compile() {
 php4_4-sapi_src_install() {
        destdir=/usr/$(get_libdir)/php4
 
-       cd ${S}
+       cd "${S}"
        addpredict /usr/share/snmp/mibs/.index
 
        PHP_INSTALLTARGETS="install-build install-headers install-programs"
        useq sharedext && PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules"
-       make INSTALL_ROOT=${D} ${PHP_INSTALLTARGETS} || die "install failed"
+       make INSTALL_ROOT="${D}" ${PHP_INSTALLTARGETS} || die "install failed"
 
        # get the extension dir
-       PHPEXTDIR="`${D}/${destdir}/bin/php-config --extension-dir`"
+       PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`"
 
        # don't forget the php.ini file
        local phpinisrc=php.ini-dist
@@ -536,25 +544,24 @@ php4_4-sapi_src_install() {
 
        # Set the include path to point to where we want to find PEAR packages
        einfo "Setting correct include_path"
-       sed -e 's|^;include_path .*|include_path = ".:/usr/share/php:/usr/share/php4"|' -i ${phpinisrc}
+       sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php4:/usr/share/php"|' -i ${phpinisrc}
 
-       # Java install needs to insert the correct lines into phpinisrc
+       # Java module and support needs to be installed
        php_install_java
 
-       # Install any extensions built as shared objects
-       if useq sharedext; then
-               for x in `ls ${D}/${PHPEXTDIR}/*.so | sort | sed -e "s|.*java.*||g"`; do
-                       echo "extension=`basename ${x}`" >> ${phpinisrc}
-               done;
-       fi
-
        # create the directory where we'll put php4-only php scripts
        keepdir /usr/share/php4
 }
 
 php4_4-sapi_install_ini() {
+       destdir=/usr/$(get_libdir)/php4
+
+       # get the extension dir
+       PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`"
+
        # work out where we are installing the ini file
        set_php_ini_dir
+
        local phpinisrc=php.ini-dist
 
        dodir ${PHP_INI_DIR}
@@ -562,6 +569,20 @@ php4_4-sapi_install_ini() {
        newins ${phpinisrc} ${PHP_INI_FILE}
 
        dodir ${PHP_EXT_INI_DIR}
+       dodir ${PHP_EXT_INI_DIR_ACTIVE}
+
+       # Java needs to insert the correct ini files
+       php_install_java_inifile
+
+       # Install any extensions built as shared objects
+       if useq sharedext ; then
+               for x in `ls "${D}/${PHPEXTDIR}/"*.so | sort | sed -e "s|.*java.*||g"` ; do
+                       inifilename=${x/.so/.ini}
+                       inifilename=`basename ${inifilename}`
+                       echo "extension=`basename ${x}`" >> "${D}/${PHP_EXT_INI_DIR}/${inifilename}"
+                       dosym "${PHP_EXT_INI_DIR}/${inifilename}" "${PHP_EXT_INI_DIR_ACTIVE}/${inifilename}"
+               done
+       fi
 }
 
 php4_4-sapi_pkg_postinst() {
@@ -614,6 +635,10 @@ php4_4-sapi_pkg_postinst() {
 
        ewarn "If you have additional third party PHP extensions (such as"
        ewarn "dev-php4/phpdbg) you may need to recompile them now."
+       ewarn "A new way of enabling/disabling PHP extensions was introduced"
+       ewarn "with the newer PHP packages releases, so please reemerge any"
+       ewarn "PHP extensions you have installed to automatically adapt to"
+       ewarn "the new configuration layout."
        ewarn
 
        if useq curl; then
@@ -621,4 +646,12 @@ php4_4-sapi_pkg_postinst() {
                ewarn "This can be a security risk!"
                ewarn
        fi
+
+       ewarn "The 'pic' USE flag was added to newer releases of dev-lang/php."
+       ewarn "With PIC enabled, your PHP installation may become slower, but"
+       ewarn "PIC is required on Hardened-Gentoo platforms (where the USE flag"
+       ewarn "is enabled automatically). You may also need this on other"
+       ewarn "configurations where you disabled TEXTRELs, for example using"
+       ewarn "PaX in the kernel."
+       ewarn
 }
index 75182c59d180de4a1ac459775d432c0244aa1b2d..dd295996b0e2ac99f2bf4c683a51230bcbafdac4 100644 (file)
@@ -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_0-sapi.eclass,v 1.4 2005/09/25 15:21:22 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php5_0-sapi.eclass,v 1.5 2005/10/31 14:08:42 chtekk Exp $
 #
 # ########################################################################
 #
 # Author(s)            Stuart Herbert
 #                              <stuart@gentoo.org>
 #
-#                              CHTEKK
-#                              <chtekk@longitekk.org>
+#                              Luca Longinotti
+#                              <chtekk@gentoo.org>
 #
 # ========================================================================
 
-CONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix interbase msql oci8 oracle7 ovrimos pfpro sapdb solid sybase sybase-ct"
+CONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix interbase mnogosearch msql oci8 oracle7 ovrimos pfpro sapdb solid sybase sybase-ct"
 EBUILD_SUPPORTS_SHAREDEXT=1
 
 inherit flag-o-matic eutils confutils libtool php-common-r1
@@ -39,7 +39,7 @@ if [ "${PHP_PACKAGE}" = 1 ]; then
        S="${WORKDIR}/${MY_PHP_P}"
 fi
 
-IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb crypt ctype curl curlwrappers db2 dba dbase dbmaker debug doc empress empress-bcs esoob exif frontbase fdftk filepro firebird flatfile ftp gd gd-external gdbm gmp hardenedphp hyperwave-api iconv imap informix inifile interbase iodbc ipv6 java-external jpeg kerberos ldap libedit mcve memlimit mhash ming msql mssql mysql mysqli ncurses nls oci8 odbc oracle7 ovrimos pcntl pcre pdo-external pear pfpro png posix postgres 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 xml2 xmlrpc xpm xsl yaz zip zlib"
+IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl curlwrappers db2 dba dbase dbmaker debug doc empress empress-bcs esoob exif frontbase fdftk filepro firebird flatfile ftp gd gd-external gdbm gmp hardenedphp hyperwave-api iconv imap informix inifile interbase iodbc ipv6 java-external kerberos ldap libedit mcve memlimit mhash ming mnogosearch msql mssql mysql mysqli ncurses nls oci8 oci8-instant-client odbc oracle7 ovrimos pcntl pcre pdo-external pear pfpro pic posix postgres 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 xml2 xmlrpc xpm xsl yaz zip zlib"
 
 # these USE flags should have the correct dependencies
 DEPEND="${DEPEND}
@@ -58,13 +58,13 @@ DEPEND="${DEPEND}
        crypt? ( >=dev-libs/libmcrypt-2.4 )
        curl? ( >=net-misc/curl-7.10.5 )
        fdftk? ( app-text/fdftk )
-       firebird? ( dev-db/firebird  )
+       firebird? ( dev-db/firebird )
+       gd? ( >=media-libs/jpeg-6b media-libs/libpng )
        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 )
@@ -76,9 +76,9 @@ DEPEND="${DEPEND}
        mysqli? ( >=dev-db/mysql-4.1 )
        ncurses? ( sys-libs/ncurses )
        nls? ( sys-devel/gettext )
+       oci8-instant-client? ( dev-db/oracle-instantclient-basic )
        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 )
@@ -87,7 +87,7 @@ DEPEND="${DEPEND}
        simplexml? ( >=dev-libs/libxml2-2.6.8 )
        snmp? ( >=net-analyzer/net-snmp-5.2 )
        soap? ( >=dev-libs/libxml2-2.6.8 )
-       spell? ( >=app-text/aspell-0.60 )
+       spell? ( >=app-text/aspell-0.50 )
        ssl? ( >=dev-libs/openssl-0.9.7 )
        sybase? ( dev-db/freetds )
        tidy? ( app-text/htmltidy )
@@ -171,16 +171,15 @@ php5_0-sapi_check_awkward_uses() {
        confutils_use_depend_all "qdbm"         "dba"
 
        # EXIF only gets built if we support a file format that uses it
-       confutils_use_depend_any "exif" "jpeg" "tiff"
+       confutils_use_depend_any "exif" "gd" "tiff"
 
        # support for the GD graphics library
        confutils_use_conflict "gd" "gd-external"
        confutils_use_depend_any "truetype" "gd" "gd-external"
-       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"
+       confutils_use_depend_any "cjk"  "gd" "gd-external"
+       confutils_use_depend_all "tiff" "gd"
+       confutils_use_depend_all "xpm"  "gd"
+       confutils_use_depend_all "gd"   "zlib"
 
        # IMAP support
        php_check_imap
@@ -192,6 +191,7 @@ php5_0-sapi_check_awkward_uses() {
        php_check_mta
 
        # Oracle support
+       confutils_use_conflict "oci8" "oci8-instant-client"
        php_check_oracle
 
        # LDAP-sasl support
@@ -246,16 +246,16 @@ php5_0-sapi_src_unpack() {
                unpack ${A}
        fi
 
-       cd ${S}
+       cd "${S}"
 
        # Patch PHP to show Gentoo as the server platform
        sed -e "s/PHP_UNAME=\`uname -a | xargs\`/PHP_UNAME=\`uname -s -n -r -v | xargs\`/g" -i configure.in
 
        # Patch for PostgreSQL support
-       sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i ext/pgsql/config.m4
+       use postgres && sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i ext/pgsql/config.m4
 
        # Patch for session persistence bug
-       epatch ${FILESDIR}/5.1.0/php5_soap_persistence_session.diff
+       epatch "${FILESDIR}/5.0-any/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
@@ -264,16 +264,16 @@ php5_0-sapi_src_unpack() {
        done
 
        # imap support
-       use imap && epatch ${FILESDIR}/5.0.0/php5-imap-symlink.diff
+       use imap && epatch "${FILESDIR}/5.0-any/php5-imap-symlink.diff"
 
        # iodbc support
-       use iodbc && epatch ${FILESDIR}/5.0.0/php5-iodbc-config.diff
-       use iodbc && epatch ${FILESDIR}/5.1.0/php5-with-iodbc.diff
+       use iodbc && epatch "${FILESDIR}/5.0-any/php5-iodbc-config.diff"
+       use iodbc && epatch "${FILESDIR}/5.0-any/php5-with-iodbc.diff"
 
        # hardenedphp support
        if use hardenedphp ; then
                if [ -n "${HARDENEDPHP_PATCH}" ] ; then
-                       epatch ${DISTDIR}/${HARDENEDPHP_PATCH}
+                       epatch "${DISTDIR}/${HARDENEDPHP_PATCH}"
                else
                        ewarn "There is no Hardened-PHP available for this PHP release yet!"
                fi
@@ -281,15 +281,14 @@ php5_0-sapi_src_unpack() {
 
        # fix problems compiling with apache2
        if useq apache2 && ! useq threads ; then
-               epatch ${FILESDIR}/5.1.0/php5-prefork.patch || die "Unable to patch for prefork support"
+               epatch "${FILESDIR}/5.0-any/php5-prefork.patch" || die "Unable to patch for prefork support"
        fi
 
-       # fix configure scripts to recognize uClibc, now done with elibtoolize,
+       # fix configure scripts to correctly support HardenedPHP
        # and patch PHP to support libtool 1.5
-       epatch ${FILESDIR}/5.0.0/php5-libtool-1.5.patch
+       epatch "${FILESDIR}/5.0-any/php5-libtool-1.5.patch"
        einfo "Running aclocal"
        WANT_AUTOMAKE=1.9 aclocal --force || die "Unable to run aclocal successfully"
-       elibtoolize
        einfo "Running libtoolize"
        libtoolize --copy --force || die "Unable to run libtoolize successfully"
 
@@ -297,6 +296,9 @@ php5_0-sapi_src_unpack() {
        einfo "Rebuilding configure script"
        WANT_AUTOCONF=2.5 autoreconf --force -W no-cross || die "Unable to regenerate configure script"
 
+       # run elibtoolize
+       elibtoolize
+
        # Just in case ;-)
        chmod 755 configure
 }
@@ -304,16 +306,17 @@ php5_0-sapi_src_unpack() {
 set_php_ini_dir() {
        PHP_INI_DIR="/etc/php/${PHPSAPI}-php5"
        PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+       PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
 }
 
 php5_0-sapi_src_compile() {
        destdir=/usr/$(get_libdir)/php5
        set_php_ini_dir
 
-       cd ${S}
+       cd "${S}"
        confutils_init
 
-       my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR} --without-pear"
+       my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE} --without-pear"
 
        #                               extension               USE flag                shared support?
        enable_extension_enable         "bcmath"                "bcmath"                1
@@ -336,7 +339,6 @@ php5_0-sapi_src_compile() {
        enable_extension_with           "informix"              "informix"              1
        enable_extension_disable        "ipv6"                  "ipv6"                  0
        # ircg extension not supported on Gentoo at this time
-       enable_extension_with           "jpeg-dir"              "jpeg"                  0 "/usr"
        enable_extension_with           "kerberos"              "kerberos"              0 "/usr"
        enable_extension_disable        "libxml"                "xml2"                  0
        enable_extension_enable         "mbstring"              "nls"                   1
@@ -345,10 +347,12 @@ php5_0-sapi_src_compile() {
        enable_extension_enable         "memory-limit"  "memlimit"              0
        enable_extension_with           "mhash"                 "mhash"                 1
        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           "oci8-instant-client"   "oci8-instant-client"   1
        enable_extension_with           "oracle"                "oracle7"               1
        enable_extension_with           "openssl"               "ssl"                   1
        enable_extension_with           "openssl-dir"   "ssl"                   0 "/usr"
@@ -396,15 +400,16 @@ php5_0-sapi_src_compile() {
        if useq gd-external ; then
                enable_extension_with   "freetype-dir"  "truetype"              0 "/usr"
                enable_extension_with   "t1lib"                 "truetype"              0 "/usr"
-               enable_extension_enable "gd-jis-conv"   "nls"                   0
+               enable_extension_enable "gd-jis-conv"   "cjk"                   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-conv"   "nls"                   0
+               enable_extension_enable "gd-jis-conv"   "cjk"                   0
                enable_extension_enable "gd-native-ttf" "truetype"              0
-               enable_extension_with   "png-dir"               "png"                   0 "/usr"
+               enable_extension_with   "jpeg-dir"              "gd"                    0 "/usr"
+               enable_extension_with   "png-dir"               "gd"                    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
@@ -475,7 +480,7 @@ php5_0-sapi_src_compile() {
        fi
 
        # fix ELF-related problems
-       if has_pic ; then
+       if useq pic ; then
                einfo "Enabling PIC support"
                my_conf="${my_conf} --with-pic"
        fi
@@ -504,12 +509,12 @@ php5_0-sapi_src_compile() {
 php5_0-sapi_src_install() {
        destdir=/usr/$(get_libdir)/php5
 
-       cd ${S}
+       cd "${S}"
        addpredict /usr/share/snmp/mibs/.index
 
        PHP_INSTALLTARGETS="install-build install-headers install-programs"
        useq sharedext && PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules"
-       make INSTALL_ROOT=${D} ${PHP_INSTALLTARGETS} || die "install failed"
+       make INSTALL_ROOT="${D}" ${PHP_INSTALLTARGETS} || die "install failed"
 
        # install missing header files
        if useq nls ; then
@@ -521,7 +526,7 @@ php5_0-sapi_src_install() {
        fi
 
        # get the extension dir
-       PHPEXTDIR="`${D}/${destdir}/bin/php-config --extension-dir`"
+       PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`"
 
        # don't forget the php.ini file
        local phpinisrc=php.ini-dist
@@ -535,22 +540,21 @@ php5_0-sapi_src_install() {
 
        # Set the include path to point to where we want to find PEAR packages
        einfo "Setting correct include_path"
-       sed -e 's|^;include_path .*|include_path = ".:/usr/share/php:/usr/share/php5"|' -i ${phpinisrc}
-
-       # Install any extensions built as shared objects
-       if useq sharedext; then
-               for x in `ls ${D}/${PHPEXTDIR}/*.so | sort`; do
-                       echo "extension=`basename ${x}`" >> ${phpinisrc}
-               done;
-       fi
+       sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php5:/usr/share/php"|' -i ${phpinisrc}
 
        # create the directory where we'll put php5-only php scripts
        keepdir /usr/share/php5
 }
 
 php5_0-sapi_install_ini() {
+       destdir=/usr/$(get_libdir)/php5
+
+       # get the extension dir
+       PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`"
+
        # work out where we are installing the ini file
        set_php_ini_dir
+
        local phpinisrc=php.ini-dist
 
        dodir ${PHP_INI_DIR}
@@ -558,6 +562,17 @@ php5_0-sapi_install_ini() {
        newins ${phpinisrc} ${PHP_INI_FILE}
 
        dodir ${PHP_EXT_INI_DIR}
+       dodir ${PHP_EXT_INI_DIR_ACTIVE}
+
+       # Install any extensions built as shared objects
+       if useq sharedext ; then
+               for x in `ls "${D}/${PHPEXTDIR}/"*.so | sort` ; do
+                       inifilename=${x/.so/.ini}
+                       inifilename=`basename ${inifilename}`
+                       echo "extension=`basename ${x}`" >> "${D}/${PHP_EXT_INI_DIR}/${inifilename}"
+                       dosym "${PHP_EXT_INI_DIR}/${inifilename}" "${PHP_EXT_INI_DIR_ACTIVE}/${inifilename}"
+               done
+       fi
 }
 
 php5_0-sapi_pkg_postinst() {
@@ -610,6 +625,10 @@ php5_0-sapi_pkg_postinst() {
 
        ewarn "If you have additional third party PHP extensions (such as"
        ewarn "dev-php5/phpdbg) you may need to recompile them now."
+       ewarn "A new way of enabling/disabling PHP extensions was introduced"
+       ewarn "with the newer PHP packages releases, so please reemerge any"
+       ewarn "PHP extensions you have installed to automatically adapt to"
+       ewarn "the new configuration layout."
        ewarn
 
        if useq curl; then
@@ -617,4 +636,12 @@ php5_0-sapi_pkg_postinst() {
                ewarn "This can be a security risk!"
                ewarn
        fi
+
+       ewarn "The 'pic' USE flag was added to newer releases of dev-lang/php."
+       ewarn "With PIC enabled, your PHP installation may become slower, but"
+       ewarn "PIC is required on Hardened-Gentoo platforms (where the USE flag"
+       ewarn "is enabled automatically). You may also need this on other"
+       ewarn "configurations where you disabled TEXTRELs, for example using"
+       ewarn "PaX in the kernel."
+       ewarn
 }
index c7579de2663c7fdd49958046d935f96d90d33f5d..f4c8a3c7952c717fc1471a3f8c2f217f25905c84 100644 (file)
@@ -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_1-sapi.eclass,v 1.6 2005/09/25 15:21:22 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php5_1-sapi.eclass,v 1.7 2005/10/31 14:08:42 chtekk Exp $
 #
 # ########################################################################
 #
@@ -14,8 +14,8 @@
 # Author(s)            Stuart Herbert
 #                              <stuart@gentoo.org>
 #
-#                              CHTEKK
-#                              <chtekk@longitekk.org>
+#                              Luca Longinotti
+#                              <chtekk@gentoo.org>
 #
 # ========================================================================
 
@@ -39,7 +39,7 @@ if [ "${PHP_PACKAGE}" = 1 ]; then
        S="${WORKDIR}/${MY_PHP_P}"
 fi
 
-IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb crypt ctype curl curlwrappers db2 dba dbase dbmaker debug doc empress empress-bcs esoob exif fastbuild frontbase fdftk filepro firebird flatfile ftp gd gd-external gdbm gmp hardenedphp hyperwave-api iconv imap informix inifile interbase iodbc ipv6 java-external jpeg kerberos ldap libedit mcve memlimit mhash ming msql mssql mysql mysqli ncurses nls oci8 odbc oracle7 ovrimos pcntl pcre pdo pdo-external pear pfpro png posix postgres 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 vm-goto vm-switch wddx xml2 xmlreader xmlrpc xpm xsl yaz zip zlib"
+IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl curlwrappers db2 dba dbase dbmaker debug doc empress empress-bcs esoob exif fastbuild frontbase fdftk filepro firebird flatfile ftp gd gd-external gdbm gmp hardenedphp hyperwave-api iconv imap informix inifile interbase iodbc ipv6 java-external kerberos ldap libedit mcve memlimit mhash ming msql mssql mysql mysqli ncurses nls oci8 oci8-instant-client odbc oracle7 ovrimos pcntl pcre pdo pdo-external pear pfpro pic posix postgres 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 vm-goto vm-switch wddx xml2 xmlreader xmlrpc xpm xsl yaz zip zlib"
 
 # these USE flags should have the correct dependencies
 DEPEND="${DEPEND}
@@ -58,13 +58,13 @@ DEPEND="${DEPEND}
        crypt? ( >=dev-libs/libmcrypt-2.4 )
        curl? ( >=net-misc/curl-7.10.5 )
        fdftk? ( app-text/fdftk )
-       firebird? ( dev-db/firebird  )
+       firebird? ( dev-db/firebird )
+       gd? ( >=media-libs/jpeg-6b media-libs/libpng )
        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 )
@@ -76,9 +76,9 @@ DEPEND="${DEPEND}
        mysqli? ( >=dev-db/mysql-4.1 )
        ncurses? ( sys-libs/ncurses )
        nls? ( sys-devel/gettext )
+       oci8-instant-client? ( dev-db/oracle-instantclient-basic )
        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 )
@@ -87,7 +87,7 @@ DEPEND="${DEPEND}
        simplexml? ( >=dev-libs/libxml2-2.6.8 )
        snmp? ( >=net-analyzer/net-snmp-5.2 )
        soap? ( >=dev-libs/libxml2-2.6.8 )
-       spell? ( >=app-text/aspell-0.60 )
+       spell? ( >=app-text/aspell-0.50 )
        ssl? ( >=dev-libs/openssl-0.9.7 )
        sybase? ( dev-db/freetds )
        tidy? ( app-text/htmltidy )
@@ -171,16 +171,15 @@ php5_1-sapi_check_awkward_uses() {
        confutils_use_depend_all "qdbm"         "dba"
 
        # EXIF only gets built if we support a file format that uses it
-       confutils_use_depend_any "exif" "jpeg" "tiff"
+       confutils_use_depend_any "exif" "gd" "tiff"
 
        # support for the GD graphics library
        confutils_use_conflict "gd" "gd-external"
        confutils_use_depend_any "truetype" "gd" "gd-external"
-       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"
+       confutils_use_depend_any "cjk"  "gd" "gd-external"
+       confutils_use_depend_all "tiff" "gd"
+       confutils_use_depend_all "xpm"  "gd"
+       confutils_use_depend_all "gd"   "zlib"
 
        # IMAP support
        php_check_imap
@@ -192,6 +191,7 @@ php5_1-sapi_check_awkward_uses() {
        php_check_mta
 
        # Oracle support
+       confutils_use_conflict "oci8" "oci8-instant-client"
        php_check_oracle
 
        # LDAP-sasl support
@@ -253,16 +253,16 @@ php5_1-sapi_src_unpack() {
                unpack ${A}
        fi
 
-       cd ${S}
+       cd "${S}"
 
        # Patch PHP to show Gentoo as the server platform
        sed -e "s/PHP_UNAME=\`uname -a | xargs\`/PHP_UNAME=\`uname -s -n -r -v | xargs\`/g" -i configure.in
 
        # Patch for PostgreSQL support
-       sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i ext/pgsql/config.m4
+       use postgres && sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i ext/pgsql/config.m4
 
        # Patch for session persistence bug
-       epatch ${FILESDIR}/5.1.0/php5_soap_persistence_session.diff
+       epatch "${FILESDIR}/5.1-any/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
@@ -271,33 +271,32 @@ php5_1-sapi_src_unpack() {
        done
 
        # imap support
-       use imap && epatch ${FILESDIR}/5.1.0/php5-imap-symlink.diff
+       use imap && epatch "${FILESDIR}/5.1-any/php5-imap-symlink.diff"
 
        # iodbc support
-       use iodbc && epatch ${FILESDIR}/5.1.0/php5-iodbc-config.diff
-       use iodbc && epatch ${FILESDIR}/5.1.0/php5-with-iodbc.diff
+       use iodbc && epatch "${FILESDIR}/5.1-any/php5-iodbc-config.diff"
+       use iodbc && epatch "${FILESDIR}/5.1-any/php5-with-iodbc.diff"
 
        # hardenedphp support
        if use hardenedphp ; then
                if [ -n "${HARDENEDPHP_PATCH}" ] ; then
-                       epatch ${DISTDIR}/${HARDENEDPHP_PATCH}
+                       epatch "${DISTDIR}/${HARDENEDPHP_PATCH}"
                else
                        ewarn "There is no Hardened-PHP available for this PHP release yet!"
                fi
        fi
 
        # fastbuild support
-       use fastbuild && epatch ${FILESDIR}/5.1.0/fastbuild.patch
+       use fastbuild && epatch "${FILESDIR}/5.1-any/php5-fastbuild.patch"
 
        # fix problems compiling with apache2
        if useq apache2 && ! useq threads ; then
-               epatch ${FILESDIR}/5.1.0/php5-prefork.patch || die "Unable to patch for prefork support"
+               epatch "${FILESDIR}/5.1-any/php5-prefork.patch" || die "Unable to patch for prefork support"
        fi
 
-       # fix configure scripts to recognize uClibc, now done with elibtoolize
+       # fix configure scripts to correctly support HardenedPHP
        einfo "Running aclocal"
        WANT_AUTOMAKE=1.9 aclocal --force || die "Unable to run aclocal successfully"
-       elibtoolize
        einfo "Running libtoolize"
        libtoolize --copy --force || die "Unable to run libtoolize successfully"
 
@@ -305,6 +304,9 @@ php5_1-sapi_src_unpack() {
        einfo "Rebuilding configure script"
        WANT_AUTOCONF=2.5 autoreconf --force -W no-cross || die "Unable to regenerate configure script"
 
+       # run elibtoolize
+       elibtoolize
+
        # Just in case ;-)
        chmod 755 configure
 }
@@ -312,16 +314,17 @@ php5_1-sapi_src_unpack() {
 set_php_ini_dir() {
        PHP_INI_DIR="/etc/php/${PHPSAPI}-php5"
        PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+       PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
 }
 
 php5_1-sapi_src_compile() {
        destdir=/usr/$(get_libdir)/php5
        set_php_ini_dir
 
-       cd ${S}
+       cd "${S}"
        confutils_init
 
-       my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR} --without-pear"
+       my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE} --without-pear"
 
        #                               extension               USE flag                shared support?
        enable_extension_enable         "bcmath"                "bcmath"                1
@@ -344,7 +347,6 @@ php5_1-sapi_src_compile() {
        enable_extension_with           "informix"              "informix"              1
        enable_extension_disable        "ipv6"                  "ipv6"                  0
        # ircg extension not supported on Gentoo at this time
-       enable_extension_with           "jpeg-dir"              "jpeg"                  0 "/usr"
        enable_extension_with           "kerberos"              "kerberos"              0 "/usr"
        enable_extension_disable        "libxml"                "xml2"                  0
        enable_extension_enable         "mbstring"              "nls"                   1
@@ -357,6 +359,7 @@ php5_1-sapi_src_compile() {
        enable_extension_with           "mssql"                 "mssql"                 1
        enable_extension_with           "ncurses"               "ncurses"               1
        enable_extension_with           "oci8"                  "oci8"                  1
+       enable_extension_with           "oci8-instant-client"   "oci8-instant-client"   1
        enable_extension_with           "oracle"                "oracle7"               1
        enable_extension_with           "openssl"               "ssl"                   1
        enable_extension_with           "openssl-dir"   "ssl"                   0 "/usr"
@@ -406,15 +409,16 @@ php5_1-sapi_src_compile() {
        if useq gd-external ; then
                enable_extension_with   "freetype-dir"  "truetype"              0 "/usr"
                enable_extension_with   "t1lib"                 "truetype"              0 "/usr"
-               enable_extension_enable "gd-jis-conv"   "nls"                   0
+               enable_extension_enable "gd-jis-conv"   "cjk"                   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-conv"   "nls"                   0
+               enable_extension_enable "gd-jis-conv"   "cjk"                   0
                enable_extension_enable "gd-native-ttf" "truetype"              0
-               enable_extension_with   "png-dir"               "png"                   0 "/usr"
+               enable_extension_with   "jpeg-dir"              "gd"                    0 "/usr"
+               enable_extension_with   "png-dir"               "gd"                    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
@@ -471,6 +475,11 @@ php5_1-sapi_src_compile() {
                enable_extension_with           "pdo-firebird"  "firebird"              1
                enable_extension_with           "pdo-mysql"             "mysql"                 1 "/usr"
                enable_extension_with           "pdo-oci"               "oci8"                  1
+               if useq oci8-instant-client ; then
+                       OCI8IC_PKG="`best_version dev-db/oracle-instantclient-basic`"
+                       OCI8IC_PKG="`printf ${OCI8IC_PKG} | sed -e 's|dev-db/oracle-instantclient-basic-||g'`"
+               fi
+               enable_extension_with           "pdo-oci"               "oci8-instant-client"   1       "instantclient,/usr,${OCI8IC_PKG}"
                enable_extension_with           "pdo-odbc"              "odbc"                  1 "unixODBC,/usr"
                enable_extension_with           "pdo-pgsql"             "postgres"              1
                enable_extension_without        "pdo-sqlite"    "sqlite"                1
@@ -506,7 +515,7 @@ php5_1-sapi_src_compile() {
        fi
 
        # fix ELF-related problems
-       if has_pic ; then
+       if useq pic ; then
                einfo "Enabling PIC support"
                my_conf="${my_conf} --with-pic"
        fi
@@ -535,12 +544,12 @@ php5_1-sapi_src_compile() {
 php5_1-sapi_src_install() {
        destdir=/usr/$(get_libdir)/php5
 
-       cd ${S}
+       cd "${S}"
        addpredict /usr/share/snmp/mibs/.index
 
        PHP_INSTALLTARGETS="install-build install-headers install-programs"
        useq sharedext && PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules"
-       make INSTALL_ROOT=${D} ${PHP_INSTALLTARGETS} || die "install failed"
+       make INSTALL_ROOT="${D}" ${PHP_INSTALLTARGETS} || die "install failed"
 
        # install missing header files
        if useq nls ; then
@@ -552,7 +561,7 @@ php5_1-sapi_src_install() {
        fi
 
        # get the extension dir
-       PHPEXTDIR="`${D}/${destdir}/bin/php-config --extension-dir`"
+       PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`"
 
        # don't forget the php.ini file
        local phpinisrc=php.ini-dist
@@ -566,22 +575,21 @@ php5_1-sapi_src_install() {
 
        # Set the include path to point to where we want to find PEAR packages
        einfo "Setting correct include_path"
-       sed -e 's|^;include_path .*|include_path = ".:/usr/share/php:/usr/share/php5"|' -i ${phpinisrc}
-
-       # Install any extensions built as shared objects
-       if useq sharedext; then
-               for x in `ls ${D}/${PHPEXTDIR}/*.so | sort`; do
-                       echo "extension=`basename ${x}`" >> ${phpinisrc}
-               done;
-       fi
+       sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php5:/usr/share/php"|' -i ${phpinisrc}
 
        # create the directory where we'll put php5-only php scripts
        keepdir /usr/share/php5
 }
 
 php5_1-sapi_install_ini() {
+       destdir=/usr/$(get_libdir)/php5
+
+       # get the extension dir
+       PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`"
+
        # work out where we are installing the ini file
        set_php_ini_dir
+
        local phpinisrc=php.ini-dist
 
        dodir ${PHP_INI_DIR}
@@ -589,6 +597,17 @@ php5_1-sapi_install_ini() {
        newins ${phpinisrc} ${PHP_INI_FILE}
 
        dodir ${PHP_EXT_INI_DIR}
+       dodir ${PHP_EXT_INI_DIR_ACTIVE}
+
+       # Install any extensions built as shared objects
+       if useq sharedext ; then
+               for x in `ls "${D}/${PHPEXTDIR}/"*.so | sort` ; do
+                       inifilename=${x/.so/.ini}
+                       inifilename=`basename ${inifilename}`
+                       echo "extension=`basename ${x}`" >> "${D}/${PHP_EXT_INI_DIR}/${inifilename}"
+                       dosym "${PHP_EXT_INI_DIR}/${inifilename}" "${PHP_EXT_INI_DIR_ACTIVE}/${inifilename}"
+               done
+       fi
 }
 
 php5_1-sapi_pkg_postinst() {
@@ -641,6 +660,10 @@ php5_1-sapi_pkg_postinst() {
 
        ewarn "If you have additional third party PHP extensions (such as"
        ewarn "dev-php5/phpdbg) you may need to recompile them now."
+       ewarn "A new way of enabling/disabling PHP extensions was introduced"
+       ewarn "with the newer PHP packages releases, so please reemerge any"
+       ewarn "PHP extensions you have installed to automatically adapt to"
+       ewarn "the new configuration layout."
        ewarn
 
        if useq curl; then
@@ -648,4 +671,12 @@ php5_1-sapi_pkg_postinst() {
                ewarn "This can be a security risk!"
                ewarn
        fi
+
+       ewarn "The 'pic' USE flag was added to newer releases of dev-lang/php."
+       ewarn "With PIC enabled, your PHP installation may become slower, but"
+       ewarn "PIC is required on Hardened-Gentoo platforms (where the USE flag"
+       ewarn "is enabled automatically). You may also need this on other"
+       ewarn "configurations where you disabled TEXTRELs, for example using"
+       ewarn "PaX in the kernel."
+       ewarn
 }