commit:     faa43f444ebc363689ea5d0e3c8068540548f541
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 23 16:31:48 2015 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Nov 23 16:32:27 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=faa43f44

dev-lang/php: revision the 5.6.x and 7.x series to use upstream php-fpm.conf.

There are a few changes batched together here.

The main purpose of the new revisions is to stop using our bundled
php-fpm.conf (from php-5.3) and switch to the one provided by
upstream. This is bug 559116. In the 5.6.x series, this is trivial: we
just install the php-fpm.conf from the tarball. But in 7.x, upstream
has split the FPM config into pieces. Their default "include" path
needed to be changed for our slotting, so that has been done with a
`sed` in src_prepare().  We then install the split "www.conf" config
file in the location that was enshrined with `sed`.

Next, the autotools-utils eclass was dropped. The functionality from
src_configure() was inlined. This is due to the deprecation of that
eclass; see,

  https://blogs.gentoo.org/mgorny/2015/11/13/the-ultimate-guide-to-eapi-6/

Finally, the db-use eclass was dropped. It was no longer used.

Gentoo-Bug: 559116

Package-Manager: portage-2.2.20.1

 .../{php-5.6.15-r3.ebuild => php-5.6.15-r4.ebuild} | 29 +++++++--------
 ...hp-7.0.0_rc7.ebuild => php-7.0.0_rc7-r1.ebuild} | 41 +++++++++++++---------
 2 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/dev-lang/php/php-5.6.15-r3.ebuild 
b/dev-lang/php/php-5.6.15-r4.ebuild
similarity index 96%
rename from dev-lang/php/php-5.6.15-r3.ebuild
rename to dev-lang/php/php-5.6.15-r4.ebuild
index 85c79f1..0925fd3 100644
--- a/dev-lang/php/php-5.6.15-r3.ebuild
+++ b/dev-lang/php/php-5.6.15-r4.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=5
 
-inherit eutils autotools autotools-utils flag-o-matic versionator 
depend.apache apache-module db-use libtool systemd
+inherit eutils autotools flag-o-matic versionator depend.apache apache-module 
libtool systemd
 
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc 
~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux 
~ppc-macos ~x64-macos ~x86-macos"
 
@@ -262,22 +262,14 @@ php_install_ini() {
        fi
 
        # SAPI-specific handling
-
        if [[ "${sapi}" == "fpm" ]] ; then
-               [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0
-               einfo "Installing FPM CGI config file php-fpm.conf"
+               einfo "Installing FPM config file php-fpm.conf"
                insinto "${PHP_INI_DIR#${EPREFIX}}"
-               newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" 
php-fpm.conf
-
-               # Remove bogus /etc/php-fpm.conf.default (bug 359906)
-               rm -f "${ED}/etc/php-fpm.conf.default" || die
+               doins sapi/fpm/php-fpm.conf
        fi
 
-       # Install PHP ini files into /usr/share/php
-
        dodoc php.ini-development
        dodoc php.ini-production
-
 }
 
 php_set_ini_dir() {
@@ -530,8 +522,9 @@ src_configure() {
                use "${one_sapi}" || continue
                php_set_ini_dir "${one_sapi}"
 
-               # The BUILD_DIR variable is used by autotools-utils to determine
-               # where to output the files that autotools creates.
+               # The BUILD_DIR variable is used to determine where to output
+               # the files that autotools creates. This was all originally
+               # based on the autotools-utils eclass.
                BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
                cp -r "${S}" "${BUILD_DIR}" || die
                cd "${BUILD_DIR}" || die
@@ -561,12 +554,14 @@ src_configure() {
                        esac
                done
 
-               # Construct the autotools-utils $myeconfargs array by
-               # concatenating $our_conf (the common args) and $sapi_conf (the
-               # SAPI-specific args).
+               # Construct the $myeconfargs array by concatenating $our_conf
+               # (the common args) and $sapi_conf (the SAPI-specific args).
                local myeconfargs=( "${our_conf[@]}" )
                myeconfargs+=( "${sapi_conf[@]}" )
-               autotools-utils_src_configure
+
+               pushd "${BUILD_DIR}" > /dev/null || die
+               econf "${myeconfargs[@]}"
+               popd > /dev/null || die
        done
 }
 

diff --git a/dev-lang/php/php-7.0.0_rc7.ebuild 
b/dev-lang/php/php-7.0.0_rc7-r1.ebuild
similarity index 94%
rename from dev-lang/php/php-7.0.0_rc7.ebuild
rename to dev-lang/php/php-7.0.0_rc7-r1.ebuild
index 63e9778..ca638a4 100644
--- a/dev-lang/php/php-7.0.0_rc7.ebuild
+++ b/dev-lang/php/php-7.0.0_rc7-r1.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=5
 
-inherit eutils autotools autotools-utils flag-o-matic versionator 
depend.apache apache-module db-use libtool systemd
+inherit eutils autotools flag-o-matic versionator depend.apache apache-module 
libtool systemd
 
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc 
~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux 
~ppc-macos ~x64-macos ~x86-macos"
 
@@ -252,22 +252,16 @@ php_install_ini() {
        fi
 
        # SAPI-specific handling
-
        if [[ "${sapi}" == "fpm" ]] ; then
-               [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0
-               einfo "Installing FPM CGI config file php-fpm.conf"
+               einfo "Installing FPM config files php-fpm.conf and www.conf"
                insinto "${PHP_INI_DIR#${EPREFIX}}"
-               newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" 
php-fpm.conf
-
-               # Remove bogus /etc/php-fpm.conf.default (bug 359906)
-               rm -f "${ED}/etc/php-fpm.conf.default" || die
+               doins sapi/fpm/php-fpm.conf
+               insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
+               doins sapi/fpm/www.conf
        fi
 
-       # Install PHP ini files into /usr/share/php
-
        dodoc php.ini-development
        dodoc php.ini-production
-
 }
 
 php_set_ini_dir() {
@@ -305,6 +299,16 @@ 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() {
@@ -501,8 +505,9 @@ src_configure() {
                use "${one_sapi}" || continue
                php_set_ini_dir "${one_sapi}"
 
-               # The BUILD_DIR variable is used by autotools-utils to determine
-               # where to output the files that autotools creates.
+               # The BUILD_DIR variable is used to determine where to output
+               # the files that autotools creates. This was all originally
+               # based on the autotools-utils eclass.
                BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
                cp -r "${S}" "${BUILD_DIR}" || die
                cd "${BUILD_DIR}" || die
@@ -532,12 +537,14 @@ src_configure() {
                        esac
                done
 
-               # Construct the autotools-utils $myeconfargs array by
-               # concatenating $our_conf (the common args) and $sapi_conf (the
-               # SAPI-specific args).
+               # Construct the $myeconfargs array by concatenating $our_conf
+               # (the common args) and $sapi_conf (the SAPI-specific args).
                local myeconfargs=( "${our_conf[@]}" )
                myeconfargs+=( "${sapi_conf[@]}" )
-               autotools-utils_src_configure
+
+               pushd "${BUILD_DIR}" > /dev/null || die
+               econf "${myeconfargs[@]}"
+               popd > /dev/null || die
        done
 }
 

Reply via email to