dev-lang/php: revision the 5.6.x and 7.x series to use upstream php-fpm.conf.
authorMichael Orlitzky <mjo@gentoo.org>
Mon, 23 Nov 2015 16:31:48 +0000 (11:31 -0500)
committerMichael Orlitzky <mjo@gentoo.org>
Mon, 23 Nov 2015 16:32:27 +0000 (11:32 -0500)
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

dev-lang/php/php-5.6.15-r4.ebuild [moved from dev-lang/php/php-5.6.15-r3.ebuild with 96% similarity]
dev-lang/php/php-7.0.0_rc7-r1.ebuild [moved from dev-lang/php/php-7.0.0_rc7.ebuild with 94% similarity]

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 85c79f1b91a9299533e6a2c7490248e4270bd187..0925fd39e8b689d37037cc197743d51692e6b649 100644 (file)
@@ -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
 }
 
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 63e97783ede56a33eb6c58781560216441310bf2..ca638a42b682daa8bd2617640b46c967eac980a1 100644 (file)
@@ -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
 }