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.6_rc3-r1.ebuild
Date: Sun, 30 Mar 2008 14:15:59
Message-Id: E1JfyKC-0004sX-6O@stork.gentoo.org
1 hoffie 08/03/30 14:15:56
2
3 Modified: ChangeLog
4 Added: php-5.2.6_rc3-r1.ebuild
5 Log:
6 revbump with a patch to fix a regression in escapeshell{arg,cmd}() functions in regards to multi-byte handling, phpbug 44564
7 (Portage version: 2.1.4.4)
8
9 Revision Changes Path
10 1.258 dev-lang/php/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.258&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.258&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?r1=1.257&r2=1.258
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v
19 retrieving revision 1.257
20 retrieving revision 1.258
21 diff -u -r1.257 -r1.258
22 --- ChangeLog 29 Mar 2008 20:00:50 -0000 1.257
23 +++ ChangeLog 30 Mar 2008 14:15:55 -0000 1.258
24 @@ -1,6 +1,13 @@
25 # ChangeLog for dev-lang/php
26 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.257 2008/03/29 20:00:50 maekke Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.258 2008/03/30 14:15:55 hoffie Exp $
29 +
30 +*php-5.2.6_rc3-r1 (30 Mar 2008)
31 +
32 + 30 Mar 2008; Christian Hoffmann <hoffie@g.o>
33 + +php-5.2.6_rc3-r1.ebuild:
34 + revbump with a patch to fix a regression in escapeshell{arg,cmd}()
35 + functions in regards to multi-byte handling, phpbug 44564
36
37 29 Mar 2008; Markus Meier <maekke@g.o> php-5.2.6_rc3.ebuild:
38 x86 stable, security bug #215266
39
40
41
42 1.1 dev-lang/php/php-5.2.6_rc3-r1.ebuild
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.6_rc3-r1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.6_rc3-r1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: php-5.2.6_rc3-r1.ebuild
48 ===================================================================
49 # Copyright 1999-2008 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.6_rc3-r1.ebuild,v 1.1 2008/03/30 14:15:55 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
70 # php patch settings, general
71 PHP_PATCHSET_REV="1"
72 SUHOSIN_PATCH="suhosin-patch-5.2.5_p20080206-0.9.6.2-gentoo.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
78 inherit versionator php5_2-sapi apache-module
79
80 SRC_URI="http://downloads.php.net/ilia/${MY_PHP_P/_rc/RC}.tar.bz2
81 http://gentoo.longitekk.com/php-patchset-${PV}-r${PHP_PATCHSET_REV}.tar.bz2"
82 S="${WORKDIR}/${MY_PHP_P/_rc/RC}"
83
84 # Suhosin patch support
85 [[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? ( http://gentoo.longitekk.com/${SUHOSIN_PATCH} )"
86
87 DESCRIPTION="The PHP language runtime engine: CLI, CGI and Apache2 SAPIs."
88
89 DEPEND="app-admin/php-toolkit"
90 RDEPEND="${DEPEND}"
91
92 want_apache
93
94 pkg_setup() {
95 PHPCONFUTILS_AUTO_USE=""
96
97 # Make sure the user has specified at least one SAPI
98 einfo "Determining SAPI(s) to build"
99 phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache2
100
101 # Threaded Apache2 support
102 if use apache2 ; then
103 has_apache_threads
104 fi
105
106 # Concurrent PHP Apache2 modules support
107 if use apache2 ; then
108 if use concurrentmodphp ; then
109 ewarn
110 ewarn "'concurrentmodphp' makes it possible to load multiple, differently"
111 ewarn "versioned mod_php's into the same Apache instance. This is done with"
112 ewarn "a few linker tricks and workarounds, and is not guaranteed to always"
113 ewarn "work correctly, so use it at your own risk. Especially, do not use"
114 ewarn "this in conjunction with PHP modules (PECL, ...) other than the ones"
115 ewarn "you may find in the Portage tree or the PHP Overlay!"
116 ewarn "This is an experimental feature, so please rebuild PHP"
117 ewarn "without the 'concurrentmodphp' USE flag if you experience"
118 ewarn "any problems, and then reproduce any bugs before filing"
119 ewarn "them in Gentoo's Bugzilla or bugs.php.net."
120 ewarn "If you have conclusive evidence that a bug directly"
121 ewarn "derives from 'concurrentmodphp', please file a bug in"
122 ewarn "Gentoo's Bugzilla only."
123 ewarn
124 ebeep 5
125 fi
126 fi
127
128 # fastbuild support
129 if use fastbuild ; then
130 ewarn
131 ewarn "'fastbuild' attempts to build all SAPIs in a single pass."
132 ewarn "This is an experimental feature, so please rebuild PHP"
133 ewarn "without the 'fastbuild' USE flag if you experience"
134 ewarn "any problems, and then reproduce any bugs before filing"
135 ewarn "them in Gentoo's Bugzilla or bugs.php.net."
136 ewarn "If you have conclusive evidence that a bug directly"
137 ewarn "derives from 'fastbuild', please file a bug in"
138 ewarn "Gentoo's Bugzilla only."
139 ewarn
140 fi
141
142 php5_2-sapi_pkg_setup
143 }
144
145 php_determine_sapis() {
146 # holds the list of sapis that we want to build
147 PHPSAPIS=
148
149 if use cli || phpconfutils_usecheck cli ; then
150 PHPSAPIS="${PHPSAPIS} cli"
151 fi
152
153 if use cgi ; then
154 PHPSAPIS="${PHPSAPIS} cgi"
155 fi
156
157 # note - apache SAPI comes after the simpler cli/cgi sapis
158 if use apache2 ; then
159 PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}"
160 fi
161 }
162
163 src_unpack() {
164 if [[ "${PHP_PACKAGE}" == 1 ]] ; then
165 unpack ${A}
166 fi
167
168 cd "${S}"
169
170 # Concurrent PHP Apache2 modules support
171 if use apache2 ; then
172 if use concurrentmodphp ; then
173 if [[ -n "${CONCURRENTMODPHP_PATCH}" ]] && [[ -f "${WORKDIR}/${CONCURRENTMODPHP_PATCH}" ]] ; then
174 epatch "${WORKDIR}/${CONCURRENTMODPHP_PATCH}"
175 else
176 ewarn "There is no concurrent mod_php patch available for this PHP release yet!"
177 fi
178 fi
179 fi
180
181 # fastbuild support
182 if use fastbuild ; then
183 if [[ -n "${FASTBUILD_PATCH}" ]] && [[ -f "${WORKDIR}/${FASTBUILD_PATCH}" ]] ; then
184 epatch "${WORKDIR}/${FASTBUILD_PATCH}"
185 else
186 ewarn "There is no fastbuild patch available for this PHP release yet!"
187 fi
188 fi
189
190 PHP_EXTRA_BRANDING="RC${PV#*_rc}"
191 # Now let the eclass do the rest and regenerate the configure
192 php5_2-sapi_src_unpack
193
194 # Fix Makefile.global:test to consider the CGI SAPI if present
195 if use cgi ; then
196 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
197 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
198 fi
199
200 # try to fix some test cases which fail because of sandbox otherwise
201 sed -e 's:/no/such/:.\0:' -i ext/standard/tests/file/005_error.phpt \
202 ext/standard/tests/file/006_error.phpt \
203 ext/standard/tests/file/touch.phpt
204
205 # REMOVING BROKEN TESTS:
206 # removing this test as it has been broken for ages and is not easily
207 # fixable (depends on a lot of factors)
208 rm ext/standard/tests/general_functions/phpinfo.phpt
209
210 # never worked properly, no easy fix
211 rm ext/iconv/tests/bug16069.phpt ext/iconv/tests/iconv_stream_filter.phpt
212 }
213
214 src_compile() {
215 if use fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then
216 src_compile_fastbuild
217 else
218 src_compile_normal
219 fi
220 }
221
222 src_compile_fastbuild() {
223 php_determine_sapis
224
225 build_cli=0
226 build_cgi=0
227 build_apache2=0
228 my_conf=""
229
230 for x in ${PHPSAPIS} ; do
231 case ${x} in
232 cli)
233 build_cli=1
234 ;;
235 cgi)
236 build_cgi=1
237 ;;
238 apache2)
239 build_apache2=1
240 ;;
241 esac
242 done
243
244 if [[ ${build_cli} = 1 ]] ; then
245 my_conf="${my_conf} --enable-cli"
246 else
247 my_conf="${my_conf} --disable-cli"
248 fi
249
250 if [[ ${build_cgi} = 1 ]] ; then
251 my_conf="${my_conf} --enable-cgi --enable-fastcgi"
252 phpconfutils_extension_enable "discard-path" "discard-path" 0
253 phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
254 else
255 my_conf="${my_conf} --disable-cgi"
256 fi
257
258 if [[ ${build_apache2} = 1 ]] ; then
259 my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2"
260
261 # Threaded Apache2 support
262 if use threads ; then
263 my_conf="${my_conf} --enable-maintainer-zts"
264 ewarn "Enabling ZTS for Apache2 MPM"
265 fi
266
267 # Concurrent PHP Apache2 modules support
268 if use concurrentmodphp ; then
269 append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
270 fi
271 fi
272
273 # Now we know what we are building, build it
274 php5_2-sapi_src_compile
275
276 # To keep the separate php.ini files for each SAPI, we change the
277 # build-defs.h and recompile
278
279 if [[ ${build_cli} = 1 ]] ; then
280 einfo
281 einfo "Building CLI SAPI"
282 einfo
283
284 sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php5"|g;' -i main/build-defs.h
285 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
286 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
287 [[ -f ${x} ]] && rm -f ${x}
288 done
289 make sapi/cli/php || die "Unable to make CLI SAPI"
290 cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
291 fi
292
293 if [[ ${build_cgi} = 1 ]] ; then
294 einfo
295 einfo "Building CGI SAPI"
296 einfo
297
298 sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php5"|g;' -i main/build-defs.h
299 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
300 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
301 [[ -f ${x} ]] && rm -f ${x}
302 done
303 make sapi/cgi/php-cgi || die "Unable to make CGI SAPI"
304 cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
305 fi
306
307 if [[ ${build_apache2} = 1 ]] ; then
308 einfo
309 einfo "Building apache${APACHE_VERSION} SAPI"
310 einfo
311
312 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
313 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
314 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
315 [[ -f ${x} ]] && rm -f ${x}
316 done
317 make || die "Unable to make apache${APACHE_VERSION} SAPI"
318 fi
319 }
320
321 src_compile_normal() {
322 php_determine_sapis
323
324 CLEAN_REQUIRED=0
325 my_conf=""
326
327 # Support the Apache2 extras, they must be set globally for all
328 # SAPIs to work correctly, especially for external PHP extensions
329 if use apache2 ; then
330 # Concurrent PHP Apache2 modules support
331 if use concurrentmodphp ; then
332 append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
333 fi
334 fi
335
336 for x in ${PHPSAPIS} ; do
337 # Support the Apache2 extras, they must be set globally for all
338 # SAPIs to work correctly, especially for external PHP extensions
339 if use apache2 ; then
340 # Threaded Apache2 support
341 if use threads ; then
342 my_conf="${my_conf} --enable-maintainer-zts"
343 ewarn "Enabling ZTS for Apache2 MPM"
344 fi
345 fi
346
347 if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then
348 make clean
349 fi
350
351 PHPSAPI="${x}"
352
353 case ${x} in
354 cli)
355 my_conf="${my_conf} --enable-cli --disable-cgi"
356 php5_2-sapi_src_compile
357 cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
358 ;;
359 cgi)
360 my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi"
361 phpconfutils_extension_enable "discard-path" "discard-path" 0
362 phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
363 php5_2-sapi_src_compile
364 cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
365 ;;
366 apache2)
367 my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2"
368 php5_2-sapi_src_compile
369 ;;
370 esac
371
372 CLEAN_REQUIRED=1
373 my_conf=""
374 done
375 }
376
377 src_install() {
378 php_determine_sapis
379
380 destdir=/usr/$(get_libdir)/php5
381
382 # Let the eclass do the common work
383 php5_2-sapi_src_install
384
385 einfo
386 einfo "Installing SAPI(s) ${PHPSAPIS}"
387 einfo
388
389 for x in ${PHPSAPIS} ; do
390
391 PHPSAPI="${x}"
392
393 case ${x} in
394 cli)
395 einfo "Installing CLI SAPI"
396 into ${destdir}
397 newbin php-cli php || die "Unable to install ${x} sapi"
398 php5_2-sapi_install_ini
399 ;;
400 cgi)
401 einfo "Installing CGI SAPI"
402 into ${destdir}
403 dobin php-cgi || die "Unable to install ${x} sapi"
404 php5_2-sapi_install_ini
405 ;;
406 apache2)
407 einfo "Installing Apache${APACHE_VERSION} SAPI"
408 make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"
409 if use concurrentmodphp ; then
410 einfo "Installing Apache${APACHE_VERSION} config file for PHP5-concurrent (70_mod_php5_concurr.conf)"
411 insinto ${APACHE_MODULES_CONFDIR}
412 newins "${FILESDIR}/70_mod_php5_concurr.conf-apache2" "70_mod_php5_concurr.conf"
413
414 # Put the ld version script in the right place so it's always accessible
415 insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
416 doins "${FILESDIR}/php5-ldvs"
417
418 # Redefine the extension dir to have the modphp suffix
419 PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`-versioned"
420 else
421 einfo "Installing Apache${APACHE_VERSION} config file for PHP5 (70_mod_php5.conf)"
422 insinto ${APACHE_MODULES_CONFDIR}
423 newins "${FILESDIR}/70_mod_php5.conf-apache2" "70_mod_php5.conf"
424 fi
425 php5_2-sapi_install_ini
426 ;;
427 esac
428 done
429
430 # Install env.d files
431 newenvd "${FILESDIR}/20php5-envd" "20php5"
432 sed -e "s|/lib/|/$(get_libdir)/|g" -i "${D}/etc/env.d/20php5"
433 }
434
435 pkg_postinst() {
436 # Output some general info to the user
437 if use apache2 ; then
438 APACHE2_MOD_DEFINE="PHP5"
439 if use concurrentmodphp ; then
440 APACHE2_MOD_CONF="70_mod_php5_concurr"
441 else
442 APACHE2_MOD_CONF="70_mod_php5"
443 fi
444 apache-module_pkg_postinst
445 fi
446
447 # Update Apache2 to use mod_php
448 if use apache2 ; then
449 "${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1
450 exitStatus=$?
451 if [[ ${exitStatus} == 2 ]] ; then
452 php-select apache2 php5
453 elif [[ ${exitStatus} == 4 ]] ; then
454 ewarn
455 ewarn "Apache2 is configured to load a different version of PHP."
456 ewarn "To make Apache2 use PHP v5, use php-select:"
457 ewarn
458 ewarn " php-select apache2 php5"
459 ewarn
460 fi
461 fi
462
463 # Create the symlinks for php-cli
464 if use cli || phpconfutils_usecheck cli ; then
465 "${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1
466 exitStatus=$?
467 if [[ ${exitStatus} == 5 ]] ; then
468 php-select php php5
469 elif [[ ${exitStatus} == 4 ]] ; then
470 ewarn
471 ewarn "/usr/bin/php links to a different version of PHP."
472 ewarn "To make /usr/bin/php point to PHP v5, use php-select:"
473 ewarn
474 ewarn " php-select php php5"
475 ewarn
476 fi
477 fi
478
479 # Create the symlinks for php-cgi
480 if use cgi ; then
481 "${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1
482 exitStatus=$?
483 if [[ ${exitStatus} == 5 ]] ; then
484 php-select php-cgi php5
485 elif [[ ${exitStatus} == 4 ]] ; then
486 ewarn
487 ewarn "/usr/bin/php-cgi links to a different version of PHP."
488 ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:"
489 ewarn
490 ewarn " php-select php-cgi php5"
491 ewarn
492 fi
493 fi
494
495 # Create the symlinks for php-devel
496 "${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1
497 exitStatus=$?
498 if [[ $exitStatus == 5 ]] ; then
499 php-select php-devel php5
500 elif [[ $exitStatus == 4 ]] ; then
501 ewarn
502 ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a"
503 ewarn "different version of PHP. To make them point to PHP v5, use"
504 ewarn "php-select:"
505 ewarn
506 ewarn " php-select php-devel php5"
507 ewarn
508 fi
509
510 php5_2-sapi_pkg_postinst
511 }
512
513 src_test() {
514 vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
515 if [[ ! -x "${S}"/php-cli ]]; then
516 ewarn "Running the php test suite requires USE=cli"
517 return
518 fi
519
520 export TEST_PHP_EXECUTABLE="${S}"/php-cli
521 if [[ -x "${S}"/php-cgi ]]; then
522 export TEST_PHP_CGI_EXECUTABLE="${S}"/php-cgi
523 fi
524 REPORT_EXIT_STATUS=1 "${S}"/php-cli -n "${S}"/run-tests.php -n
525
526 if [[ $? != 0 ]] ; then
527 eerror "Not all tests were successful!"
528 fi
529 }
530
531
532
533 --
534 gentoo-commits@l.g.o mailing list