commit:     eb52e5fc00c55bb18c93beca65e3bf97a1f7ad45
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 21 17:50:27 2017 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 19:27:07 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb52e5fc

dev-lang/php: new revisions to phase out PHP_INI_VERSION.

These three new revisions install the "production" version of php.ini
unconditionally. The changes between the two versions are minimal
anway, and the production version is safer for people who don't care.

A warning will be emitted for users who still have the variable set.

In addition, the 5.6 and 7.0 series will now cache their ./configure
test results. This is based on a similar change made in 7.1, and
should speed up the build a little.

Gentoo-Bug: 530002
Gentoo-Bug: 611214

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../{php-5.6.30-r1.ebuild => php-5.6.30-r2.ebuild} | 44 +++++++++------------
 .../{php-7.0.17.ebuild => php-7.0.17-r1.ebuild}    | 44 +++++++++------------
 .../php/{php-7.1.3.ebuild => php-7.1.3-r1.ebuild}  | 46 +++++++++-------------
 3 files changed, 55 insertions(+), 79 deletions(-)

diff --git a/dev-lang/php/php-5.6.30-r1.ebuild 
b/dev-lang/php/php-5.6.30-r2.ebuild
similarity index 96%
rename from dev-lang/php/php-5.6.30-r1.ebuild
rename to dev-lang/php/php-5.6.30-r2.ebuild
index fb4eafab0a7..bcd67542c27 100644
--- a/dev-lang/php/php-5.6.30-r1.ebuild
+++ b/dev-lang/php/php-5.6.30-r2.ebuild
@@ -177,27 +177,22 @@ REQUIRED_USE="
 
 PHP_MV="$(get_major_version)"
 
-# 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
-
 php_install_ini() {
        local phpsapi="${1}"
 
        # work out where we are installing the ini file
        php_set_ini_dir "${phpsapi}"
 
-       local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
-       cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
+       # Always install the production INI file, bug 611214.
+       local phpinisrc="php.ini-production-${phpsapi}"
+       cp php.ini-production "${phpinisrc}" || die
 
        # default to /tmp for save_path, bug #282768
        sed -e 's|^;session.save_path .*$|session.save_path = 
"'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
 
        # Set the extension dir
-       sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i 
"${phpinisrc}" || die
+       sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+               -i "${phpinisrc}" || die
 
        # Set the include path to point to where we want to find PEAR packages
        sed -e 's|^;include_path = ".:/php/includes".*|include_path = 
".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i 
"${phpinisrc}" || die
@@ -227,8 +222,7 @@ php_install_ini() {
                doins sapi/fpm/php-fpm.conf
        fi
 
-       dodoc php.ini-development
-       dodoc php.ini-production
+       dodoc php.ini-{development,production}
 }
 
 php_set_ini_dir() {
@@ -473,6 +467,9 @@ src_configure() {
        # Changed order to run it in reverse for bug #32022 and #12021.
        replace-cpu-flags "k6*" "i586"
 
+       # Cache the ./configure test results between SAPIs.
+       our_conf+=( --cache-file="${T}/config.cache" )
+
        # Support user-passed configuration parameters
        our_conf+=( ${EXTRA_ECONF:-} )
 
@@ -744,20 +741,15 @@ pkg_postinst() {
           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
+       # Warn about the removal of PHP_INI_VERSION if the user has it set.
+       if [[ -n "${PHP_INI_VERSION}" ]]; then
+               ewarn 'The PHP_INI_VERSION variable has been phased out. You 
may'
+               ewarn 'remove it from your configuration at your convenience. 
See'
+               ewarn
+               ewarn '  https://bugs.gentoo.org/611214'
+               ewarn
+               ewarn 'for more information.'
+       fi
 
        elog "For details on how version slotting works, please see"
        elog "the wiki:"

diff --git a/dev-lang/php/php-7.0.17.ebuild b/dev-lang/php/php-7.0.17-r1.ebuild
similarity index 95%
rename from dev-lang/php/php-7.0.17.ebuild
rename to dev-lang/php/php-7.0.17-r1.ebuild
index 959f0c1d225..0521ed7a63f 100644
--- a/dev-lang/php/php-7.0.17.ebuild
+++ b/dev-lang/php/php-7.0.17-r1.ebuild
@@ -164,27 +164,22 @@ REQUIRED_USE="
 
 PHP_MV="$(get_major_version)"
 
-# 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
-
 php_install_ini() {
        local phpsapi="${1}"
 
        # work out where we are installing the ini file
        php_set_ini_dir "${phpsapi}"
 
-       local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
-       cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
+       # Always install the production INI file, bug 611214.
+       local phpinisrc="php.ini-production-${phpsapi}"
+       cp php.ini-production "${phpinisrc}" || die
 
        # default to /tmp for save_path, bug #282768
        sed -e 's|^;session.save_path .*$|session.save_path = 
"'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
 
        # Set the extension dir
-       sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i 
"${phpinisrc}" || die
+       sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+               -i "${phpinisrc}" || die
 
        # Set the include path to point to where we want to find PEAR packages
        sed -e 's|^;include_path = ".:/php/includes".*|include_path = 
".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i 
"${phpinisrc}" || die
@@ -216,8 +211,7 @@ php_install_ini() {
                doins sapi/fpm/www.conf
        fi
 
-       dodoc php.ini-development
-       dodoc php.ini-production
+       dodoc php.ini-{development,production}
 }
 
 php_set_ini_dir() {
@@ -432,6 +426,9 @@ src_configure() {
        # Changed order to run it in reverse for bug #32022 and #12021.
        replace-cpu-flags "k6*" "i586"
 
+       # Cache the ./configure test results between SAPIs.
+       our_conf+=( --cache-file="${T}/config.cache" )
+
        # Support user-passed configuration parameters
        our_conf+=( ${EXTRA_ECONF:-} )
 
@@ -710,20 +707,15 @@ pkg_postinst() {
           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
+       # Warn about the removal of PHP_INI_VERSION if the user has it set.
+       if [[ -n "${PHP_INI_VERSION}" ]]; then
+               ewarn 'The PHP_INI_VERSION variable has been phased out. You 
may'
+               ewarn 'remove it from your configuration at your convenience. 
See'
+               ewarn
+               ewarn '  https://bugs.gentoo.org/611214'
+               ewarn
+               ewarn 'for more information.'
+       fi
 
        elog "For details on how version slotting works, please see"
        elog "the wiki:"

diff --git a/dev-lang/php/php-7.1.3.ebuild b/dev-lang/php/php-7.1.3-r1.ebuild
similarity index 95%
rename from dev-lang/php/php-7.1.3.ebuild
rename to dev-lang/php/php-7.1.3-r1.ebuild
index 692625bee3b..98b84526328 100644
--- a/dev-lang/php/php-7.1.3.ebuild
+++ b/dev-lang/php/php-7.1.3-r1.ebuild
@@ -164,27 +164,22 @@ REQUIRED_USE="
 
 PHP_MV="$(get_major_version)"
 
-# 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
-
 php_install_ini() {
        local phpsapi="${1}"
 
        # work out where we are installing the ini file
        php_set_ini_dir "${phpsapi}"
 
-       local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
-       cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
+       # Always install the production INI file, bug 611214.
+       local phpinisrc="php.ini-production-${phpsapi}"
+       cp php.ini-production "${phpinisrc}" || die
 
        # default to /tmp for save_path, bug #282768
        sed -e 's|^;session.save_path .*$|session.save_path = 
"'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
 
        # Set the extension dir
-       sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i 
"${phpinisrc}" || die
+       sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+               -i "${phpinisrc}" || die
 
        # Set the include path to point to where we want to find PEAR packages
        sed -e 's|^;include_path = ".:/php/includes".*|include_path = 
".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i 
"${phpinisrc}" || die
@@ -216,8 +211,7 @@ php_install_ini() {
                doins sapi/fpm/www.conf
        fi
 
-       dodoc php.ini-development
-       dodoc php.ini-production
+       dodoc php.ini-{development,production}
 }
 
 php_set_ini_dir() {
@@ -432,8 +426,11 @@ src_configure() {
        # Changed order to run it in reverse for bug #32022 and #12021.
        replace-cpu-flags "k6*" "i586"
 
+       # Cache the ./configure test results between SAPIs.
+       our_conf+=( --cache-file="${T}/config.cache" )
+
        # Support user-passed configuration parameters
-       our_conf+=( --cache-file="${T}/config.cache" ${EXTRA_ECONF:-} )
+       our_conf+=( ${EXTRA_ECONF:-} )
 
        # Support the Apache2 extras, they must be set globally for all
        # SAPIs to work correctly, especially for external PHP extensions
@@ -710,20 +707,15 @@ pkg_postinst() {
           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
+       # Warn about the removal of PHP_INI_VERSION if the user has it set.
+       if [[ -n "${PHP_INI_VERSION}" ]]; then
+               ewarn 'The PHP_INI_VERSION variable has been phased out. You 
may'
+               ewarn 'remove it from your configuration at your convenience. 
See'
+               ewarn
+               ewarn '  https://bugs.gentoo.org/611214'
+               ewarn
+               ewarn 'for more information.'
+       fi
 
        elog "For details on how version slotting works, please see"
        elog "the wiki:"

Reply via email to