commit:     7cd30f93ff9444fe97fe6ed2f44979c8598cf26a
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 01:25:46 2016 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 01:26:01 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cd30f93

dev-lang/php: new edit/revision to hide some elog messages when possible.

Two of the elog messages that we show only need to be dealt with
once. If the user has the recently-emerged slot of PHP in his
PHP_TARGETS already, then we don't need to bug him about that. And if
he has PHP_INI_VERSION set to a legal value, then we don't need to
inform him about that either.

A new revision is made for the php-5.6.x series. The 7.x series is not
stable, so an in-place edit was made.

Gentoo-Bug: 440574

Package-Manager: portage-2.2.28

 .../php/{php-7.0.8.ebuild => php-5.6.23-r1.ebuild} | 117 ++++++++++++---------
 dev-lang/php/php-7.0.8.ebuild                      |  47 +++++----
 2 files changed, 92 insertions(+), 72 deletions(-)

diff --git a/dev-lang/php/php-7.0.8.ebuild b/dev-lang/php/php-5.6.23-r1.ebuild
similarity index 90%
copy from dev-lang/php/php-7.0.8.ebuild
copy to dev-lang/php/php-5.6.23-r1.ebuild
index fbc800d..0696638 100644
--- a/dev-lang/php/php-7.0.8.ebuild
+++ b/dev-lang/php/php-5.6.23-r1.ebuild
@@ -12,7 +12,7 @@ function php_get_uri ()
 {
        case "${1}" in
                "php-pre")
-                       echo "http://downloads.php.net/ab/${2}";
+                       echo "http://downloads.php.net/dsp/${2}";
                ;;
                "php")
                        echo "http://www.php.net/distributions/${2}";
@@ -56,7 +56,7 @@ LICENSE="PHP-3"
 S="${WORKDIR}/${PHP_P}"
 
 # We can build the following SAPIs in the given order
-SAPIS="embed cli cgi fpm apache2 phpdbg"
+SAPIS="embed cli cgi fpm apache2"
 
 # SAPIs and SAPI-specific USE flags (cli SAPI is default on):
 IUSE="${IUSE}
@@ -68,11 +68,11 @@ IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
        enchant exif frontbase +fileinfo +filter firebird
        flatfile ftp gd gdbm gmp +hash +iconv imap inifile
        intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
-       mhash mssql mysql mysqli nls
+       mhash mssql mysql libmysqlclient mysqli nls
        oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
        readline recode selinux +session sharedmem
        +simplexml snmp soap sockets spell sqlite ssl
-       sysvipc systemd tidy +tokenizer truetype unicode wddx webp
+       sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
        +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
 
 DEPEND="
@@ -119,6 +119,10 @@ DEPEND="${DEPEND}
        ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
        libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
        mssql? ( dev-db/freetds[mssql] )
+       libmysqlclient? (
+               mysql? ( virtual/mysql )
+               mysqli? ( >=virtual/mysql-4.1 )
+       )
        nls? ( sys-devel/gettext )
        oci8-instant-client? ( dev-db/oracle-instantclient-basic )
        odbc? ( >=dev-db/unixODBC-1.8.13 )
@@ -136,15 +140,17 @@ DEPEND="${DEPEND}
                !libressl? ( dev-libs/openssl:0 )
                libressl? ( dev-libs/libressl )
        )
+       sybase-ct? ( dev-db/freetds )
        tidy? ( app-text/htmltidy )
        truetype? (
                =media-libs/freetype-2*
+               >=media-libs/t1lib-5.0.0
                !gd? (
                        virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
        )
        unicode? ( dev-libs/oniguruma )
+       vpx? ( media-libs/libvpx )
        wddx? ( >=dev-libs/libxml2-2.6.8 )
-       webp? ( media-libs/libwebp )
        xml? ( >=dev-libs/libxml2-2.6.8 )
        xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
        xmlreader? ( >=dev-libs/libxml2-2.6.8 )
@@ -166,7 +172,7 @@ php="=${CATEGORY}/${PF}"
 REQUIRED_USE="
        cli? ( ^^ ( readline libedit ) )
        truetype? ( gd )
-       webp? ( gd )
+       vpx? ( gd )
        cjk? ( gd )
        exif? ( gd )
 
@@ -181,15 +187,18 @@ REQUIRED_USE="
        ldap-sasl? ( ldap )
        mhash? ( hash )
        phar? ( hash )
+       libmysqlclient? ( || (
+               mysql
+               mysqli
+               pdo
+       ) )
 
        qdbm? ( !gdbm )
        readline? ( !libedit )
-       recode? ( !imap !mysqli )
+       recode? ( !imap !mysql !mysqli )
        sharedmem? ( !threads )
 
-       mysql? ( || ( mysqli pdo ) )
-
-       || ( cli cgi fpm apache2 embed phpdbg )"
+       !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
 
 RDEPEND="${DEPEND}"
 
@@ -204,16 +213,12 @@ DEPEND="${DEPEND}
        >=sys-devel/libtool-1.5.18"
 
 # Allow users to install production version if they want to
+if [[ "${PHP_INI_VERSION}" == "production" ]]; then
+       PHP_INI_UPSTREAM="php.ini-production"
+else
+       PHP_INI_UPSTREAM="php.ini-development"
+fi
 
-case "${PHP_INI_VERSION}" in
-       production|development)
-               ;;
-       *)
-               PHP_INI_VERSION="development"
-               ;;
-esac
-
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
 PHP_INI_FILE="php.ini"
 
 want_apache
@@ -260,11 +265,9 @@ php_install_ini() {
 
        # SAPI-specific handling
        if [[ "${sapi}" == "fpm" ]] ; then
-               einfo "Installing FPM config files php-fpm.conf and www.conf"
+               einfo "Installing FPM config file php-fpm.conf"
                insinto "${PHP_INI_DIR#${EPREFIX}}"
                doins sapi/fpm/php-fpm.conf
-               insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
-               doins sapi/fpm/www.conf
        fi
 
        dodoc php.ini-development
@@ -287,6 +290,14 @@ src_prepare() {
        sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | 
xargs`/g' \
                -i configure.in || die "Failed to fix server platform name"
 
+       # Prevent PHP from activating the Apache config,
+       # as we will do that ourselves
+       sed -i \
+               -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
+               -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
+               configure sapi/apache2filter/config.m4 
sapi/apache2handler/config.m4 \
+               || die
+
        # Patch PHP to support heimdal instead of mit-krb5
        if has_version "app-crypt/heimdal" ; then
                sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
@@ -306,16 +317,6 @@ src_prepare() {
                # http://bugs.php.net/bug.php?id=48795, bug #343481
                sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
        fi
-
-       # In php-7.x, the FPM pool configuration files have been split off
-       # of the main config. By default the pool config files go in
-       # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
-       # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
-       # we'll install the pool configuration file "www.conf" there.
-       php_set_ini_dir fpm
-       sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
-               sapi/fpm/php-fpm.conf.in \
-               || die 'failed to move the include directory in php-fpm.conf'
 }
 
 src_configure() {
@@ -363,6 +364,7 @@ src_configure() {
                $(use_with xml libxml-dir "${EPREFIX}/usr")
                $(use_enable unicode mbstring)
                $(use_with crypt mcrypt "${EPREFIX}/usr")
+               $(use_with mssql mssql "${EPREFIX}/usr")
                $(use_with unicode onig "${EPREFIX}/usr")
                $(use_with ssl openssl "${EPREFIX}/usr")
                $(use_with ssl openssl-dir "${EPREFIX}/usr")
@@ -380,6 +382,7 @@ src_configure() {
                $(use_enable soap soap)
                $(use_enable sockets sockets)
                $(use_with sqlite sqlite3 "${EPREFIX}/usr")
+               $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
                $(use_enable sysvipc sysvmsg)
                $(use_enable sysvipc sysvsem)
                $(use_enable sysvipc sysvshm)
@@ -416,14 +419,13 @@ src_configure() {
        # Support for the GD graphics library
        our_conf+=(
                $(use_with truetype freetype-dir "${EPREFIX}/usr")
+               $(use_with truetype t1lib "${EPREFIX}/usr")
                $(use_enable cjk gd-jis-conv)
                $(use_with gd jpeg-dir "${EPREFIX}/usr")
                $(use_with gd png-dir "${EPREFIX}/usr")
                $(use_with xpm xpm-dir "${EPREFIX}/usr")
+               $(use_with vpx vpx-dir "${EPREFIX}/usr")
        )
-       if use webp; then
-               our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
-       fi
        # enable gd last, so configure can pick up the previous settings
        our_conf+=( $(use_with gd gd) )
 
@@ -449,7 +451,10 @@ src_configure() {
        # MySQL support
        local mysqllib="mysqlnd"
        local mysqlilib="mysqlnd"
+       use libmysqlclient && mysqllib="${EPREFIX}/usr"
+       use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
 
+       our_conf+=( $(use_with mysql mysql "${mysqllib}") )
        our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
 
        local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
@@ -469,7 +474,7 @@ src_configure() {
        # PDO support
        if use pdo ; then
                our_conf+=(
-                       $(use_with mssql pdo-dblib "${EPREFIX}/usr")
+                       $(use_with mssql pdo-dblib)
                        $(use_with mysql pdo-mysql "${mysqllib}")
                        $(use_with postgres pdo-pgsql)
                        $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
@@ -533,7 +538,7 @@ src_configure() {
 
                for sapi in $SAPIS ; do
                        case "$sapi" in
-                               cli|cgi|embed|fpm|phpdbg)
+                               cli|cgi|embed|fpm)
                                        if [[ "${one_sapi}" == "${sapi}" ]] ; 
then
                                                sapi_conf+=( "--enable-${sapi}" 
)
                                        else
@@ -614,7 +619,7 @@ src_install() {
                                # We're specifically not using emake 
install-sapi as libtool
                                # may cause unnecessary relink failures (see 
bug #351266)
                                insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
-                               newins ".libs/libphp${PHP_MV}$(get_libname)" \
+                               newins ".libs/libphp5$(get_libname)" \
                                           "libphp${PHP_MV}$(get_libname)"
                                keepdir "/usr/$(get_libdir)/apache2/modules"
                        else
@@ -634,9 +639,6 @@ src_install() {
                                        embed)
                                                
source="libs/libphp${PHP_MV}$(get_libname)"
                                                ;;
-                                       phpdbg)
-                                               source="sapi/phpdbg/phpdbg"
-                                               ;;
                                        *)
                                                die "unhandled sapi in 
src_install"
                                                ;;
@@ -770,17 +772,28 @@ pkg_postinst() {
        # supposed to remove that dead link per bug 572436.
        eselect php cleanup || die
 
-       elog "To build extensions for this version of PHP, you will need to"
-       elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
-       elog
-       elog "This ebuild installed a version of php.ini based on"
-       elog "php.ini-${PHP_INI_VERSION}. You can choose which version of"
-       elog "php.ini to install by default by setting PHP_INI_VERSION"
-       elog "to either 'production' or 'development' in your make.conf."
-       elog "Both versions of php.ini can be found with the PHP docs in"
-       elog "${EPREFIX}/usr/share/doc/${PF}"
-       elog
-       elog "For more details on how version slotting works, please see"
+       if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
+          elog "To build extensions for this version of PHP, you will need to"
+          elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
+          elog
+       fi
+
+       # Only mention PHP_INI_VERSION if the user doesn't have it set.
+       case "${PHP_INI_VERSION}" in
+               production|development)
+               ;;
+       *)
+               elog "This ebuild installed a version of php.ini based on"
+               elog "${PHP_INI_UPSTREAM}. You can choose which version of"
+               elog "php.ini to install by default by setting PHP_INI_VERSION"
+               elog "to either 'production' or 'development' in your 
make.conf."
+               elog "Both versions of php.ini can be found with the PHP docs 
in"
+               elog "${EPREFIX}/usr/share/doc/${PF}"
+               elog
+               ;;
+       esac
+
+       elog "For details on how version slotting works, please see"
        elog "the wiki:"
        elog
        elog "  https://wiki.gentoo.org/wiki/PHP";

diff --git a/dev-lang/php/php-7.0.8.ebuild b/dev-lang/php/php-7.0.8.ebuild
index fbc800d..5925bb3 100644
--- a/dev-lang/php/php-7.0.8.ebuild
+++ b/dev-lang/php/php-7.0.8.ebuild
@@ -204,16 +204,12 @@ DEPEND="${DEPEND}
        >=sys-devel/libtool-1.5.18"
 
 # Allow users to install production version if they want to
+if [[ "${PHP_INI_VERSION}" == "production" ]]; then
+       PHP_INI_UPSTREAM="php.ini-production"
+else
+       PHP_INI_UPSTREAM="php.ini-development"
+fi
 
-case "${PHP_INI_VERSION}" in
-       production|development)
-               ;;
-       *)
-               PHP_INI_VERSION="development"
-               ;;
-esac
-
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
 PHP_INI_FILE="php.ini"
 
 want_apache
@@ -770,17 +766,28 @@ pkg_postinst() {
        # supposed to remove that dead link per bug 572436.
        eselect php cleanup || die
 
-       elog "To build extensions for this version of PHP, you will need to"
-       elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
-       elog
-       elog "This ebuild installed a version of php.ini based on"
-       elog "php.ini-${PHP_INI_VERSION}. You can choose which version of"
-       elog "php.ini to install by default by setting PHP_INI_VERSION"
-       elog "to either 'production' or 'development' in your make.conf."
-       elog "Both versions of php.ini can be found with the PHP docs in"
-       elog "${EPREFIX}/usr/share/doc/${PF}"
-       elog
-       elog "For more details on how version slotting works, please see"
+       if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
+          elog "To build extensions for this version of PHP, you will need to"
+          elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
+          elog
+       fi
+
+       # Only mention PHP_INI_VERSION if the user doesn't have it set.
+       case "${PHP_INI_VERSION}" in
+               production|development)
+               ;;
+       *)
+               elog "This ebuild installed a version of php.ini based on"
+               elog "${PHP_INI_UPSTREAM}. You can choose which version of"
+               elog "php.ini to install by default by setting PHP_INI_VERSION"
+               elog "to either 'production' or 'development' in your 
make.conf."
+               elog "Both versions of php.ini can be found with the PHP docs 
in"
+               elog "${EPREFIX}/usr/share/doc/${PF}"
+               elog
+               ;;
+       esac
+
+       elog "For details on how version slotting works, please see"
        elog "the wiki:"
        elog
        elog "  https://wiki.gentoo.org/wiki/PHP";

Reply via email to