diff options
-rw-r--r-- | eclass/php-common-r1.eclass | 16 | ||||
-rw-r--r-- | eclass/php-ext-source-r1.eclass | 60 | ||||
-rw-r--r-- | eclass/php4_4-sapi.eclass | 312 | ||||
-rw-r--r-- | eclass/php5_0-sapi.eclass | 318 | ||||
-rw-r--r-- | eclass/php5_1-sapi.eclass | 338 | ||||
-rw-r--r-- | eclass/phpconfutils.eclass | 16 |
6 files changed, 428 insertions, 632 deletions
diff --git a/eclass/php-common-r1.eclass b/eclass/php-common-r1.eclass index fa31c7749fb4..6d7794c0b35d 100644 --- a/eclass/php-common-r1.eclass +++ b/eclass/php-common-r1.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 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.7 2006/04/18 12:21:14 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-common-r1.eclass,v 1.8 2006/07/14 16:02:36 chtekk Exp $ # ######################################################################## # @@ -115,16 +115,18 @@ php_install_java() { # 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 PHP java extension" + doins "modules/java.so" + + einfo "Creating PHP java extension symlink" + dosym "${PHPEXTDIR}/java.so" "${PHPEXTDIR}/libphp_java.so" + einfo "Installing JAR for PHP" doins "ext/java/php_java.jar" einfo "Installing Java test page" newins "ext/java/except.php" "java-test.php" - - einfo "Installing Java extension for PHP" - doins "modules/java.so" - - dosym "${PHPEXTDIR}/java.so" "${PHPEXTDIR}/libphp_java.so" } php_install_java_inifile() { diff --git a/eclass/php-ext-source-r1.eclass b/eclass/php-ext-source-r1.eclass index 894715ff26a7..b9cc9b3d4f33 100644 --- a/eclass/php-ext-source-r1.eclass +++ b/eclass/php-ext-source-r1.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 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.4 2005/11/20 01:35:05 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.5 2006/07/14 16:02:36 chtekk Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # Author: Stuart Herbert <stuart@gentoo.org> @@ -13,7 +13,7 @@ # # inherit php-ext-source-r1 -inherit php-ext-base-r1 +inherit php-ext-base-r1 flag-o-matic EXPORT_FUNCTIONS src_compile src_install @@ -25,8 +25,7 @@ EXPORT_FUNCTIONS src_compile src_install # ---end ebuild configurable settings -DEPEND="${DEPEND} - >=sys-devel/m4-1.4.3 +DEPEND=">=sys-devel/m4-1.4.3 >=sys-devel/libtool-1.5.18 >=sys-devel/automake-1.9.6 sys-devel/automake-wrapper @@ -34,22 +33,59 @@ DEPEND="${DEPEND} sys-devel/autoconf-wrapper" php-ext-source-r1_src_compile() { - # pull in the PHP settings + # Pull in the PHP settings has_php + cd "${S}" my_conf="${my_conf} --prefix=${PHPPREFIX} --with-php-config=${PHPCONFIG}" addpredict /usr/share/snmp/mibs/.index - # phpize creates configure out of config.m4 - export WANT_AUTOMAKE=1.9 WANT_AUTOCONF=2.5 + + # Create configure out of config.m4 ${PHPIZE} + + # Set needed automake/autoconf versions + export WANT_AUTOMAKE=1.9 WANT_AUTOCONF=2.5 + + # Concurrent PHP Apache2 modules support + if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then + if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then + append-ldflags "-Wl,--version-script=${ROOT}/var/lib/php-pkg/${PHP_PKG}/php${PHP_VERSION}-ldvs" + fi + fi + + # First compile run: the default ./configure ${my_conf} || die "Unable to configure code to compile" emake || die "Unable to make code" + mv -f "modules/${PHP_EXT_NAME}.so" "${WORKDIR}/${PHP_EXT_NAME}-default.so" || die "Unable to move extension" + + # Concurrent PHP Apache2 modules support + if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then + if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then + # First let's clean up + make distclean || die "Unable to clean build environment" + + # Second compile run: the versioned one + append-ldflags "-Wl,--allow-shlib-undefined -L/usr/$(get_libdir)/apache2/modules/ -lphp${PHP_VERSION}" + ./configure ${my_conf} || die "Unable to configure code to compile" + emake || die "Unable to make code" + mv -f "modules/${PHP_EXT_NAME}.so" "${WORKDIR}/${PHP_EXT_NAME}-versioned.so" || die "Unable to move extension" + fi + fi } php-ext-source-r1_src_install() { has_php - addpredict /usr/share/snmp/mibs/.index - chmod +x build/shtool - insinto ${EXT_DIR} - doins modules/${PHP_EXT_NAME}.so + + # Let's put the default module away + insinto "${EXT_DIR}" + newins "${WORKDIR}/${PHP_EXT_NAME}-default.so" "${PHP_EXT_NAME}.so" + + # And now the versioned one + if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then + if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then + insinto "${EXT_DIR}-versioned" + newins "${WORKDIR}/${PHP_EXT_NAME}-versioned.so" "${PHP_EXT_NAME}.so" + fi + fi + php-ext-base-r1_src_install } diff --git a/eclass/php4_4-sapi.eclass b/eclass/php4_4-sapi.eclass index 4a2d9923fa31..b530d411ae04 100644 --- a/eclass/php4_4-sapi.eclass +++ b/eclass/php4_4-sapi.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 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.21 2006/06/04 22:59:15 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php4_4-sapi.eclass,v 1.22 2006/07/14 16:02:36 chtekk Exp $ # # ######################################################################## # @@ -19,10 +19,9 @@ # # ======================================================================== -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" +PHPCONFUTILS_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" -inherit flag-o-matic eutils phpconfutils libtool php-common-r1 toolchain-funcs +inherit flag-o-matic toolchain-funcs libtool eutils phpconfutils php-common-r1 # set MY_PHP_P in the ebuild @@ -39,77 +38,75 @@ if [[ "${PHP_PACKAGE}" == 1 ]] ; then S="${WORKDIR}/${MY_PHP_P}" fi -IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl db2 dbase dbmaker dbx debug doc empress empress-bcs esoob exif expat 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 pfpro pic posix postgres readline recode sapdb session sharedext sharedmem snmp sockets solid spell sqlite ssl sybase sybase-ct sysvipc threads tokenizer truetype unicode wddx xml xmlrpc xpm xsl yaz zip zlib" +IUSE="adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl db2 dbase dbmaker dbx debug doc empress empress-bcs esoob exif expat 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 pfpro pic posix postgres readline recode sapdb session sharedext sharedmem snmp sockets solid spell sqlite ssl sybase sybase-ct sysvipc tokenizer truetype unicode wddx xml xmlrpc xpm xsl yaz zip zlib" # these USE flags should have the correct dependencies -DEPEND="${DEPEND} - !dev-php/php - !dev-php/php-cgi - !dev-php/mod_php - adabas? ( >=dev-db/unixODBC-1.8.13 ) - berkdb? ( =sys-libs/db-4* ) - birdstep? ( >=dev-db/unixODBC-1.8.13 ) - bzip2? ( app-arch/bzip2 ) - cdb? ( dev-db/cdb ) - cjk? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - crypt? ( >=dev-libs/libmcrypt-2.4 ) - curl? ( >=net-misc/curl-7.10.5 ) - db2? ( >=dev-db/unixODBC-1.8.13 ) - dbmaker? ( >=dev-db/unixODBC-1.8.13 ) - empress? ( >=dev-db/unixODBC-1.8.13 ) - empress-bcs? ( >=dev-db/unixODBC-1.8.13 ) - esoob? ( >=dev-db/unixODBC-1.8.13 ) - exif? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - fdftk? ( app-text/fdftk ) - firebird? ( dev-db/firebird ) - gd? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) - gd-external? ( media-libs/gd ) - gdbm? ( >=sys-libs/gdbm-1.8.0 ) - gmp? ( >=dev-libs/gmp-4.1.2 ) - iconv? ( virtual/libiconv ) - imap? ( virtual/imap-c-client ) - iodbc? ( dev-db/libiodbc >=dev-db/unixODBC-1.8.13 ) - java-internal? ( =virtual/jdk-1.4* dev-java/java-config !dev-php4/php-java-bridge ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11 ) - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) - mcal? ( dev-libs/libmcal !=dev-libs/libmcal-0.7-r2 ) - mcve? ( net-libs/libmonetra >=dev-libs/openssl-0.9.7 ) - mhash? ( app-crypt/mhash ) - ming? ( media-libs/ming ) - mssql? ( dev-db/freetds ) - 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 ) - postgres? ( >=dev-db/libpq-7.1 ) - readline? ( sys-libs/readline ) - recode? ( app-text/recode ) - sapdb? ( >=dev-db/unixODBC-1.8.13 ) - sharedmem? ( dev-libs/mm ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) - solid? ( >=dev-db/unixODBC-1.8.13 ) - spell? ( >=app-text/aspell-0.50 ) - ssl? ( >=dev-libs/openssl-0.9.7 ) - sybase? ( dev-db/freetds ) - truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - xml? ( dev-libs/libxml2 sys-libs/zlib xsl? ( dev-libs/libxslt ) ) - xmlrpc? ( dev-libs/expat virtual/libiconv ) - xpm? ( || ( x11-libs/libXpm virtual/x11 ) >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) - xsl? ( app-text/sablotron dev-libs/expat virtual/libiconv ) - zlib? ( sys-libs/zlib ) - virtual/mta" +DEPEND="adabas? ( >=dev-db/unixODBC-1.8.13 ) + berkdb? ( =sys-libs/db-4* ) + birdstep? ( >=dev-db/unixODBC-1.8.13 ) + bzip2? ( app-arch/bzip2 ) + cdb? ( dev-db/cdb ) + cjk? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + crypt? ( >=dev-libs/libmcrypt-2.4 ) + curl? ( >=net-misc/curl-7.10.5 ) + db2? ( >=dev-db/unixODBC-1.8.13 ) + dbmaker? ( >=dev-db/unixODBC-1.8.13 ) + empress? ( >=dev-db/unixODBC-1.8.13 ) + empress-bcs? ( >=dev-db/unixODBC-1.8.13 ) + esoob? ( >=dev-db/unixODBC-1.8.13 ) + exif? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + fdftk? ( app-text/fdftk ) + firebird? ( dev-db/firebird ) + gd? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) + gd-external? ( media-libs/gd ) + gdbm? ( >=sys-libs/gdbm-1.8.0 ) + gmp? ( >=dev-libs/gmp-4.1.2 ) + iconv? ( virtual/libiconv ) + imap? ( virtual/imap-c-client ) + iodbc? ( dev-db/libiodbc >=dev-db/unixODBC-1.8.13 ) + java-internal? ( >=virtual/jdk-1.4.2 dev-java/java-config !dev-php4/php-java-bridge ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11 ) + libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) + mcal? ( dev-libs/libmcal !=dev-libs/libmcal-0.7-r2 ) + mcve? ( net-libs/libmonetra >=dev-libs/openssl-0.9.7 ) + mhash? ( app-crypt/mhash ) + ming? ( media-libs/ming ) + mssql? ( dev-db/freetds ) + 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 ) + postgres? ( >=dev-db/libpq-7.1 ) + readline? ( sys-libs/readline ) + recode? ( app-text/recode ) + sapdb? ( >=dev-db/unixODBC-1.8.13 ) + sharedmem? ( dev-libs/mm ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + solid? ( >=dev-db/unixODBC-1.8.13 ) + spell? ( >=app-text/aspell-0.50 ) + ssl? ( >=dev-libs/openssl-0.9.7 ) + sybase? ( dev-db/freetds ) + truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + xml? ( dev-libs/libxml2 sys-libs/zlib xsl? ( dev-libs/libxslt ) ) + xmlrpc? ( dev-libs/expat virtual/libiconv ) + xpm? ( || ( x11-libs/libXpm virtual/x11 ) >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) + xsl? ( app-text/sablotron dev-libs/expat virtual/libiconv ) + zlib? ( sys-libs/zlib ) + virtual/mta" # libswf conflicts with ming and should not # be installed with the new PHP ebuilds -DEPEND="${DEPEND} !media-libs/libswf" +DEPEND="${DEPEND} + !media-libs/libswf" # 9libs causes a configure error -DEPEND="${DEPEND} !dev-libs/9libs" +DEPEND="${DEPEND} + !dev-libs/9libs" # simplistic for now -RDEPEND="${RDEPEND} ${DEPEND}" +RDEPEND="${DEPEND}" # those are only needed at compile-time DEPEND="${DEPEND} @@ -123,8 +120,7 @@ DEPEND="${DEPEND} # Additional features # # They are in PDEPEND because we need PHP installed first! -PDEPEND="${PDEPEND} - doc? ( app-doc/php-docs ) +PDEPEND="doc? ( app-doc/php-docs ) java-external? ( dev-php4/php-java-bridge ) sqlite? ( dev-php4/pecl-sqlite ) yaz? ( dev-php4/pecl-yaz ) @@ -135,6 +131,15 @@ PDEPEND="${PDEPEND} # ======================================================================== PHP_INI_FILE="php.ini" +PHP_INI_UPSTREAM="php.ini-dist" + +# ======================================================================== + +# PHP patchsets support +SRC_URI="${SRC_URI} http://gentoo.longitekk.com/php-patchset-${MY_PHP_PV}-r${PHP_PATCHSET_REV}.tar.bz2" + +# Hardened-PHP patch support +[[ -n "${HARDENEDPHP_PATCH}" ]] && SRC_URI="${SRC_URI} hardenedphp? ( http://gentoo.longitekk.com/${HARDENEDPHP_PATCH} )" # ======================================================================== @@ -206,13 +211,25 @@ php4_4-sapi_set_php_ini_dir() { php4_4-sapi_install_ini() { destdir=/usr/$(get_libdir)/php4 - # get the extension dir - PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" + # get the extension dir, if not already defined + [[ -z "${PHPEXTDIR}" ]] && PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" # work out where we are installing the ini file php4_4-sapi_set_php_ini_dir - local phpinisrc=php.ini-dist + local phpinisrc=${PHP_INI_UPSTREAM} + + # Set the extension dir + einfo "Setting extension_dir in php.ini" + sed -e "s|^extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc} + + # A patch for PHP for security + einfo "Securing fopen wrappers" + sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} + + # Set the include path to point to where we want to find PEAR packages + einfo "Setting correct include_path" + sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php4:/usr/share/php"|' -i ${phpinisrc} dodir ${PHP_INI_DIR} insinto ${PHP_INI_DIR} @@ -246,10 +263,6 @@ php4_4-sapi_pkg_setup() { } php4_4-sapi_src_unpack() { - if [[ "${PHP_PACKAGE}" == 1 ]] ; then - unpack ${A} - fi - cd "${S}" # Change PHP branding @@ -305,15 +318,6 @@ php4_4-sapi_src_unpack() { fi fi - # fastbuild support - if useq fastbuild ; then - if [[ -n "${FASTBUILD_PATCH}" ]] && [[ -f "${WORKDIR}/${FASTBUILD_PATCH}" ]] ; then - epatch "${WORKDIR}/${FASTBUILD_PATCH}" - else - ewarn "There is no fastbuild patch available for this PHP release yet!" - fi - fi - # Fix configure scripts to correctly support Hardened-PHP einfo "Running aclocal" WANT_AUTOMAKE=1.9 aclocal --force || die "Unable to run aclocal successfully" @@ -333,9 +337,11 @@ php4_4-sapi_src_unpack() { php4_4-sapi_src_compile() { destdir=/usr/$(get_libdir)/php4 + php4_4-sapi_set_php_ini_dir cd "${S}" + phpconfutils_init my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE} --without-pear" @@ -356,7 +362,7 @@ php4_4-sapi_src_compile() { phpconfutils_extension_with "gettext" "nls" 1 phpconfutils_extension_with "gmp" "gmp" 1 phpconfutils_extension_with "hwapi" "hyperwave-api" 1 - phpconfutils_extension_with "iconv" "iconv" 1 + phpconfutils_extension_with "iconv" "iconv" 0 phpconfutils_extension_with "informix" "informix" 1 phpconfutils_extension_disable "ipv6" "ipv6" 0 phpconfutils_extension_with "kerberos" "kerberos" 0 "/usr" @@ -382,7 +388,7 @@ php4_4-sapi_src_compile() { phpconfutils_extension_without "pcre-regex" "pcre" 0 phpconfutils_extension_with "pfpro" "pfpro" 1 phpconfutils_extension_with "pgsql" "postgres" 1 - phpconfutils_extension_disable "posix" "posix" 1 + phpconfutils_extension_disable "posix" "posix" 0 phpconfutils_extension_with "pspell" "spell" 1 phpconfutils_extension_with "recode" "recode" 1 phpconfutils_extension_enable "shmop" "sharedmem" 0 @@ -393,7 +399,7 @@ php4_4-sapi_src_compile() { phpconfutils_extension_enable "sysvmsg" "sysvipc" 1 phpconfutils_extension_enable "sysvsem" "sysvipc" 1 phpconfutils_extension_enable "sysvshm" "sysvipc" 1 - phpconfutils_extension_disable "tokenizer" "tokenizer" 1 + phpconfutils_extension_disable "tokenizer" "tokenizer" 0 phpconfutils_extension_enable "wddx" "wddx" 1 phpconfutils_extension_disable "xml" "expat" 0 phpconfutils_extension_with "xmlrpc" "xmlrpc" 1 @@ -457,12 +463,12 @@ php4_4-sapi_src_compile() { # MySQL support # In PHP4, MySQL is enabled by default, so if no 'mysql' USE flag is set, - # we must turn it off. + # we must turn it off explicitely if useq mysql ; then phpconfutils_extension_with "mysql" "mysql" 1 "/usr" phpconfutils_extension_with "mysql-sock" "mysql" 0 "/var/run/mysqld/mysqld.sock" else - phpconfutils_extension_without "mysql" "mysql" 1 "/usr" + phpconfutils_extension_without "mysql" "mysql" 0 fi # ODBC support @@ -498,23 +504,17 @@ php4_4-sapi_src_compile() { # Session support if ! useq session && ! phpconfutils_usecheck session ; then - phpconfutils_extension_disable "session" "session" 1 + phpconfutils_extension_disable "session" "session" 0 else phpconfutils_extension_with "mm" "sharedmem" 0 fi # Fix ELF-related problems - if useq pic ; then + if useq pic || phpconfutils_usecheck pic ; then einfo "Enabling PIC support" my_conf="${my_conf} --with-pic" fi - # apache2 & threads support - if useq apache2 && useq threads ; then - my_conf="${my_conf} --enable-experimental-zts" - ewarn "Enabling ZTS for Apache2 MPM" - fi - # Catch CFLAGS problems php_check_cflags @@ -530,7 +530,7 @@ php4_4-sapi_src_compile() { tc-export CC # We don't use econf, because we need to override all of its settings - ./configure --prefix=${destdir} --sysconfdir=/etc --cache-file=./config.cache ${my_conf} ${EXTRA_ECONF} || die "configure failed" + ./configure --prefix=${destdir} --host=${CHOST} --mandir=${destdir}/man --infodir=${destdir}/info --sysconfdir=/etc --cache-file=./config.cache ${my_conf} ${EXTRA_ECONF} || die "configure failed" emake || die "make failed" } @@ -538,27 +538,23 @@ php4_4-sapi_src_install() { destdir=/usr/$(get_libdir)/php4 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" - # Get the extension dir - PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" + addpredict /usr/share/snmp/mibs/.index - # 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} + # Install PHP + make INSTALL_ROOT="${D}" install-build install-headers install-programs || die "make install failed" - # A patch for PHP for security - einfo "Securing fopen wrappers" - sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} + # Get the extension dir, if not already defined + [[ -z "${PHPEXTDIR}" ]] && PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" - # Set the include path to point to where we want to find PEAR packages - einfo "Setting correct include_path" - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php4:/usr/share/php"|' -i ${phpinisrc} + # And install the modules to it + if useq sharedext ; then + for x in `ls "${S}/modules/"*.so | sort | sed -e "s|.*java.*||g"` ; do + insinto "${PHPEXTDIR}" + einfo "Installing PHP ${x/.so/} extension" + doins "modules/${x}" + done + fi # Java module and support needs to be installed php_install_java @@ -571,85 +567,7 @@ php4_4-sapi_src_install() { } php4_4-sapi_pkg_postinst() { - # Update Apache1 to use mod_php - if useq apache ; then - "${ROOT}/usr/sbin/php-select" -t apache1 php4 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 2 ]] ; then - php-select apache1 php4 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "Apache 1 is configured to load a different version of PHP." - ewarn "To make Apache 1 use PHP v4, use php-select:" - ewarn - ewarn " php-select apache1 php4" - ewarn - fi - fi - - # Update Apache2 to use mod_php - if useq apache2 ; then - "${ROOT}/usr/sbin/php-select" -t apache2 php4 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 2 ]] ; then - php-select apache2 php4 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "Apache 2 is configured to load a different version of PHP." - ewarn "To make Apache 2 use PHP v4, use php-select:" - ewarn - ewarn " php-select apache2 php4" - ewarn - fi - fi - - # Create the symlinks for php-cli - if useq cli || phpconfutils_usecheck cli ; then - "${ROOT}/usr/sbin/php-select" -t php php4 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 5 ]] ; then - php-select php php4 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "/usr/bin/php links to a different version of PHP." - ewarn "To make /usr/bin/php point to PHP v4, use php-select:" - ewarn - ewarn " php-select php php4" - ewarn - fi - fi - - # Create the symlinks for php-cgi - if useq cgi ; then - "${ROOT}/usr/sbin/php-select" -t php-cgi php4 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 5 ]] ; then - php-select php-cgi php4 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "/usr/bin/php-cgi links to a different version of PHP." - ewarn "To make /usr/bin/php-cgi point to PHP v4, use php-select:" - ewarn - ewarn " php-select php-cgi php4" - ewarn - fi - fi - - # Create the symlinks for php-devel - "${ROOT}/usr/sbin/php-select" -t php-devel php4 > /dev/null 2>&1 - exitStatus=$? - if [[ $exitStatus == 5 ]] ; then - php-select php-devel php4 - elif [[ $exitStatus == 4 ]] ; then - ewarn - ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a" - ewarn "different version of PHP. To make them point to PHP v4, use" - ewarn "php-select:" - ewarn - ewarn " php-select php-devel php4" - ewarn - fi - + ewarn 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" @@ -665,7 +583,7 @@ php4_4-sapi_pkg_postinst() { fi ewarn - if useq curl; then + if useq curl ; then ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions." ewarn "This can be a security risk!" ewarn @@ -675,8 +593,8 @@ php4_4-sapi_pkg_postinst() { 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 "configurations where TEXTRELs are disabled, for example when using" + ewarn "certain PaX options in the kernel." ewarn ewarn "The 'xml' and 'xml2' USE flags were unified in only the 'xml' USE" diff --git a/eclass/php5_0-sapi.eclass b/eclass/php5_0-sapi.eclass index 7348aa7d5452..4968fe8c66a9 100644 --- a/eclass/php5_0-sapi.eclass +++ b/eclass/php5_0-sapi.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 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.23 2006/06/04 22:59:15 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php5_0-sapi.eclass,v 1.24 2006/07/14 16:02:36 chtekk Exp $ # # ######################################################################## # @@ -19,10 +19,9 @@ # # ======================================================================== -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" +PHPCONFUTILS_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" -inherit flag-o-matic eutils phpconfutils libtool php-common-r1 toolchain-funcs +inherit flag-o-matic toolchain-funcs libtool eutils phpconfutils php-common-r1 # set MY_PHP_P in the ebuild @@ -39,79 +38,76 @@ if [[ "${PHP_PACKAGE}" == 1 ]] ; then S="${WORKDIR}/${MY_PHP_P}" fi -IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl curlwrappers db2 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 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 tokenizer truetype unicode wddx xml xmlrpc xpm xsl yaz zip zlib" +IUSE="adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl curlwrappers db2 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 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 tidy tokenizer truetype unicode wddx xml xmlrpc xpm xsl yaz zip zlib" # these USE flags should have the correct dependencies -DEPEND="${DEPEND} - !dev-php/php - !dev-php/php-cgi - !dev-php/mod_php - adabas? ( >=dev-db/unixODBC-1.8.13 ) - berkdb? ( =sys-libs/db-4* ) - birdstep? ( >=dev-db/unixODBC-1.8.13 ) - bzip2? ( app-arch/bzip2 ) - cdb? ( dev-db/cdb ) - cjk? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - crypt? ( >=dev-libs/libmcrypt-2.4 ) - curl? ( >=net-misc/curl-7.10.5 ) - db2? ( >=dev-db/unixODBC-1.8.13 ) - dbmaker? ( >=dev-db/unixODBC-1.8.13 ) - empress? ( >=dev-db/unixODBC-1.8.13 ) - empress-bcs? ( >=dev-db/unixODBC-1.8.13 ) - esoob? ( >=dev-db/unixODBC-1.8.13 ) - exif? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - fdftk? ( app-text/fdftk ) - firebird? ( dev-db/firebird ) - gd? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) - gd-external? ( media-libs/gd ) - gdbm? ( >=sys-libs/gdbm-1.8.0 ) - gmp? ( >=dev-libs/gmp-4.1.2 ) - iconv? ( virtual/libiconv ) - imap? ( virtual/imap-c-client ) - iodbc? ( dev-db/libiodbc >=dev-db/unixODBC-1.8.13 ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11 ) - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) - mcve? ( >=dev-libs/openssl-0.9.7 ) - mhash? ( app-crypt/mhash ) - ming? ( media-libs/ming ) - mssql? ( dev-db/freetds ) - mysql? ( dev-db/mysql ) - 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/libpq-7.1 ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline ) - recode? ( app-text/recode ) - sapdb? ( >=dev-db/unixODBC-1.8.13 ) - sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) - sharedmem? ( dev-libs/mm ) - simplexml? ( >=dev-libs/libxml2-2.6.8 ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) - soap? ( >=dev-libs/libxml2-2.6.8 ) - solid? ( >=dev-db/unixODBC-1.8.13 ) - spell? ( >=app-text/aspell-0.50 ) - ssl? ( >=dev-libs/openssl-0.9.7 ) - sybase? ( dev-db/freetds ) - tidy? ( app-text/htmltidy ) - truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - wddx? ( >=dev-libs/libxml2-2.6.8 ) - xml? ( >=dev-libs/libxml2-2.6.8 ) - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) - xpm? ( || ( x11-libs/libXpm virtual/x11 ) >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) - xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) - zlib? ( sys-libs/zlib ) - virtual/mta" +DEPEND="adabas? ( >=dev-db/unixODBC-1.8.13 ) + berkdb? ( =sys-libs/db-4* ) + birdstep? ( >=dev-db/unixODBC-1.8.13 ) + bzip2? ( app-arch/bzip2 ) + cdb? ( dev-db/cdb ) + cjk? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + crypt? ( >=dev-libs/libmcrypt-2.4 ) + curl? ( >=net-misc/curl-7.10.5 ) + db2? ( >=dev-db/unixODBC-1.8.13 ) + dbmaker? ( >=dev-db/unixODBC-1.8.13 ) + empress? ( >=dev-db/unixODBC-1.8.13 ) + empress-bcs? ( >=dev-db/unixODBC-1.8.13 ) + esoob? ( >=dev-db/unixODBC-1.8.13 ) + exif? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + fdftk? ( app-text/fdftk ) + firebird? ( dev-db/firebird ) + gd? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) + gd-external? ( media-libs/gd ) + gdbm? ( >=sys-libs/gdbm-1.8.0 ) + gmp? ( >=dev-libs/gmp-4.1.2 ) + iconv? ( virtual/libiconv ) + imap? ( virtual/imap-c-client ) + iodbc? ( dev-db/libiodbc >=dev-db/unixODBC-1.8.13 ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11 ) + libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) + mcve? ( >=dev-libs/openssl-0.9.7 ) + mhash? ( app-crypt/mhash ) + ming? ( media-libs/ming ) + mssql? ( dev-db/freetds ) + mysql? ( dev-db/mysql ) + 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/libpq-7.1 ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline ) + recode? ( app-text/recode ) + sapdb? ( >=dev-db/unixODBC-1.8.13 ) + sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) + sharedmem? ( dev-libs/mm ) + simplexml? ( >=dev-libs/libxml2-2.6.8 ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + soap? ( >=dev-libs/libxml2-2.6.8 ) + solid? ( >=dev-db/unixODBC-1.8.13 ) + spell? ( >=app-text/aspell-0.50 ) + ssl? ( >=dev-libs/openssl-0.9.7 ) + sybase? ( dev-db/freetds ) + tidy? ( app-text/htmltidy ) + truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + wddx? ( >=dev-libs/libxml2-2.6.8 ) + xml? ( >=dev-libs/libxml2-2.6.8 ) + xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) + xpm? ( || ( x11-libs/libXpm virtual/x11 ) >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) + xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) + zlib? ( sys-libs/zlib ) + virtual/mta" # libswf conflicts with ming and should not # be installed with the new PHP ebuilds -DEPEND="${DEPEND} !media-libs/libswf" +DEPEND="${DEPEND} + !media-libs/libswf" # simplistic for now -RDEPEND="${RDEPEND} ${DEPEND}" +RDEPEND="${DEPEND}" # those are only needed at compile-time DEPEND="${DEPEND} @@ -125,8 +121,7 @@ DEPEND="${DEPEND} # Additional features # # They are in PDEPEND because we need PHP installed first! -PDEPEND="${PDEPEND} - doc? ( app-doc/php-docs ) +PDEPEND="doc? ( app-doc/php-docs ) java-external? ( dev-php5/php-java-bridge ) mcve? ( dev-php5/pecl-mcve ) pdo-external? ( dev-php5/pecl-pdo ) @@ -138,6 +133,15 @@ PDEPEND="${PDEPEND} # ======================================================================== PHP_INI_FILE="php.ini" +PHP_INI_UPSTREAM="php.ini-dist" + +# ======================================================================== + +# PHP patchsets support +SRC_URI="${SRC_URI} http://gentoo.longitekk.com/php-patchset-${MY_PHP_PV}-r${PHP_PATCHSET_REV}.tar.bz2" + +# Hardened-PHP patch support +[[ -n "${HARDENEDPHP_PATCH}" ]] && SRC_URI="${SRC_URI} hardenedphp? ( http://gentoo.longitekk.com/${HARDENEDPHP_PATCH} )" # ======================================================================== @@ -161,8 +165,8 @@ php5_0-sapi_check_use_flags() { phpconfutils_use_depend_all "wddx" "xml" phpconfutils_use_depend_all "xmlrpc" "xml" phpconfutils_use_depend_all "xsl" "xml" - phpconfutils_use_depend_all "xmlrpc" "iconv" - phpconfutils_use_depend_all "java-external" "session" + phpconfutils_use_depend_all "xmlrpc" "iconv" + phpconfutils_use_depend_all "java-external" "session" phpconfutils_use_depend_all "sasl" "ldap" phpconfutils_use_depend_all "mcve" "ssl" phpconfutils_use_depend_all "adabas" "odbc" @@ -210,13 +214,25 @@ php5_0-sapi_set_php_ini_dir() { php5_0-sapi_install_ini() { destdir=/usr/$(get_libdir)/php5 - # get the extension dir - PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" + # get the extension dir, if not already defined + [[ -z "${PHPEXTDIR}" ]] && PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" # work out where we are installing the ini file php5_0-sapi_set_php_ini_dir - local phpinisrc=php.ini-dist + local phpinisrc=${PHP_INI_UPSTREAM} + + # Set the extension dir + einfo "Setting extension_dir in php.ini" + sed -e "s|^extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc} + + # A patch for PHP for security + einfo "Securing fopen wrappers" + sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} + + # Set the include path to point to where we want to find PEAR packages + einfo "Setting correct include_path" + sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php5:/usr/share/php"|' -i ${phpinisrc} dodir ${PHP_INI_DIR} insinto ${PHP_INI_DIR} @@ -247,10 +263,6 @@ php5_0-sapi_pkg_setup() { } php5_0-sapi_src_unpack() { - if [[ "${PHP_PACKAGE}" == 1 ]] ; then - unpack ${A} - fi - cd "${S}" # Change PHP branding @@ -325,9 +337,11 @@ php5_0-sapi_src_unpack() { php5_0-sapi_src_compile() { destdir=/usr/$(get_libdir)/php5 + php5_0-sapi_set_php_ini_dir cd "${S}" + phpconfutils_init my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE} --without-pear" @@ -338,7 +352,7 @@ php5_0-sapi_src_compile() { phpconfutils_extension_enable "calendar" "calendar" 1 phpconfutils_extension_disable "ctype" "ctype" 0 phpconfutils_extension_with "curl" "curl" 1 - phpconfutils_extension_with "curlwrappers" "curlwrappers" 1 + phpconfutils_extension_with "curlwrappers" "curlwrappers" 0 phpconfutils_extension_enable "dbase" "dbase" 1 phpconfutils_extension_disable "dom" "xml" 0 phpconfutils_extension_enable "exif" "exif" 1 @@ -373,22 +387,22 @@ php5_0-sapi_src_compile() { phpconfutils_extension_without "pcre-regex" "pcre" 0 phpconfutils_extension_with "pfpro" "pfpro" 1 phpconfutils_extension_with "pgsql" "postgres" 1 - phpconfutils_extension_disable "posix" "posix" 1 + phpconfutils_extension_disable "posix" "posix" 0 phpconfutils_extension_with "pspell" "spell" 1 phpconfutils_extension_with "recode" "recode" 1 - phpconfutils_extension_disable "simplexml" "simplexml" 1 + phpconfutils_extension_disable "simplexml" "simplexml" 0 phpconfutils_extension_enable "shmop" "sharedmem" 0 phpconfutils_extension_with "snmp" "snmp" 1 phpconfutils_extension_enable "soap" "soap" 1 phpconfutils_extension_enable "sockets" "sockets" 1 - phpconfutils_extension_disable "spl" "spl" 1 + phpconfutils_extension_disable "spl" "spl" 0 phpconfutils_extension_with "sybase" "sybase" 1 phpconfutils_extension_with "sybase-ct" "sybase-ct" 1 phpconfutils_extension_enable "sysvmsg" "sysvipc" 1 phpconfutils_extension_enable "sysvsem" "sysvipc" 1 phpconfutils_extension_enable "sysvshm" "sysvipc" 1 phpconfutils_extension_with "tidy" "tidy" 1 - phpconfutils_extension_disable "tokenizer" "tokenizer" 1 + phpconfutils_extension_disable "tokenizer" "tokenizer" 0 phpconfutils_extension_enable "wddx" "wddx" 1 phpconfutils_extension_disable "xml" "xml" 0 phpconfutils_extension_with "xmlrpc" "xmlrpc" 1 @@ -407,7 +421,7 @@ php5_0-sapi_src_compile() { phpconfutils_extension_with "flatfile" "flatfile" 1 phpconfutils_extension_with "gdbm" "gdbm" 1 phpconfutils_extension_with "inifile" "inifile" 1 - phpconfutils_extension_with "qdbm" "qdbm" 1 + phpconfutils_extension_with "qdbm" "qdbm" 1 # Support for the GD graphics library if useq gd-external || phpconfutils_usecheck gd-external ; then @@ -479,12 +493,12 @@ php5_0-sapi_src_compile() { # Session support if ! useq session && ! phpconfutils_usecheck session ; then - phpconfutils_extension_disable "session" "session" 1 + phpconfutils_extension_disable "session" "session" 0 else phpconfutils_extension_with "mm" "sharedmem" 0 fi - # Sqlite support + # SQLite support if ! useq sqlite && ! phpconfutils_usecheck sqlite ; then phpconfutils_extension_without "sqlite" "sqlite" 0 else @@ -492,17 +506,11 @@ php5_0-sapi_src_compile() { fi # Fix ELF-related problems - if useq pic ; then + if useq pic || phpconfutils_usecheck pic ; then einfo "Enabling PIC support" my_conf="${my_conf} --with-pic" fi - # apache2 & threads support - if useq apache2 && useq threads ; then - my_conf="${my_conf} --enable-maintainer-zts" - ewarn "Enabling ZTS for Apache2 MPM" - fi - # Catch CFLAGS problems php_check_cflags @@ -518,7 +526,7 @@ php5_0-sapi_src_compile() { tc-export CC # We don't use econf, because we need to override all of its settings - ./configure --prefix=${destdir} --sysconfdir=/etc --cache-file=./config.cache ${my_conf} ${EXTRA_ECONF} || die "configure failed" + ./configure --prefix=${destdir} --host=${CHOST} --mandir=${destdir}/man --infodir=${destdir}/info --sysconfdir=/etc --cache-file=./config.cache ${my_conf} ${EXTRA_ECONF} || die "configure failed" emake || die "make failed" } @@ -526,11 +534,11 @@ php5_0-sapi_src_install() { destdir=/usr/$(get_libdir)/php5 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" + # Install PHP + make INSTALL_ROOT="${D}" install-build install-headers install-programs || die "make install failed" # Install missing header files if useq unicode || phpconfutils_usecheck unicode ; then @@ -541,21 +549,17 @@ php5_0-sapi_src_install() { done fi - # Get the extension dir - PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" + # Get the extension dir, if not already defined + [[ -z "${PHPEXTDIR}" ]] && PHPEXTDIR="`"${D}/${destdir}/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 - einfo "Securing fopen wrappers" - sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} - - # Set the include path to point to where we want to find PEAR packages - einfo "Setting correct include_path" - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php5:/usr/share/php"|' -i ${phpinisrc} + # And install the modules to it + if useq sharedext ; then + for x in `ls "${S}/modules/"*.so | sort` ; do + insinto "${PHPEXTDIR}" + einfo "Installing PHP ${x/.so/} extension" + doins "modules/${x}" + done + fi # Generate the USE file for PHP phpconfutils_generate_usefile @@ -565,85 +569,7 @@ php5_0-sapi_src_install() { } php5_0-sapi_pkg_postinst() { - # Update Apache1 to use mod_php - if useq apache ; then - "${ROOT}/usr/sbin/php-select" -t apache1 php5 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 2 ]] ; then - php-select apache1 php5 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "Apache 1 is configured to load a different version of PHP." - ewarn "To make Apache 1 use PHP v5, use php-select:" - ewarn - ewarn " php-select apache1 php5" - ewarn - fi - fi - - # Update Apache2 to use mod_php - if useq apache2 ; then - "${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 2 ]] ; then - php-select apache2 php5 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "Apache 2 is configured to load a different version of PHP." - ewarn "To make Apache 2 use PHP v5, use php-select:" - ewarn - ewarn " php-select apache2 php5" - ewarn - fi - fi - - # Create the symlinks for php-cli - if useq cli || phpconfutils_usecheck cli ; then - "${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 5 ]] ; then - php-select php php5 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "/usr/bin/php links to a different version of PHP." - ewarn "To make /usr/bin/php point to PHP v5, use php-select:" - ewarn - ewarn " php-select php php5" - ewarn - fi - fi - - # Create the symlinks for php-cgi - if useq cgi ; then - "${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 5 ]] ; then - php-select php-cgi php5 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "/usr/bin/php-cgi links to a different version of PHP." - ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:" - ewarn - ewarn " php-select php-cgi php5" - ewarn - fi - fi - - # Create the symlinks for php-devel - "${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1 - exitStatus=$? - if [[ $exitStatus == 5 ]] ; then - php-select php-devel php5 - elif [[ $exitStatus == 4 ]] ; then - ewarn - ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a" - ewarn "different version of PHP. To make them point to PHP v5, use" - ewarn "php-select:" - ewarn - ewarn " php-select php-devel php5" - ewarn - fi - + ewarn 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" @@ -659,7 +585,7 @@ php5_0-sapi_pkg_postinst() { fi ewarn - if useq curl; then + if useq curl ; then ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions." ewarn "This can be a security risk!" ewarn @@ -669,8 +595,8 @@ php5_0-sapi_pkg_postinst() { 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 "configurations where TEXTRELs are disabled, for example when using" + ewarn "certain PaX options in the kernel." ewarn ewarn "The 'xml' and 'xml2' USE flags were unified in only the 'xml' USE" diff --git a/eclass/php5_1-sapi.eclass b/eclass/php5_1-sapi.eclass index d9f17259c0ca..769f2d873793 100644 --- a/eclass/php5_1-sapi.eclass +++ b/eclass/php5_1-sapi.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 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.27 2006/07/06 15:10:16 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php5_1-sapi.eclass,v 1.28 2006/07/14 16:02:36 chtekk Exp $ # # ######################################################################## # @@ -19,10 +19,9 @@ # # ======================================================================== -CONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix interbase msql oci8 sapdb solid sybase sybase-ct" -EBUILD_SUPPORTS_SHAREDEXT="1" +PHPCONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix interbase msql oci8 sapdb solid sybase sybase-ct" -inherit flag-o-matic eutils phpconfutils libtool php-common-r1 toolchain-funcs +inherit flag-o-matic toolchain-funcs libtool eutils phpconfutils php-common-r1 # set MY_PHP_P in the ebuild @@ -39,81 +38,78 @@ if [[ "${PHP_PACKAGE}" == 1 ]] ; then S="${WORKDIR}/${MY_PHP_P}" fi -IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl curlwrappers db2 dbase dbmaker debug doc empress empress-bcs esoob exif fastbuild frontbase fdftk filepro firebird flatfile ftp gd gd-external gdbm gmp hardenedphp hash 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 pcntl pcre pdo pdo-external pic posix postgres qdbm readline reflection recode sapdb sasl session sharedext sharedmem simplexml snmp soap sockets solid spell spl sqlite ssl sybase sybase-ct sysvipc threads tidy tokenizer truetype unicode vm-goto vm-switch wddx xml xmlreader xmlwriter xmlrpc xpm xsl yaz zip zlib" +IUSE="adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl curlwrappers db2 dbase dbmaker debug doc empress empress-bcs esoob exif frontbase fdftk filepro firebird flatfile ftp gd gd-external gdbm gmp hardenedphp hash 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 pcntl pcre pdo pdo-external pic posix postgres qdbm readline reflection recode sapdb sasl session sharedext sharedmem simplexml snmp soap sockets solid spell spl sqlite ssl sybase sybase-ct sysvipc tidy tokenizer truetype unicode vm-goto vm-switch wddx xml xmlreader xmlwriter xmlrpc xpm xsl yaz zip zlib" # these USE flags should have the correct dependencies -DEPEND="${DEPEND} - !dev-php/php - !dev-php/php-cgi - !dev-php/mod_php - adabas? ( >=dev-db/unixODBC-1.8.13 ) - berkdb? ( =sys-libs/db-4* ) - birdstep? ( >=dev-db/unixODBC-1.8.13 ) - bzip2? ( app-arch/bzip2 ) - cdb? ( dev-db/cdb ) - cjk? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - crypt? ( >=dev-libs/libmcrypt-2.4 ) - curl? ( >=net-misc/curl-7.10.5 ) - db2? ( >=dev-db/unixODBC-1.8.13 ) - dbmaker? ( >=dev-db/unixODBC-1.8.13 ) - empress? ( >=dev-db/unixODBC-1.8.13 ) - empress-bcs? ( >=dev-db/unixODBC-1.8.13 ) - esoob? ( >=dev-db/unixODBC-1.8.13 ) - exif? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - fdftk? ( app-text/fdftk ) - firebird? ( dev-db/firebird ) - gd? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) - gd-external? ( media-libs/gd ) - gdbm? ( >=sys-libs/gdbm-1.8.0 ) - gmp? ( >=dev-libs/gmp-4.1.2 ) - iconv? ( virtual/libiconv ) - imap? ( virtual/imap-c-client ) - iodbc? ( dev-db/libiodbc >=dev-db/unixODBC-1.8.13 ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11 ) - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) - mcve? ( >=dev-libs/openssl-0.9.7 ) - mhash? ( app-crypt/mhash ) - ming? ( media-libs/ming ) - mssql? ( dev-db/freetds ) - mysql? ( dev-db/mysql ) - 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/libpq-7.1 ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline ) - recode? ( app-text/recode ) - sapdb? ( >=dev-db/unixODBC-1.8.13 ) - sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) - sharedmem? ( dev-libs/mm ) - simplexml? ( >=dev-libs/libxml2-2.6.8 ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) - soap? ( >=dev-libs/libxml2-2.6.8 ) - solid? ( >=dev-db/unixODBC-1.8.13 ) - spell? ( >=app-text/aspell-0.50 ) - ssl? ( >=dev-libs/openssl-0.9.7 ) - sybase? ( dev-db/freetds ) - tidy? ( app-text/htmltidy ) - truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) - wddx? ( >=dev-libs/libxml2-2.6.8 ) - xml? ( >=dev-libs/libxml2-2.6.8 ) - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) - xmlreader? ( >=dev-libs/libxml2-2.6.8 ) - xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) - xpm? ( || ( x11-libs/libXpm virtual/x11 ) >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) - xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) - zlib? ( sys-libs/zlib ) - virtual/mta" +DEPEND="adabas? ( >=dev-db/unixODBC-1.8.13 ) + berkdb? ( =sys-libs/db-4* ) + birdstep? ( >=dev-db/unixODBC-1.8.13 ) + bzip2? ( app-arch/bzip2 ) + cdb? ( dev-db/cdb ) + cjk? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + crypt? ( >=dev-libs/libmcrypt-2.4 ) + curl? ( >=net-misc/curl-7.10.5 ) + db2? ( >=dev-db/unixODBC-1.8.13 ) + dbmaker? ( >=dev-db/unixODBC-1.8.13 ) + empress? ( >=dev-db/unixODBC-1.8.13 ) + empress-bcs? ( >=dev-db/unixODBC-1.8.13 ) + esoob? ( >=dev-db/unixODBC-1.8.13 ) + exif? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + fdftk? ( app-text/fdftk ) + firebird? ( dev-db/firebird ) + gd? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) + gd-external? ( media-libs/gd ) + gdbm? ( >=sys-libs/gdbm-1.8.0 ) + gmp? ( >=dev-libs/gmp-4.1.2 ) + iconv? ( virtual/libiconv ) + imap? ( virtual/imap-c-client ) + iodbc? ( dev-db/libiodbc >=dev-db/unixODBC-1.8.13 ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11 ) + libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) + mcve? ( >=dev-libs/openssl-0.9.7 ) + mhash? ( app-crypt/mhash ) + ming? ( media-libs/ming ) + mssql? ( dev-db/freetds ) + mysql? ( dev-db/mysql ) + 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/libpq-7.1 ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline ) + recode? ( app-text/recode ) + sapdb? ( >=dev-db/unixODBC-1.8.13 ) + sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) + sharedmem? ( dev-libs/mm ) + simplexml? ( >=dev-libs/libxml2-2.6.8 ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + soap? ( >=dev-libs/libxml2-2.6.8 ) + solid? ( >=dev-db/unixODBC-1.8.13 ) + spell? ( >=app-text/aspell-0.50 ) + ssl? ( >=dev-libs/openssl-0.9.7 ) + sybase? ( dev-db/freetds ) + tidy? ( app-text/htmltidy ) + truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) ) + wddx? ( >=dev-libs/libxml2-2.6.8 ) + xml? ( >=dev-libs/libxml2-2.6.8 ) + xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) + xmlreader? ( >=dev-libs/libxml2-2.6.8 ) + xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) + xpm? ( || ( x11-libs/libXpm virtual/x11 ) >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) + xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) + zlib? ( sys-libs/zlib ) + virtual/mta" # libswf conflicts with ming and should not # be installed with the new PHP ebuilds -DEPEND="${DEPEND} !media-libs/libswf" +DEPEND="${DEPEND} + !media-libs/libswf" # simplistic for now -RDEPEND="${RDEPEND} ${DEPEND}" +RDEPEND="${DEPEND}" # those are only needed at compile-time DEPEND="${DEPEND} @@ -127,8 +123,7 @@ DEPEND="${DEPEND} # Additional features # # They are in PDEPEND because we need PHP installed first! -PDEPEND="${PDEPEND} - doc? ( app-doc/php-docs ) +PDEPEND="doc? ( app-doc/php-docs ) java-external? ( dev-php5/php-java-bridge ) mcve? ( dev-php5/pecl-mcve ) pdo-external? ( dev-php5/pecl-pdo ) @@ -140,6 +135,15 @@ PDEPEND="${PDEPEND} # ======================================================================== PHP_INI_FILE="php.ini" +PHP_INI_UPSTREAM="php.ini-dist" + +# ======================================================================== + +# PHP patchsets support +SRC_URI="${SRC_URI} http://gentoo.longitekk.com/php-patchset-${MY_PHP_PV}-r${PHP_PATCHSET_REV}.tar.bz2" + +# Hardened-PHP patch support +[[ -n "${HARDENEDPHP_PATCH}" ]] && SRC_URI="${SRC_URI} hardenedphp? ( http://gentoo.longitekk.com/${HARDENEDPHP_PATCH} )" # ======================================================================== @@ -165,8 +169,8 @@ php5_1-sapi_check_use_flags() { phpconfutils_use_depend_all "xmlreader" "xml" phpconfutils_use_depend_all "xmlwriter" "xml" phpconfutils_use_depend_all "xsl" "xml" - phpconfutils_use_depend_all "xmlrpc" "iconv" - phpconfutils_use_depend_all "java-external" "session" + phpconfutils_use_depend_all "xmlrpc" "iconv" + phpconfutils_use_depend_all "java-external" "session" phpconfutils_use_depend_all "sasl" "ldap" phpconfutils_use_depend_all "mcve" "ssl" phpconfutils_use_depend_all "adabas" "odbc" @@ -216,13 +220,25 @@ php5_1-sapi_set_php_ini_dir() { php5_1-sapi_install_ini() { destdir=/usr/$(get_libdir)/php5 - # get the extension dir - PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" + # get the extension dir, if not already defined + [[ -z "${PHPEXTDIR}" ]] && PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" # work out where we are installing the ini file php5_1-sapi_set_php_ini_dir - local phpinisrc=php.ini-dist + local phpinisrc=${PHP_INI_UPSTREAM} + + # Set the extension dir + einfo "Setting extension_dir in php.ini" + sed -e "s|^extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc} + + # A patch for PHP for security + einfo "Securing fopen wrappers" + sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} + + # Set the include path to point to where we want to find PEAR packages + einfo "Setting correct include_path" + sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php5:/usr/share/php"|' -i ${phpinisrc} dodir ${PHP_INI_DIR} insinto ${PHP_INI_DIR} @@ -253,10 +269,6 @@ php5_1-sapi_pkg_setup() { } php5_1-sapi_src_unpack() { - if [[ "${PHP_PACKAGE}" == 1 ]] ; then - unpack ${A} - fi - cd "${S}" # Change PHP branding @@ -312,15 +324,6 @@ php5_1-sapi_src_unpack() { fi fi - # fastbuild support - if useq fastbuild ; then - if [[ -n "${FASTBUILD_PATCH}" ]] && [[ -f "${WORKDIR}/${FASTBUILD_PATCH}" ]] ; then - epatch "${WORKDIR}/${FASTBUILD_PATCH}" - else - ewarn "There is no fastbuild patch available for this PHP release yet!" - fi - fi - # Fix configure scripts to correctly support Hardened-PHP einfo "Running aclocal" WANT_AUTOMAKE=1.9 aclocal --force || die "Unable to run aclocal successfully" @@ -340,9 +343,11 @@ php5_1-sapi_src_unpack() { php5_1-sapi_src_compile() { destdir=/usr/$(get_libdir)/php5 + php5_1-sapi_set_php_ini_dir cd "${S}" + phpconfutils_init my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE} --without-pear" @@ -353,7 +358,7 @@ php5_1-sapi_src_compile() { phpconfutils_extension_enable "calendar" "calendar" 1 phpconfutils_extension_disable "ctype" "ctype" 0 phpconfutils_extension_with "curl" "curl" 1 - phpconfutils_extension_with "curlwrappers" "curlwrappers" 1 + phpconfutils_extension_with "curlwrappers" "curlwrappers" 0 phpconfutils_extension_enable "dbase" "dbase" 1 phpconfutils_extension_disable "dom" "xml" 0 phpconfutils_extension_enable "exif" "exif" 1 @@ -382,29 +387,29 @@ php5_1-sapi_src_compile() { phpconfutils_extension_with "openssl-dir" "ssl" 0 "/usr" phpconfutils_extension_enable "pcntl" "pcntl" 1 phpconfutils_extension_without "pcre-regex" "pcre" 0 - phpconfutils_extension_disable "pdo" "pdo" 1 + phpconfutils_extension_disable "pdo" "pdo" 0 phpconfutils_extension_with "pgsql" "postgres" 1 - phpconfutils_extension_disable "posix" "posix" 1 + phpconfutils_extension_disable "posix" "posix" 0 phpconfutils_extension_with "pspell" "spell" 1 phpconfutils_extension_with "recode" "recode" 1 phpconfutils_extension_disable "reflection" "reflection" 0 - phpconfutils_extension_disable "simplexml" "simplexml" 1 + phpconfutils_extension_disable "simplexml" "simplexml" 0 phpconfutils_extension_enable "shmop" "sharedmem" 0 phpconfutils_extension_with "snmp" "snmp" 1 phpconfutils_extension_enable "soap" "soap" 1 phpconfutils_extension_enable "sockets" "sockets" 1 - phpconfutils_extension_disable "spl" "spl" 1 + phpconfutils_extension_disable "spl" "spl" 0 phpconfutils_extension_with "sybase" "sybase" 1 phpconfutils_extension_with "sybase-ct" "sybase-ct" 1 phpconfutils_extension_enable "sysvmsg" "sysvipc" 1 phpconfutils_extension_enable "sysvsem" "sysvipc" 1 phpconfutils_extension_enable "sysvshm" "sysvipc" 1 phpconfutils_extension_with "tidy" "tidy" 1 - phpconfutils_extension_disable "tokenizer" "tokenizer" 1 + phpconfutils_extension_disable "tokenizer" "tokenizer" 0 phpconfutils_extension_enable "wddx" "wddx" 1 phpconfutils_extension_disable "xml" "xml" 0 - phpconfutils_extension_disable "xmlreader" "xmlreader" 1 - phpconfutils_extension_disable "xmlwriter" "xmlwriter" 1 + phpconfutils_extension_disable "xmlreader" "xmlreader" 0 + phpconfutils_extension_disable "xmlwriter" "xmlwriter" 0 phpconfutils_extension_with "xmlrpc" "xmlrpc" 1 phpconfutils_extension_with "xsl" "xsl" 1 phpconfutils_extension_with "zlib" "zlib" 1 @@ -421,7 +426,7 @@ php5_1-sapi_src_compile() { phpconfutils_extension_with "flatfile" "flatfile" 1 phpconfutils_extension_with "gdbm" "gdbm" 1 phpconfutils_extension_with "inifile" "inifile" 1 - phpconfutils_extension_with "qdbm" "qdbm" 1 + phpconfutils_extension_with "qdbm" "qdbm" 1 # Support for the GD graphics library if useq gd-external || phpconfutils_usecheck gd-external ; then @@ -521,12 +526,12 @@ php5_1-sapi_src_compile() { # Session support if ! useq session && ! phpconfutils_usecheck session ; then - phpconfutils_extension_disable "session" "session" 1 + phpconfutils_extension_disable "session" "session" 0 else phpconfutils_extension_with "mm" "sharedmem" 0 fi - # Sqlite support + # SQLite support if ! useq sqlite && ! phpconfutils_usecheck sqlite ; then phpconfutils_extension_without "sqlite" "sqlite" 0 else @@ -544,17 +549,11 @@ php5_1-sapi_src_compile() { fi # Fix ELF-related problems - if useq pic ; then + if useq pic || phpconfutils_usecheck pic ; then einfo "Enabling PIC support" my_conf="${my_conf} --with-pic" fi - # apache2 & threads support - if useq apache2 && useq threads ; then - my_conf="${my_conf} --enable-maintainer-zts" - ewarn "Enabling ZTS for Apache2 MPM" - fi - # Catch CFLAGS problems php_check_cflags @@ -570,7 +569,7 @@ php5_1-sapi_src_compile() { tc-export CC # We don't use econf, because we need to override all of its settings - ./configure --prefix=${destdir} --sysconfdir=/etc --cache-file=./config.cache ${my_conf} ${EXTRA_ECONF} || die "configure failed" + ./configure --prefix=${destdir} --host=${CHOST} --mandir=${destdir}/man --infodir=${destdir}/info --sysconfdir=/etc --cache-file=./config.cache ${my_conf} ${EXTRA_ECONF} || die "configure failed" emake || die "make failed" } @@ -578,11 +577,11 @@ php5_1-sapi_src_install() { destdir=/usr/$(get_libdir)/php5 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" + # Install PHP + make INSTALL_ROOT="${D}" install-build install-headers install-programs || die "make install failed" # Install missing header files if useq unicode || phpconfutils_usecheck unicode ; then @@ -593,21 +592,17 @@ php5_1-sapi_src_install() { done fi - # Get the extension dir - PHPEXTDIR="`"${D}/${destdir}/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 - einfo "Securing fopen wrappers" - sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc} + # Get the extension dir, if not already defined + [[ -z "${PHPEXTDIR}" ]] && PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`" - # Set the include path to point to where we want to find PEAR packages - einfo "Setting correct include_path" - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php5:/usr/share/php"|' -i ${phpinisrc} + # And install the modules to it + if useq sharedext ; then + for x in `ls "${S}/modules/"*.so | sort` ; do + insinto "${PHPEXTDIR}" + einfo "Installing PHP ${x/.so/} extension" + doins "modules/${x}" + done + fi # Generate the USE file for PHP phpconfutils_generate_usefile @@ -617,85 +612,7 @@ php5_1-sapi_src_install() { } php5_1-sapi_pkg_postinst() { - # Update Apache1 to use mod_php - if useq apache ; then - "${ROOT}/usr/sbin/php-select" -t apache1 php5 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 2 ]] ; then - php-select apache1 php5 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "Apache 1 is configured to load a different version of PHP." - ewarn "To make Apache 1 use PHP v5, use php-select:" - ewarn - ewarn " php-select apache1 php5" - ewarn - fi - fi - - # Update Apache2 to use mod_php - if useq apache2 ; then - "${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 2 ]] ; then - php-select apache2 php5 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "Apache 2 is configured to load a different version of PHP." - ewarn "To make Apache 2 use PHP v5, use php-select:" - ewarn - ewarn " php-select apache2 php5" - ewarn - fi - fi - - # Create the symlinks for php-cli - if useq cli || phpconfutils_usecheck cli ; then - "${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 5 ]] ; then - php-select php php5 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "/usr/bin/php links to a different version of PHP." - ewarn "To make /usr/bin/php point to PHP v5, use php-select:" - ewarn - ewarn " php-select php php5" - ewarn - fi - fi - - # Create the symlinks for php-cgi - if useq cgi ; then - "${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1 - exitStatus=$? - if [[ ${exitStatus} == 5 ]] ; then - php-select php-cgi php5 - elif [[ ${exitStatus} == 4 ]] ; then - ewarn - ewarn "/usr/bin/php-cgi links to a different version of PHP." - ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:" - ewarn - ewarn " php-select php-cgi php5" - ewarn - fi - fi - - # Create the symlinks for php-devel - "${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1 - exitStatus=$? - if [[ $exitStatus == 5 ]] ; then - php-select php-devel php5 - elif [[ $exitStatus == 4 ]] ; then - ewarn - ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a" - ewarn "different version of PHP. To make them point to PHP v5, use" - ewarn "php-select:" - ewarn - ewarn " php-select php-devel php5" - ewarn - fi - + ewarn 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" @@ -711,7 +628,7 @@ php5_1-sapi_pkg_postinst() { fi ewarn - if useq curl; then + if useq curl ; then ewarn "Please be aware that CURL can allow the bypass of open_basedir restrictions." ewarn "This can be a security risk!" ewarn @@ -721,8 +638,8 @@ php5_1-sapi_pkg_postinst() { 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 "configurations where TEXTRELs are disabled, for example when using" + ewarn "certain PaX options in the kernel." ewarn ewarn "With PHP 5.1, some extensions were removed from PHP because" @@ -734,6 +651,7 @@ php5_1-sapi_pkg_postinst() { ewarn "and thus can now be found in dev-php5/pecl-mcve. The Ovrimos" ewarn "and Pfpro extensions were removed altogether and have no" ewarn "available substitute." + ewarn ewarn "The 'xml' and 'xml2' USE flags were unified in only the 'xml' USE" ewarn "flag. To get the features that were once controlled by the 'xml2'" diff --git a/eclass/phpconfutils.eclass b/eclass/phpconfutils.eclass index a1e9d8997714..87d9157a4176 100644 --- a/eclass/phpconfutils.eclass +++ b/eclass/phpconfutils.eclass @@ -1,13 +1,13 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/phpconfutils.eclass,v 1.3 2006/04/20 12:15:35 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/phpconfutils.eclass,v 1.4 2006/07/14 16:02:36 chtekk Exp $ # # ######################################################################## # # eclass/phpconfutils.eclass # Utility functions to help with configuring PHP # -# Based on stuart's work on the original confutils eclass +# Based on Stuart's work on the original confutils eclass # # Author(s) Luca Longinotti # <chtekk@gentoo.org> @@ -16,15 +16,11 @@ # # ======================================================================== -if [[ "${EBUILD_SUPPORTS_SHAREDEXT}" == "1" ]] ; then - IUSE="sharedext" -fi - # ======================================================================== # List of USE flags that need deps that aren't yet in Portage # or that can't be (fex. certain commercial apps) # -# You must define CONFUTILS_MISSING_DEPS if you need this +# You must define PHPCONFUTILS_MISSING_DEPS if you need this # ======================================================================== # phpconfutils_sort_flags() @@ -46,7 +42,7 @@ phpconfutils_sort_flags() { phpconfutils_init() { # Define wheter we shall support shared extensions or not - if [[ "${EBUILD_SUPPORTS_SHAREDEXT}" == "1" ]] && useq "sharedext" ; then + if useq "sharedext" ; then shared="=shared" else shared="" @@ -396,7 +392,7 @@ phpconfutils_warn_about_external_deps() { local x local my_found="0" - for x in ${CONFUTILS_MISSING_DEPS} ; do + for x in ${PHPCONFUTILS_MISSING_DEPS} ; do if useq "${x}" || phpconfutils_usecheck "${x}" ; then ewarn "USE flag ${x} enables support for software not present in Portage!" my_found="1" @@ -412,7 +408,7 @@ phpconfutils_warn_about_external_deps() { ewarn "when using one of those flags, as we aren't able to support them." ewarn "|=|=|=|=|=|=| You are on your own if you use them! |=|=|=|=|=|=|" ewarn - sleep 5 + ebeep 5 fi } |