Skip to content

Commit

Permalink
dev-lang/php: revision the 5.6.x and 7.x series to use upstream php-f…
Browse files Browse the repository at this point in the history
…pm.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
  • Loading branch information
orlitzky committed Nov 23, 2015
1 parent 8ed6f86 commit faa43f4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit faa43f4

Please sign in to comment.