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