Gentoo Archives: gentoo-commits

From: "Ole Markus With (olemarkus)" <olemarkus@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/php: php-5.6.1.ebuild ChangeLog
Date: Fri, 03 Oct 2014 09:04:08
Message-Id: 20141003090404.9BF8E6D58@oystercatcher.gentoo.org
1 olemarkus 14/10/03 09:04:04
2
3 Modified: ChangeLog
4 Added: php-5.6.1.ebuild
5 Log:
6 Version bump
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key C4A92BF5)
9
10 Revision Changes Path
11 1.891 dev-lang/php/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?rev=1.891&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?rev=1.891&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?r1=1.890&r2=1.891
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v
20 retrieving revision 1.890
21 retrieving revision 1.891
22 diff -u -r1.890 -r1.891
23 --- ChangeLog 19 Sep 2014 12:14:27 -0000 1.890
24 +++ ChangeLog 3 Oct 2014 09:04:04 -0000 1.891
25 @@ -1,6 +1,11 @@
26 # ChangeLog for dev-lang/php
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.890 2014/09/19 12:14:27 olemarkus Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.891 2014/10/03 09:04:04 olemarkus Exp $
30 +
31 +*php-5.6.1 (03 Oct 2014)
32 +
33 + 03 Oct 2014; Ole Markus With <olemarkus@g.o> +php-5.6.1.ebuild:
34 + Version bump
35
36 *php-5.4.33 (19 Sep 2014)
37 *php-5.5.17 (19 Sep 2014)
38
39
40
41 1.1 dev-lang/php/php-5.6.1.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.6.1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.6.1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: php-5.6.1.ebuild
47 ===================================================================
48 # Copyright 1999-2014 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.6.1.ebuild,v 1.1 2014/10/03 09:04:04 olemarkus Exp $
51
52 EAPI=5
53
54 inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd
55
56 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"
57
58 function php_get_uri ()
59 {
60 case "${1}" in
61 "php-pre")
62 echo "http://downloads.php.net/dsp/${2}"
63 ;;
64 "php")
65 echo "http://www.php.net/distributions/${2}"
66 ;;
67 "olemarkus")
68 echo "http://dev.gentoo.org/~olemarkus/php/${2}"
69 ;;
70 "gentoo")
71 echo "mirror://gentoo/${2}"
72 ;;
73 *)
74 die "unhandled case in php_get_uri"
75 ;;
76 esac
77 }
78
79 PHP_MV="$(get_major_version)"
80 SLOT="$(get_version_component_range 1-2)"
81
82 # alias, so we can handle different types of releases (finals, rcs, alphas,
83 # betas, ...) w/o changing the whole ebuild
84 PHP_PV="${PV/_rc/RC}"
85 PHP_PV="${PHP_PV/_alpha/alpha}"
86 PHP_PV="${PHP_PV/_beta/beta}"
87 PHP_RELEASE="php"
88 [[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
89 [[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
90 [[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
91 PHP_P="${PN}-${PHP_PV}"
92
93 PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
94
95 PHP_FPM_CONF_VER="1"
96
97 SRC_URI="${PHP_SRC_URI}"
98
99 DESCRIPTION="The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs"
100 HOMEPAGE="http://php.net/"
101 LICENSE="PHP-3"
102
103 S="${WORKDIR}/${PHP_P}"
104
105 # We can build the following SAPIs in the given order
106 SAPIS="embed cli cgi fpm apache2"
107
108 # SAPIs and SAPI-specific USE flags (cli SAPI is default on):
109 IUSE="${IUSE}
110 ${SAPIS/cli/+cli}
111 threads"
112
113 IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
114 crypt +ctype curl debug
115 enchant exif frontbase +fileinfo +filter firebird
116 flatfile ftp gd gdbm gmp +hash +iconv imap inifile
117 intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash
118 mssql mysql libmysqlclient mysqli nls
119 oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
120 readline recode selinux +session sharedmem
121 +simplexml snmp soap sockets spell sqlite ssl
122 sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
123 +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
124
125 DEPEND="
126 >=app-admin/eselect-php-0.7.1-r3[apache2?,fpm?]
127 >=dev-libs/libpcre-8.32[unicode]
128 apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
129 <www-servers/apache-2.4[threads=] ) )
130 berkdb? ( =sys-libs/db-4* )
131 bzip2? ( app-arch/bzip2 )
132 cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
133 cjk? ( !gd? (
134 virtual/jpeg:0
135 media-libs/libpng:0=
136 sys-libs/zlib
137 ) )
138 crypt? ( >=dev-libs/libmcrypt-2.4 )
139 curl? ( >=net-misc/curl-7.10.5 )
140 enchant? ( app-text/enchant )
141 exif? ( !gd? (
142 virtual/jpeg:0
143 media-libs/libpng:0=
144 sys-libs/zlib
145 ) )
146 firebird? ( dev-db/firebird )
147 gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
148 gdbm? ( >=sys-libs/gdbm-1.8.0 )
149 gmp? ( >=dev-libs/gmp-4.1.2 )
150 iconv? ( virtual/libiconv )
151 imap? ( virtual/imap-c-client[ssl=] )
152 intl? ( dev-libs/icu:= )
153 iodbc? ( dev-db/libiodbc )
154 kerberos? ( virtual/krb5 )
155 ldap? ( >=net-nds/openldap-1.2.11 )
156 ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
157 libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
158 mssql? ( dev-db/freetds[mssql] )
159 libmysqlclient? (
160 mysql? ( virtual/mysql )
161 mysqli? ( >=virtual/mysql-4.1 )
162 )
163 nls? ( sys-devel/gettext )
164 oci8-instant-client? ( dev-db/oracle-instantclient-basic )
165 odbc? ( >=dev-db/unixODBC-1.8.13 )
166 postgres? ( dev-db/postgresql-base )
167 qdbm? ( dev-db/qdbm )
168 readline? ( sys-libs/readline )
169 recode? ( app-text/recode )
170 sharedmem? ( dev-libs/mm )
171 simplexml? ( >=dev-libs/libxml2-2.6.8 )
172 snmp? ( >=net-analyzer/net-snmp-5.2 )
173 soap? ( >=dev-libs/libxml2-2.6.8 )
174 spell? ( >=app-text/aspell-0.50 )
175 sqlite? ( >=dev-db/sqlite-3.7.6.3 )
176 ssl? ( >=dev-libs/openssl-0.9.7 )
177 sybase-ct? ( dev-db/freetds )
178 tidy? ( app-text/htmltidy )
179 truetype? (
180 =media-libs/freetype-2*
181 >=media-libs/t1lib-5.0.0
182 !gd? (
183 virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
184 )
185 unicode? ( dev-libs/oniguruma )
186 vpx? ( media-libs/libvpx )
187 wddx? ( >=dev-libs/libxml2-2.6.8 )
188 xml? ( >=dev-libs/libxml2-2.6.8 )
189 xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
190 xmlreader? ( >=dev-libs/libxml2-2.6.8 )
191 xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
192 xpm? (
193 x11-libs/libXpm
194 virtual/jpeg:0
195 media-libs/libpng:0= sys-libs/zlib
196 )
197 xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
198 zip? ( sys-libs/zlib )
199 zlib? ( sys-libs/zlib )
200 virtual/mta
201 "
202
203 php="=${CATEGORY}/${PF}"
204
205 REQUIRED_USE="
206 truetype? ( gd )
207 vpx? ( gd )
208 cjk? ( gd )
209 exif? ( gd )
210
211 xpm? ( gd )
212 gd? ( zlib )
213 simplexml? ( xml )
214 soap? ( xml )
215 wddx? ( xml )
216 xmlrpc? ( || ( xml iconv ) )
217 xmlreader? ( xml )
218 xslt? ( xml )
219 ldap-sasl? ( ldap )
220 mhash? ( hash )
221 phar? ( hash )
222 libmysqlclient? ( || (
223 mysql
224 mysqli
225 pdo
226 ) )
227
228 qdbm? ( !gdbm )
229 readline? ( !libedit )
230 recode? ( !imap !mysql !mysqli )
231 sharedmem? ( !threads )
232
233 !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
234
235 RDEPEND="${DEPEND}"
236
237 RDEPEND="${RDEPEND}
238 fpm? (
239 selinux? ( sec-policy/selinux-phpfpm )
240 systemd? ( sys-apps/systemd ) )"
241
242 DEPEND="${DEPEND}
243 sys-devel/flex
244 >=sys-devel/m4-1.4.3
245 >=sys-devel/libtool-1.5.18"
246
247 # Allow users to install production version if they want to
248
249 case "${PHP_INI_VERSION}" in
250 production|development)
251 ;;
252 *)
253 PHP_INI_VERSION="development"
254 ;;
255 esac
256
257 PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
258 PHP_INI_FILE="php.ini"
259
260 want_apache
261
262 pkg_setup() {
263 depend.apache_pkg_setup
264 }
265
266 php_install_ini() {
267 local phpsapi="${1}"
268
269 # work out where we are installing the ini file
270 php_set_ini_dir "${phpsapi}"
271
272 local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
273 cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
274
275 # default to /tmp for save_path, bug #282768
276 sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}"
277
278 # Set the extension dir
279 sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
280
281 # Set the include path to point to where we want to find PEAR packages
282 sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}"
283
284 dodir "${PHP_INI_DIR#${EPREFIX}}"
285 insinto "${PHP_INI_DIR#${EPREFIX}}"
286 newins "${phpinisrc}" "${PHP_INI_FILE}"
287
288 elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
289 elog
290
291 dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
292 dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
293
294 if use_if_iuse opcache; then
295 elog "Adding opcache to $PHP_EXT_INI_DIR"
296 echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
297 dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
298 fi
299
300 # SAPI-specific handling
301
302 if [[ "${sapi}" == "fpm" ]] ; then
303 [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0
304 einfo "Installing FPM CGI config file php-fpm.conf"
305 insinto "${PHP_INI_DIR#${EPREFIX}}"
306 newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf
307
308 # Remove bogus /etc/php-fpm.conf.default (bug 359906)
309 [[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default"
310 fi
311
312 # Install PHP ini files into /usr/share/php
313
314 dodoc php.ini-development
315 dodoc php.ini-production
316
317 }
318
319 php_set_ini_dir() {
320 PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
321 PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
322 PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
323 }
324
325 src_prepare() {
326 # USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
327 # ([empty session.save_path]/session_mm_[sapi][gid].sem)
328 # there is no easy way to circumvent that, all php calls during
329 # install use -n, so no php.ini file will be used.
330 # As such, this is the easiest way to get around
331 addpredict /session_mm_cli250.sem
332 addpredict /session_mm_cli0.sem
333
334 # Change PHP branding
335 # Get the alpha/beta/rc version
336 sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
337 -i configure.in || die "Unable to change PHP branding"
338
339 # Patch PHP to show Gentoo as the server platform
340 sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
341 -i configure.in || die "Failed to fix server platform name"
342
343 # Prevent PHP from activating the Apache config,
344 # as we will do that ourselves
345 sed -i \
346 -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
347 -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
348 configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4
349
350 # Patch PHP to support heimdal instead of mit-krb5
351 if has_version "app-crypt/heimdal" ; then
352 sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
353 || die "Failed to fix heimdal libname"
354 sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
355 || die "Failed to fix heimdal crypt library reference"
356 fi
357
358 #Add user patches #357637
359 epatch_user
360
361 #force rebuilding aclocal.m4
362 rm aclocal.m4
363 eautoreconf
364
365 if [[ ${CHOST} == *-darwin* ]] ; then
366 # http://bugs.php.net/bug.php?id=48795, bug #343481
367 sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
368 fi
369 }
370
371 src_configure() {
372 addpredict /usr/share/snmp/mibs/.index
373 addpredict /var/lib/net-snmp/mib_indexes
374
375 PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
376
377 # This is a global variable and should be in caps. It isn't because the
378 # phpconfutils eclass relies on exactly this name...
379 # for --with-libdir see bug #327025
380 my_conf="
381 --prefix="${PHP_DESTDIR}"
382 --mandir="${PHP_DESTDIR}"/man
383 --infodir="${PHP_DESTDIR}"/info
384 --libdir="${PHP_DESTDIR}"/lib
385 --with-libdir=$(get_libdir)
386 --without-pear
387 $(use_enable threads maintainer-zts)"
388
389 # extension USE flag shared
390 my_conf+="
391 $(use_enable bcmath bcmath )
392 $(use_with bzip2 bz2 "${EPREFIX}"/usr)
393 $(use_enable calendar calendar )
394 $(use_enable ctype ctype )
395 $(use_with curl curl "${EPREFIX}"/usr)
396 $(use_enable xml dom )
397 $(use_with enchant enchant "${EPREFIX}"/usr)
398 $(use_enable exif exif )
399 $(use_enable fileinfo fileinfo )
400 $(use_enable filter filter )
401 $(use_enable ftp ftp )
402 $(use_with nls gettext "${EPREFIX}"/usr)
403 $(use_with gmp gmp "${EPREFIX}"/usr)
404 $(use_enable hash hash )
405 $(use_with mhash mhash "${EPREFIX}"/usr)
406 $(use_with iconv iconv $(use elibc_glibc || echo "${EPREFIX}"/usr))
407 $(use_enable intl intl )
408 $(use_enable ipv6 ipv6 )
409 $(use_enable json json )
410 $(use_with kerberos kerberos "${EPREFIX}"/usr)
411 $(use_enable xml libxml )
412 $(use_with xml libxml-dir "${EPREFIX}"/usr)
413 $(use_enable unicode mbstring )
414 $(use_with crypt mcrypt "${EPREFIX}"/usr)
415 $(use_with mssql mssql "${EPREFIX}"/usr)
416 $(use_with unicode onig "${EPREFIX}"/usr)
417 $(use_with ssl openssl "${EPREFIX}"/usr)
418 $(use_with ssl openssl-dir "${EPREFIX}"/usr)
419 $(use_enable pcntl pcntl )
420 $(use_enable phar phar )
421 $(use_enable pdo pdo )
422 $(use_enable opcache opcache )
423 $(use_with postgres pgsql "${EPREFIX}"/usr)
424 $(use_enable posix posix )
425 $(use_with spell pspell "${EPREFIX}"/usr)
426 $(use_with recode recode "${EPREFIX}"/usr)
427 $(use_enable simplexml simplexml )
428 $(use_enable sharedmem shmop )
429 $(use_with snmp snmp "${EPREFIX}"/usr)
430 $(use_enable soap soap )
431 $(use_enable sockets sockets )
432 $(use_with sqlite sqlite3 "${EPREFIX}"/usr)
433 $(use_with sybase-ct sybase-ct "${EPREFIX}"/usr)
434 $(use_enable sysvipc sysvmsg )
435 $(use_enable sysvipc sysvsem )
436 $(use_enable sysvipc sysvshm )
437 $(use_with systemd fpm-systemd)
438 $(use_with tidy tidy "${EPREFIX}"/usr)
439 $(use_enable tokenizer tokenizer )
440 $(use_enable wddx wddx )
441 $(use_enable xml xml )
442 $(use_enable xmlreader xmlreader )
443 $(use_enable xmlwriter xmlwriter )
444 $(use_with xmlrpc xmlrpc)
445 $(use_with xslt xsl "${EPREFIX}"/usr)
446 $(use_enable zip zip )
447 $(use_with zlib zlib "${EPREFIX}"/usr)
448 $(use_enable debug debug )"
449
450 # DBA support
451 if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
452 || use qdbm ; then
453 my_conf="${my_conf} --enable-dba${shared}"
454 fi
455
456 # DBA drivers support
457 my_conf+="
458 $(use_with cdb cdb)
459 $(use_with berkdb db4 ${EPREFIX}/usr)
460 $(use_enable flatfile flatfile )
461 $(use_with gdbm gdbm ${EPREFIX}/usr)
462 $(use_enable inifile inifile )
463 $(use_with qdbm qdbm ${EPREFIX}/usr)"
464
465 # Support for the GD graphics library
466 my_conf+="
467 $(use_with truetype freetype-dir ${EPREFIX}/usr)
468 $(use_with truetype t1lib ${EPREFIX}/usr)
469 $(use_enable cjk gd-jis-conv )
470 $(use_with gd jpeg-dir ${EPREFIX}/usr)
471 $(use_with gd png-dir ${EPREFIX}/usr)
472 $(use_with xpm xpm-dir ${EPREFIX}/usr)
473 $(use_with vpx vpx-dir ${EPREFIX}/usr)"
474 # enable gd last, so configure can pick up the previous settings
475 my_conf+="
476 $(use_with gd gd)"
477
478 # IMAP support
479 if use imap ; then
480 my_conf+="
481 $(use_with imap imap ${EPREFIX}/usr)
482 $(use_with ssl imap-ssl ${EPREFIX}/usr)"
483 fi
484
485 # Interbase/firebird support
486
487 if use firebird ; then
488 my_conf+="
489 $(use_with firebird interbase ${EPREFIX}/usr)"
490 fi
491
492 # LDAP support
493 if use ldap ; then
494 my_conf+="
495 $(use_with ldap ldap ${EPREFIX}/usr)
496 $(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)"
497 fi
498
499 # MySQL support
500 local mysqllib="mysqlnd"
501 local mysqlilib="mysqlnd"
502 use libmysqlclient && mysqllib="${EPREFIX}/usr"
503 use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
504
505 my_conf+=" $(use_with mysql mysql $mysqllib)"
506 my_conf+=" $(use_with mysqli mysqli $mysqlilib)"
507
508 local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)"
509 if use mysql ; then
510 my_conf+="${mysqlsock}"
511 elif use mysqli ; then
512 my_conf+="${mysqlsock}"
513 fi
514
515 # ODBC support
516 if use odbc ; then
517 my_conf+="
518 $(use_with odbc unixODBC ${EPREFIX}/usr)"
519 fi
520
521 if use iodbc ; then
522 my_conf+="
523 $(use_with iodbc iodbc ${EPREFIX}/usr)"
524 fi
525
526 # Oracle support
527 if use oci8-instant-client ; then
528 my_conf+="
529 $(use_with oci8-instant-client oci8)"
530 fi
531
532 # PDO support
533 if use pdo ; then
534 my_conf+="
535 $(use_with mssql pdo-dblib )
536 $(use_with mysql pdo-mysql ${mysqllib})
537 $(use_with postgres pdo-pgsql )
538 $(use_with sqlite pdo-sqlite ${EPREFIX}/usr)
539 $(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)"
540 if use oci8-instant-client ; then
541 my_conf+="
542 $(use_with oci8-instant-client pdo-oci)"
543 fi
544 fi
545
546 # readline/libedit support
547 my_conf+="
548 $(use_with readline readline ${EPREFIX}/usr)
549 $(use_with libedit libedit ${EPREFIX}/usr)"
550
551 # Session support
552 if use session ; then
553 my_conf+="
554 $(use_with sharedmem mm ${EPREFIX}/usr)"
555 else
556 my_conf+="
557 $(use_enable session session )"
558 fi
559
560 # Use pic for shared modules such as apache2's mod_php
561 my_conf="${my_conf} --with-pic"
562
563 # we use the system copy of pcre
564 # --with-pcre-regex affects ext/pcre
565 # --with-pcre-dir affects ext/filter and ext/zip
566 my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr"
567
568 # Catch CFLAGS problems
569 # Fixes bug #14067.
570 # Changed order to run it in reverse for bug #32022 and #12021.
571 replace-cpu-flags "k6*" "i586"
572
573 # Support user-passed configuration parameters
574 my_conf="${my_conf} ${EXTRA_ECONF:-}"
575
576 # Support the Apache2 extras, they must be set globally for all
577 # SAPIs to work correctly, especially for external PHP extensions
578
579 mkdir -p "${WORKDIR}/sapis-build"
580 for one_sapi in $SAPIS ; do
581 use "${one_sapi}" || continue
582 php_set_ini_dir "${one_sapi}"
583
584 cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}"
585 cd "${WORKDIR}/sapis-build/${one_sapi}"
586
587 sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
588 --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
589
590 for sapi in $SAPIS ; do
591 case "$sapi" in
592 cli|cgi|embed|fpm)
593 if [[ "${one_sapi}" == "${sapi}" ]] ; then
594 sapi_conf="${sapi_conf} --enable-${sapi}"
595 else
596 sapi_conf="${sapi_conf} --disable-${sapi}"
597 fi
598 ;;
599
600 apache2)
601 if [[ "${one_sapi}" == "${sapi}" ]] ; then
602 sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs"
603 else
604 sapi_conf="${sapi_conf} --without-apxs2"
605 fi
606 ;;
607 esac
608 done
609
610 econf ${sapi_conf}
611 done
612 }
613
614 src_compile() {
615 # snmp seems to run during src_compile, too (bug #324739)
616 addpredict /usr/share/snmp/mibs/.index
617 addpredict /var/lib/net-snmp/mib_indexes
618
619 for sapi in ${SAPIS} ; do
620 if use "${sapi}"; then
621 cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1"
622 emake || die "emake failed"
623 fi
624 done
625 }
626
627 src_install() {
628 # see bug #324739 for what happens when we don't have that
629 addpredict /usr/share/snmp/mibs/.index
630
631 # grab the first SAPI that got built and install common files from there
632 local first_sapi=""
633 for sapi in $SAPIS ; do
634 if use $sapi ; then
635 first_sapi=$sapi
636 break
637 fi
638 done
639
640 # Makefile forgets to create this before trying to write to it...
641 dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
642
643 # Install php environment (without any sapis)
644 cd "${WORKDIR}/sapis-build/$first_sapi"
645 emake INSTALL_ROOT="${D}" \
646 install-build install-headers install-programs \
647 || die "emake install failed"
648
649 local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
650
651 # Create the directory where we'll put version-specific php scripts
652 keepdir /usr/share/php${PHP_MV}
653
654 local sapi="", file=""
655 local sapi_list=""
656
657 for sapi in ${SAPIS}; do
658 if use "${sapi}" ; then
659 einfo "Installing SAPI: ${sapi}"
660 cd "${WORKDIR}/sapis-build/${sapi}"
661
662 if [[ "${sapi}" == "apache2" ]] ; then
663 # We're specifically not using emake install-sapi as libtool
664 # may cause unnecessary relink failures (see bug #351266)
665 insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
666 newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)"
667 keepdir "/usr/$(get_libdir)/apache2/modules"
668 else
669 # needed each time, php_install_ini would reset it
670 local dest="${PHP_DESTDIR#${EPREFIX}}"
671 into "${dest}"
672 case "$sapi" in
673 cli)
674 source="sapi/cli/php"
675 ;;
676 cgi)
677 source="sapi/cgi/php-cgi"
678 ;;
679 fpm)
680 source="sapi/fpm/php-fpm"
681 ;;
682 embed)
683 source="libs/libphp${PHP_MV}$(get_libname)"
684 ;;
685 *)
686 die "unhandled sapi in src_install"
687 ;;
688 esac
689
690 if [[ "${source}" == *"$(get_libname)" ]]; then
691 dolib.so "${source}" || die "Unable to install ${sapi} sapi"
692 else
693 dobin "${source}" || die "Unable to install ${sapi} sapi"
694 local name="$(basename ${source})"
695 dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
696 fi
697 fi
698
699 php_install_ini "${sapi}"
700
701 # construct correct SAPI string for php-config
702 # thanks to ferringb for the bash voodoo
703 if [[ "${sapi}" == "apache2" ]]; then
704 sapi_list="${sapi_list:+${sapi_list} }apache2handler"
705 else
706 sapi_list="${sapi_list:+${sapi_list} }${sapi}"
707 fi
708 fi
709 done
710
711 # Installing opcache module
712 if use_if_iuse opcache ; then
713 dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module"
714 fi
715
716 # Install env.d files
717 newenvd "${FILESDIR}/20php5-envd" \
718 "20php${SLOT}"
719 sed -e "s|/lib/|/$(get_libdir)/|g" -i \
720 "${ED}/etc/env.d/20php${SLOT}"
721 sed -e "s|php5|php${SLOT}|g" -i \
722 "${ED}/etc/env.d/20php${SLOT}"
723
724 # set php-config variable correctly (bug #278439)
725 sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
726 "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config"
727
728 if use fpm ; then
729 if use systemd; then
730 systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service"
731 else
732 systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service"
733 fi
734 fi
735 }
736
737 src_test() {
738 echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
739 PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
740 if [[ ! -x "${PHP_BIN}" ]] ; then
741 ewarn "Test phase requires USE=cli, skipping"
742 return
743 else
744 export TEST_PHP_EXECUTABLE="${PHP_BIN}"
745 fi
746
747 if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
748 export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
749 fi
750
751 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \
752 "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}"
753
754 for name in ${EXPECTED_TEST_FAILURES}; do
755 mv "${name}.out" "${name}.out.orig" 2>/dev/null
756 done
757
758 local failed="$(find -name '*.out')"
759 if [[ ${failed} != "" ]] ; then
760 ewarn "The following test cases failed unexpectedly:"
761 for name in ${failed}; do
762 ewarn " ${name/.out/}"
763 done
764 else
765 einfo "No unexpected test failures, all fine"
766 fi
767
768 if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
769 local passed=""
770 for name in ${EXPECTED_TEST_FAILURES}; do
771 [[ -f "${name}.diff" ]] && continue
772 passed="${passed} ${name}"
773 done
774 if [[ ${passed} != "" ]] ; then
775 einfo "The following test cases passed unexpectedly:"
776 for name in ${passed}; do
777 ewarn " ${passed}"
778 done
779 else
780 einfo "None of the known-to-fail tests passed, all fine"
781 fi
782 fi
783 }
784
785 pkg_postinst() {
786 # Output some general info to the user
787 if use apache2 ; then
788 APACHE2_MOD_DEFINE="PHP5"
789 APACHE2_MOD_CONF="70_mod_php5"
790 apache-module_pkg_postinst
791 fi
792
793 # Create the symlinks for php
794 for m in ${SAPIS}; do
795 [[ ${m} == 'embed' ]] && continue;
796 if use $m ; then
797 local ci=$(eselect php show $m)
798 if [[ -z $ci ]]; then
799 eselect php set $m php${SLOT}
800 einfo "Switched ${m} to use php:${SLOT}"
801 einfo
802 elif [[ $ci != "php${SLOT}" ]] ; then
803 elog "To switch $m to use php:${SLOT}, run"
804 elog " eselect php set $m php${SLOT}"
805 elog
806 fi
807 fi
808 done
809
810 elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order"
811 elog "to compile extensions for the ${SLOT} ABI"
812 elog
813 if ! use readline && use cli ; then
814 ewarn "Note that in order to use php interactivly, you need to enable"
815 ewarn "the readline USE flag or php -a will hang"
816 fi
817 elog
818 elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
819 elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
820 elog "'production' or 'development' in ${EPREFIX}/etc/make.conf"
821 elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}"
822
823 elog
824 elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
825 elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml"
826 elog
827 }
828
829 pkg_prerm() {
830 eselect php cleanup
831 }