dev-lang/php: new revisions to phase out PHP_INI_VERSION.
authorMichael Orlitzky <mjo@gentoo.org>
Tue, 21 Mar 2017 17:50:27 +0000 (13:50 -0400)
committerMichael Orlitzky <mjo@gentoo.org>
Tue, 21 Mar 2017 19:27:07 +0000 (15:27 -0400)
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

dev-lang/php/php-5.6.30-r2.ebuild [moved from dev-lang/php/php-5.6.30-r1.ebuild with 96% similarity]
dev-lang/php/php-7.0.17-r1.ebuild [moved from dev-lang/php/php-7.0.17.ebuild with 95% similarity]
dev-lang/php/php-7.1.3-r1.ebuild [moved from dev-lang/php/php-7.1.3.ebuild with 95% similarity]

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 fb4eafab0a7c489549980c086dbf9deca6d17cf4..bcd67542c27fdf07d0e592a897b608fa218fda54 100644 (file)
@@ -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:"
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 959f0c1d22583f420a99ba9968535bb995c95b33..0521ed7a63fe3fd69a0b1cc470072bc0bd1b1b0d 100644 (file)
@@ -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:"
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 692625bee3b3e99298537b3eed3e77829bff7029..98b84526328eda61b78e38c734b3aaed71446632 100644 (file)
@@ -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:"