php 5.3.2 update
Hanno Böck

Hanno Böck commited on 2010-03-07 18:42:03
Zeige 2 geänderte Dateien mit 551 Einfügungen und 0 Löschungen.

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