1 |
hoffie 09/04/16 18:28:43 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: php-5.2.9-r2.ebuild |
5 |
Removed: php-5.2.8-r1.ebuild php-5.2.6-r7.ebuild |
6 |
Log: |
7 |
cleaning old; revision bump to fix yet three possible security issues, see bug 260576 for details |
8 |
(Portage version: 2.1.6.11/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.322 dev-lang/php/ChangeLog |
12 |
|
13 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.322&view=markup |
14 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?rev=1.322&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/ChangeLog?r1=1.321&r2=1.322 |
16 |
|
17 |
Index: ChangeLog |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v |
20 |
retrieving revision 1.321 |
21 |
retrieving revision 1.322 |
22 |
diff -u -r1.321 -r1.322 |
23 |
--- ChangeLog 10 Apr 2009 10:25:55 -0000 1.321 |
24 |
+++ ChangeLog 16 Apr 2009 18:28:43 -0000 1.322 |
25 |
@@ -1,6 +1,13 @@ |
26 |
# ChangeLog for dev-lang/php |
27 |
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.321 2009/04/10 10:25:55 hoffie Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.322 2009/04/16 18:28:43 hoffie Exp $ |
30 |
+ |
31 |
+*php-5.2.9-r2 (16 Apr 2009) |
32 |
+ |
33 |
+ 16 Apr 2009; Christian Hoffmann <hoffie@g.o> -php-5.2.6-r7.ebuild, |
34 |
+ -php-5.2.8-r1.ebuild, +php-5.2.9-r2.ebuild: |
35 |
+ cleaning old; revision bump to fix yet three possible security issues, see |
36 |
+ bug 260576 for details |
37 |
|
38 |
*php-5.2.9-r1 (10 Apr 2009) |
39 |
*php-5.2.9 (10 Apr 2009) |
40 |
|
41 |
|
42 |
|
43 |
1.1 dev-lang/php/php-5.2.9-r2.ebuild |
44 |
|
45 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.9-r2.ebuild?rev=1.1&view=markup |
46 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/php/php-5.2.9-r2.ebuild?rev=1.1&content-type=text/plain |
47 |
|
48 |
Index: php-5.2.9-r2.ebuild |
49 |
=================================================================== |
50 |
# Copyright 1999-2009 Gentoo Foundation |
51 |
# Distributed under the terms of the GNU General Public License v2 |
52 |
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.2.9-r2.ebuild,v 1.1 2009/04/16 18:28:43 hoffie Exp $ |
53 |
|
54 |
CGI_SAPI_USE="discard-path force-cgi-redirect" |
55 |
APACHE2_SAPI_USE="concurrentmodphp threads" |
56 |
IUSE="cli cgi ${CGI_SAPI_USE} ${APACHE2_SAPI_USE} fastbuild" |
57 |
|
58 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" |
59 |
|
60 |
# NOTE: Portage doesn't support setting PROVIDE based on the USE flags |
61 |
# that have been enabled, so we have to PROVIDE everything for now |
62 |
# and hope for the best |
63 |
PROVIDE="virtual/php virtual/httpd-php" |
64 |
|
65 |
# php package settings |
66 |
SLOT="5" |
67 |
MY_PHP_PV="${PV}" |
68 |
MY_PHP_P="php-${MY_PHP_PV}" |
69 |
PHP_PACKAGE="1" |
70 |
|
71 |
# php patch settings, general |
72 |
PHP_PATCHSET_REV="${PR/r/}" |
73 |
SUHOSIN_PATCH="suhosin-patch-${PV}-0.9.7.patch.gz" |
74 |
MULTILIB_PATCH="${MY_PHP_PV}/opt/multilib-search-path.patch" |
75 |
# php patch settings, ebuild specific |
76 |
FASTBUILD_PATCH="${MY_PHP_PV}/opt/fastbuild.patch" |
77 |
CONCURRENTMODPHP_PATCH="${MY_PHP_PV}/opt/concurrent_apache_modules.patch" |
78 |
# kolab patch - http://kolab.org/cgi-bin/viewcvs-kolab.cgi/server/patches/php/ |
79 |
# bugs about this go to wrobel@g.o |
80 |
KOLAB_PATCH="${MY_PHP_PV}/opt/kolab-imap-annotations.patch" |
81 |
|
82 |
inherit versionator php5_2-sapi apache-module |
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 |
imap? ( >=virtual/imap-c-client-2006k ) |
91 |
pcre? ( >=dev-libs/libpcre-7.8 ) |
92 |
xml? ( >=dev-libs/libxml2-2.7.2-r2 ) |
93 |
xmlrpc? ( >=dev-libs/libxml2-2.7.2-r2 virtual/libiconv )" |
94 |
|
95 |
RDEPEND="${DEPEND}" |
96 |
if [[ -n "${KOLAB_PATCH}" ]] ; then |
97 |
IUSE="${IUSE} kolab" |
98 |
DEPEND="${DEPEND} |
99 |
kolab? ( >=net-libs/c-client-2004g-r1 )" |
100 |
fi |
101 |
|
102 |
want_apache |
103 |
|
104 |
pkg_setup() { |
105 |
PHPCONFUTILS_AUTO_USE="" |
106 |
|
107 |
# Make sure the user has specified at least one SAPI |
108 |
einfo "Determining SAPI(s) to build" |
109 |
phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache2 |
110 |
|
111 |
# Threaded Apache2 support |
112 |
if use apache2 ; then |
113 |
has_apache_threads |
114 |
fi |
115 |
|
116 |
# Concurrent PHP Apache2 modules support |
117 |
if use apache2 ; 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 |
|
138 |
# fastbuild support |
139 |
if use fastbuild ; then |
140 |
ewarn |
141 |
ewarn "'fastbuild' attempts to build all SAPIs in a single pass." |
142 |
ewarn "This is an experimental feature, so please rebuild PHP" |
143 |
ewarn "without the 'fastbuild' USE flag if you experience" |
144 |
ewarn "any problems, and then reproduce any bugs before filing" |
145 |
ewarn "them in Gentoo's Bugzilla or bugs.php.net." |
146 |
ewarn "If you have conclusive evidence that a bug directly" |
147 |
ewarn "derives from 'fastbuild', please file a bug in" |
148 |
ewarn "Gentoo's Bugzilla only." |
149 |
ewarn |
150 |
fi |
151 |
|
152 |
if use pcre ; then |
153 |
built_with_use dev-libs/libpcre unicode || \ |
154 |
die "Please rebuild dev-libs/libpcre with USE=unicode" |
155 |
fi |
156 |
|
157 |
php5_2-sapi_pkg_setup |
158 |
} |
159 |
|
160 |
php_determine_sapis() { |
161 |
# holds the list of sapis that we want to build |
162 |
PHPSAPIS= |
163 |
|
164 |
if use cli || phpconfutils_usecheck cli ; then |
165 |
PHPSAPIS="${PHPSAPIS} cli" |
166 |
fi |
167 |
|
168 |
if use cgi ; then |
169 |
PHPSAPIS="${PHPSAPIS} cgi" |
170 |
fi |
171 |
|
172 |
# note - apache SAPI comes after the simpler cli/cgi sapis |
173 |
if use apache2 ; then |
174 |
PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}" |
175 |
fi |
176 |
} |
177 |
|
178 |
src_unpack() { |
179 |
if [[ "${PHP_PACKAGE}" == 1 ]] ; then |
180 |
unpack ${A} |
181 |
fi |
182 |
|
183 |
cd "${S}" |
184 |
|
185 |
# Concurrent PHP Apache2 modules support |
186 |
if use apache2 ; 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 |
|
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 |
# kolab support |
206 |
if [[ -n "${KOLAB_PATCH}" ]] ; then |
207 |
use kolab && epatch "${WORKDIR}/${KOLAB_PATCH}" |
208 |
fi |
209 |
|
210 |
# pretend to not have flex, bug 221357 |
211 |
sed -re 's:( +)PHP_SUBST\(LEX\):\1LEX="exit 0;"\n\0:' -i acinclude.m4 |
212 |
|
213 |
# Now let the eclass do the rest and regenerate the configure |
214 |
php5_2-sapi_src_unpack |
215 |
|
216 |
# Fix Makefile.global:test to consider the CGI SAPI if present |
217 |
if use cgi ; then |
218 |
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 |
219 |
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 |
220 |
fi |
221 |
|
222 |
# try to fix some test cases which fail because of sandbox otherwise |
223 |
sed -e 's:/no/such/:.\0:' -i ext/standard/tests/file/005_error.phpt \ |
224 |
ext/standard/tests/file/006_error.phpt \ |
225 |
ext/standard/tests/file/touch.phpt |
226 |
|
227 |
# REMOVING BROKEN TESTS: |
228 |
# removing this test as it has been broken for ages and is not easily |
229 |
# fixable (depends on a lot of factors) |
230 |
rm ext/standard/tests/general_functions/phpinfo.phpt |
231 |
|
232 |
# never worked properly, no easy fix |
233 |
rm ext/iconv/tests/bug16069.phpt ext/iconv/tests/iconv_stream_filter.phpt |
234 |
|
235 |
# needs write access to /tmp and others |
236 |
rm ext/session/tests/session_save_path_variation5.phpt |
237 |
|
238 |
# new tests since 5.2.7 which have never been working for me |
239 |
rm ext/spl/tests/arrayObject___construct_basic4.phpt \ |
240 |
ext/spl/tests/arrayObject___construct_basic5.phpt \ |
241 |
ext/spl/tests/arrayObject_exchangeArray_basic3.phpt \ |
242 |
ext/spl/tests/arrayObject_setFlags_basic1.phpt \ |
243 |
tests/lang/bug45392.phpt |
244 |
|
245 |
# those might as well be related to suhosin |
246 |
rm ext/session/tests/session_decode_variation3.phpt \ |
247 |
ext/session/tests/session_encode_variation8.phpt |
248 |
|
249 |
# missing skipif |
250 |
use reflection || \ |
251 |
rm ext/standard/tests/directory/DirectoryClass_basic_001.phpt |
252 |
|
253 |
# sandbox-related (sandbox checks for permissions before even looking |
254 |
# at the fs, but the tests expect "No such file or directory" |
255 |
sed -e 's:/blah:./bla:' -i \ |
256 |
ext/session/tests/session_save_path_variation{2,3}.phpt |
257 |
rm ext/standard/tests/file/rename_variation13.phpt |
258 |
|
259 |
# test passes, but run-tests.php claims failure |
260 |
rm ext/standard/tests/file/tempnam_variation4.phpt |
261 |
|
262 |
# these tests behave differently with suhosin enabled, adapting them... |
263 |
use suhosin && sed -e 's:File(\.\./):File(..):g' -i \ |
264 |
tests/security/open_basedir*{.inc,.phpt} |
265 |
} |
266 |
|
267 |
src_compile() { |
268 |
# bug 217392 (autconf-2.62 behavior changes) |
269 |
export CFLAGS="${CFLAGS} -D_GNU_SOURCE" |
270 |
export CXXFLAGS="${CXXFLAGS} -D_GNU_SOURCE" |
271 |
if use fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then |
272 |
src_compile_fastbuild |
273 |
else |
274 |
src_compile_normal |
275 |
fi |
276 |
} |
277 |
|
278 |
src_compile_fastbuild() { |
279 |
php_determine_sapis |
280 |
|
281 |
build_cli=0 |
282 |
build_cgi=0 |
283 |
build_apache2=0 |
284 |
my_conf="" |
285 |
|
286 |
for x in ${PHPSAPIS} ; do |
287 |
case ${x} in |
288 |
cli) |
289 |
build_cli=1 |
290 |
;; |
291 |
cgi) |
292 |
build_cgi=1 |
293 |
;; |
294 |
apache2) |
295 |
build_apache2=1 |
296 |
;; |
297 |
esac |
298 |
done |
299 |
|
300 |
if [[ ${build_cli} = 1 ]] ; then |
301 |
my_conf="${my_conf} --enable-cli" |
302 |
else |
303 |
my_conf="${my_conf} --disable-cli" |
304 |
fi |
305 |
|
306 |
if [[ ${build_cgi} = 1 ]] ; then |
307 |
my_conf="${my_conf} --enable-cgi --enable-fastcgi" |
308 |
phpconfutils_extension_enable "discard-path" "discard-path" 0 |
309 |
phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0 |
310 |
else |
311 |
my_conf="${my_conf} --disable-cgi" |
312 |
fi |
313 |
|
314 |
if [[ ${build_apache2} = 1 ]] ; then |
315 |
my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2" |
316 |
|
317 |
# Threaded Apache2 support |
318 |
if use threads ; then |
319 |
my_conf="${my_conf} --enable-maintainer-zts" |
320 |
ewarn "Enabling ZTS for Apache2 MPM" |
321 |
fi |
322 |
|
323 |
# Concurrent PHP Apache2 modules support |
324 |
if use concurrentmodphp ; then |
325 |
append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs" |
326 |
fi |
327 |
fi |
328 |
|
329 |
if use pcre || phpconfutils_usecheck pcre ; then |
330 |
myconf="${my_conf} --with-pcre-dir=/usr" |
331 |
phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr" |
332 |
fi |
333 |
|
334 |
# Now we know what we are building, build it |
335 |
php5_2-sapi_src_compile |
336 |
|
337 |
# To keep the separate php.ini files for each SAPI, we change the |
338 |
# build-defs.h and recompile |
339 |
|
340 |
if [[ ${build_cli} = 1 ]] ; then |
341 |
einfo |
342 |
einfo "Building CLI SAPI" |
343 |
einfo |
344 |
|
345 |
sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php5"|g;' -i main/build-defs.h |
346 |
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 |
347 |
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do |
348 |
[[ -f ${x} ]] && rm -f ${x} |
349 |
done |
350 |
make sapi/cli/php || die "Unable to make CLI SAPI" |
351 |
cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI" |
352 |
fi |
353 |
|
354 |
if [[ ${build_cgi} = 1 ]] ; then |
355 |
einfo |
356 |
einfo "Building CGI SAPI" |
357 |
einfo |
358 |
|
359 |
sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php5"|g;' -i main/build-defs.h |
360 |
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 |
361 |
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do |
362 |
[[ -f ${x} ]] && rm -f ${x} |
363 |
done |
364 |
make sapi/cgi/php-cgi || die "Unable to make CGI SAPI" |
365 |
cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI" |
366 |
fi |
367 |
|
368 |
if [[ ${build_apache2} = 1 ]] ; then |
369 |
einfo |
370 |
einfo "Building apache${APACHE_VERSION} SAPI" |
371 |
einfo |
372 |
|
373 |
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 |
374 |
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 |
375 |
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do |
376 |
[[ -f ${x} ]] && rm -f ${x} |
377 |
done |
378 |
make || die "Unable to make apache${APACHE_VERSION} SAPI" |
379 |
fi |
380 |
} |
381 |
|
382 |
src_compile_normal() { |
383 |
php_determine_sapis |
384 |
|
385 |
CLEAN_REQUIRED=0 |
386 |
my_conf="" |
387 |
|
388 |
# Support the Apache2 extras, they must be set globally for all |
389 |
# SAPIs to work correctly, especially for external PHP extensions |
390 |
if use apache2 ; then |
391 |
# Concurrent PHP Apache2 modules support |
392 |
if use concurrentmodphp ; then |
393 |
append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs" |
394 |
fi |
395 |
fi |
396 |
|
397 |
for x in ${PHPSAPIS} ; do |
398 |
if use pcre || phpconfutils_usecheck pcre ; then |
399 |
myconf="${my_conf} --with-pcre-dir=/usr" |
400 |
phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr" |
401 |
fi |
402 |
|
403 |
# Support the Apache2 extras, they must be set globally for all |
404 |
# SAPIs to work correctly, especially for external PHP extensions |
405 |
if use apache2 ; then |
406 |
# Threaded Apache2 support |
407 |
if use threads ; then |
408 |
my_conf="${my_conf} --enable-maintainer-zts" |
409 |
ewarn "Enabling ZTS for Apache2 MPM" |
410 |
fi |
411 |
fi |
412 |
|
413 |
if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then |
414 |
make clean |
415 |
fi |
416 |
|
417 |
PHPSAPI="${x}" |
418 |
|
419 |
case ${x} in |
420 |
cli) |
421 |
my_conf="${my_conf} --enable-cli --disable-cgi" |
422 |
php5_2-sapi_src_compile |
423 |
cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI" |
424 |
;; |
425 |
cgi) |
426 |
my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi" |
427 |
phpconfutils_extension_enable "discard-path" "discard-path" 0 |
428 |
phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0 |
429 |
php5_2-sapi_src_compile |
430 |
cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI" |
431 |
;; |
432 |
apache2) |
433 |
my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2" |
434 |
php5_2-sapi_src_compile |
435 |
;; |
436 |
esac |
437 |
|
438 |
CLEAN_REQUIRED=1 |
439 |
my_conf="" |
440 |
done |
441 |
} |
442 |
|
443 |
src_install() { |
444 |
php_determine_sapis |
445 |
|
446 |
destdir=/usr/$(get_libdir)/php5 |
447 |
|
448 |
# Let the eclass do the common work |
449 |
php5_2-sapi_src_install |
450 |
|
451 |
einfo |
452 |
einfo "Installing SAPI(s) ${PHPSAPIS}" |
453 |
einfo |
454 |
|
455 |
for x in ${PHPSAPIS} ; do |
456 |
|
457 |
PHPSAPI="${x}" |
458 |
|
459 |
case ${x} in |
460 |
cli) |
461 |
einfo "Installing CLI SAPI" |
462 |
into ${destdir} |
463 |
newbin php-cli php || die "Unable to install ${x} sapi" |
464 |
php5_2-sapi_install_ini |
465 |
;; |
466 |
cgi) |
467 |
einfo "Installing CGI SAPI" |
468 |
into ${destdir} |
469 |
dobin php-cgi || die "Unable to install ${x} sapi" |
470 |
php5_2-sapi_install_ini |
471 |
;; |
472 |
apache2) |
473 |
einfo "Installing Apache${APACHE_VERSION} SAPI" |
474 |
make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI" |
475 |
if use concurrentmodphp ; then |
476 |
einfo "Installing Apache${APACHE_VERSION} config file for PHP5-concurrent (70_mod_php5_concurr.conf)" |
477 |
insinto ${APACHE_MODULES_CONFDIR} |
478 |
newins "${FILESDIR}/70_mod_php5_concurr.conf-apache2-r1" "70_mod_php5_concurr.conf" |
479 |
|
480 |
# Put the ld version script in the right place so it's always accessible |
481 |
insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/" |
482 |
doins "${FILESDIR}/php5-ldvs" |
483 |
|
484 |
# Redefine the extension dir to have the modphp suffix |
485 |
PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`-versioned" |
486 |
else |
487 |
einfo "Installing Apache${APACHE_VERSION} config file for PHP5 (70_mod_php5.conf)" |
488 |
insinto ${APACHE_MODULES_CONFDIR} |
489 |
newins "${FILESDIR}/70_mod_php5.conf-apache2-r1" "70_mod_php5.conf" |
490 |
fi |
491 |
php5_2-sapi_install_ini |
492 |
;; |
493 |
esac |
494 |
done |
495 |
|
496 |
# Install env.d files |
497 |
newenvd "${FILESDIR}/20php5-envd" "20php5" |
498 |
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${D}/etc/env.d/20php5" |
499 |
} |
500 |
|
501 |
pkg_postinst() { |
502 |
# Output some general info to the user |
503 |
if use apache2 ; then |
504 |
APACHE2_MOD_DEFINE="PHP5" |
505 |
if use concurrentmodphp ; then |
506 |
APACHE2_MOD_CONF="70_mod_php5_concurr" |
507 |
else |
508 |
APACHE2_MOD_CONF="70_mod_php5" |
509 |
fi |
510 |
apache-module_pkg_postinst |
511 |
fi |
512 |
|
513 |
# Update Apache2 to use mod_php |
514 |
if use apache2 ; then |
515 |
"${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1 |
516 |
exitStatus=$? |
517 |
if [[ ${exitStatus} == 2 ]] ; then |
518 |
php-select apache2 php5 |
519 |
elif [[ ${exitStatus} == 4 ]] ; then |
520 |
ewarn |
521 |
ewarn "Apache2 is configured to load a different version of PHP." |
522 |
ewarn "To make Apache2 use PHP v5, use php-select:" |
523 |
ewarn |
524 |
ewarn " php-select apache2 php5" |
525 |
ewarn |
526 |
fi |
527 |
fi |
528 |
|
529 |
# Create the symlinks for php-cli |
530 |
if use cli || phpconfutils_usecheck cli ; then |
531 |
"${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1 |
532 |
exitStatus=$? |
533 |
if [[ ${exitStatus} == 5 ]] ; then |
534 |
php-select php php5 |
535 |
elif [[ ${exitStatus} == 4 ]] ; then |
536 |
ewarn |
537 |
ewarn "/usr/bin/php links to a different version of PHP." |
538 |
ewarn "To make /usr/bin/php point to PHP v5, use php-select:" |
539 |
ewarn |
540 |
ewarn " php-select php php5" |
541 |
ewarn |
542 |
fi |
543 |
fi |
544 |
|
545 |
# Create the symlinks for php-cgi |
546 |
if use cgi ; then |
547 |
"${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1 |
548 |
exitStatus=$? |
549 |
if [[ ${exitStatus} == 5 ]] ; then |
550 |
php-select php-cgi php5 |
551 |
elif [[ ${exitStatus} == 4 ]] ; then |
552 |
ewarn |
553 |
ewarn "/usr/bin/php-cgi links to a different version of PHP." |
554 |
ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:" |
555 |
ewarn |
556 |
ewarn " php-select php-cgi php5" |
557 |
ewarn |
558 |
fi |
559 |
fi |
560 |
|
561 |
# Create the symlinks for php-devel |
562 |
"${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1 |
563 |
exitStatus=$? |
564 |
if [[ $exitStatus == 5 ]] ; then |
565 |
php-select php-devel php5 |
566 |
elif [[ $exitStatus == 4 ]] ; then |
567 |
ewarn |
568 |
ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a" |
569 |
ewarn "different version of PHP. To make them point to PHP v5, use" |
570 |
ewarn "php-select:" |
571 |
ewarn |
572 |
ewarn " php-select php-devel php5" |
573 |
ewarn |
574 |
fi |
575 |
|
576 |
php5_2-sapi_pkg_postinst |
577 |
} |
578 |
|
579 |
src_test() { |
580 |
vecho ">>> Test phase [test]: ${CATEGORY}/${PF}" |
581 |
if [[ ! -x "${S}"/php-cli ]]; then |
582 |
ewarn "Running the php test suite requires USE=cli" |
583 |
return |
584 |
fi |
585 |
|
586 |
export TEST_PHP_EXECUTABLE="${S}"/php-cli |
587 |
if [[ -x "${S}"/php-cgi ]]; then |
588 |
export TEST_PHP_CGI_EXECUTABLE="${S}"/php-cgi |
589 |
fi |
590 |
REPORT_EXIT_STATUS=1 "${S}"/php-cli -n "${S}"/run-tests.php -n |
591 |
|
592 |
if [[ $? != 0 ]] ; then |
593 |
eerror "Not all tests were successful!" |
594 |
fi |
595 |
} |