Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Sun, 03 Sep 2017 21:34:34
Message-Id: 1504474449.6190a9e9d5365b3555e61b602d7f62337bd37882.mjo@gentoo
1 commit: 6190a9e9d5365b3555e61b602d7f62337bd37882
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 3 21:33:20 2017 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 3 21:34:09 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6190a9e9
7
8 dev-lang/php: remove php-7.1.8 to fix CVE-2017-12932.
9
10 Gentoo-Bug: 629452
11
12 Package-Manager: Portage-2.3.6, Repoman-2.3.1
13
14 dev-lang/php/Manifest | 1 -
15 dev-lang/php/php-7.1.8.ebuild | 721 ------------------------------------------
16 2 files changed, 722 deletions(-)
17
18 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
19 index bb66f9069e2..323f498eca6 100644
20 --- a/dev-lang/php/Manifest
21 +++ b/dev-lang/php/Manifest
22 @@ -4,6 +4,5 @@ DIST php-7.0.15.tar.xz 12575116 SHA256 300364d57fc4a6176ff7d52d390ee870ab6e30df1
23 DIST php-7.0.19.tar.xz 12595396 SHA256 640e5e3377d15a6d19adce2b94a9d876eeddabdb862d154a5e347987f4225ef6 SHA512 7e926ef791cc511b28a92fc6ad9e66cc5abbee0506f1318f55b18134834212f6af7ff38df3cbaf25c36b0f5c5dabf8c00a55cf2aedf48c76952b687be114720e WHIRLPOOL c717c821596c8ce8ee676030c6949e449797a9887e9b81c55d11af50a69afc36e93dde6ea599436af2048a099ab79b1c8b165842e1593f4cae3f74ff0f70c64c
24 DIST php-7.0.21.tar.xz 12626276 SHA256 6713fe3024365d661593235b525235045ef81f18d0043654658c9de1bcb8b9e3 SHA512 6fabbadc6076622628e5c408c1be546982412f56b631285f6abe4a98cedc2bbb5d05f4c1c14b07a7e0a04e24270a8a0d7361baa4f42a2232703baee70934ec34 WHIRLPOOL 4f2fbbdb2eca5515721f21924df3bf00d61a2856c06d15c46b5e7592700b7a036dc58f3745a20bb5b908469b1007b293c91ebd0c17cd60372a1b392fc9e0a8bb
25 DIST php-7.0.23.tar.xz 11953100 SHA256 8e526e3551a58e00c8055fa4a72804aa1bd3ee1c0411b25bf1504cc4992609df SHA512 62201592fca88fb1c302badf7e73e5d417e9a062300e0d32fdfcb346d300cd86bf957b880a73795037a332fe148b64589bb15204bdd6b0ddcbbddc5a12e6d042 WHIRLPOOL 5d6131b5d7701b01c1aa849c6b5e3b133b4276999354eccecf847675552eb0be79a68cd0a10595c64bda2594489d3699868b4ed9a1fe3c5cdcc4fda45be32493
26 -DIST php-7.1.8.tar.xz 12874840 SHA256 8943858738604acb33ecedb865d6c4051eeffe4e2d06f3a3c8f794daccaa2aab SHA512 89345cf6983ddac498a612e6b63e57b84917f2e55ef9cbd3ba7eb4db9dd8f3d083dd6fdb288bcdf373ca67441fbbe84e16b643659df867984f72d79e446f2823 WHIRLPOOL db3fd86145975fd247a45be642edf6a03ede3e5b87485fa3d2beece2c18d50bdf87523a30ee0595084d0f6fd941977b5eacfa5e733c760ed9ee7cd4f6b467a64
27 DIST php-7.1.9.tar.xz 12157172 SHA256 ec9ca348dd51f19a84dc5d33acfff1fba1f977300604bdac08ed46ae2c281e8c SHA512 feefaae7edda115c9c10d6a07a9d897343ca972e4e5ec327f383cb28f204ac10956653fc120f0474901e59f32f105dc1a7afe64d49a3ea8bf486377837618013 WHIRLPOOL 5179ca1adddb099a3d8dccc009a96202f6d69edeea3126a5f861498475f36413f0a17a6a501b1b0eadba3acfb4ff262a8a5a7ee324043f03d74e857d1dc7c6a8
28 DIST php-7.2.0RC1.tar.xz 11970504 SHA256 04f68d9accb60e56adecc34a80b84bde16edb255a13eef701ea2d6c2b13dc15b SHA512 0b342416df181f7e67174e9be899e1db1d621630366b7b27a3568a076e7eae4b1f7bf08093f39cf8a3adc9698cf35a66c4b59a6014c7cbb2d4d00e4c1cf2618d WHIRLPOOL 63ecc092b7b96f1bb68c4c003d0627640eba46cac2f6b6ee2e5664ff4a3c347765ea117722b9bf607331d185c0a162bb0ce34308cd8749cedf0e9653120aa755
29
30 diff --git a/dev-lang/php/php-7.1.8.ebuild b/dev-lang/php/php-7.1.8.ebuild
31 deleted file mode 100644
32 index 054f5bdb63e..00000000000
33 --- a/dev-lang/php/php-7.1.8.ebuild
34 +++ /dev/null
35 @@ -1,721 +0,0 @@
36 -# Copyright 1999-2017 Gentoo Foundation
37 -# Distributed under the terms of the GNU General Public License v2
38 -
39 -EAPI=6
40 -
41 -inherit flag-o-matic versionator systemd
42 -
43 -DESCRIPTION="The PHP language runtime engine"
44 -HOMEPAGE="http://php.net/"
45 -SRC_URI="http://php.net/distributions/${P}.tar.xz"
46 -
47 -LICENSE="PHP-3.01
48 - BSD
49 - Zend-2.0
50 - bcmath? ( LGPL-2.1+ )
51 - fpm? ( BSD-2 )
52 - gd? ( gd )
53 - unicode? ( BSD-2 LGPL-2.1 )"
54 -
55 -SLOT="$(get_version_component_range 1-2)"
56 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
57 -
58 -# We can build the following SAPIs in the given order
59 -SAPIS="embed cli cgi fpm apache2 phpdbg"
60 -
61 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
62 -IUSE="${IUSE}
63 - ${SAPIS/cli/+cli}
64 - threads"
65 -
66 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
67 - coverage crypt +ctype curl debug
68 - enchant exif +fileinfo +filter firebird
69 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
70 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
71 - mhash mssql mysql mysqli nls
72 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
73 - readline recode selinux +session sharedmem
74 - +simplexml snmp soap sockets spell sqlite ssl
75 - sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
76 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
77 -
78 -# The supported (that is, autodetected) versions of BDB are listed in
79 -# the ./configure script. Other versions *work*, but we need to stick to
80 -# the ones that can be detected to avoid a repeat of bug #564824.
81 -COMMON_DEPEND="
82 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
83 - >=dev-libs/libpcre-8.32[unicode]
84 - acl? ( sys-apps/acl )
85 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
86 - <www-servers/apache-2.4[threads=] ) )
87 - berkdb? ( || ( sys-libs/db:5.3
88 - sys-libs/db:5.1
89 - sys-libs/db:4.8
90 - sys-libs/db:4.7
91 - sys-libs/db:4.6
92 - sys-libs/db:4.5 ) )
93 - bzip2? ( app-arch/bzip2 )
94 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
95 - coverage? ( dev-util/lcov )
96 - crypt? ( >=dev-libs/libmcrypt-2.4 )
97 - curl? ( >=net-misc/curl-7.10.5 )
98 - enchant? ( app-text/enchant )
99 - firebird? ( dev-db/firebird )
100 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
101 - gdbm? ( >=sys-libs/gdbm-1.8.0 )
102 - gmp? ( dev-libs/gmp:0 )
103 - iconv? ( virtual/libiconv )
104 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
105 - intl? ( dev-libs/icu:= )
106 - iodbc? ( dev-db/libiodbc )
107 - kerberos? ( virtual/krb5 )
108 - ldap? ( >=net-nds/openldap-1.2.11 )
109 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
110 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
111 - mssql? ( dev-db/freetds[mssql] )
112 - nls? ( sys-devel/gettext )
113 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
114 - odbc? ( >=dev-db/unixODBC-1.8.13 )
115 - postgres? ( dev-db/postgresql:* )
116 - qdbm? ( dev-db/qdbm )
117 - readline? ( sys-libs/readline:0= )
118 - recode? ( app-text/recode )
119 - sharedmem? ( dev-libs/mm )
120 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
121 - snmp? ( >=net-analyzer/net-snmp-5.2 )
122 - soap? ( >=dev-libs/libxml2-2.6.8 )
123 - spell? ( >=app-text/aspell-0.50 )
124 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
125 - ssl? (
126 - !libressl? ( dev-libs/openssl:0 )
127 - libressl? ( dev-libs/libressl )
128 - )
129 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
130 - truetype? ( =media-libs/freetype-2* )
131 - unicode? ( dev-libs/oniguruma:= )
132 - wddx? ( >=dev-libs/libxml2-2.6.8 )
133 - webp? ( media-libs/libwebp )
134 - xml? ( >=dev-libs/libxml2-2.6.8 )
135 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
136 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
137 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
138 - xpm? ( x11-libs/libXpm )
139 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
140 - zip? ( sys-libs/zlib )
141 - zlib? ( sys-libs/zlib )
142 -"
143 -
144 -RDEPEND="${COMMON_DEPEND}
145 - virtual/mta
146 - fpm? (
147 - selinux? ( sec-policy/selinux-phpfpm )
148 - systemd? ( sys-apps/systemd ) )"
149 -
150 -# Bison isn't actually needed when building from a release tarball
151 -# However, the configure script will warn if it's absent or if you
152 -# have an incompatible version installed. See bug 593278.
153 -DEPEND="${COMMON_DEPEND}
154 - app-arch/xz-utils
155 - >=sys-devel/bison-3.0.1"
156 -
157 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
158 -REQUIRED_USE="
159 - || ( cli cgi fpm apache2 embed phpdbg )
160 - cli? ( ^^ ( readline libedit ) )
161 - truetype? ( gd )
162 - webp? ( gd )
163 - cjk? ( gd )
164 - exif? ( gd )
165 - xpm? ( gd )
166 - gd? ( zlib )
167 - simplexml? ( xml )
168 - soap? ( xml )
169 - wddx? ( xml )
170 - xmlrpc? ( || ( xml iconv ) )
171 - xmlreader? ( xml )
172 - xslt? ( xml )
173 - ldap-sasl? ( ldap )
174 - mhash? ( hash )
175 - phar? ( hash )
176 - qdbm? ( !gdbm )
177 - readline? ( !libedit )
178 - recode? ( !imap !mysqli !mysql )
179 - sharedmem? ( !threads )
180 - mysql? ( || ( mysqli pdo ) )
181 -"
182 -
183 -PHP_MV="$(get_major_version)"
184 -
185 -php_install_ini() {
186 - local phpsapi="${1}"
187 -
188 - # work out where we are installing the ini file
189 - php_set_ini_dir "${phpsapi}"
190 -
191 - # Always install the production INI file, bug 611214.
192 - local phpinisrc="php.ini-production-${phpsapi}"
193 - cp php.ini-production "${phpinisrc}" || die
194 -
195 - # default to /tmp for save_path, bug #282768
196 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
197 -
198 - # Set the extension dir
199 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
200 - -i "${phpinisrc}" || die
201 -
202 - # Set the include path to point to where we want to find PEAR packages
203 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
204 -
205 - dodir "${PHP_INI_DIR#${EPREFIX}}"
206 - insinto "${PHP_INI_DIR#${EPREFIX}}"
207 - newins "${phpinisrc}" php.ini
208 -
209 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
210 - elog
211 -
212 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
213 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
214 -
215 - if use opcache; then
216 - elog "Adding opcache to $PHP_EXT_INI_DIR"
217 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
218 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
219 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
220 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
221 - fi
222 -
223 - # SAPI-specific handling
224 - if [[ "${sapi}" == "fpm" ]] ; then
225 - einfo "Installing FPM config files php-fpm.conf and www.conf"
226 - insinto "${PHP_INI_DIR#${EPREFIX}}"
227 - doins sapi/fpm/php-fpm.conf
228 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
229 - doins sapi/fpm/www.conf
230 - fi
231 -
232 - dodoc php.ini-{development,production}
233 -}
234 -
235 -php_set_ini_dir() {
236 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
237 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
238 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
239 -}
240 -
241 -src_prepare() {
242 - default
243 -
244 - # In php-7.x, the FPM pool configuration files have been split off
245 - # of the main config. By default the pool config files go in
246 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
247 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
248 - # we'll install the pool configuration file "www.conf" there.
249 - php_set_ini_dir fpm
250 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
251 - sapi/fpm/php-fpm.conf.in \
252 - || die 'failed to move the include directory in php-fpm.conf'
253 -}
254 -
255 -src_configure() {
256 - addpredict /usr/share/snmp/mibs/.index
257 - addpredict /var/lib/net-snmp/mib_indexes
258 -
259 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
260 -
261 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
262 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
263 - local our_conf=(
264 - --prefix="${PHP_DESTDIR}"
265 - --mandir="${PHP_DESTDIR}/man"
266 - --infodir="${PHP_DESTDIR}/info"
267 - --libdir="${PHP_DESTDIR}/lib"
268 - --with-libdir="$(get_libdir)"
269 - --localstatedir="${EPREFIX}/var"
270 - --without-pear
271 - $(use_enable threads maintainer-zts)
272 - )
273 -
274 - our_conf+=(
275 - $(use_with acl fpm-acl)
276 - $(use_enable bcmath bcmath)
277 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
278 - $(use_enable calendar calendar)
279 - $(use_enable coverage gcov)
280 - $(use_enable ctype ctype)
281 - $(use_with curl curl "${EPREFIX}/usr")
282 - $(use_enable xml dom)
283 - $(use_with enchant enchant "${EPREFIX}/usr")
284 - $(use_enable exif exif)
285 - $(use_enable fileinfo fileinfo)
286 - $(use_enable filter filter)
287 - $(use_enable ftp ftp)
288 - $(use_with nls gettext "${EPREFIX}/usr")
289 - $(use_with gmp gmp "${EPREFIX}/usr")
290 - $(use_enable hash hash)
291 - $(use_with mhash mhash "${EPREFIX}/usr")
292 - $(use_with iconv iconv \
293 - $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
294 - $(use_enable intl intl)
295 - $(use_enable ipv6 ipv6)
296 - $(use_enable json json)
297 - $(use_with kerberos kerberos "${EPREFIX}/usr")
298 - $(use_enable xml libxml)
299 - $(use_with xml libxml-dir "${EPREFIX}/usr")
300 - $(use_enable unicode mbstring)
301 - $(use_with crypt mcrypt "${EPREFIX}/usr")
302 - $(use_with unicode onig "${EPREFIX}/usr")
303 - $(use_with ssl openssl "${EPREFIX}/usr")
304 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
305 - $(use_enable pcntl pcntl)
306 - $(use_enable phar phar)
307 - $(use_enable pdo pdo)
308 - $(use_enable opcache opcache)
309 - $(use_with postgres pgsql "${EPREFIX}/usr")
310 - $(use_enable posix posix)
311 - $(use_with spell pspell "${EPREFIX}/usr")
312 - $(use_with recode recode "${EPREFIX}/usr")
313 - $(use_enable simplexml simplexml)
314 - $(use_enable sharedmem shmop)
315 - $(use_with snmp snmp "${EPREFIX}/usr")
316 - $(use_enable soap soap)
317 - $(use_enable sockets sockets)
318 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
319 - $(use_enable sysvipc sysvmsg)
320 - $(use_enable sysvipc sysvsem)
321 - $(use_enable sysvipc sysvshm)
322 - $(use_with systemd fpm-systemd)
323 - $(use_with tidy tidy "${EPREFIX}/usr")
324 - $(use_enable tokenizer tokenizer)
325 - $(use_enable wddx wddx)
326 - $(use_enable xml xml)
327 - $(use_enable xmlreader xmlreader)
328 - $(use_enable xmlwriter xmlwriter)
329 - $(use_with xmlrpc xmlrpc)
330 - $(use_with xslt xsl "${EPREFIX}/usr")
331 - $(use_enable zip zip)
332 - $(use_with zlib zlib "${EPREFIX}/usr")
333 - $(use_enable debug debug)
334 - )
335 -
336 - # DBA support
337 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
338 - || use qdbm ; then
339 - our_conf+=( "--enable-dba${shared}" )
340 - fi
341 -
342 - # DBA drivers support
343 - our_conf+=(
344 - $(use_with cdb cdb)
345 - $(use_with berkdb db4 "${EPREFIX}/usr")
346 - $(use_enable flatfile flatfile)
347 - $(use_with gdbm gdbm "${EPREFIX}/usr")
348 - $(use_enable inifile inifile)
349 - $(use_with qdbm qdbm "${EPREFIX}/usr")
350 - )
351 -
352 - # Support for the GD graphics library
353 - our_conf+=(
354 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
355 - $(use_enable cjk gd-jis-conv)
356 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
357 - $(use_with gd png-dir "${EPREFIX}/usr")
358 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
359 - )
360 - if use webp; then
361 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
362 - fi
363 - # enable gd last, so configure can pick up the previous settings
364 - our_conf+=( $(use_with gd gd) )
365 -
366 - # IMAP support
367 - if use imap ; then
368 - our_conf+=(
369 - $(use_with imap imap "${EPREFIX}/usr")
370 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
371 - )
372 - fi
373 -
374 - # Interbase/firebird support
375 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
376 -
377 - # LDAP support
378 - if use ldap ; then
379 - our_conf+=(
380 - $(use_with ldap ldap "${EPREFIX}/usr")
381 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
382 - )
383 - fi
384 -
385 - # MySQL support
386 - local mysqllib="mysqlnd"
387 - local mysqlilib="mysqlnd"
388 -
389 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
390 -
391 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
392 - if use mysql || use mysqli ; then
393 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
394 - fi
395 -
396 - # ODBC support
397 - our_conf+=(
398 - $(use_with odbc unixODBC "${EPREFIX}/usr")
399 - $(use_with iodbc iodbc "${EPREFIX}/usr")
400 - )
401 -
402 - # Oracle support
403 - our_conf+=( $(use_with oci8-instant-client oci8) )
404 -
405 - # PDO support
406 - if use pdo ; then
407 - our_conf+=(
408 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
409 - $(use_with mysql pdo-mysql "${mysqllib}")
410 - $(use_with postgres pdo-pgsql)
411 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
412 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
413 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
414 - $(use_with oci8-instant-client pdo-oci)
415 - )
416 - fi
417 -
418 - # readline/libedit support
419 - our_conf+=(
420 - $(use_with readline readline "${EPREFIX}/usr")
421 - $(use_with libedit libedit "${EPREFIX}/usr")
422 - )
423 -
424 - # Session support
425 - if use session ; then
426 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
427 - else
428 - our_conf+=( $(use_enable session session) )
429 - fi
430 -
431 - # Use pic for shared modules such as apache2's mod_php
432 - our_conf+=( --with-pic )
433 -
434 - # we use the system copy of pcre
435 - # --with-pcre-regex affects ext/pcre
436 - # --with-pcre-dir affects ext/filter and ext/zip
437 - our_conf+=(
438 - --with-pcre-regex="${EPREFIX}/usr"
439 - --with-pcre-dir="${EPREFIX}/usr"
440 - )
441 -
442 - # Catch CFLAGS problems
443 - # Fixes bug #14067.
444 - # Changed order to run it in reverse for bug #32022 and #12021.
445 - replace-cpu-flags "k6*" "i586"
446 -
447 - # Cache the ./configure test results between SAPIs.
448 - our_conf+=( --cache-file="${T}/config.cache" )
449 -
450 - # Support user-passed configuration parameters
451 - our_conf+=( ${EXTRA_ECONF:-} )
452 -
453 - # Support the Apache2 extras, they must be set globally for all
454 - # SAPIs to work correctly, especially for external PHP extensions
455 -
456 - mkdir -p "${WORKDIR}/sapis-build" || die
457 - for one_sapi in $SAPIS ; do
458 - use "${one_sapi}" || continue
459 - php_set_ini_dir "${one_sapi}"
460 -
461 - # The BUILD_DIR variable is used to determine where to output
462 - # the files that autotools creates. This was all originally
463 - # based on the autotools-utils eclass.
464 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
465 - cp -a "${S}" "${BUILD_DIR}" || die
466 - cd "${BUILD_DIR}" || die
467 -
468 - local sapi_conf=(
469 - --with-config-file-path="${PHP_INI_DIR}"
470 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
471 - )
472 -
473 - for sapi in $SAPIS ; do
474 - case "$sapi" in
475 - cli|cgi|embed|fpm|phpdbg)
476 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
477 - sapi_conf+=( "--enable-${sapi}" )
478 - else
479 - sapi_conf+=( "--disable-${sapi}" )
480 - fi
481 - ;;
482 -
483 - apache2)
484 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
485 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
486 - else
487 - sapi_conf+=( --without-apxs2 )
488 - fi
489 - ;;
490 - esac
491 - done
492 -
493 - # Construct the $myeconfargs array by concatenating $our_conf
494 - # (the common args) and $sapi_conf (the SAPI-specific args).
495 - local myeconfargs=( "${our_conf[@]}" )
496 - myeconfargs+=( "${sapi_conf[@]}" )
497 -
498 - pushd "${BUILD_DIR}" > /dev/null || die
499 - econf "${myeconfargs[@]}"
500 - popd > /dev/null || die
501 - done
502 -}
503 -
504 -src_compile() {
505 - # snmp seems to run during src_compile, too (bug #324739)
506 - addpredict /usr/share/snmp/mibs/.index
507 - addpredict /var/lib/net-snmp/mib_indexes
508 -
509 - for sapi in ${SAPIS} ; do
510 - if use "${sapi}"; then
511 - cd "${WORKDIR}/sapis-build/$sapi" || \
512 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
513 - emake
514 - fi
515 - done
516 -}
517 -
518 -src_install() {
519 - # see bug #324739 for what happens when we don't have that
520 - addpredict /usr/share/snmp/mibs/.index
521 -
522 - # grab the first SAPI that got built and install common files from there
523 - local first_sapi=""
524 - for sapi in $SAPIS ; do
525 - if use $sapi ; then
526 - first_sapi=$sapi
527 - break
528 - fi
529 - done
530 -
531 - # Makefile forgets to create this before trying to write to it...
532 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
533 -
534 - # Install php environment (without any sapis)
535 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
536 - emake INSTALL_ROOT="${D}" \
537 - install-build install-headers install-programs
538 -
539 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
540 -
541 - # Create the directory where we'll put version-specific php scripts
542 - keepdir "/usr/share/php${PHP_MV}"
543 -
544 - local sapi="", file=""
545 - local sapi_list=""
546 -
547 - for sapi in ${SAPIS}; do
548 - if use "${sapi}" ; then
549 - einfo "Installing SAPI: ${sapi}"
550 - cd "${WORKDIR}/sapis-build/${sapi}" || die
551 -
552 - if [[ "${sapi}" == "apache2" ]] ; then
553 - # We're specifically not using emake install-sapi as libtool
554 - # may cause unnecessary relink failures (see bug #351266)
555 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
556 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
557 - "libphp${PHP_MV}$(get_libname)"
558 - keepdir "/usr/$(get_libdir)/apache2/modules"
559 - else
560 - # needed each time, php_install_ini would reset it
561 - local dest="${PHP_DESTDIR#${EPREFIX}}"
562 - into "${dest}"
563 - case "$sapi" in
564 - cli)
565 - source="sapi/cli/php"
566 - ;;
567 - cgi)
568 - source="sapi/cgi/php-cgi"
569 - ;;
570 - fpm)
571 - source="sapi/fpm/php-fpm"
572 - ;;
573 - embed)
574 - source="libs/libphp${PHP_MV}$(get_libname)"
575 - ;;
576 - phpdbg)
577 - source="sapi/phpdbg/phpdbg"
578 - ;;
579 - *)
580 - die "unhandled sapi in src_install"
581 - ;;
582 - esac
583 -
584 - if [[ "${source}" == *"$(get_libname)" ]]; then
585 - dolib.so "${source}"
586 - else
587 - dobin "${source}"
588 - local name="$(basename ${source})"
589 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
590 - fi
591 - fi
592 -
593 - php_install_ini "${sapi}"
594 -
595 - # construct correct SAPI string for php-config
596 - # thanks to ferringb for the bash voodoo
597 - if [[ "${sapi}" == "apache2" ]]; then
598 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
599 - else
600 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
601 - fi
602 - fi
603 - done
604 -
605 - # Installing opcache module
606 - if use opcache ; then
607 - into "${PHP_DESTDIR#${EPREFIX}}"
608 - dolib.so "modules/opcache$(get_libname)"
609 - fi
610 -
611 - # Install env.d files
612 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
613 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
614 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
615 -
616 - # set php-config variable correctly (bug #278439)
617 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
618 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
619 -
620 - if use fpm ; then
621 - if use systemd; then
622 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
623 - "php-fpm@${SLOT}.service"
624 - else
625 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
626 - "php-fpm@${SLOT}.service"
627 - fi
628 - fi
629 -}
630 -
631 -src_test() {
632 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
633 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
634 - if [[ ! -x "${PHP_BIN}" ]] ; then
635 - ewarn "Test phase requires USE=cli, skipping"
636 - return
637 - else
638 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
639 - fi
640 -
641 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
642 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
643 - fi
644 -
645 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
646 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
647 - fi
648 -
649 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
650 - "session.save_path=${T}" \
651 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
652 - "session.save_path=${T}"
653 -
654 - for name in ${EXPECTED_TEST_FAILURES}; do
655 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
656 - done
657 -
658 - local failed="$(find -name '*.out')"
659 - if [[ ${failed} != "" ]] ; then
660 - ewarn "The following test cases failed unexpectedly:"
661 - for name in ${failed}; do
662 - ewarn " ${name/.out/}"
663 - done
664 - else
665 - einfo "No unexpected test failures, all fine"
666 - fi
667 -
668 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
669 - local passed=""
670 - for name in ${EXPECTED_TEST_FAILURES}; do
671 - [[ -f "${name}.diff" ]] && continue
672 - passed="${passed} ${name}"
673 - done
674 - if [[ ${passed} != "" ]] ; then
675 - einfo "The following test cases passed unexpectedly:"
676 - for name in ${passed}; do
677 - ewarn " ${passed}"
678 - done
679 - else
680 - einfo "None of the known-to-fail tests passed, all fine"
681 - fi
682 - fi
683 -}
684 -
685 -pkg_postinst() {
686 - # Output some general info to the user
687 - if use apache2 ; then
688 - elog
689 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
690 - elog "your apache2 command. OpenRC users can append that string to"
691 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
692 - elog
693 - elog "The apache module configuration file 70_mod_php.conf is"
694 - elog "provided (and maintained) by eselect-php."
695 - elog
696 - fi
697 -
698 - # Create the symlinks for php
699 - for m in ${SAPIS}; do
700 - [[ ${m} == 'embed' ]] && continue;
701 - if use $m ; then
702 - local ci=$(eselect php show $m)
703 - if [[ -z $ci ]]; then
704 - eselect php set $m php${SLOT} || die
705 - einfo "Switched ${m} to use php:${SLOT}"
706 - einfo
707 - elif [[ $ci != "php${SLOT}" ]] ; then
708 - elog "To switch $m to use php:${SLOT}, run"
709 - elog " eselect php set $m php${SLOT}"
710 - elog
711 - fi
712 - fi
713 - done
714 -
715 - # Remove dead symlinks for SAPIs that were just disabled. For
716 - # example, if the user has the cgi SAPI enabled, then he has an
717 - # eselect-php symlink for it. If he later reinstalls PHP with
718 - # USE="-cgi", that symlink will break. This call to eselect is
719 - # supposed to remove that dead link per bug 572436.
720 - eselect php cleanup || die
721 -
722 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
723 - elog "To build extensions for this version of PHP, you will need to"
724 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
725 - elog
726 - fi
727 -
728 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
729 - if [[ -n "${PHP_INI_VERSION}" ]]; then
730 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
731 - ewarn 'remove it from your configuration at your convenience. See'
732 - ewarn
733 - ewarn ' https://bugs.gentoo.org/611214'
734 - ewarn
735 - ewarn 'for more information.'
736 - fi
737 -
738 - elog "For details on how version slotting works, please see"
739 - elog "the wiki:"
740 - elog
741 - elog " https://wiki.gentoo.org/wiki/PHP"
742 - elog
743 -}
744 -
745 -pkg_postrm() {
746 - # This serves two purposes. First, if we have just removed the last
747 - # installed version of PHP, then this will remove any dead symlinks
748 - # belonging to eselect-php. Second, if a user upgrades slots from
749 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
750 - # his existing symlinks to point to the new 7.0 installation. The
751 - # latter is bug 432962.
752 - #
753 - # Note: the eselect-php package may not be installed at this point,
754 - # so we can't die() if this command fails.
755 - eselect php cleanup
756 -}