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