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.5.0_rc2.ebuild ChangeLog
Date: Wed, 05 Jun 2013 13:18:52
Message-Id: 20130605131846.8F5F22171D@flycatcher.gentoo.org
1 olemarkus 13/06/05 13:18:46
2
3 Modified: ChangeLog
4 Added: php-5.5.0_rc2.ebuild
5 Log:
6 Version bump
7
8 (Portage version: 2.1.11.55/cvs/Linux x86_64, signed Manifest commit with key C4A92BF5)
9
10 Revision Changes Path
11 1.712 dev-lang/php/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?rev=1.712&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?rev=1.712&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?r1=1.711&r2=1.712
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v
20 retrieving revision 1.711
21 retrieving revision 1.712
22 diff -u -r1.711 -r1.712
23 --- ChangeLog 15 May 2013 05:33:53 -0000 1.711
24 +++ ChangeLog 5 Jun 2013 13:18:46 -0000 1.712
25 @@ -1,6 +1,11 @@
26 # ChangeLog for dev-lang/php
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.711 2013/05/15 05:33:53 patrick Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.712 2013/06/05 13:18:46 olemarkus Exp $
30 +
31 +*php-5.5.0_rc2 (05 Jun 2013)
32 +
33 + 05 Jun 2013; Ole Markus With <olemarkus@g.o> +php-5.5.0_rc2.ebuild:
34 + Version bump
35
36 15 May 2013; Patrick Lauer <patrick@g.o> metadata.xml:
37 Fix metadata.xml
38
39
40
41 1.1 dev-lang/php/php-5.5.0_rc2.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.5.0_rc2.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.5.0_rc2.ebuild?rev=1.1&content-type=text/plain
45
46 Index: php-5.5.0_rc2.ebuild
47 ===================================================================
48 # Copyright 1999-2013 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.5.0_rc2.ebuild,v 1.1 2013/06/05 13:18:46 olemarkus Exp $
51
52 EAPI=5
53
54 inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool
55
56 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-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 tidy +tokenizer truetype unicode wddx
123 +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
124
125 DEPEND="
126 >=app-admin/eselect-php-0.7.0[apache2?,fpm?]
127 >=dev-libs/libpcre-8.32[unicode]
128 apache2? ( www-servers/apache[threads=] )
129 berkdb? ( =sys-libs/db-4* )
130 bzip2? ( app-arch/bzip2 )
131 cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
132 cjk? ( !gd? (
133 virtual/jpeg
134 media-libs/libpng:0=
135 sys-libs/zlib
136 ) )
137 crypt? ( >=dev-libs/libmcrypt-2.4 )
138 curl? ( >=net-misc/curl-7.10.5 )
139 enchant? ( app-text/enchant )
140 exif? ( !gd? (
141 virtual/jpeg
142 media-libs/libpng:0=
143 sys-libs/zlib
144 ) )
145 firebird? ( dev-db/firebird )
146 gd? ( virtual/jpeg media-libs/libpng:0= sys-libs/zlib )
147 gdbm? ( >=sys-libs/gdbm-1.8.0 )
148 gmp? ( >=dev-libs/gmp-4.1.2 )
149 iconv? ( virtual/libiconv )
150 imap? ( virtual/imap-c-client[ssl=] )
151 intl? ( dev-libs/icu:= )
152 iodbc? ( dev-db/libiodbc )
153 kerberos? ( virtual/krb5 )
154 ldap? ( >=net-nds/openldap-1.2.11 )
155 ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
156 libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
157 mssql? ( dev-db/freetds[mssql] )
158 libmysqlclient? (
159 mysql? ( virtual/mysql )
160 mysqli? ( >=virtual/mysql-4.1 )
161 )
162 nls? ( sys-devel/gettext )
163 oci8-instant-client? ( dev-db/oracle-instantclient-basic )
164 odbc? ( >=dev-db/unixODBC-1.8.13 )
165 postgres? ( dev-db/postgresql-base )
166 qdbm? ( dev-db/qdbm )
167 readline? ( sys-libs/readline )
168 recode? ( app-text/recode )
169 sharedmem? ( dev-libs/mm )
170 simplexml? ( >=dev-libs/libxml2-2.6.8 )
171 snmp? ( >=net-analyzer/net-snmp-5.2 )
172 soap? ( >=dev-libs/libxml2-2.6.8 )
173 spell? ( >=app-text/aspell-0.50 )
174 sqlite? ( >=dev-db/sqlite-3.7.6.3 )
175 ssl? ( >=dev-libs/openssl-0.9.7 )
176 sybase-ct? ( dev-db/freetds )
177 tidy? ( app-text/htmltidy )
178 truetype? (
179 =media-libs/freetype-2*
180 >=media-libs/t1lib-5.0.0
181 !gd? (
182 virtual/jpeg media-libs/libpng:0= sys-libs/zlib )
183 )
184 unicode? ( dev-libs/oniguruma )
185 wddx? ( >=dev-libs/libxml2-2.6.8 )
186 xml? ( >=dev-libs/libxml2-2.6.8 )
187 xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
188 xmlreader? ( >=dev-libs/libxml2-2.6.8 )
189 xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
190 xpm? (
191 x11-libs/libXpm
192 virtual/jpeg
193 media-libs/libpng:0= sys-libs/zlib
194 )
195 xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
196 zip? ( sys-libs/zlib )
197 zlib? ( sys-libs/zlib )
198 virtual/mta
199 "
200
201 php="=${CATEGORY}/${PF}"
202
203 REQUIRED_USE="
204 truetype? ( gd )
205 cjk? ( gd )
206 exif? ( gd )
207
208 xpm? ( gd )
209 gd? ( zlib )
210 simplexml? ( xml )
211 soap? ( xml )
212 wddx? ( xml )
213 xmlrpc? ( || ( xml iconv ) )
214 xmlreader? ( xml )
215 xslt? ( xml )
216 ldap-sasl? ( ldap )
217 mhash? ( hash )
218 phar? ( hash )
219 libmysqlclient? ( || (
220 mysql
221 mysqli
222 pdo
223 ) )
224
225 qdbm? ( !gdbm )
226 readline? ( !libedit )
227 recode? ( !imap !mysql !mysqli )
228 sharedmem? ( !threads )
229
230 !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
231
232 RDEPEND="${DEPEND}"
233
234 RDEPEND="${RDEPEND} fpm? ( selinux? ( sec-policy/selinux-phpfpm ) )"
235
236 DEPEND="${DEPEND}
237 sys-devel/flex
238 >=sys-devel/m4-1.4.3
239 >=sys-devel/libtool-1.5.18"
240
241 # Allow users to install production version if they want to
242
243 case "${PHP_INI_VERSION}" in
244 production|development)
245 ;;
246 *)
247 PHP_INI_VERSION="development"
248 ;;
249 esac
250
251 PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
252 PHP_INI_FILE="php.ini"
253
254 want_apache
255
256 pkg_setup() {
257 depend.apache_pkg_setup
258 }
259
260 php_install_ini() {
261 local phpsapi="${1}"
262
263 # work out where we are installing the ini file
264 php_set_ini_dir "${phpsapi}"
265
266 local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
267 cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
268
269 # default to /tmp for save_path, bug #282768
270 sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}"
271
272 # Set the extension dir
273 sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
274
275 # Set the include path to point to where we want to find PEAR packages
276 sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}"
277
278
279 dodir "${PHP_INI_DIR#${EPREFIX}}"
280 insinto "${PHP_INI_DIR#${EPREFIX}}"
281 newins "${phpinisrc}" "${PHP_INI_FILE}"
282
283 elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
284 elog
285
286 dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
287 dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
288
289 if use_if_iuse opcache; then
290 elog "Adding opcache to $PHP_EXT_INI_DIR"
291 echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
292 dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
293 fi
294
295 # SAPI-specific handling
296
297 if [[ "${sapi}" == "fpm" ]] ; then
298 [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0
299 einfo "Installing FPM CGI config file php-fpm.conf"
300 insinto "${PHP_INI_DIR#${EPREFIX}}"
301 newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf
302
303 # Remove bogus /etc/php-fpm.conf.default (bug 359906)
304 [[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default"
305 fi
306
307 # Install PHP ini files into /usr/share/php
308
309 dodoc php.ini-development
310 dodoc php.ini-production
311
312 }
313
314 php_set_ini_dir() {
315 PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
316 PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
317 PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
318 }
319
320 src_prepare() {
321 # USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
322 # ([empty session.save_path]/session_mm_[sapi][gid].sem)
323 # there is no easy way to circumvent that, all php calls during
324 # install use -n, so no php.ini file will be used.
325 # As such, this is the easiest way to get around
326 addpredict /session_mm_cli250.sem
327 addpredict /session_mm_cli0.sem
328
329 # Change PHP branding
330 # Get the alpha/beta/rc version
331 sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
332 -i configure.in || die "Unable to change PHP branding"
333
334
335 epatch "${FILESDIR}"/iodbc-pkgconfig.patch
336 epatch "${FILESDIR}"/stricter-libc-client-symlink-check.patch
337 epatch "${FILESDIR}"/all_strict_aliasing.patch
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 tidy tidy "${EPREFIX}"/usr)
438 $(use_enable tokenizer tokenizer )
439 $(use_enable wddx wddx )
440 $(use_enable xml xml )
441 $(use_enable xmlreader xmlreader )
442 $(use_enable xmlwriter xmlwriter )
443 $(use_with xmlrpc xmlrpc)
444 $(use_with xslt xsl "${EPREFIX}"/usr)
445 $(use_enable zip zip )
446 $(use_with zlib zlib "${EPREFIX}"/usr)
447 $(use_enable debug debug )"
448
449 # DBA support
450 if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
451 || use qdbm ; then
452 my_conf="${my_conf} --enable-dba${shared}"
453 fi
454
455 # DBA drivers support
456 my_conf+="
457 $(use_with cdb cdb)
458 $(use_with berkdb db4 ${EPREFIX}/usr)
459 $(use_enable flatfile flatfile )
460 $(use_with gdbm gdbm ${EPREFIX}/usr)
461 $(use_enable inifile inifile )
462 $(use_with qdbm qdbm ${EPREFIX}/usr)"
463
464 # Support for the GD graphics library
465 my_conf+="
466 $(use_with truetype freetype-dir ${EPREFIX}/usr)
467 $(use_with truetype t1lib ${EPREFIX}/usr)
468 $(use_enable cjk gd-jis-conv )
469 $(use_with gd jpeg-dir ${EPREFIX}/usr)
470 $(use_with gd png-dir ${EPREFIX}/usr)
471 $(use_with xpm xpm-dir ${EPREFIX}/usr)"
472 # enable gd last, so configure can pick up the previous settings
473 my_conf+="
474 $(use_with gd gd)"
475
476 # IMAP support
477 if use imap ; then
478 my_conf+="
479 $(use_with imap imap ${EPREFIX}/usr)
480 $(use_with ssl imap-ssl ${EPREFIX}/usr)"
481 fi
482
483 # Interbase/firebird support
484
485 if use firebird ; then
486 my_conf+="
487 $(use_with firebird interbase ${EPREFIX}/usr)"
488 fi
489
490 # LDAP support
491 if use ldap ; then
492 my_conf+="
493 $(use_with ldap ldap ${EPREFIX}/usr)
494 $(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)"
495 fi
496
497 # MySQL support
498 local mysqllib="mysqlnd"
499 local mysqlilib="mysqlnd"
500 use libmysqlclient && mysqllib="${EPREFIX}/usr"
501 use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
502
503 my_conf+=" $(use_with mysql mysql $mysqllib)"
504 my_conf+=" $(use_with mysqli mysqli $mysqlilib)"
505
506 local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)"
507 if use mysql ; then
508 my_conf+="${mysqlsock}"
509 elif use mysqli ; then
510 my_conf+="${mysqlsock}"
511 fi
512
513 # ODBC support
514 if use odbc ; then
515 my_conf+="
516 $(use_with odbc unixODBC ${EPREFIX}/usr)"
517 fi
518
519 if use iodbc ; then
520 my_conf+="
521 $(use_with iodbc iodbc ${EPREFIX}/usr)"
522 fi
523
524 # Oracle support
525 if use oci8-instant-client ; then
526 my_conf+="
527 $(use_with oci8-instant-client oci8)"
528 fi
529
530 # PDO support
531 if use pdo ; then
532 my_conf+="
533 $(use_with mssql pdo-dblib )
534 $(use_with mysql pdo-mysql ${mysqllib})
535 $(use_with postgres pdo-pgsql )
536 $(use_with sqlite pdo-sqlite ${EPREFIX}/usr)
537 $(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)"
538 if use oci8-instant-client ; then
539 my_conf+="
540 $(use_with oci8-instant-client pdo-oci)"
541 fi
542 fi
543
544 # readline/libedit support
545 my_conf+="
546 $(use_with readline readline ${EPREFIX}/usr)
547 $(use_with libedit libedit ${EPREFIX}/usr)"
548
549 # Session support
550 if use session ; then
551 my_conf+="
552 $(use_with sharedmem mm ${EPREFIX}/usr)"
553 else
554 my_conf+="
555 $(use_enable session session )"
556 fi
557
558 # Use pic for shared modules such as apache2's mod_php
559 my_conf="${my_conf} --with-pic"
560
561 # we use the system copy of pcre
562 # --with-pcre-regex affects ext/pcre
563 # --with-pcre-dir affects ext/filter and ext/zip
564 my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr"
565
566 # Catch CFLAGS problems
567 # Fixes bug #14067.
568 # Changed order to run it in reverse for bug #32022 and #12021.
569 replace-cpu-flags "k6*" "i586"
570
571 # Support user-passed configuration parameters
572 my_conf="${my_conf} ${EXTRA_ECONF:-}"
573
574 # Support the Apache2 extras, they must be set globally for all
575 # SAPIs to work correctly, especially for external PHP extensions
576
577 mkdir -p "${WORKDIR}/sapis-build"
578 for one_sapi in $SAPIS ; do
579 use "${one_sapi}" || continue
580 php_set_ini_dir "${one_sapi}"
581
582 cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}"
583 cd "${WORKDIR}/sapis-build/${one_sapi}"
584
585 sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
586 --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
587
588 for sapi in $SAPIS ; do
589 case "$sapi" in
590 cli|cgi|embed|fpm)
591 if [[ "${one_sapi}" == "${sapi}" ]] ; then
592 sapi_conf="${sapi_conf} --enable-${sapi}"
593 else
594 sapi_conf="${sapi_conf} --disable-${sapi}"
595 fi
596 ;;
597
598 apache2)
599 if [[ "${one_sapi}" == "${sapi}" ]] ; then
600 sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs"
601 else
602 sapi_conf="${sapi_conf} --without-apxs2"
603 fi
604 ;;
605 esac
606 done
607
608 econf ${sapi_conf}
609 done
610 }
611
612 src_compile() {
613 # snmp seems to run during src_compile, too (bug #324739)
614 addpredict /usr/share/snmp/mibs/.index
615 addpredict /var/lib/net-snmp/mib_indexes
616
617 for sapi in ${SAPIS} ; do
618 if use "${sapi}"; then
619 cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1"
620 emake || die "emake failed"
621 fi
622 done
623 }
624
625 src_install() {
626 # see bug #324739 for what happens when we don't have that
627 addpredict /usr/share/snmp/mibs/.index
628
629 # grab the first SAPI that got built and install common files from there
630 local first_sapi=""
631 for sapi in $SAPIS ; do
632 if use $sapi ; then
633 first_sapi=$sapi
634 break
635 fi
636 done
637
638 # Makefile forgets to create this before trying to write to it...
639 dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
640
641 # Install php environment (without any sapis)
642 cd "${WORKDIR}/sapis-build/$first_sapi"
643 emake INSTALL_ROOT="${D}" \
644 install-build install-headers install-programs \
645 || die "emake install failed"
646
647 local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
648
649 # Create the directory where we'll put version-specific php scripts
650 keepdir /usr/share/php${PHP_MV}
651
652 local sapi="", file=""
653 local sapi_list=""
654
655 for sapi in ${SAPIS}; do
656 if use "${sapi}" ; then
657 einfo "Installing SAPI: ${sapi}"
658 cd "${WORKDIR}/sapis-build/${sapi}"
659
660 if [[ "${sapi}" == "apache2" ]] ; then
661 # We're specifically not using emake install-sapi as libtool
662 # may cause unnecessary relink failures (see bug #351266)
663 insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
664 newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)"
665 keepdir "/usr/$(get_libdir)/apache2/modules"
666 else
667 # needed each time, php_install_ini would reset it
668 into "${PHP_DESTDIR#${EPREFIX}}"
669 case "$sapi" in
670 cli)
671 source="sapi/cli/php"
672 ;;
673 cgi)
674 source="sapi/cgi/php-cgi"
675 ;;
676 fpm)
677 source="sapi/fpm/php-fpm"
678 ;;
679 embed)
680 source="libs/libphp${PHP_MV}$(get_libname)"
681 ;;
682 *)
683 die "unhandled sapi in src_install"
684 ;;
685 esac
686
687 if [[ "${source}" == *"$(get_libname)" ]]; then
688 dolib.so "${source}" || die "Unable to install ${sapi} sapi"
689 else
690 dobin "${source}" || die "Unable to install ${sapi} sapi"
691 fi
692 fi
693
694 php_install_ini "${sapi}"
695
696 # construct correct SAPI string for php-config
697 # thanks to ferringb for the bash voodoo
698 if [[ "${sapi}" == "apache2" ]]; then
699 sapi_list="${sapi_list:+${sapi_list} }apache2handler"
700 else
701 sapi_list="${sapi_list:+${sapi_list} }${sapi}"
702 fi
703 fi
704 done
705
706 # Installing opcache module
707 if use_if_iuse opcache ; then
708 dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module"
709 fi
710
711 # Install env.d files
712 newenvd "${FILESDIR}/20php5-envd" \
713 "20php${SLOT}"
714 sed -e "s|/lib/|/$(get_libdir)/|g" -i \
715 "${ED}/etc/env.d/20php${SLOT}"
716 sed -e "s|php5|php${SLOT}|g" -i \
717 "${ED}/etc/env.d/20php${SLOT}"
718
719 # set php-config variable correctly (bug #278439)
720 sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
721 "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config"
722 }
723
724 src_test() {
725 echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
726 PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
727 if [[ ! -x "${PHP_BIN}" ]] ; then
728 ewarn "Test phase requires USE=cli, skipping"
729 return
730 else
731 export TEST_PHP_EXECUTABLE="${PHP_BIN}"
732 fi
733
734 if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
735 export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
736 fi
737
738 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \
739 "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}"
740
741 for name in ${EXPECTED_TEST_FAILURES}; do
742 mv "${name}.out" "${name}.out.orig" 2>/dev/null
743 done
744
745 local failed="$(find -name '*.out')"
746 if [[ ${failed} != "" ]] ; then
747 ewarn "The following test cases failed unexpectedly:"
748 for name in ${failed}; do
749 ewarn " ${name/.out/}"
750 done
751 else
752 einfo "No unexpected test failures, all fine"
753 fi
754
755 if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
756 local passed=""
757 for name in ${EXPECTED_TEST_FAILURES}; do
758 [[ -f "${name}.diff" ]] && continue
759 passed="${passed} ${name}"
760 done
761 if [[ ${passed} != "" ]] ; then
762 einfo "The following test cases passed unexpectedly:"
763 for name in ${passed}; do
764 ewarn " ${passed}"
765 done
766 else
767 einfo "None of the known-to-fail tests passed, all fine"
768 fi
769 fi
770 }
771
772 pkg_postinst() {
773 # Output some general info to the user
774 if use apache2 ; then
775 APACHE2_MOD_DEFINE="PHP5"
776 APACHE2_MOD_CONF="70_mod_php5"
777 apache-module_pkg_postinst
778 fi
779
780 # Create the symlinks for php
781 for m in ${SAPIS}; do
782 [[ ${m} == 'embed' ]] && continue;
783 if use $m ; then
784 local ci=$(eselect php show $m)
785 if [[ -z $ci ]]; then
786 eselect php set $m php${SLOT}
787 einfo "Switched ${m} to use php:${SLOT}"
788 einfo
789 elif [[ $ci != "php${SLOT}" ]] ; then
790 elog "To switch $m to use php:${SLOT}, run"
791 elog " eselect php set $m php${SLOT}"
792 elog
793 fi
794 fi
795 done
796
797 elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order"
798 elog "to compile extensions for the ${SLOT} ABI"
799 elog
800 if ! use readline && use cli ; then
801 ewarn "Note that in order to use php interactivly, you need to enable"
802 ewarn "the readline USE flag or php -a will hang"
803 fi
804 elog
805 elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
806 elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
807 elog "'production' or 'development' in ${EPREFIX}/etc/make.conf"
808 elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}"
809
810 elog
811 elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
812 elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml"
813 elog
814 }
815
816 pkg_prerm() {
817 eselect php cleanup
818 }