Gentoo Archives: gentoo-commits

From: "Christian Hoffmann (hoffie)" <hoffie@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/php: ChangeLog php-5.2.12.ebuild
Date: Wed, 30 Dec 2009 13:34:15
Message-Id: E1NPygl-0003rS-9j@stork.gentoo.org
1 hoffie 09/12/30 13:34:11
2
3 Modified: ChangeLog
4 Added: php-5.2.12.ebuild
5 Log:
6 version bump to 5.2.12 wrt security bug 297399
7 (Portage version: 2.1.7.15/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.360 dev-lang/php/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.360&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.360&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?r1=1.359&r2=1.360
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v
19 retrieving revision 1.359
20 retrieving revision 1.360
21 diff -u -r1.359 -r1.360
22 --- ChangeLog 16 Dec 2009 21:53:55 -0000 1.359
23 +++ ChangeLog 30 Dec 2009 13:34:10 -0000 1.360
24 @@ -1,6 +1,13 @@
25 # ChangeLog for dev-lang/php
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.359 2009/12/16 21:53:55 hoffie Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.360 2009/12/30 13:34:10 hoffie Exp $
29 +
30 +*php-5.2.12 (30 Dec 2009)
31 +
32 + 30 Dec 2009; Christian Hoffmann <hoffie@g.o> +php-5.2.12.ebuild:
33 + version bump to 5.2.12 wrt security bug 297399, please note that
34 + USE=concurrentmodphp is broken (but should not be needed at the moment
35 + anyway), bug 298969
36
37 16 Dec 2009; Christian Hoffmann <hoffie@g.o> php-5.2.11.ebuild,
38 php-5.2.11-r1.ebuild:
39
40
41
42 1.1 dev-lang/php/php-5.2.12.ebuild
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.12.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.12.ebuild?rev=1.1&content-type=text/plain
46
47 Index: php-5.2.12.ebuild
48 ===================================================================
49 # Copyright 1999-2009 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.2.12.ebuild,v 1.1 2009/12/30 13:34:10 hoffie Exp $
52
53 CGI_SAPI_USE="discard-path force-cgi-redirect"
54 APACHE2_SAPI_USE="concurrentmodphp threads"
55 IUSE="cli cgi ${CGI_SAPI_USE} ${APACHE2_SAPI_USE} fastbuild"
56
57 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
58
59 # NOTE: Portage doesn't support setting PROVIDE based on the USE flags
60 # that have been enabled, so we have to PROVIDE everything for now
61 # and hope for the best
62 PROVIDE="virtual/php virtual/httpd-php"
63
64 # php package settings
65 SLOT="5"
66 MY_PHP_PV="${PV}"
67 MY_PHP_P="php-${MY_PHP_PV}"
68 PHP_PACKAGE="1"
69 # php patch settings, general
70 PHP_PATCHSET_REV="${PR/r/}"
71 PHP_PATCHSET_URI="http://dev.gentoo.org/~hoffie/distfiles/php-patchset-${PV}-r${PHP_PATCHSET_REV}.tar.bz2"
72 SUHOSIN_PATCH="suhosin-patch-5.2.11-0.9.7.patch.gz"
73 MULTILIB_PATCH="${MY_PHP_PV}/opt/multilib-search-path.patch"
74 # php patch settings, ebuild specific
75 FASTBUILD_PATCH="${MY_PHP_PV}/opt/fastbuild.patch"
76 CONCURRENTMODPHP_PATCH="${MY_PHP_PV}/opt/concurrent_apache_modules.patch"
77 # kolab patch - http://kolab.org/cgi-bin/viewcvs-kolab.cgi/server/patches/php/
78 # bugs about this go to wrobel@g.o
79 KOLAB_PATCH="${MY_PHP_PV}/opt/kolab-imap-annotations.patch"
80
81 inherit versionator php5_2-sapi apache-module
82
83 # Suhosin patch support
84 [[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? ( http://gentoo.longitekk.com/${SUHOSIN_PATCH} )"
85
86 DESCRIPTION="The PHP language runtime engine: CLI, CGI and Apache2 SAPIs."
87
88 DEPEND="app-admin/php-toolkit
89 imap? ( >=virtual/imap-c-client-2006k )
90 pcre? ( >=dev-libs/libpcre-7.8 )
91 xml? ( >=dev-libs/libxml2-2.7.2-r2 )
92 xmlrpc? ( >=dev-libs/libxml2-2.7.2-r2 virtual/libiconv )"
93
94 RDEPEND="${DEPEND}"
95 if [[ -n "${KOLAB_PATCH}" ]] ; then
96 IUSE="${IUSE} kolab"
97 DEPEND="${DEPEND}
98 kolab? ( >=net-libs/c-client-2004g-r1 )"
99 fi
100
101 PDEPEND="suhosin? ( >=dev-php5/suhosin-0.9.29 )"
102
103 want_apache
104
105 pkg_setup() {
106 PHPCONFUTILS_AUTO_USE=""
107
108 # Make sure the user has specified at least one SAPI
109 einfo "Determining SAPI(s) to build"
110 phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache2
111
112 # Threaded Apache2 support
113 if use apache2 ; then
114 has_apache_threads
115 fi
116
117 # Concurrent PHP Apache2 modules support
118 if use apache2 ; then
119 if use concurrentmodphp ; then
120 ewarn
121 ewarn "'concurrentmodphp' makes it possible to load multiple, differently"
122 ewarn "versioned mod_php's into the same Apache instance. This is done with"
123 ewarn "a few linker tricks and workarounds, and is not guaranteed to always"
124 ewarn "work correctly, so use it at your own risk. Especially, do not use"
125 ewarn "this in conjunction with PHP modules (PECL, ...) other than the ones"
126 ewarn "you may find in the Portage tree or the PHP Overlay!"
127 ewarn "This is an experimental feature, so please rebuild PHP"
128 ewarn "without the 'concurrentmodphp' USE flag if you experience"
129 ewarn "any problems, and then reproduce any bugs before filing"
130 ewarn "them in Gentoo's Bugzilla or bugs.php.net."
131 ewarn "If you have conclusive evidence that a bug directly"
132 ewarn "derives from 'concurrentmodphp', please file a bug in"
133 ewarn "Gentoo's Bugzilla only."
134 ewarn
135 ebeep 5
136 fi
137 fi
138
139 # fastbuild support
140 if use fastbuild ; then
141 ewarn
142 ewarn "'fastbuild' attempts to build all SAPIs in a single pass."
143 ewarn "This is an experimental feature, so please rebuild PHP"
144 ewarn "without the 'fastbuild' USE flag if you experience"
145 ewarn "any problems, and then reproduce any bugs before filing"
146 ewarn "them in Gentoo's Bugzilla or bugs.php.net."
147 ewarn "If you have conclusive evidence that a bug directly"
148 ewarn "derives from 'fastbuild', please file a bug in"
149 ewarn "Gentoo's Bugzilla only."
150 ewarn
151 fi
152
153 if use pcre ; then
154 built_with_use dev-libs/libpcre unicode || \
155 die "Please rebuild dev-libs/libpcre with USE=unicode"
156 fi
157
158 depend.apache_pkg_setup
159 php5_2-sapi_pkg_setup
160 }
161
162 php_determine_sapis() {
163 # holds the list of sapis that we want to build
164 PHPSAPIS=
165
166 if use cli || phpconfutils_usecheck cli ; then
167 PHPSAPIS="${PHPSAPIS} cli"
168 fi
169
170 if use cgi ; then
171 PHPSAPIS="${PHPSAPIS} cgi"
172 fi
173
174 # note - apache SAPI comes after the simpler cli/cgi sapis
175 if use apache2 ; then
176 PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}"
177 fi
178 }
179
180 src_unpack() {
181 if [[ "${PHP_PACKAGE}" == 1 ]] ; then
182 unpack ${A}
183 fi
184
185 cd "${S}"
186
187 # Concurrent PHP Apache2 modules support
188 if use apache2 ; then
189 if use concurrentmodphp ; then
190 if [[ -n "${CONCURRENTMODPHP_PATCH}" ]] && [[ -f "${WORKDIR}/${CONCURRENTMODPHP_PATCH}" ]] ; then
191 epatch "${WORKDIR}/${CONCURRENTMODPHP_PATCH}"
192 else
193 ewarn "There is no concurrent mod_php patch available for this PHP release yet!"
194 fi
195 fi
196 fi
197
198 # fastbuild support
199 if use fastbuild ; then
200 if [[ -n "${FASTBUILD_PATCH}" ]] && [[ -f "${WORKDIR}/${FASTBUILD_PATCH}" ]] ; then
201 epatch "${WORKDIR}/${FASTBUILD_PATCH}"
202 else
203 ewarn "There is no fastbuild patch available for this PHP release yet!"
204 fi
205 fi
206
207 # kolab support
208 if [[ -n "${KOLAB_PATCH}" ]] ; then
209 use kolab && epatch "${WORKDIR}/${KOLAB_PATCH}"
210 fi
211
212 # pretend to not have flex, bug 221357
213 sed -re 's:( +)PHP_SUBST\(LEX\):\1LEX="exit 0;"\n\0:' -i acinclude.m4
214
215 # Now let the eclass do the rest and regenerate the configure
216 php5_2-sapi_src_unpack
217
218 # Fix Makefile.global:test to consider the CGI SAPI if present
219 if use cgi ; then
220 sed -e "s|test \! -z \"\$(top_builddir)/php-cli\" \&\& test -x \"\$(top_builddir)/php-cli\"|test \! -z \"\$(top_builddir)/php-cli\" \&\& test -x \"\$(top_builddir)/php-cli\" \&\& test \! -z \"\$(top_builddir)/php-cgi\" \&\& test -x \"\$(top_builddir)/php-cgi\"|g" -i Makefile.global
221 sed -e "s|TEST_PHP_EXECUTABLE=\"\$(top_builddir)/php-cli\"|TEST_PHP_EXECUTABLE=\"\$(top_builddir)/php-cli\" TEST_PHP_CGI_EXECUTABLE=\"\$(top_builddir)/php-cgi\"|g" -i Makefile.global
222 fi
223
224 # try to fix some test cases which fail because of sandbox otherwise
225 sed -e 's:/no/such/:.\0:' -i ext/standard/tests/file/005_error.phpt \
226 ext/standard/tests/file/006_error.phpt \
227 ext/standard/tests/file/touch.phpt
228
229 # REMOVING BROKEN TESTS:
230 # removing this test as it has been broken for ages and is not easily
231 # fixable (depends on a lot of factors)
232 rm ext/standard/tests/general_functions/phpinfo.phpt
233
234 # never worked properly, no easy fix
235 rm ext/iconv/tests/bug16069.phpt ext/iconv/tests/iconv_stream_filter.phpt
236
237 # needs write access to /tmp and others
238 rm ext/session/tests/session_save_path_variation5.phpt
239
240 # new tests since 5.2.7 which have never been working for me
241 rm ext/spl/tests/arrayObject___construct_basic4.phpt \
242 ext/spl/tests/arrayObject___construct_basic5.phpt \
243 ext/spl/tests/arrayObject_exchangeArray_basic3.phpt \
244 ext/spl/tests/arrayObject_setFlags_basic1.phpt
245
246 # those might as well be related to suhosin
247 rm ext/session/tests/session_decode_variation3.phpt \
248 ext/session/tests/session_encode_variation8.phpt
249
250 # missing skipif
251 use reflection || \
252 rm ext/standard/tests/directory/DirectoryClass_basic_001.phpt
253
254 # sandbox-related (sandbox checks for permissions before even looking
255 # at the fs, but the tests expect "No such file or directory"
256 sed -e 's:/blah:./bla:' -i \
257 ext/session/tests/session_save_path_variation{2,3}.phpt
258 rm ext/standard/tests/file/rename_variation13.phpt
259
260 # test passes, but run-tests.php claims failure
261 rm ext/standard/tests/file/tempnam_variation4.phpt
262
263 # these tests behave differently with suhosin enabled, adapting them...
264 use suhosin && sed -e 's:File(\.\./):File(..):g' -i \
265 tests/security/open_basedir*{.inc,.phpt}
266 }
267
268 src_compile() {
269 # bug 217392 (autconf-2.62 behavior changes)
270 export CFLAGS="${CFLAGS} -D_GNU_SOURCE"
271 export CXXFLAGS="${CXXFLAGS} -D_GNU_SOURCE"
272 if use fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then
273 src_compile_fastbuild
274 else
275 src_compile_normal
276 fi
277 }
278
279 src_compile_fastbuild() {
280 php_determine_sapis
281
282 build_cli=0
283 build_cgi=0
284 build_apache2=0
285 my_conf=""
286
287 for x in ${PHPSAPIS} ; do
288 case ${x} in
289 cli)
290 build_cli=1
291 ;;
292 cgi)
293 build_cgi=1
294 ;;
295 apache2)
296 build_apache2=1
297 ;;
298 esac
299 done
300
301 if [[ ${build_cli} = 1 ]] ; then
302 my_conf="${my_conf} --enable-cli"
303 else
304 my_conf="${my_conf} --disable-cli"
305 fi
306
307 if [[ ${build_cgi} = 1 ]] ; then
308 my_conf="${my_conf} --enable-cgi --enable-fastcgi"
309 phpconfutils_extension_enable "discard-path" "discard-path" 0
310 phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
311 else
312 my_conf="${my_conf} --disable-cgi"
313 fi
314
315 if [[ ${build_apache2} = 1 ]] ; then
316 my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2"
317
318 # Threaded Apache2 support
319 if use threads ; then
320 my_conf="${my_conf} --enable-maintainer-zts"
321 ewarn "Enabling ZTS for Apache2 MPM"
322 fi
323
324 # Concurrent PHP Apache2 modules support
325 if use concurrentmodphp ; then
326 append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
327 fi
328 fi
329
330 if use pcre || phpconfutils_usecheck pcre ; then
331 myconf="${my_conf} --with-pcre-dir=/usr"
332 phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr"
333 fi
334
335 # Now we know what we are building, build it
336 php5_2-sapi_src_compile
337
338 # To keep the separate php.ini files for each SAPI, we change the
339 # build-defs.h and recompile
340
341 if [[ ${build_cli} = 1 ]] ; then
342 einfo
343 einfo "Building CLI SAPI"
344 einfo
345
346 sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php5"|g;' -i main/build-defs.h
347 sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/cli-php5/ext-active"|g;' -i main/build-defs.h
348 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
349 [[ -f ${x} ]] && rm -f ${x}
350 done
351 make sapi/cli/php || die "Unable to make CLI SAPI"
352 cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
353 fi
354
355 if [[ ${build_cgi} = 1 ]] ; then
356 einfo
357 einfo "Building CGI SAPI"
358 einfo
359
360 sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php5"|g;' -i main/build-defs.h
361 sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/cgi-php5/ext-active"|g;' -i main/build-defs.h
362 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
363 [[ -f ${x} ]] && rm -f ${x}
364 done
365 make sapi/cgi/php-cgi || die "Unable to make CGI SAPI"
366 cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
367 fi
368
369 if [[ ${build_apache2} = 1 ]] ; then
370 einfo
371 einfo "Building apache${APACHE_VERSION} SAPI"
372 einfo
373
374 sed -e "s|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH \"/etc/php/apache${APACHE_VERSION}-php5\"|g;" -i main/build-defs.h
375 sed -e "s|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR \"/etc/php/apache${APACHE_VERSION}-php5/ext-active\"|g;" -i main/build-defs.h
376 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
377 [[ -f ${x} ]] && rm -f ${x}
378 done
379 make || die "Unable to make apache${APACHE_VERSION} SAPI"
380 fi
381 }
382
383 src_compile_normal() {
384 php_determine_sapis
385
386 CLEAN_REQUIRED=0
387 my_conf=""
388
389 # Support the Apache2 extras, they must be set globally for all
390 # SAPIs to work correctly, especially for external PHP extensions
391 if use apache2 ; then
392 # Concurrent PHP Apache2 modules support
393 if use concurrentmodphp ; then
394 append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
395 fi
396 fi
397
398 for x in ${PHPSAPIS} ; do
399 if use pcre || phpconfutils_usecheck pcre ; then
400 myconf="${my_conf} --with-pcre-dir=/usr"
401 phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr"
402 fi
403
404 # Support the Apache2 extras, they must be set globally for all
405 # SAPIs to work correctly, especially for external PHP extensions
406 if use apache2 ; then
407 # Threaded Apache2 support
408 if use threads ; then
409 my_conf="${my_conf} --enable-maintainer-zts"
410 ewarn "Enabling ZTS for Apache2 MPM"
411 fi
412 fi
413
414 if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then
415 make clean
416 fi
417
418 PHPSAPI="${x}"
419
420 case ${x} in
421 cli)
422 my_conf="${my_conf} --enable-cli --disable-cgi"
423 php5_2-sapi_src_compile
424 cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
425 ;;
426 cgi)
427 my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi"
428 phpconfutils_extension_enable "discard-path" "discard-path" 0
429 phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
430 php5_2-sapi_src_compile
431 cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
432 ;;
433 apache2)
434 my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2"
435 php5_2-sapi_src_compile
436 ;;
437 esac
438
439 CLEAN_REQUIRED=1
440 my_conf=""
441 done
442 }
443
444 src_install() {
445 php_determine_sapis
446
447 destdir=/usr/$(get_libdir)/php5
448
449 # Let the eclass do the common work
450 php5_2-sapi_src_install
451
452 einfo
453 einfo "Installing SAPI(s) ${PHPSAPIS}"
454 einfo
455
456 for x in ${PHPSAPIS} ; do
457
458 PHPSAPI="${x}"
459
460 case ${x} in
461 cli)
462 einfo "Installing CLI SAPI"
463 into ${destdir}
464 newbin php-cli php || die "Unable to install ${x} sapi"
465 php5_2-sapi_install_ini
466 ;;
467 cgi)
468 einfo "Installing CGI SAPI"
469 into ${destdir}
470 dobin php-cgi || die "Unable to install ${x} sapi"
471 php5_2-sapi_install_ini
472 ;;
473 apache2)
474 einfo "Installing Apache${APACHE_VERSION} SAPI"
475 make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"
476 if use concurrentmodphp ; then
477 einfo "Installing Apache${APACHE_VERSION} config file for PHP5-concurrent (70_mod_php5_concurr.conf)"
478 insinto ${APACHE_MODULES_CONFDIR}
479 newins "${FILESDIR}/70_mod_php5_concurr.conf-apache2-r1" "70_mod_php5_concurr.conf"
480
481 # Put the ld version script in the right place so it's always accessible
482 insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
483 doins "${FILESDIR}/php5-ldvs"
484
485 # Redefine the extension dir to have the modphp suffix
486 PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`-versioned"
487 else
488 einfo "Installing Apache${APACHE_VERSION} config file for PHP5 (70_mod_php5.conf)"
489 insinto ${APACHE_MODULES_CONFDIR}
490 newins "${FILESDIR}/70_mod_php5.conf-apache2-r1" "70_mod_php5.conf"
491 fi
492 php5_2-sapi_install_ini
493 ;;
494 esac
495 done
496
497 # Install env.d files
498 newenvd "${FILESDIR}/20php5-envd" "20php5"
499 sed -e "s|/lib/|/$(get_libdir)/|g" -i "${D}/etc/env.d/20php5"
500 }
501
502 pkg_postinst() {
503 # Output some general info to the user
504 if use apache2 ; then
505 APACHE2_MOD_DEFINE="PHP5"
506 if use concurrentmodphp ; then
507 APACHE2_MOD_CONF="70_mod_php5_concurr"
508 else
509 APACHE2_MOD_CONF="70_mod_php5"
510 fi
511 apache-module_pkg_postinst
512 fi
513
514 # Update Apache2 to use mod_php
515 if use apache2 ; then
516 "${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1
517 exitStatus=$?
518 if [[ ${exitStatus} == 2 ]] ; then
519 php-select apache2 php5
520 elif [[ ${exitStatus} == 4 ]] ; then
521 ewarn
522 ewarn "Apache2 is configured to load a different version of PHP."
523 ewarn "To make Apache2 use PHP v5, use php-select:"
524 ewarn
525 ewarn " php-select apache2 php5"
526 ewarn
527 fi
528 fi
529
530 # Create the symlinks for php-cli
531 if use cli || phpconfutils_usecheck cli ; then
532 "${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1
533 exitStatus=$?
534 if [[ ${exitStatus} == 5 ]] ; then
535 php-select php php5
536 elif [[ ${exitStatus} == 4 ]] ; then
537 ewarn
538 ewarn "/usr/bin/php links to a different version of PHP."
539 ewarn "To make /usr/bin/php point to PHP v5, use php-select:"
540 ewarn
541 ewarn " php-select php php5"
542 ewarn
543 fi
544 fi
545
546 # Create the symlinks for php-cgi
547 if use cgi ; then
548 "${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1
549 exitStatus=$?
550 if [[ ${exitStatus} == 5 ]] ; then
551 php-select php-cgi php5
552 elif [[ ${exitStatus} == 4 ]] ; then
553 ewarn
554 ewarn "/usr/bin/php-cgi links to a different version of PHP."
555 ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:"
556 ewarn
557 ewarn " php-select php-cgi php5"
558 ewarn
559 fi
560 fi
561
562 # Create the symlinks for php-devel
563 "${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1
564 exitStatus=$?
565 if [[ $exitStatus == 5 ]] ; then
566 php-select php-devel php5
567 elif [[ $exitStatus == 4 ]] ; then
568 ewarn
569 ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a"
570 ewarn "different version of PHP. To make them point to PHP v5, use"
571 ewarn "php-select:"
572 ewarn
573 ewarn " php-select php-devel php5"
574 ewarn
575 fi
576
577 php5_2-sapi_pkg_postinst
578 }
579
580 src_test() {
581 vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
582 if [[ ! -x "${S}"/php-cli ]]; then
583 ewarn "Running the php test suite requires USE=cli"
584 return
585 fi
586
587 export TEST_PHP_EXECUTABLE="${S}"/php-cli
588 if [[ -x "${S}"/php-cgi ]]; then
589 export TEST_PHP_CGI_EXECUTABLE="${S}"/php-cgi
590 fi
591 REPORT_EXIT_STATUS=1 "${S}"/php-cli -n "${S}"/run-tests.php -n
592
593 if [[ $? != 0 ]] ; then
594 eerror "Not all tests were successful!"
595 fi
596 }