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.ebuild php-5.2.3-r3.ebuild
Date: Sat, 08 Sep 2007 18:33:29
Message-Id: E1IU50v-0003c1-BZ@stork.gentoo.org
1 hoffie 07/09/08 18:26:37
2
3 Modified: ChangeLog
4 Added: php-5.2.4.ebuild
5 Removed: php-5.2.3-r3.ebuild
6 Log:
7 adding php-5.2.4, bug 191034; removing broken php-5.2.3*
8 (Portage version: 2.1.2.12)
9
10 Revision Changes Path
11 1.194 dev-lang/php/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.194&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.194&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?r1=1.193&r2=1.194
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v
20 retrieving revision 1.193
21 retrieving revision 1.194
22 diff -u -r1.193 -r1.194
23 --- ChangeLog 29 Aug 2007 10:22:06 -0000 1.193
24 +++ ChangeLog 8 Sep 2007 18:26:36 -0000 1.194
25 @@ -1,6 +1,12 @@
26 # ChangeLog for dev-lang/php
27 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.193 2007/08/29 10:22:06 corsair Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.194 2007/09/08 18:26:36 hoffie Exp $
30 +
31 +*php-5.2.4 (08 Sep 2007)
32 +
33 + 08 Sep 2007; Christian Hoffmann <hoffie@g.o> -php-5.2.3-r3.ebuild,
34 + +php-5.2.4.ebuild:
35 + adding php-5.2.4, bug 191034; removing broken php-5.2.3*
36
37 29 Aug 2007; Markus Rothe <corsair@g.o>
38 php-4.4.8_pre20070816.ebuild:
39
40
41
42 1.1 dev-lang/php/php-5.2.4.ebuild
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.4.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.4.ebuild?rev=1.1&content-type=text/plain
46
47 Index: php-5.2.4.ebuild
48 ===================================================================
49 # Copyright 1999-2007 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.4.ebuild,v 1.1 2007/09/08 18:26:36 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="0"
72 SUHOSIN_PATCH="suhosin-patch-${MY_PHP_PV}-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 php5_2-sapi apache-module
79
80 DESCRIPTION="The PHP language runtime engine: CLI, CGI and Apache2 SAPIs."
81
82 DEPEND="app-admin/php-toolkit"
83 RDEPEND="${DEPEND}"
84
85 want_apache
86
87 pkg_setup() {
88 PHPCONFUTILS_AUTO_USE=""
89
90 # Make sure the user has specified at least one SAPI
91 einfo "Determining SAPI(s) to build"
92 phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache2
93
94 # Threaded Apache2 support
95 if use apache2 ; then
96 if [[ "${APACHE_VERSION}" != "0" ]] ; then
97 if ! use threads ; then
98 APACHE2_SAFE_MPMS="itk peruser prefork"
99 else
100 APACHE2_SAFE_MPMS="event leader metuxmpm perchild threadpool worker"
101 fi
102
103 ewarn
104 ewarn "If this package fails with a fatal error about Apache2 not having"
105 ewarn "been compiled with a compatible MPM, this is normally because you"
106 ewarn "need to toggle the 'threads' USE flag."
107 ewarn
108 ewarn "If 'threads' is off, try switching it on."
109 ewarn "If 'threads' is on, try switching it off."
110 ewarn
111
112 apache-module_pkg_setup
113 fi
114 fi
115
116 # Concurrent PHP Apache2 modules support
117 if use apache2 ; then
118 if [[ "${APACHE_VERSION}" != "0" ]] ; 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 fi
139
140 # fastbuild support
141 if use fastbuild ; then
142 ewarn
143 ewarn "'fastbuild' attempts to build all SAPIs in a single pass."
144 ewarn "This is an experimental feature, so please rebuild PHP"
145 ewarn "without the 'fastbuild' USE flag if you experience"
146 ewarn "any problems, and then reproduce any bugs before filing"
147 ewarn "them in Gentoo's Bugzilla or bugs.php.net."
148 ewarn "If you have conclusive evidence that a bug directly"
149 ewarn "derives from 'fastbuild', please file a bug in"
150 ewarn "Gentoo's Bugzilla only."
151 ewarn
152 fi
153
154 php5_2-sapi_pkg_setup
155 }
156
157 php_determine_sapis() {
158 # holds the list of sapis that we want to build
159 PHPSAPIS=
160
161 if use cli || phpconfutils_usecheck cli ; then
162 PHPSAPIS="${PHPSAPIS} cli"
163 fi
164
165 if use cgi ; then
166 PHPSAPIS="${PHPSAPIS} cgi"
167 fi
168
169 # note - apache SAPI comes after the simpler cli/cgi sapis
170 if use apache2 ; then
171 if [[ "${APACHE_VERSION}" != "0" ]] ; then
172 PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}"
173 fi
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 [[ "${APACHE_VERSION}" != "0" ]] ; then
187 if use concurrentmodphp ; then
188 if [[ -n "${CONCURRENTMODPHP_PATCH}" ]] && [[ -f "${WORKDIR}/${CONCURRENTMODPHP_PATCH}" ]] ; then
189 epatch "${WORKDIR}/${CONCURRENTMODPHP_PATCH}"
190 else
191 ewarn "There is no concurrent mod_php patch available for this PHP release yet!"
192 fi
193 fi
194 fi
195 fi
196
197 # fastbuild support
198 if use fastbuild ; then
199 if [[ -n "${FASTBUILD_PATCH}" ]] && [[ -f "${WORKDIR}/${FASTBUILD_PATCH}" ]] ; then
200 epatch "${WORKDIR}/${FASTBUILD_PATCH}"
201 else
202 ewarn "There is no fastbuild patch available for this PHP release yet!"
203 fi
204 fi
205
206 # Now let the eclass do the rest and regenerate the configure
207 php5_2-sapi_src_unpack
208
209 # Fix Makefile.global:test to consider the CGI SAPI if present
210 if use cgi ; then
211 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
212 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
213 fi
214 }
215
216 src_compile() {
217 if use fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then
218 src_compile_fastbuild
219 else
220 src_compile_normal
221 fi
222 }
223
224 src_compile_fastbuild() {
225 php_determine_sapis
226
227 build_cli=0
228 build_cgi=0
229 build_apache2=0
230 my_conf=""
231
232 for x in ${PHPSAPIS} ; do
233 case ${x} in
234 cli)
235 build_cli=1
236 ;;
237 cgi)
238 build_cgi=1
239 ;;
240 apache2)
241 build_apache2=1
242 ;;
243 esac
244 done
245
246 if [[ ${build_cli} = 1 ]] ; then
247 my_conf="${my_conf} --enable-cli"
248 else
249 my_conf="${my_conf} --disable-cli"
250 fi
251
252 if [[ ${build_cgi} = 1 ]] ; then
253 my_conf="${my_conf} --enable-cgi --enable-fastcgi"
254 phpconfutils_extension_enable "discard-path" "discard-path" 0
255 phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
256 else
257 my_conf="${my_conf} --disable-cgi"
258 fi
259
260 if [[ ${build_apache2} = 1 ]] ; then
261 my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2"
262
263 # Threaded Apache2 support
264 if use threads ; then
265 my_conf="${my_conf} --enable-maintainer-zts"
266 ewarn "Enabling ZTS for Apache2 MPM"
267 fi
268
269 # Concurrent PHP Apache2 modules support
270 if use concurrentmodphp ; then
271 append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
272 fi
273 fi
274
275 # Now we know what we are building, build it
276 php5_2-sapi_src_compile
277
278 # To keep the separate php.ini files for each SAPI, we change the
279 # build-defs.h and recompile
280
281 if [[ ${build_cli} = 1 ]] ; then
282 einfo
283 einfo "Building CLI SAPI"
284 einfo
285
286 sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php5"|g;' -i main/build-defs.h
287 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
288 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
289 [[ -f ${x} ]] && rm -f ${x}
290 done
291 make sapi/cli/php || die "Unable to make CLI SAPI"
292 cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
293 fi
294
295 if [[ ${build_cgi} = 1 ]] ; then
296 einfo
297 einfo "Building CGI SAPI"
298 einfo
299
300 sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php5"|g;' -i main/build-defs.h
301 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
302 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
303 [[ -f ${x} ]] && rm -f ${x}
304 done
305 make sapi/cgi/php-cgi || die "Unable to make CGI SAPI"
306 cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
307 fi
308
309 if [[ ${build_apache2} = 1 ]] ; then
310 einfo
311 einfo "Building apache${APACHE_VERSION} SAPI"
312 einfo
313
314 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
315 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
316 for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
317 [[ -f ${x} ]] && rm -f ${x}
318 done
319 make || die "Unable to make apache${APACHE_VERSION} SAPI"
320 fi
321 }
322
323 src_compile_normal() {
324 php_determine_sapis
325
326 CLEAN_REQUIRED=0
327 my_conf=""
328
329 # Support the Apache2 extras, they must be set globally for all
330 # SAPIs to work correctly, especially for external PHP extensions
331 if use apache2 ; then
332 if [[ "${APACHE_VERSION}" != "0" ]] ; then
333 # Concurrent PHP Apache2 modules support
334 if use concurrentmodphp ; then
335 append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
336 fi
337 fi
338 fi
339
340 for x in ${PHPSAPIS} ; do
341 # Support the Apache2 extras, they must be set globally for all
342 # SAPIs to work correctly, especially for external PHP extensions
343 if use apache2 ; then
344 if [[ "${APACHE_VERSION}" != "0" ]] ; then
345 # Threaded Apache2 support
346 if use threads ; then
347 my_conf="${my_conf} --enable-maintainer-zts"
348 ewarn "Enabling ZTS for Apache2 MPM"
349 fi
350 fi
351 fi
352
353 if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then
354 make clean
355 fi
356
357 PHPSAPI="${x}"
358
359 case ${x} in
360 cli)
361 my_conf="${my_conf} --enable-cli --disable-cgi"
362 php5_2-sapi_src_compile
363 cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
364 ;;
365 cgi)
366 my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi"
367 phpconfutils_extension_enable "discard-path" "discard-path" 0
368 phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
369 php5_2-sapi_src_compile
370 cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
371 ;;
372 apache2)
373 my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2"
374 php5_2-sapi_src_compile
375 ;;
376 esac
377
378 CLEAN_REQUIRED=1
379 my_conf=""
380 done
381 }
382
383 src_install() {
384 php_determine_sapis
385
386 destdir=/usr/$(get_libdir)/php5
387
388 # Let the eclass do the common work
389 php5_2-sapi_src_install
390
391 einfo
392 einfo "Installing SAPI(s) ${PHPSAPIS}"
393 einfo
394
395 for x in ${PHPSAPIS} ; do
396
397 PHPSAPI="${x}"
398
399 case ${x} in
400 cli)
401 einfo "Installing CLI SAPI"
402 into ${destdir}
403 newbin php-cli php || die "Unable to install ${x} sapi"
404 php5_2-sapi_install_ini
405 ;;
406 cgi)
407 einfo "Installing CGI SAPI"
408 into ${destdir}
409 dobin php-cgi || die "Unable to install ${x} sapi"
410 php5_2-sapi_install_ini
411 ;;
412 apache2)
413 einfo "Installing Apache${APACHE_VERSION} SAPI"
414 make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"
415 if use concurrentmodphp ; then
416 einfo "Installing Apache${APACHE_VERSION} config file for PHP5-concurrent (70_mod_php5_concurr.conf)"
417 insinto ${APACHE_MODULES_CONFDIR}
418 newins "${FILESDIR}/70_mod_php5_concurr.conf-apache2" "70_mod_php5_concurr.conf"
419
420 # Put the ld version script in the right place so it's always accessible
421 insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
422 doins "${FILESDIR}/php5-ldvs"
423
424 # Redefine the extension dir to have the modphp suffix
425 PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`-versioned"
426 else
427 einfo "Installing Apache${APACHE_VERSION} config file for PHP5 (70_mod_php5.conf)"
428 insinto ${APACHE_MODULES_CONFDIR}
429 newins "${FILESDIR}/70_mod_php5.conf-apache2" "70_mod_php5.conf"
430 fi
431 php5_2-sapi_install_ini
432 ;;
433 esac
434 done
435
436 # Install env.d files
437 newenvd "${FILESDIR}/20php5-envd" "20php5"
438 sed -e "s|/lib/|/$(get_libdir)/|g" -i "${D}/etc/env.d/20php5"
439 }
440
441 pkg_postinst() {
442 # Output some general info to the user
443 if use apache2 ; then
444 APACHE2_MOD_DEFINE="PHP5"
445 if use concurrentmodphp ; then
446 APACHE2_MOD_CONF="70_mod_php5_concurr"
447 else
448 APACHE2_MOD_CONF="70_mod_php5"
449 fi
450 apache-module_pkg_postinst
451 fi
452
453 # Update Apache2 to use mod_php
454 if use apache2 ; then
455 "${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1
456 exitStatus=$?
457 if [[ ${exitStatus} == 2 ]] ; then
458 php-select apache2 php5
459 elif [[ ${exitStatus} == 4 ]] ; then
460 ewarn
461 ewarn "Apache2 is configured to load a different version of PHP."
462 ewarn "To make Apache2 use PHP v5, use php-select:"
463 ewarn
464 ewarn " php-select apache2 php5"
465 ewarn
466 fi
467 fi
468
469 # Create the symlinks for php-cli
470 if use cli || phpconfutils_usecheck cli ; then
471 "${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1
472 exitStatus=$?
473 if [[ ${exitStatus} == 5 ]] ; then
474 php-select php php5
475 elif [[ ${exitStatus} == 4 ]] ; then
476 ewarn
477 ewarn "/usr/bin/php links to a different version of PHP."
478 ewarn "To make /usr/bin/php point to PHP v5, use php-select:"
479 ewarn
480 ewarn " php-select php php5"
481 ewarn
482 fi
483 fi
484
485 # Create the symlinks for php-cgi
486 if use cgi ; then
487 "${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1
488 exitStatus=$?
489 if [[ ${exitStatus} == 5 ]] ; then
490 php-select php-cgi php5
491 elif [[ ${exitStatus} == 4 ]] ; then
492 ewarn
493 ewarn "/usr/bin/php-cgi links to a different version of PHP."
494 ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:"
495 ewarn
496 ewarn " php-select php-cgi php5"
497 ewarn
498 fi
499 fi
500
501 # Create the symlinks for php-devel
502 "${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1
503 exitStatus=$?
504 if [[ $exitStatus == 5 ]] ; then
505 php-select php-devel php5
506 elif [[ $exitStatus == 4 ]] ; then
507 ewarn
508 ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a"
509 ewarn "different version of PHP. To make them point to PHP v5, use"
510 ewarn "php-select:"
511 ewarn
512 ewarn " php-select php-devel php5"
513 ewarn
514 fi
515
516 php5_2-sapi_pkg_postinst
517 }
518
519 src_test() {
520 einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
521 if ! emake -j1 test ; then
522 hasq test ${FEATURES} && die "Make test failed. See above for details."
523 hasq test ${FEATURES} || eerror "Make test failed. See above for details."
524 fi
525 }
526
527
528
529 --
530 gentoo-commits@g.o mailing list