php 5.3 slotted ebuild based on Frankiz Daniel's work in http://bugs.gentoo.org/show_bug.cgi?id=274512
Hanno Böck

Hanno Böck commited on 2009-11-21 10:44:37
Zeige 9 geänderte Dateien mit 1349 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,10 @@
1
+AUX 20php5-envd 145 RMD160 8c81fb7dc1d1ddf16fd956d748514db3bcb27603 SHA1 f1cef57c0def8e2c5422aaf136f40b4ff47801d2 SHA256 efaae9e6ae5f7010e073c2ab6d8a9dda009f0707c7d7b0c027e142c94f7041a4
2
+AUX 70_mod_php5.conf-apache2 490 RMD160 745bdb5db622577f473703d5ee8dc7f3c66f8f0c SHA1 7daf9c9ec2e6d108f850981853f9f4f599be0b71 SHA256 5667d06cb7a18c30d11decd28d55b87e36287c76c4d3a450b1cb37271e7fdcd1
3
+AUX 70_mod_php5.conf-apache2-r1 374 RMD160 ca06cdc9d1a3dc4129a60c938ee3a1b542497fbb SHA1 4733066b6324c5870e716485484c44c7c26a9ff1 SHA256 815c1ca23c9afe8479568ceaac4057eb91ea5444fbd863866b29adb4eea2c82b
4
+AUX 70_mod_php5_concurr.conf-apache2 414 RMD160 1783b6c830119f021c3fb6cb35a631f43c4fa70c SHA1 09f9076f35bc84994fc8c687b4befc0400475f1a SHA256 ccc3bc073eafc83f98049679a411801e80f84620bd51c37c36de2b9ee9492aa2
5
+AUX 70_mod_php5_concurr.conf-apache2-r1 376 RMD160 4f7de5c0784b6191450b5c1a7de7ad941620e199 SHA1 c42a23bd7a1d3e8c7e0ac906f50f180116349f76 SHA256 c05f499d9c8927391c586b94716a9f59d63767165552ea527ec7ff63c36eaa40
6
+AUX php5-ldvs 22 RMD160 5846dab2745b68a88175dd4e72d0b8cf4756dd46 SHA1 592398c92575adb14ec972847ce2aca28a7b9c2c SHA256 b79d0e52b1b3b4543b31ad45525ae1c2814a27ea8e676772ab10bf6fb12dfe79
7
+DIST php-5.3.1.tar.bz2 10457046 RMD160 01183a9f752ce5982a7b91dcd43721fd1b9cd88b SHA1 be08ca9337a4962cd4acf8709cd695e1e31c1149 SHA256 9803ce0d6eb2ae072f0149158f5921135b47b633ef5632b4688b30a23be20dba
8
+DIST php-patchset-5.3.1-r0.tar.bz2 7301 RMD160 2582efa0b514d9c744a403b84b9ea185f1d8fd6e SHA1 9177c25ae67c301fbe038ae1cc7d55a6a16bb06f SHA256 2dbd8743d309fffda3e2896256d26631d2522eab3ba759c81192d8cc5950bb1f
9
+DIST suhosin-patch-5.3.1RC1-0.9.8.patch.gz 38250 RMD160 cfb60da9b4142b0d3fd0f7e193fe2419ba9a5d31 SHA1 d3e8f83f81311a5f382b545cbd745dcedd5f3c93 SHA256 46a3aff061b4d6c7f3721aa65824177c36821631247a502bc77e120559a37721
10
+EBUILD php-5.3.1.ebuild 16765 RMD160 98580ee305edc2f0d8fd60d948568483827b4a85 SHA1 c799bbafcd4486b5a48c23f7fd26ffc3f7318405 SHA256 db12618c23fb4da02503cf2dfb5895d3df9d5f92e657fbf2dce16cd0ad6501f8
... ...
@@ -0,0 +1,2 @@
1
+MANPATH="/usr/lib/php5/man/"
2
+CONFIG_PROTECT_MASK="/etc/php/cli-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/apache2-php5/ext-active/"
... ...
@@ -0,0 +1,18 @@
1
+<IfDefine PHP5>
2
+	# Load the module first
3
+	<IfModule !mod_php5.c>
4
+		LoadModule php5_module    modules/libphp5.so
5
+	</IfModule>
6
+
7
+	# Set it to handle the files
8
+	<IfModule mod_mime.c>
9
+		AddType application/x-httpd-php .php
10
+		AddType application/x-httpd-php .phtml
11
+		AddType application/x-httpd-php .php3
12
+		AddType application/x-httpd-php .php4
13
+		AddType application/x-httpd-php .php5
14
+		AddType application/x-httpd-php-source .phps
15
+	</IfModule>
16
+
17
+	DirectoryIndex index.php index.phtml
18
+</IfDefine>
... ...
@@ -0,0 +1,17 @@
1
+<IfDefine PHP5>
2
+	# Load the module first
3
+	<IfModule !mod_php5.c>
4
+		LoadModule php5_module    modules/libphp5.so
5
+	</IfModule>
6
+
7
+	# Set it to handle the files
8
+	<FilesMatch "\.ph(p5?|tml)$">
9
+		SetHandler application/x-httpd-php
10
+	</FilesMatch>
11
+
12
+	<FilesMatch "\.phps$">
13
+		SetHandler application/x-httpd-php-source
14
+	</FilesMatch>
15
+
16
+	DirectoryIndex index.php index.phtml
17
+</IfDefine>
... ...
@@ -0,0 +1,16 @@
1
+<IfDefine PHP5>
2
+	# Load the module first
3
+	<IfModule !mod_php5.c>
4
+		LoadModule php5_module    modules/libphp5.so
5
+	</IfModule>
6
+
7
+	# Set it to handle the files
8
+	<IfModule mod_mime.c>
9
+		AddType application/x-httpd-php5 .php
10
+		AddType application/x-httpd-php5 .phtml
11
+		AddType application/x-httpd-php5 .php5
12
+		AddType application/x-httpd-php5-source .phps
13
+	</IfModule>
14
+
15
+	DirectoryIndex index.php index.phtml
16
+</IfDefine>
... ...
@@ -0,0 +1,17 @@
1
+<IfDefine PHP5>
2
+	# Load the module first
3
+	<IfModule !mod_php5.c>
4
+		LoadModule php5_module    modules/libphp5.so
5
+	</IfModule>
6
+
7
+	# Set it to handle the files
8
+	<FilesMatch "\.ph(p5?|tml)$">
9
+		SetHandler application/x-httpd-php5
10
+	</FilesMatch>
11
+
12
+	<FilesMatch "\.phps$">
13
+		SetHandler application/x-httpd-php5-source
14
+	</FilesMatch>
15
+
16
+	DirectoryIndex index.php index.phtml
17
+</IfDefine>
... ...
@@ -0,0 +1 @@
1
+PHP_5 { global: *; };
... ...
@@ -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-5.3.1RC1-0.9.8.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,0 +1,721 @@
1
+# Copyright 1999-2007 Gentoo Foundation
2
+# Distributed under the terms of the GNU General Public License v2
3
+# $Header: /var/cvsroot/gentoo-x86/eclass/php5_3-sapi.eclass,v 1.25 2009/07/20 10:32:34 flameeyes Exp $
4
+
5
+# ========================================================================
6
+# Based on robbat2's work on the php4 sapi eclass
7
+#
8
+# Author: Stuart Herbert <stuart@gentoo.org>
9
+# Author: Luca Longinotti <chtekk@gentoo.org>
10
+#
11
+# ========================================================================
12
+
13
+# @ECLASS: php5_3-sapi.eclass
14
+# @MAINTAINER:
15
+# Gentoo PHP team <php-bugs@gentoo.org>
16
+# @BLURB: Eclass for building different php-5.3 SAPI instances.
17
+# @DESCRIPTION:
18
+# Eclass for building different php-5.3 SAPI instances. Use it for the
19
+# new-style =dev-lang/php-5.3* ebuilds.
20
+
21
+
22
+PHPCONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase interbase oci8 sapdb solid sybase-ct"
23
+
24
+WANT_AUTOCONF="latest"
25
+WANT_AUTOMAKE="latest"
26
+
27
+inherit db-use flag-o-matic autotools toolchain-funcs libtool eutils phpconfutils php-common-r1
28
+
29
+# @ECLASS-VARIABLE: MY_PHP_P
30
+# @DESCRIPTION:
31
+# Set MY_PHP_P in the ebuild as needed to match tarball version.
32
+
33
+# @ECLASS-VARIABLE: PHP_PACKAGE
34
+# @DESCRIPTION:
35
+# We only set this variable if we are building a copy of php which can be
36
+# installed as a package in its own.
37
+# Copies of php which are compiled into other packages (e.g. php support
38
+# for the thttpd web server) don't need this variable.
39
+if [[ "${PHP_PACKAGE}" == 1 ]] ; then
40
+	HOMEPAGE="http://www.php.net/"
41
+	LICENSE="PHP-3"
42
+	SRC_URI="http://www.php.net/distributions/${MY_PHP_P}.tar.bz2"
43
+	S="${WORKDIR}/${MY_PHP_P}"
44
+fi
45
+
46
+IUSE="adabas bcmath berkdb birdstep bzip2 calendar cdb cjk crypt ctype curl curlwrappers db2 dbmaker debug doc empress empress-bcs enchant esoob exif frontbase filter firebird flatfile ftp gd gd-external gdbm gmp hash iconv imap inifile interbase intl iodbc ipv6 java-external json kerberos ldap ldap-sasl libedit mcve mhash mssql mysql mysqli nls oci8 oci8-instant-client odbc pcntl pcre pdo phar pic posix postgres qdbm readline reflection recode sapdb session sharedext sharedmem simplexml snmp soap sockets solid spell spl sqlite ssl suhosin sybase-ct sysvipc tidy tokenizer truetype unicode wddx xml xmlreader xmlwriter xmlrpc xpm xsl yaz zip zlib"
47
+
48
+# these USE flags should have the correct dependencies
49
+DEPEND="adabas? ( >=dev-db/unixODBC-1.8.13 )
50
+		berkdb? ( =sys-libs/db-4* )
51
+		birdstep? ( >=dev-db/unixODBC-1.8.13 )
52
+		bzip2? ( app-arch/bzip2 )
53
+		cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
54
+		cjk? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) )
55
+		crypt? ( >=dev-libs/libmcrypt-2.4 )
56
+		curl? ( >=net-misc/curl-7.10.5 )
57
+		db2? ( >=dev-db/unixODBC-1.8.13 )
58
+		dbmaker? ( >=dev-db/unixODBC-1.8.13 )
59
+		empress? ( >=dev-db/unixODBC-1.8.13 )
60
+		empress-bcs? ( >=dev-db/unixODBC-1.8.13 )
61
+		esoob? ( >=dev-db/unixODBC-1.8.13 )
62
+		exif? ( !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) )
63
+		firebird? ( dev-db/firebird )
64
+		gd? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib )
65
+		gd-external? ( media-libs/gd )
66
+		gdbm? ( >=sys-libs/gdbm-1.8.0 )
67
+		gmp? ( >=dev-libs/gmp-4.1.2 )
68
+		iconv? ( virtual/libiconv )
69
+		imap? ( virtual/imap-c-client )
70
+		iodbc? ( dev-db/libiodbc >=dev-db/unixODBC-1.8.13 )
71
+		kerberos? ( virtual/krb5 )
72
+		ldap? ( !oci8? ( >=net-nds/openldap-1.2.11 ) )
73
+		ldap-sasl? ( !oci8? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) )
74
+		libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
75
+		mcve? ( >=dev-libs/openssl-0.9.7 )
76
+		mhash? ( app-crypt/mhash )
77
+		mssql? ( dev-db/freetds )
78
+		mysql? ( virtual/mysql )
79
+		mysqli? ( >=virtual/mysql-4.1 )
80
+		nls? ( sys-devel/gettext )
81
+		oci8-instant-client? ( dev-db/oracle-instantclient-basic )
82
+		odbc? ( >=dev-db/unixODBC-1.8.13 )
83
+		postgres? ( || ( >=dev-db/libpq-7.1 ( app-admin/eselect-postgresql
84
+			>=dev-db/postgresql-base-7.1 ) ) )
85
+		qdbm? ( dev-db/qdbm )
86
+		readline? ( sys-libs/readline )
87
+		recode? ( app-text/recode )
88
+		sapdb? ( >=dev-db/unixODBC-1.8.13 )
89
+		sharedmem? ( dev-libs/mm )
90
+		simplexml? ( >=dev-libs/libxml2-2.6.8 )
91
+		snmp? ( >=net-analyzer/net-snmp-5.2 )
92
+		soap? ( >=dev-libs/libxml2-2.6.8 )
93
+		solid? ( >=dev-db/unixODBC-1.8.13 )
94
+		spell? ( >=app-text/aspell-0.50 )
95
+		sqlite? ( =dev-db/sqlite-2* pdo? ( =dev-db/sqlite-3* ) )
96
+		ssl? ( >=dev-libs/openssl-0.9.7 )
97
+		tidy? ( app-text/htmltidy )
98
+		truetype? ( =media-libs/freetype-2* >=media-libs/t1lib-5.0.0 !gd? ( !gd-external? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) ) )
99
+		wddx? ( >=dev-libs/libxml2-2.6.8 )
100
+		xml? ( >=dev-libs/libxml2-2.6.8 )
101
+		xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
102
+		xmlreader? ( >=dev-libs/libxml2-2.6.8 )
103
+		xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
104
+		xpm? ( x11-libs/libXpm >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib )
105
+		xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
106
+		zip? ( sys-libs/zlib )
107
+		zlib? ( sys-libs/zlib )
108
+		enchant? ( app-text/enchant )
109
+		intl? ( dev-libs/icu )
110
+		virtual/mta"
111
+
112
+# libswf conflicts with ming and should not
113
+# be installed with the new PHP ebuilds
114
+DEPEND="${DEPEND}
115
+		!media-libs/libswf"
116
+
117
+# simplistic for now
118
+RDEPEND="${DEPEND}"
119
+
120
+# those are only needed at compile-time
121
+DEPEND="${DEPEND}
122
+		>=sys-devel/m4-1.4.3
123
+		>=sys-devel/libtool-1.5.18"
124
+
125
+# Additional features
126
+#
127
+# They are in PDEPEND because we need PHP installed first!
128
+PDEPEND="doc? ( app-doc/php-docs )
129
+		filter? ( !dev-php5/pecl-filter )
130
+		java-external? ( dev-php5/php-java-bridge )
131
+		json? ( !dev-php5/pecl-json )
132
+		mcve? ( dev-php5/pecl-mcve )
133
+		pdo? ( !dev-php5/pecl-pdo )
134
+		suhosin? ( dev-php5/suhosin )
135
+		yaz? ( dev-php5/pecl-yaz )"
136
+
137
+# ========================================================================
138
+# php.ini Support
139
+# ========================================================================
140
+
141
+PHP_INI_FILE="php.ini"
142
+PHP_INI_UPSTREAM="php.ini-production"
143
+
144
+# ========================================================================
145
+
146
+# @ECLASS-VARIABLE: PHP_PATCHSET_REV
147
+# @DESCRIPTION:
148
+# Provides PHP patchsets support.
149
+SRC_URI="${SRC_URI} http://perso.musedev.org/gentoo/php-patchset-${MY_PHP_PV}-r${PHP_PATCHSET_REV}.tar.bz2"
150
+
151
+# @ECLASS-VARIABLE: SUHOSIN_PATCH
152
+# @DESCRIPTION:
153
+# Tarball name for Suhosin patch (see http://www.suhosin.org/).
154
+# This feature will not be available in php if unset.
155
+[[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? ( http://perso.musedev.org/gentoo/${SUHOSIN_PATCH} )"
156
+
157
+
158
+# ========================================================================
159
+
160
+EXPORT_FUNCTIONS pkg_setup src_compile src_install src_unpack pkg_postinst
161
+
162
+# ========================================================================
163
+# INTERNAL FUNCTIONS
164
+# ========================================================================
165
+
166
+php5_3-sapi_check_use_flags() {
167
+	# Multiple USE dependencies
168
+	phpconfutils_use_depend_any "truetype" "gd" "gd" "gd-external"
169
+	phpconfutils_use_depend_any "cjk" "gd" "gd" "gd-external"
170
+	phpconfutils_use_depend_any "exif" "gd" "gd" "gd-external"
171
+
172
+	# Simple USE dependencies
173
+	phpconfutils_use_depend_all "xpm"			"gd"
174
+	phpconfutils_use_depend_all "gd"			"zlib"
175
+	phpconfutils_use_depend_all "simplexml"			"xml"
176
+	phpconfutils_use_depend_all "soap"			"xml"
177
+	phpconfutils_use_depend_all "wddx"			"xml"
178
+	phpconfutils_use_depend_all "xmlrpc"			"xml"
179
+	phpconfutils_use_depend_all "xmlreader"			"xml"
180
+	phpconfutils_use_depend_all "xmlwriter"			"xml"
181
+	phpconfutils_use_depend_all "xsl"			"xml"
182
+	phpconfutils_use_depend_all "filter"			"pcre"
183
+	phpconfutils_use_depend_all "xmlrpc"			"iconv"
184
+	phpconfutils_use_depend_all "java-external"		"session"
185
+	phpconfutils_use_depend_all "ldap-sasl"			"ldap"
186
+	phpconfutils_use_depend_all "mcve"			"ssl"
187
+	phpconfutils_use_depend_all "suhosin"			"unicode"
188
+	phpconfutils_use_depend_all "adabas"			"odbc"
189
+	phpconfutils_use_depend_all "birdstep"			"odbc"
190
+	phpconfutils_use_depend_all "dbmaker"			"odbc"
191
+	phpconfutils_use_depend_all "empress-bcs"		"odbc" "empress"
192
+	phpconfutils_use_depend_all "empress"			"odbc"
193
+	phpconfutils_use_depend_all "esoob"			"odbc"
194
+	phpconfutils_use_depend_all "db2"			"odbc"
195
+	phpconfutils_use_depend_all "iodbc"			"odbc"
196
+	phpconfutils_use_depend_all "sapdb"			"odbc"
197
+	phpconfutils_use_depend_all "solid"			"odbc"
198
+	phpconfutils_use_depend_all "kolab"			"imap"
199
+
200
+	# Direct USE conflicts
201
+	phpconfutils_use_conflict "gd" "gd-external"
202
+	phpconfutils_use_conflict "oci8" "oci8-instant-client"
203
+	phpconfutils_use_conflict "oci8" "ldap-sasl"
204
+	phpconfutils_use_conflict "qdbm" "gdbm"
205
+	phpconfutils_use_conflict "readline" "libedit"
206
+	phpconfutils_use_conflict "recode" "mysql" "imap" "yaz" "kolab"
207
+	phpconfutils_use_conflict "sharedmem" "threads"
208
+	phpconfutils_use_conflict "firebird" "interbase"
209
+
210
+	# IMAP support
211
+	php_check_imap
212
+
213
+	# Mail support
214
+	php_check_mta
215
+
216
+	# PostgreSQL support
217
+	php_check_pgsql
218
+
219
+	# Oracle support
220
+	php_check_oracle_8
221
+
222
+	phpconfutils_warn_about_external_deps
223
+
224
+	export PHPCONFUTILS_AUTO_USE="${PHPCONFUTILS_AUTO_USE}"
225
+}
226
+
227
+php5_3-sapi_set_php_ini_dir() {
228
+	if [ $SLOT != "5" ]; then
229
+		PHP_INI_DIR="/etc/php${SLOT/./}/${PHPSAPI}-php5"
230
+	else
231
+		PHP_INI_DIR="/etc/php/${PHPSAPI}-php5"
232
+	fi
233
+	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
234
+	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
235
+}
236
+
237
+php5_3-sapi_install_ini() {
238
+	destdir=/usr/$(get_libdir)/php${SLOT/./}
239
+
240
+	# get the extension dir, if not already defined
241
+	[[ -z "${PHPEXTDIR}" ]] && PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`"
242
+
243
+	# work out where we are installing the ini file
244
+	php5_3-sapi_set_php_ini_dir
245
+
246
+	cp "${PHP_INI_UPSTREAM}" "${PHP_INI_UPSTREAM}-${PHPSAPI}"
247
+	local phpinisrc="${PHP_INI_UPSTREAM}-${PHPSAPI}"
248
+
249
+	# Set the extension dir
250
+	einfo "Setting extension_dir in php.ini"
251
+	sed -e "s|^extension_dir .*$|extension_dir = ${PHPEXTDIR}|g" -i ${phpinisrc}
252
+
253
+	# A patch for PHP for security
254
+	einfo "Securing fopen wrappers"
255
+	sed -e 's|^allow_url_fopen .*|allow_url_fopen = Off|g' -i ${phpinisrc}
256
+
257
+	# Set the include path to point to where we want to find PEAR packages
258
+	einfo "Setting correct include_path"
259
+	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php5:/usr/share/php"|' -i ${phpinisrc}
260
+
261
+	# Add needed MySQL extensions charset configuration
262
+	local phpmycnfcharset=""
263
+
264
+	if [[ "${PHPSAPI}" == "cli" ]] ; then
265
+		phpmycnfcharset="`php_get_mycnf_charset cli`"
266
+		einfo "MySQL extensions charset for 'cli' SAPI is: ${phpmycnfcharset}"
267
+	elif [[ "${PHPSAPI}" == "cgi" ]] ; then
268
+		phpmycnfcharset="`php_get_mycnf_charset cgi-fcgi`"
269
+		einfo "MySQL extensions charset for 'cgi' SAPI is: ${phpmycnfcharset}"
270
+	elif [[ "${PHPSAPI}" == "apache2" ]] ; then
271
+		phpmycnfcharset="`php_get_mycnf_charset apache2handler`"
272
+		einfo "MySQL extensions charset for 'apache2' SAPI is: ${phpmycnfcharset}"
273
+	else
274
+		einfo "No supported SAPI found for which to get the MySQL charset."
275
+	fi
276
+
277
+	if [[ -n "${phpmycnfcharset}" ]] && [[ "${phpmycnfcharset}" != "empty" ]] ; then
278
+		einfo "Setting MySQL extensions charset to ${phpmycnfcharset}"
279
+		echo "" >> ${phpinisrc}
280
+		echo "; MySQL extensions default connection charset settings" >> ${phpinisrc}
281
+		echo "mysql.connect_charset = ${phpmycnfcharset}" >> ${phpinisrc}
282
+		echo "mysqli.connect_charset = ${phpmycnfcharset}" >> ${phpinisrc}
283
+		echo "pdo_mysql.connect_charset = ${phpmycnfcharset}" >> ${phpinisrc}
284
+	else
285
+		echo "" >> ${phpinisrc}
286
+		echo "; MySQL extensions default connection charset settings" >> ${phpinisrc}
287
+		echo ";mysql.connect_charset = utf8" >> ${phpinisrc}
288
+		echo ";mysqli.connect_charset = utf8" >> ${phpinisrc}
289
+		echo ";pdo_mysql.connect_charset = utf8" >> ${phpinisrc}
290
+	fi
291
+
292
+	dodir ${PHP_INI_DIR}
293
+	insinto ${PHP_INI_DIR}
294
+	newins ${phpinisrc} ${PHP_INI_FILE}
295
+
296
+	dodir ${PHP_EXT_INI_DIR}
297
+	dodir ${PHP_EXT_INI_DIR_ACTIVE}
298
+
299
+	# Install any extensions built as shared objects
300
+	if use sharedext ; then
301
+		for x in `ls "${D}/${PHPEXTDIR}/"*.so | sort` ; do
302
+			inifilename=${x/.so/.ini}
303
+			inifilename=`basename ${inifilename}`
304
+			echo "extension=`basename ${x}`" >> "${D}/${PHP_EXT_INI_DIR}/${inifilename}"
305
+			dosym "${PHP_EXT_INI_DIR}/${inifilename}" "${PHP_EXT_INI_DIR_ACTIVE}/${inifilename}"
306
+		done
307
+	fi
308
+}
309
+
310
+# ========================================================================
311
+# EXPORTED FUNCTIONS
312
+# ========================================================================
313
+
314
+# @FUNCTION: php5_3-sapi_pkg_setup
315
+# @DESCRIPTION:
316
+# Performs all the USE flag testing and magic before we do anything else.
317
+# This way saves a lot of time.
318
+php5_3-sapi_pkg_setup() {
319
+	php5_3-sapi_check_use_flags
320
+}
321
+
322
+# @FUNCTION: php5_3-sapi_src_unpack
323
+# @DESCRIPTION:
324
+# Takes care of unpacking, patching and autotools magic and disables
325
+# interactive tests.
326
+
327
+# @VARIABLE: PHP_EXTRA_BRANDING
328
+# @DESCRIPTION:
329
+# This variable allows an ebuild to add additional information like
330
+# snapshot dates to the version line.
331
+php5_3-sapi_src_unpack() {
332
+	cd "${S}"
333
+
334
+	[[ -z "${PHP_EXTRA_BRANDING}" ]] && PHP_EXTRA_BRANDING=""
335
+
336
+	# Change PHP branding
337
+	PHPPR=${PR/r/}
338
+	# >=php-5.2.4 has PHP_EXTRA_VERSION, previous had EXTRA_VERSION
339
+	sed -re "s|^(PHP_)?EXTRA_VERSION=\".*\"|\1EXTRA_VERSION=\"${PHP_EXTRA_BRANDING}-pl${PHPPR}-gentoo\"|g" -i configure.in \
340
+		|| die "Unable to change PHP branding to ${PHP_EXTRA_BRANDING}-pl${PHPPR}-gentoo"
341
+
342
+	# multilib-strict support
343
+	if [[ -n "${MULTILIB_PATCH}" ]] && [[ -f "${WORKDIR}/${MULTILIB_PATCH}" ]] ; then
344
+		epatch "${WORKDIR}/${MULTILIB_PATCH}"
345
+	else
346
+		ewarn "There is no multilib-strict patch available for this PHP release yet!"
347
+	fi
348
+
349
+	# Apply general PHP5 patches
350
+	if [[ -d "${WORKDIR}/${MY_PHP_PV}/php5" ]] ; then
351
+		EPATCH_SOURCE="${WORKDIR}/${MY_PHP_PV}/php5" EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch
352
+	fi
353
+
354
+	# Apply version-specific PHP patches
355
+	if [[ -d "${WORKDIR}/${MY_PHP_PV}/${MY_PHP_PV}" ]] ; then
356
+		EPATCH_SOURCE="${WORKDIR}/${MY_PHP_PV}/${MY_PHP_PV}" EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch
357
+	fi
358
+
359
+	# Patch PHP to show Gentoo as the server platform
360
+	sed -e "s/PHP_UNAME=\`uname -a | xargs\`/PHP_UNAME=\`uname -s -n -r -v | xargs\`/g" -i configure.in || die "Failed to fix server platform name"
361
+
362
+	# Disable interactive make test
363
+	sed -e 's/'`echo "\!getenv('NO_INTERACTION')"`'/false/g' -i run-tests.php
364
+
365
+	# Stop PHP from activating the Apache config, as we will do that ourselves
366
+	for i in configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 ; do
367
+		sed -i.orig -e 's,-i -a -n php5,-i -n php5,g' ${i}
368
+		sed -i.orig -e 's,-i -A -n php5,-i -n php5,g' ${i}
369
+	done
370
+
371
+	# Patch PHP to support heimdal instead of mit-krb5
372
+	if has_version "app-crypt/heimdal" ; then
373
+		sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 || die "Failed to fix heimdal libname"
374
+		sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 || die "Failed to fix heimdal crypt library reference"
375
+	fi
376
+
377
+	# Patch for PostgreSQL support
378
+	if use postgres ; then
379
+		sed -e 's|include/postgresql|include/postgresql include/postgresql/pgsql|g' -i ext/pgsql/config.m4 || die "Failed to fix PostgreSQL include paths"
380
+	fi
381
+
382
+	# Suhosin support
383
+	if use suhosin ; then
384
+		if [[ -n "${SUHOSIN_PATCH}" ]] && [[ -f "${DISTDIR}/${SUHOSIN_PATCH}" ]] ; then
385
+			epatch "${DISTDIR}/${SUHOSIN_PATCH}"
386
+		else
387
+			ewarn "There is no Suhosin patch available for this PHP release yet!"
388
+		fi
389
+	fi
390
+
391
+	# We are heavily patching autotools base files (configure.in) because
392
+	# of suhosin etc., so let's regenerate the whole stuff now
393
+
394
+	# eaclocal doesn't accept --force, so we try to force re-generation
395
+	# this way
396
+	rm aclocal.m4
397
+	eautoreconf --force -W no-cross
398
+
399
+}
400
+
401
+# @FUNCTION: php5_3-sapi_src_compile
402
+# @DESCRIPTION:
403
+# Takes care of compiling php according to USE flags set by user (and those automagically
404
+# enabled via phpconfutils eclass if unavoidable).
405
+php5_3-sapi_src_compile() {
406
+	destdir=/usr/$(get_libdir)/php${SLOT/./}
407
+
408
+	php5_3-sapi_set_php_ini_dir
409
+
410
+	cd "${S}"
411
+
412
+	phpconfutils_init
413
+
414
+	my_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE} --without-pear"
415
+
416
+	#				extension		USE flag		shared support?
417
+	phpconfutils_extension_enable	"bcmath"		"bcmath"		1
418
+	phpconfutils_extension_with	"bz2"			"bzip2"			1
419
+	phpconfutils_extension_enable	"calendar"		"calendar"		1
420
+	phpconfutils_extension_disable	"ctype"			"ctype"			0
421
+	phpconfutils_extension_with	"curl"			"curl"			1
422
+	phpconfutils_extension_with	"curlwrappers"		"curlwrappers"		0
423
+	phpconfutils_extension_disable	"dom"			"xml"			0
424
+	phpconfutils_extension_enable	"exif"			"exif"			1
425
+	phpconfutils_extension_disable	"filter"		"filter"		0
426
+	phpconfutils_extension_enable	"ftp"			"ftp"			1
427
+	phpconfutils_extension_with	"gettext"		"nls"			1
428
+	phpconfutils_extension_with	"gmp"			"gmp"			1
429
+	phpconfutils_extension_disable	"hash"			"hash"			0
430
+	phpconfutils_extension_without	"iconv"			"iconv"			0
431
+	phpconfutils_extension_disable	"ipv6"			"ipv6"			0
432
+	phpconfutils_extension_disable	"json"			"json"			0
433
+	phpconfutils_extension_with	"kerberos"		"kerberos"		0 "/usr"
434
+	phpconfutils_extension_disable	"libxml"		"xml"			0
435
+	phpconfutils_extension_enable	"mbstring"		"unicode"		1
436
+	phpconfutils_extension_with	"mcrypt"		"crypt"			1
437
+	phpconfutils_extension_with	"mhash"			"mhash"			1
438
+	phpconfutils_extension_with	"mssql"			"mssql"			1
439
+	phpconfutils_extension_with	"openssl"		"ssl"			0
440
+	phpconfutils_extension_with	"openssl-dir"		"ssl"			0 "/usr"
441
+	phpconfutils_extension_enable	"pcntl" 		"pcntl" 		1
442
+	phpconfutils_extension_without	"pcre-regex"		"pcre"			0
443
+	phpconfutils_extension_disable	"pdo"			"pdo"			0
444
+	phpconfutils_extension_with	"pgsql"			"postgres"		1
445
+	phpconfutils_extension_disable	"posix"			"posix"			0
446
+	phpconfutils_extension_with	"pspell"		"spell"			1
447
+	phpconfutils_extension_with	"recode"		"recode"		1
448
+	phpconfutils_extension_disable	"reflection"		"reflection"		0
449
+	phpconfutils_extension_disable	"simplexml"		"simplexml"		0
450
+	phpconfutils_extension_enable	"shmop"			"sharedmem"		0
451
+	phpconfutils_extension_with	"snmp"			"snmp"			1
452
+	phpconfutils_extension_enable	"soap"			"soap"			1
453
+	phpconfutils_extension_enable	"sockets"		"sockets"		1
454
+	phpconfutils_extension_disable	"spl"			"spl"			0
455
+	phpconfutils_extension_with	"sybase-ct"		"sybase-ct"		1
456
+	phpconfutils_extension_enable	"sysvmsg"		"sysvipc"		1
457
+	phpconfutils_extension_enable	"sysvsem"		"sysvipc"		1
458
+	phpconfutils_extension_enable	"sysvshm"		"sysvipc"		1
459
+	phpconfutils_extension_with	"tidy"			"tidy"			1
460
+	phpconfutils_extension_disable	"tokenizer"		"tokenizer"		0
461
+	phpconfutils_extension_enable	"wddx"			"wddx"			1
462
+	phpconfutils_extension_disable	"xml"			"xml"			0
463
+	phpconfutils_extension_disable	"xmlreader"		"xmlreader"		0
464
+	phpconfutils_extension_disable	"xmlwriter"		"xmlwriter"		0
465
+	phpconfutils_extension_with	"xmlrpc"		"xmlrpc"		1
466
+	phpconfutils_extension_with	"xsl"			"xsl"			1
467
+	phpconfutils_extension_enable	"zip"			"zip"			1
468
+	phpconfutils_extension_with	"zlib"			"zlib"			1
469
+	phpconfutils_extension_enable	"debug"			"debug"			0
470
+	phpconfutils_extension_with	"enchant"		"enchant"		1
471
+	phpconfutils_extension_enable	"intl"			"intl"			0
472
+	phpconfutils_extension_enable	"phar"			"phar"			0
473
+
474
+	# DBA support
475
+	if use cdb || use berkdb || use flatfile || use gdbm || use inifile || use qdbm ; then
476
+		my_conf="${my_conf} --enable-dba${shared}"
477
+	fi
478
+
479
+	# Tell PHP where the db.h is on FreeBSD
480
+#	if use berkdb ; then
481
+#		append-cppflags "-I$(db_includedir)"
482
+#	fi
483
+
484
+	# DBA drivers support
485
+	phpconfutils_extension_with 	"cdb"			"cdb"			0
486
+	phpconfutils_extension_with 	"db4"			"berkdb"		0
487
+	phpconfutils_extension_disable 	"flatfile"		"flatfile"		0
488
+	phpconfutils_extension_with 	"gdbm"			"gdbm"			0
489
+	phpconfutils_extension_disable 	"inifile"		"inifile"		0
490
+	phpconfutils_extension_with	"qdbm"			"qdbm"			0
491
+
492
+	# Support for the GD graphics library
493
+	if use gd-external || phpconfutils_usecheck gd-external ; then
494
+		phpconfutils_extension_with	"freetype-dir"	"truetype"		0 "/usr"
495
+		phpconfutils_extension_with	"t1lib"		"truetype"		0 "/usr"
496
+		phpconfutils_extension_enable	"gd-jis-conv"	"cjk" 			0
497
+		phpconfutils_extension_with 	"gd" 		"gd-external"		1 "/usr"
498
+	else
499
+		phpconfutils_extension_with	"freetype-dir"	"truetype"		0 "/usr"
500
+		phpconfutils_extension_with	"t1lib"		"truetype"		0 "/usr"
501
+		phpconfutils_extension_enable	"gd-jis-conv"	"cjk"			0
502
+		phpconfutils_extension_with	"jpeg-dir"	"gd"			0 "/usr"
503
+		phpconfutils_extension_with 	"png-dir" 	"gd" 			0 "/usr"
504
+		phpconfutils_extension_with 	"xpm-dir" 	"xpm" 			0 "/usr"
505
+		# enable gd last, so configure can pick up the previous settings
506
+		phpconfutils_extension_with 	"gd" 		"gd" 			0
507
+	fi
508
+
509
+	# IMAP support
510
+	if use imap || phpconfutils_usecheck imap ; then
511
+		phpconfutils_extension_with	"imap"		"imap"			1
512
+		phpconfutils_extension_with	"imap-ssl"	"ssl"			0
513
+	fi
514
+
515
+	# Interbase support
516
+	if use interbase ; then
517
+		my_conf="${my_conf} --with-interbase=/opt"
518
+	fi
519
+
520
+	# Firebird support - see Bug 186791
521
+	if use firebird ; then
522
+		my_conf="${my_conf} --with-interbase=/usr"
523
+	fi
524
+
525
+	# LDAP support
526
+	if use ldap || phpconfutils_usecheck ldap ; then
527
+		if use oci8 ; then
528
+			phpconfutils_extension_with	"ldap"		"ldap"		1 "${ORACLE_HOME}"
529
+		else
530
+			phpconfutils_extension_with	"ldap"		"ldap"		1
531
+			phpconfutils_extension_with	"ldap-sasl"	"ldap-sasl"	0
532
+		fi
533
+	fi
534
+
535
+	# MySQL support
536
+	if use mysql ; then
537
+		phpconfutils_extension_with	"mysql"			"mysql"		1 "/usr"
538
+		phpconfutils_extension_with	"mysql-sock"		"mysql"		0 "/var/run/mysqld/mysqld.sock"
539
+	fi
540
+
541
+	# MySQLi support
542
+	phpconfutils_extension_with		"mysqli"		"mysqli"	1 "/usr/bin/mysql_config"
543
+
544
+	# ODBC support
545
+	if use odbc || phpconfutils_usecheck odbc ; then
546
+		phpconfutils_extension_with	"unixODBC"		"odbc"		1 "/usr"
547
+
548
+		phpconfutils_extension_with	"adabas"		"adabas"	1
549
+		phpconfutils_extension_with	"birdstep"		"birdstep"	1
550
+		phpconfutils_extension_with	"dbmaker"		"dbmaker"	1
551
+		phpconfutils_extension_with	"empress"		"empress"	1
552
+		if use empress || phpconfutils_usecheck empress ; then
553
+			phpconfutils_extension_with	"empress-bcs"	"empress-bcs"	0
554
+		fi
555
+		phpconfutils_extension_with	"esoob"			"esoob"		1
556
+		phpconfutils_extension_with	"ibm-db2"		"db2"		1
557
+		phpconfutils_extension_with	"iodbc"			"iodbc"		1 "/usr"
558
+		phpconfutils_extension_with	"sapdb"			"sapdb"		1
559
+		phpconfutils_extension_with	"solid"			"solid"		1
560
+	fi
561
+
562
+	# Oracle support
563
+	if use oci8 ; then
564
+		phpconfutils_extension_with	"oci8"			"oci8"		1
565
+	fi
566
+	if use oci8-instant-client ; then
567
+		OCI8IC_PKG="`best_version dev-db/oracle-instantclient-basic`"
568
+		OCI8IC_PKG="`printf ${OCI8IC_PKG} | sed -e 's|dev-db/oracle-instantclient-basic-||g' | sed -e 's|-r.*||g'`"
569
+		phpconfutils_extension_with	"oci8"			"oci8-instant-client"	1	"instantclient,/usr/lib/oracle/${OCI8IC_PKG}/client/lib"
570
+	fi
571
+
572
+	# PDO support
573
+	if use pdo || phpconfutils_usecheck pdo ; then
574
+		phpconfutils_extension_with		"pdo-dblib"	"mssql"		1
575
+		# The PDO-Firebird driver is broken and unmaintained upstream
576
+		# phpconfutils_extension_with	"pdo-firebird"	"firebird"		1
577
+		phpconfutils_extension_with		"pdo-mysql"	"mysql"		1 "/usr"
578
+		if use oci8 ; then
579
+			phpconfutils_extension_with	"pdo-oci"	"oci8"		1
580
+		fi
581
+		if use oci8-instant-client ; then
582
+			OCI8IC_PKG="`best_version dev-db/oracle-instantclient-basic`"
583
+			OCI8IC_PKG="`printf ${OCI8IC_PKG} | sed -e 's|dev-db/oracle-instantclient-basic-||g' | sed -e 's|-r.*||g'`"
584
+			phpconfutils_extension_with	"pdo-oci"	"oci8-instant-client"	1	"instantclient,/usr,${OCI8IC_PKG}"
585
+		fi
586
+		phpconfutils_extension_with		"pdo-odbc"	"odbc"		1 "unixODBC,/usr"
587
+		phpconfutils_extension_with		"pdo-pgsql"	"postgres"	1
588
+		phpconfutils_extension_with		"pdo-sqlite"	"sqlite"	1 "/usr"
589
+	fi
590
+
591
+	# readline/libedit support
592
+	# You can use readline or libedit, but you can't use both
593
+	phpconfutils_extension_with			"readline"	"readline"	0
594
+	phpconfutils_extension_with			"libedit"	"libedit"	0
595
+
596
+	# Session support
597
+	if ! use session && ! phpconfutils_usecheck session ; then
598
+		phpconfutils_extension_disable		"session"	"session"	0
599
+	else
600
+		phpconfutils_extension_with		"mm"		"sharedmem"	0
601
+	fi
602
+
603
+	# SQLite support
604
+	if ! use sqlite && ! phpconfutils_usecheck sqlite ; then
605
+		phpconfutils_extension_without		"sqlite"	"sqlite"	0
606
+	else
607
+		phpconfutils_extension_with		"sqlite"	"sqlite"	0 "/usr"
608
+		phpconfutils_extension_enable		"sqlite-utf8"	"unicode"	0
609
+	fi
610
+
611
+	# Fix ELF-related problems
612
+	if use pic || phpconfutils_usecheck pic ; then
613
+		einfo "Enabling PIC support"
614
+		my_conf="${my_conf} --with-pic"
615
+	fi
616
+
617
+	# Catch CFLAGS problems
618
+	php_check_cflags
619
+
620
+	# multilib support
621
+	if [[ $(get_libdir) != lib ]] ; then
622
+		my_conf="--with-libdir=$(get_libdir) ${my_conf}"
623
+	fi
624
+
625
+	# Support user-passed configuration parameters
626
+	[[ -z "${EXTRA_ECONF}" ]] && EXTRA_ECONF=""
627
+
628
+	# Set the correct compiler for cross-compilation
629
+	tc-export CC
630
+
631
+	# We don't use econf, because we need to override all of its settings
632
+	./configure --prefix=${destdir} --host=${CHOST} --mandir=${destdir}/man --infodir=${destdir}/info --sysconfdir=/etc --cache-file=./config.cache ${my_conf} ${EXTRA_ECONF} || die "configure failed"
633
+	emake || die "make failed"
634
+}
635
+
636
+# @FUNCTION: php5_3-sapi_src_install
637
+# @DESCRIPTION:
638
+# Takes care of installing php (and its shared extensions if enabled).
639
+php5_3-sapi_src_install() {
640
+	destdir=/usr/$(get_libdir)/php${SLOT/./}
641
+
642
+	cd "${S}"
643
+
644
+	addpredict /usr/share/snmp/mibs/.index
645
+
646
+	# Install PHP
647
+	emake -j1 INSTALL_ROOT="${D}" install-build install-headers install-programs || die "make install failed"
648
+
649
+	# Install missing header files
650
+	if use unicode || phpconfutils_usecheck unicode ; then
651
+		dodir ${destdir}/include/php/ext/mbstring
652
+		insinto ${destdir}/include/php/ext/mbstring
653
+		for x in `ls "${S}/ext/mbstring/"*.h` ; do
654
+			file=`basename ${x}`
655
+			doins ext/mbstring/${file}
656
+		done
657
+		dodir ${destdir}/include/php/ext/mbstring/oniguruma
658
+		insinto ${destdir}/include/php/ext/mbstring/oniguruma
659
+		for x in `ls "${S}/ext/mbstring/oniguruma/"*.h` ; do
660
+			file=`basename ${x}`
661
+			doins ext/mbstring/oniguruma/${file}
662
+		done
663
+		dodir ${destdir}/include/php/ext/mbstring/libmbfl/mbfl
664
+		insinto ${destdir}/include/php/ext/mbstring/libmbfl/mbfl
665
+		for x in `ls "${S}/ext/mbstring/libmbfl/mbfl/"*.h` ; do
666
+			file=`basename ${x}`
667
+			doins ext/mbstring/libmbfl/mbfl/${file}
668
+		done
669
+	fi
670
+
671
+	# Get the extension dir, if not already defined
672
+	[[ -z "${PHPEXTDIR}" ]] && PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`"
673
+
674
+	# And install the modules to it
675
+	if use sharedext ; then
676
+		for x in `ls "${S}/modules/"*.so | sort` ; do
677
+			module=`basename ${x}`
678
+			modulename=${module/.so/}
679
+			insinto "${PHPEXTDIR}"
680
+			einfo "Installing PHP ${modulename} extension"
681
+			doins "modules/${module}"
682
+		done
683
+	fi
684
+
685
+	# Generate the USE file for PHP
686
+	phpconfutils_generate_usefile
687
+
688
+	# Create the directory where we'll put php5-only php scripts
689
+	keepdir /usr/share/php5
690
+}
691
+
692
+# @FUNCTION: php5_3-sapi_pkg_postinst
693
+# @DESCRIPTION:
694
+# Provides important information to users after install is finished.
695
+php5_3-sapi_pkg_postinst() {
696
+	ewarn "If you have additional third party PHP extensions (such as"
697
+	ewarn "dev-php5/phpdbg) you may need to recompile them now."
698
+	ewarn
699
+
700
+	if use sharedext ; then
701
+		ewarn "Make sure to use etc-update or dispatch-conf so that extension-specific"
702
+		ewarn "ini files get merged properly"
703
+		ewarn
704
+	fi
705
+
706
+	if has kolab ${IUSE} && use kolab ; then
707
+		ewarn "Please note that kolab support is still experimental!"
708
+		ewarn "Issues specific to USE=kolab must be reported to Gentoo bugzilla only!"
709
+		ewarn
710
+		ewarn "Kolab groupware server requires annotations support for IMAP, which is enabled"
711
+		ewarn "by a third-party patch. Please do NOT report issues with the imap extension"
712
+		ewarn "to bugs.php.net until you have recompiled both PHP and net-libs/c-client"
713
+		ewarn "with USE=\"-kolab\" and confirmed that those issues still exist!"
714
+		ewarn
715
+	fi
716
+
717
+		ewarn "USE=\"pic\" slows down PHP but has to be enabled on setups where TEXTRELs"
718
+		ewarn "are disabled (e.g. when using PaX in the kernel). On hardened profiles this"
719
+		ewarn "USE flag is enabled automatically"
720
+		ewarn
721
+}
0 722