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