1 |
hoffie 09/09/29 16:37:04 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: php-5.2.11.ebuild |
5 |
Log: |
6 |
version bump per bug 285434 (security) |
7 |
(Portage version: 2.1.6.13/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.344 dev-lang/php/ChangeLog |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.344&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.344&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?r1=1.343&r2=1.344 |
15 |
|
16 |
Index: ChangeLog |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v |
19 |
retrieving revision 1.343 |
20 |
retrieving revision 1.344 |
21 |
diff -u -r1.343 -r1.344 |
22 |
--- ChangeLog 24 Sep 2009 23:36:54 -0000 1.343 |
23 |
+++ ChangeLog 29 Sep 2009 16:37:04 -0000 1.344 |
24 |
@@ -1,6 +1,11 @@ |
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.343 2009/09/24 23:36:54 cla Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.344 2009/09/29 16:37:04 hoffie Exp $ |
29 |
+ |
30 |
+*php-5.2.11 (29 Sep 2009) |
31 |
+ |
32 |
+ 29 Sep 2009; Christian Hoffmann <hoffie@g.o> +php-5.2.11.ebuild: |
33 |
+ version bump per bug 285434 (security) |
34 |
|
35 |
*php-5.2.10-r2 (24 Sep 2009) |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
1.1 dev-lang/php/php-5.2.11.ebuild |
41 |
|
42 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.11.ebuild?rev=1.1&view=markup |
43 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.11.ebuild?rev=1.1&content-type=text/plain |
44 |
|
45 |
Index: php-5.2.11.ebuild |
46 |
=================================================================== |
47 |
# Copyright 1999-2009 Gentoo Foundation |
48 |
# Distributed under the terms of the GNU General Public License v2 |
49 |
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.2.11.ebuild,v 1.1 2009/09/29 16:37:04 hoffie Exp $ |
50 |
|
51 |
CGI_SAPI_USE="discard-path force-cgi-redirect" |
52 |
APACHE2_SAPI_USE="concurrentmodphp threads" |
53 |
IUSE="cli cgi ${CGI_SAPI_USE} ${APACHE2_SAPI_USE} fastbuild" |
54 |
|
55 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" |
56 |
|
57 |
# NOTE: Portage doesn't support setting PROVIDE based on the USE flags |
58 |
# that have been enabled, so we have to PROVIDE everything for now |
59 |
# and hope for the best |
60 |
PROVIDE="virtual/php virtual/httpd-php" |
61 |
|
62 |
# php package settings |
63 |
SLOT="5" |
64 |
MY_PHP_PV="${PV}" |
65 |
MY_PHP_P="php-${MY_PHP_PV}" |
66 |
PHP_PACKAGE="1" |
67 |
|
68 |
# php patch settings, general |
69 |
PHP_PATCHSET_REV="${PR/r/}" |
70 |
PHP_PATCHSET_REV="${PHP_PATCHSET_REV/2/1}" |
71 |
SUHOSIN_PATCH="suhosin-patch-${MY_PHP_PV}-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 |
|
243 |
# those might as well be related to suhosin |
244 |
rm ext/session/tests/session_decode_variation3.phpt \ |
245 |
ext/session/tests/session_encode_variation8.phpt |
246 |
|
247 |
# missing skipif |
248 |
use reflection || \ |
249 |
rm ext/standard/tests/directory/DirectoryClass_basic_001.phpt |
250 |
|
251 |
# sandbox-related (sandbox checks for permissions before even looking |
252 |
# at the fs, but the tests expect "No such file or directory" |
253 |
sed -e 's:/blah:./bla:' -i \ |
254 |
ext/session/tests/session_save_path_variation{2,3}.phpt |
255 |
rm ext/standard/tests/file/rename_variation13.phpt |
256 |
|
257 |
# test passes, but run-tests.php claims failure |
258 |
rm ext/standard/tests/file/tempnam_variation4.phpt |
259 |
|
260 |
# these tests behave differently with suhosin enabled, adapting them... |
261 |
use suhosin && sed -e 's:File(\.\./):File(..):g' -i \ |
262 |
tests/security/open_basedir*{.inc,.phpt} |
263 |
} |
264 |
|
265 |
src_compile() { |
266 |
# bug 217392 (autconf-2.62 behavior changes) |
267 |
export CFLAGS="${CFLAGS} -D_GNU_SOURCE" |
268 |
export CXXFLAGS="${CXXFLAGS} -D_GNU_SOURCE" |
269 |
if use fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then |
270 |
src_compile_fastbuild |
271 |
else |
272 |
src_compile_normal |
273 |
fi |
274 |
} |
275 |
|
276 |
src_compile_fastbuild() { |
277 |
php_determine_sapis |
278 |
|
279 |
build_cli=0 |
280 |
build_cgi=0 |
281 |
build_apache2=0 |
282 |
my_conf="" |
283 |
|
284 |
for x in ${PHPSAPIS} ; do |
285 |
case ${x} in |
286 |
cli) |
287 |
build_cli=1 |
288 |
;; |
289 |
cgi) |
290 |
build_cgi=1 |
291 |
;; |
292 |
apache2) |
293 |
build_apache2=1 |
294 |
;; |
295 |
esac |
296 |
done |
297 |
|
298 |
if [[ ${build_cli} = 1 ]] ; then |
299 |
my_conf="${my_conf} --enable-cli" |
300 |
else |
301 |
my_conf="${my_conf} --disable-cli" |
302 |
fi |
303 |
|
304 |
if [[ ${build_cgi} = 1 ]] ; then |
305 |
my_conf="${my_conf} --enable-cgi --enable-fastcgi" |
306 |
phpconfutils_extension_enable "discard-path" "discard-path" 0 |
307 |
phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0 |
308 |
else |
309 |
my_conf="${my_conf} --disable-cgi" |
310 |
fi |
311 |
|
312 |
if [[ ${build_apache2} = 1 ]] ; then |
313 |
my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2" |
314 |
|
315 |
# Threaded Apache2 support |
316 |
if use threads ; then |
317 |
my_conf="${my_conf} --enable-maintainer-zts" |
318 |
ewarn "Enabling ZTS for Apache2 MPM" |
319 |
fi |
320 |
|
321 |
# Concurrent PHP Apache2 modules support |
322 |
if use concurrentmodphp ; then |
323 |
append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs" |
324 |
fi |
325 |
fi |
326 |
|
327 |
if use pcre || phpconfutils_usecheck pcre ; then |
328 |
myconf="${my_conf} --with-pcre-dir=/usr" |
329 |
phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr" |
330 |
fi |
331 |
|
332 |
# Now we know what we are building, build it |
333 |
php5_2-sapi_src_compile |
334 |
|
335 |
# To keep the separate php.ini files for each SAPI, we change the |
336 |
# build-defs.h and recompile |
337 |
|
338 |
if [[ ${build_cli} = 1 ]] ; then |
339 |
einfo |
340 |
einfo "Building CLI SAPI" |
341 |
einfo |
342 |
|
343 |
sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php5"|g;' -i main/build-defs.h |
344 |
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 |
345 |
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do |
346 |
[[ -f ${x} ]] && rm -f ${x} |
347 |
done |
348 |
make sapi/cli/php || die "Unable to make CLI SAPI" |
349 |
cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI" |
350 |
fi |
351 |
|
352 |
if [[ ${build_cgi} = 1 ]] ; then |
353 |
einfo |
354 |
einfo "Building CGI SAPI" |
355 |
einfo |
356 |
|
357 |
sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php5"|g;' -i main/build-defs.h |
358 |
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 |
359 |
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do |
360 |
[[ -f ${x} ]] && rm -f ${x} |
361 |
done |
362 |
make sapi/cgi/php-cgi || die "Unable to make CGI SAPI" |
363 |
cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI" |
364 |
fi |
365 |
|
366 |
if [[ ${build_apache2} = 1 ]] ; then |
367 |
einfo |
368 |
einfo "Building apache${APACHE_VERSION} SAPI" |
369 |
einfo |
370 |
|
371 |
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 |
372 |
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 |
373 |
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do |
374 |
[[ -f ${x} ]] && rm -f ${x} |
375 |
done |
376 |
make || die "Unable to make apache${APACHE_VERSION} SAPI" |
377 |
fi |
378 |
} |
379 |
|
380 |
src_compile_normal() { |
381 |
php_determine_sapis |
382 |
|
383 |
CLEAN_REQUIRED=0 |
384 |
my_conf="" |
385 |
|
386 |
# Support the Apache2 extras, they must be set globally for all |
387 |
# SAPIs to work correctly, especially for external PHP extensions |
388 |
if use apache2 ; then |
389 |
# Concurrent PHP Apache2 modules support |
390 |
if use concurrentmodphp ; then |
391 |
append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs" |
392 |
fi |
393 |
fi |
394 |
|
395 |
for x in ${PHPSAPIS} ; do |
396 |
if use pcre || phpconfutils_usecheck pcre ; then |
397 |
myconf="${my_conf} --with-pcre-dir=/usr" |
398 |
phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr" |
399 |
fi |
400 |
|
401 |
# Support the Apache2 extras, they must be set globally for all |
402 |
# SAPIs to work correctly, especially for external PHP extensions |
403 |
if use apache2 ; then |
404 |
# Threaded Apache2 support |
405 |
if use threads ; then |
406 |
my_conf="${my_conf} --enable-maintainer-zts" |
407 |
ewarn "Enabling ZTS for Apache2 MPM" |
408 |
fi |
409 |
fi |
410 |
|
411 |
if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then |
412 |
make clean |
413 |
fi |
414 |
|
415 |
PHPSAPI="${x}" |
416 |
|
417 |
case ${x} in |
418 |
cli) |
419 |
my_conf="${my_conf} --enable-cli --disable-cgi" |
420 |
php5_2-sapi_src_compile |
421 |
cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI" |
422 |
;; |
423 |
cgi) |
424 |
my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi" |
425 |
phpconfutils_extension_enable "discard-path" "discard-path" 0 |
426 |
phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0 |
427 |
php5_2-sapi_src_compile |
428 |
cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI" |
429 |
;; |
430 |
apache2) |
431 |
my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2" |
432 |
php5_2-sapi_src_compile |
433 |
;; |
434 |
esac |
435 |
|
436 |
CLEAN_REQUIRED=1 |
437 |
my_conf="" |
438 |
done |
439 |
} |
440 |
|
441 |
src_install() { |
442 |
php_determine_sapis |
443 |
|
444 |
destdir=/usr/$(get_libdir)/php5 |
445 |
|
446 |
# Let the eclass do the common work |
447 |
php5_2-sapi_src_install |
448 |
|
449 |
einfo |
450 |
einfo "Installing SAPI(s) ${PHPSAPIS}" |
451 |
einfo |
452 |
|
453 |
for x in ${PHPSAPIS} ; do |
454 |
|
455 |
PHPSAPI="${x}" |
456 |
|
457 |
case ${x} in |
458 |
cli) |
459 |
einfo "Installing CLI SAPI" |
460 |
into ${destdir} |
461 |
newbin php-cli php || die "Unable to install ${x} sapi" |
462 |
php5_2-sapi_install_ini |
463 |
;; |
464 |
cgi) |
465 |
einfo "Installing CGI SAPI" |
466 |
into ${destdir} |
467 |
dobin php-cgi || die "Unable to install ${x} sapi" |
468 |
php5_2-sapi_install_ini |
469 |
;; |
470 |
apache2) |
471 |
einfo "Installing Apache${APACHE_VERSION} SAPI" |
472 |
make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI" |
473 |
if use concurrentmodphp ; then |
474 |
einfo "Installing Apache${APACHE_VERSION} config file for PHP5-concurrent (70_mod_php5_concurr.conf)" |
475 |
insinto ${APACHE_MODULES_CONFDIR} |
476 |
newins "${FILESDIR}/70_mod_php5_concurr.conf-apache2-r1" "70_mod_php5_concurr.conf" |
477 |
|
478 |
# Put the ld version script in the right place so it's always accessible |
479 |
insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/" |
480 |
doins "${FILESDIR}/php5-ldvs" |
481 |
|
482 |
# Redefine the extension dir to have the modphp suffix |
483 |
PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`-versioned" |
484 |
else |
485 |
einfo "Installing Apache${APACHE_VERSION} config file for PHP5 (70_mod_php5.conf)" |
486 |
insinto ${APACHE_MODULES_CONFDIR} |
487 |
newins "${FILESDIR}/70_mod_php5.conf-apache2-r1" "70_mod_php5.conf" |
488 |
fi |
489 |
php5_2-sapi_install_ini |
490 |
;; |
491 |
esac |
492 |
done |
493 |
|
494 |
# Install env.d files |
495 |
newenvd "${FILESDIR}/20php5-envd" "20php5" |
496 |
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${D}/etc/env.d/20php5" |
497 |
} |
498 |
|
499 |
pkg_postinst() { |
500 |
# Output some general info to the user |
501 |
if use apache2 ; then |
502 |
APACHE2_MOD_DEFINE="PHP5" |
503 |
if use concurrentmodphp ; then |
504 |
APACHE2_MOD_CONF="70_mod_php5_concurr" |
505 |
else |
506 |
APACHE2_MOD_CONF="70_mod_php5" |
507 |
fi |
508 |
apache-module_pkg_postinst |
509 |
fi |
510 |
|
511 |
# Update Apache2 to use mod_php |
512 |
if use apache2 ; then |
513 |
"${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1 |
514 |
exitStatus=$? |
515 |
if [[ ${exitStatus} == 2 ]] ; then |
516 |
php-select apache2 php5 |
517 |
elif [[ ${exitStatus} == 4 ]] ; then |
518 |
ewarn |
519 |
ewarn "Apache2 is configured to load a different version of PHP." |
520 |
ewarn "To make Apache2 use PHP v5, use php-select:" |
521 |
ewarn |
522 |
ewarn " php-select apache2 php5" |
523 |
ewarn |
524 |
fi |
525 |
fi |
526 |
|
527 |
# Create the symlinks for php-cli |
528 |
if use cli || phpconfutils_usecheck cli ; then |
529 |
"${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1 |
530 |
exitStatus=$? |
531 |
if [[ ${exitStatus} == 5 ]] ; then |
532 |
php-select php php5 |
533 |
elif [[ ${exitStatus} == 4 ]] ; then |
534 |
ewarn |
535 |
ewarn "/usr/bin/php links to a different version of PHP." |
536 |
ewarn "To make /usr/bin/php point to PHP v5, use php-select:" |
537 |
ewarn |
538 |
ewarn " php-select php php5" |
539 |
ewarn |
540 |
fi |
541 |
fi |
542 |
|
543 |
# Create the symlinks for php-cgi |
544 |
if use cgi ; then |
545 |
"${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1 |
546 |
exitStatus=$? |
547 |
if [[ ${exitStatus} == 5 ]] ; then |
548 |
php-select php-cgi php5 |
549 |
elif [[ ${exitStatus} == 4 ]] ; then |
550 |
ewarn |
551 |
ewarn "/usr/bin/php-cgi links to a different version of PHP." |
552 |
ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:" |
553 |
ewarn |
554 |
ewarn " php-select php-cgi php5" |
555 |
ewarn |
556 |
fi |
557 |
fi |
558 |
|
559 |
# Create the symlinks for php-devel |
560 |
"${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1 |
561 |
exitStatus=$? |
562 |
if [[ $exitStatus == 5 ]] ; then |
563 |
php-select php-devel php5 |
564 |
elif [[ $exitStatus == 4 ]] ; then |
565 |
ewarn |
566 |
ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a" |
567 |
ewarn "different version of PHP. To make them point to PHP v5, use" |
568 |
ewarn "php-select:" |
569 |
ewarn |
570 |
ewarn " php-select php-devel php5" |
571 |
ewarn |
572 |
fi |
573 |
|
574 |
php5_2-sapi_pkg_postinst |
575 |
} |
576 |
|
577 |
src_test() { |
578 |
vecho ">>> Test phase [test]: ${CATEGORY}/${PF}" |
579 |
if [[ ! -x "${S}"/php-cli ]]; then |
580 |
ewarn "Running the php test suite requires USE=cli" |
581 |
return |
582 |
fi |
583 |
|
584 |
export TEST_PHP_EXECUTABLE="${S}"/php-cli |
585 |
if [[ -x "${S}"/php-cgi ]]; then |
586 |
export TEST_PHP_CGI_EXECUTABLE="${S}"/php-cgi |
587 |
fi |
588 |
REPORT_EXIT_STATUS=1 "${S}"/php-cli -n "${S}"/run-tests.php -n |
589 |
|
590 |
if [[ $? != 0 ]] ; then |
591 |
eerror "Not all tests were successful!" |
592 |
fi |
593 |
} |