php update
Lars Strojny

Lars Strojny commited on 2007-07-01 18:09:37
Zeige 12 geänderte Dateien mit 608 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,46 @@
1
+AUX 20php4-envd 145 RMD160 fb57b2d202ab1031303e7525a8ef5b353dc04ef8 SHA1 34ef066d2de22f147fc86bbe884692af7631f726 SHA256 17cd1a952434988b4c2125e4d1eef1df7114809f404605d35f255674419dd5d5
2
+MD5 77e3309d68e4a820b2abd408cd6c0ca0 files/20php4-envd 145
3
+RMD160 fb57b2d202ab1031303e7525a8ef5b353dc04ef8 files/20php4-envd 145
4
+SHA256 17cd1a952434988b4c2125e4d1eef1df7114809f404605d35f255674419dd5d5 files/20php4-envd 145
5
+AUX 20php5-envd 145 RMD160 8c81fb7dc1d1ddf16fd956d748514db3bcb27603 SHA1 f1cef57c0def8e2c5422aaf136f40b4ff47801d2 SHA256 efaae9e6ae5f7010e073c2ab6d8a9dda009f0707c7d7b0c027e142c94f7041a4
6
+MD5 9de5c2b4ffa3f2753b5e5e690fdade42 files/20php5-envd 145
7
+RMD160 8c81fb7dc1d1ddf16fd956d748514db3bcb27603 files/20php5-envd 145
8
+SHA256 efaae9e6ae5f7010e073c2ab6d8a9dda009f0707c7d7b0c027e142c94f7041a4 files/20php5-envd 145
9
+AUX 70_mod_php.conf-apache2 457 RMD160 3db748289c54547b815f6b2069cc02f4a18f16da SHA1 31f1ef36ad414beaf1dcbd99c3b41db7967c129d SHA256 03059ce0ece6c9b4db2d3bbf4b6352e0a4193a45843f3888ce3c37cc447748a1
10
+MD5 159253d05611d995e6ec3ca73bd372ca files/70_mod_php.conf-apache2 457
11
+RMD160 3db748289c54547b815f6b2069cc02f4a18f16da files/70_mod_php.conf-apache2 457
12
+SHA256 03059ce0ece6c9b4db2d3bbf4b6352e0a4193a45843f3888ce3c37cc447748a1 files/70_mod_php.conf-apache2 457
13
+AUX 70_mod_php5.conf-apache2 493 RMD160 c4ace955ff65ca2ce964cf4c8d2b42f6a41e90ef SHA1 226e31837e28675addb82f48d12f05bb4e0a5e66 SHA256 9de8f6073983e0b2ff784271047563782870d981a241abdecbdda8a038b15033
14
+MD5 d2b2325e816b90d3be7bd23388980421 files/70_mod_php5.conf-apache2 493
15
+RMD160 c4ace955ff65ca2ce964cf4c8d2b42f6a41e90ef files/70_mod_php5.conf-apache2 493
16
+SHA256 9de8f6073983e0b2ff784271047563782870d981a241abdecbdda8a038b15033 files/70_mod_php5.conf-apache2 493
17
+AUX 70_mod_php5_concurr.conf-apache2 417 RMD160 2f6bc0900fd2a94268f36254f7f6717b7a5fd649 SHA1 5490af6724ecdb5801ec12ed20ab80ac26d2f950 SHA256 f09cedf53f0355130f3a449920191fd4456f7303ebfcedaf57a636a2b18c29ba
18
+MD5 ddc2f34aaaf326706aff17e220aec916 files/70_mod_php5_concurr.conf-apache2 417
19
+RMD160 2f6bc0900fd2a94268f36254f7f6717b7a5fd649 files/70_mod_php5_concurr.conf-apache2 417
20
+SHA256 f09cedf53f0355130f3a449920191fd4456f7303ebfcedaf57a636a2b18c29ba files/70_mod_php5_concurr.conf-apache2 417
21
+AUX 70_mod_php_concurr.conf-apache2 332 RMD160 e7691ce9ab686e32c48c7b204da339db098f3ef1 SHA1 fdfcebb517a25d78bc4373fec8756b147fd02fad SHA256 bb1764de57b950ca971d20a28a75ea98f907c11e2d8cc82996eda5eacd4baf7f
22
+MD5 b325972ed888590c3f371458d3aa3d76 files/70_mod_php_concurr.conf-apache2 332
23
+RMD160 e7691ce9ab686e32c48c7b204da339db098f3ef1 files/70_mod_php_concurr.conf-apache2 332
24
+SHA256 bb1764de57b950ca971d20a28a75ea98f907c11e2d8cc82996eda5eacd4baf7f files/70_mod_php_concurr.conf-apache2 332
25
+AUX php4-ldvs 22 RMD160 e70c565b3930d9d9e3253062b7c633346cb99a63 SHA1 8c66355dfb80e2ecc6ee6faae30bf7dbb1727651 SHA256 4aee18478b09cda7e925ccde157db6099ea0122b5c4efb0868e3761b65688dde
26
+MD5 abaacd6115552db702b3a8df140d107d files/php4-ldvs 22
27
+RMD160 e70c565b3930d9d9e3253062b7c633346cb99a63 files/php4-ldvs 22
28
+SHA256 4aee18478b09cda7e925ccde157db6099ea0122b5c4efb0868e3761b65688dde files/php4-ldvs 22
29
+AUX php5-ldvs 22 RMD160 5846dab2745b68a88175dd4e72d0b8cf4756dd46 SHA1 592398c92575adb14ec972847ce2aca28a7b9c2c SHA256 b79d0e52b1b3b4543b31ad45525ae1c2814a27ea8e676772ab10bf6fb12dfe79
30
+MD5 9b26422d0bda7252a77a81d1b734e1bd files/php5-ldvs 22
31
+RMD160 5846dab2745b68a88175dd4e72d0b8cf4756dd46 files/php5-ldvs 22
32
+SHA256 b79d0e52b1b3b4543b31ad45525ae1c2814a27ea8e676772ab10bf6fb12dfe79 files/php5-ldvs 22
33
+DIST php-5.2.3.tar.bz2 7417635 RMD160 3c895cf7e513e5a3d7d9f742a9d56102cbb3a79b SHA1 0a02e05e1c663c0d4ee0b253917c0e140e606261 SHA256 eedffda5069caa801a7fec217c77619657416a5fcaefb79ba4620432f0befe29
34
+DIST php-patchset-5.2.3-r1.tar.bz2 16387 RMD160 abcf153994e73020637ca061050dd6e57088ce6a SHA1 530ae1b4a0c2d104a6816f439d1ad7b85d837184 SHA256 49669e1f6a790987afdd207965b5cdae41df0a0d2e7c5641e11b1169d86fed62
35
+DIST suhosin-patch-5.2.3-0.9.6.2-gentoo.patch.gz 22789 RMD160 3adfe1038b8436dac56cb05c63a2b1305a6a0266 SHA1 9f4ee79b049df097efc634eb9d60249320441df3 SHA256 214c43e4808483f0700f36ffa57aba909a669cb335c179d46c1e8f765d70bd1f
36
+EBUILD php-5.2.3.ebuild 14258 RMD160 ca076fd79125bc00dac472bf25614db3c9b07463 SHA1 044a869fb461516080f67fc10380eacab1588043 SHA256 7d1abf411f42a03f461926768fd1b3722751e74c56a37c3fd96f716d36adf2bb
37
+MD5 546cd9eba71a25b6f3f8e382191e5a8e php-5.2.3.ebuild 14258
38
+RMD160 ca076fd79125bc00dac472bf25614db3c9b07463 php-5.2.3.ebuild 14258
39
+SHA256 7d1abf411f42a03f461926768fd1b3722751e74c56a37c3fd96f716d36adf2bb php-5.2.3.ebuild 14258
40
+MISC metadata.xml 157 RMD160 a98db3a086fae3c09a903dadbc05f60443ec4b1a SHA1 ddaa23cc35eb917bf8962b652442bebb1ce0f440 SHA256 54f8878ca0228e380abbaa4b529806b5533a6b9b51b3b16c0909e906586a91a1
41
+MD5 c58d07ca1c1235bbad9bccaec96fc062 metadata.xml 157
42
+RMD160 a98db3a086fae3c09a903dadbc05f60443ec4b1a metadata.xml 157
43
+SHA256 54f8878ca0228e380abbaa4b529806b5533a6b9b51b3b16c0909e906586a91a1 metadata.xml 157
44
+MD5 f7c96d4c8333079d2569c77eb642d74e files/digest-php-5.2.3 807
45
+RMD160 b036dee7544b553b27b068743cdd37a2899e8055 files/digest-php-5.2.3 807
46
+SHA256 33723d3118772674f432d65fe02f51c746eb1dba5c0bda00f970f8cc5192ee36 files/digest-php-5.2.3 807
... ...
@@ -0,0 +1,2 @@
1
+MANPATH="/usr/lib/php4/man/"
2
+CONFIG_PROTECT_MASK="/etc/php/cli-php4/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/apache2-php4/ext-active/"
... ...
@@ -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,17 @@
1
+<IfDefine PHP4>
2
+	# Load the module first
3
+	<IfModule !sapi_apache2.c>
4
+		LoadModule php4_module    modules/libphp4.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-source .phps
14
+	</IfModule>
15
+
16
+	AddDirectoryIndex index.php index.phtml
17
+</IfDefine>
... ...
@@ -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
+	AddDirectoryIndex index.php index.phtml
18
+</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
+	AddDirectoryIndex index.php index.phtml
16
+</IfDefine>
... ...
@@ -0,0 +1,14 @@
1
+<IfDefine PHP4>
2
+	# Load the module first
3
+	<IfModule !sapi_apache2.c>
4
+		LoadModule php4_module    modules/libphp4.so
5
+	</IfModule>
6
+
7
+	# Set it to handle the files
8
+	<IfModule mod_mime.c>
9
+		AddType application/x-httpd-php4 .php3
10
+		AddType application/x-httpd-php4 .php4
11
+	</IfModule>
12
+
13
+	AddDirectoryIndex index.php index.phtml
14
+</IfDefine>
... ...
@@ -0,0 +1,9 @@
1
+MD5 eb50b751c8e1ced05bd012d5a0e4dec3 php-5.2.3.tar.bz2 7417635
2
+RMD160 3c895cf7e513e5a3d7d9f742a9d56102cbb3a79b php-5.2.3.tar.bz2 7417635
3
+SHA256 eedffda5069caa801a7fec217c77619657416a5fcaefb79ba4620432f0befe29 php-5.2.3.tar.bz2 7417635
4
+MD5 e4ee19831e4104fe72e5c98b847fae93 php-patchset-5.2.3-r1.tar.bz2 16387
5
+RMD160 abcf153994e73020637ca061050dd6e57088ce6a php-patchset-5.2.3-r1.tar.bz2 16387
6
+SHA256 49669e1f6a790987afdd207965b5cdae41df0a0d2e7c5641e11b1169d86fed62 php-patchset-5.2.3-r1.tar.bz2 16387
7
+MD5 f217d04f9513222e48cea6588ac65b89 suhosin-patch-5.2.3-0.9.6.2-gentoo.patch.gz 22789
8
+RMD160 3adfe1038b8436dac56cb05c63a2b1305a6a0266 suhosin-patch-5.2.3-0.9.6.2-gentoo.patch.gz 22789
9
+SHA256 214c43e4808483f0700f36ffa57aba909a669cb335c179d46c1e8f765d70bd1f suhosin-patch-5.2.3-0.9.6.2-gentoo.patch.gz 22789
... ...
@@ -0,0 +1 @@
1
+PHP_4 { global: *; };
... ...
@@ -0,0 +1 @@
1
+PHP_5 { global: *; };
... ...
@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
+<pkgmetadata>
4
+	<herd>php</herd>
5
+</pkgmetadata>
... ...
@@ -0,0 +1,477 @@
1
+# Copyright 1999-2007 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.2-r1.ebuild,v 1.9 2007/05/12 11:26:51 corsair 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"
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="1"
24
+SUHOSIN_PATCH="suhosin-patch-${MY_PHP_PV}-0.9.6.2-gentoo.patch.gz"
25
+MULTILIB_PATCH="${MY_PHP_PV}/opt/php${MY_PHP_PV}-multilib-search-path.patch"
26
+# php patch settings, ebuild specific
27
+FASTBUILD_PATCH="${MY_PHP_PV}/opt/php${MY_PHP_PV}-fastbuild.patch"
28
+CONCURRENTMODPHP_PATCH="${MY_PHP_PV}/opt/php${MY_PHP_PV}-concurrent_apache_modules.patch"
29
+
30
+inherit php5_2-sapi apache-module
31
+
32
+DESCRIPTION="The PHP language runtime engine: CLI, CGI and Apache2 SAPIs."
33
+
34
+DEPEND="app-admin/php-toolkit"
35
+RDEPEND="${DEPEND}"
36
+
37
+want_apache
38
+
39
+pkg_setup() {
40
+	PHPCONFUTILS_AUTO_USE=""
41
+
42
+	# Make sure the user has specified at least one SAPI
43
+	einfo "Determining SAPI(s) to build"
44
+	phpconfutils_require_any "  Enabled  SAPI:" "  Disabled SAPI:" cli cgi apache2
45
+
46
+	# Threaded Apache2 support
47
+	if use apache2 ; then
48
+		if [[ "${APACHE_VERSION}" != "0" ]] ; then
49
+			if ! use threads ; then
50
+				APACHE2_SAFE_MPMS="itk peruser prefork"
51
+			else
52
+				APACHE2_SAFE_MPMS="event leader metuxmpm perchild threadpool worker"
53
+			fi
54
+
55
+			ewarn
56
+			ewarn "If this package fails with a fatal error about Apache2 not having"
57
+			ewarn "been compiled with a compatible MPM, this is normally because you"
58
+			ewarn "need to toggle the 'threads' USE flag."
59
+			ewarn
60
+			ewarn "If 'threads' is off, try switching it on."
61
+			ewarn "If 'threads' is on, try switching it off."
62
+			ewarn
63
+
64
+			apache-module_pkg_setup
65
+		fi
66
+	fi
67
+
68
+	# Concurrent PHP Apache2 modules support
69
+	if use apache2 ; then
70
+		if [[ "${APACHE_VERSION}" != "0" ]] ; then
71
+			if use concurrentmodphp ; then
72
+				ewarn
73
+				ewarn "'concurrentmodphp' makes it possible to load multiple, differently"
74
+				ewarn "versioned mod_php's into the same Apache instance. This is done with"
75
+				ewarn "a few linker tricks and workarounds, and is not guaranteed to always"
76
+				ewarn "work correctly, so use it at your own risk. Especially, do not use"
77
+				ewarn "this in conjunction with PHP modules (PECL, ...) other than the ones"
78
+				ewarn "you may find in the Portage tree or the PHP Overlay!"
79
+				ewarn "This is an experimental feature, so please rebuild PHP"
80
+				ewarn "without the 'concurrentmodphp' USE flag if you experience"
81
+				ewarn "any problems, and then reproduce any bugs before filing"
82
+				ewarn "them in Gentoo's Bugzilla or bugs.php.net."
83
+				ewarn "If you have conclusive evidence that a bug directly"
84
+				ewarn "derives from 'concurrentmodphp', please file a bug in"
85
+				ewarn "Gentoo's Bugzilla only."
86
+				ewarn
87
+				ebeep 5
88
+			fi
89
+		fi
90
+	fi
91
+
92
+	# fastbuild support
93
+	if use fastbuild ; then
94
+		ewarn
95
+		ewarn "'fastbuild' attempts to build all SAPIs in a single pass."
96
+		ewarn "This is an experimental feature, so please rebuild PHP"
97
+		ewarn "without the 'fastbuild' USE flag if you experience"
98
+		ewarn "any problems, and then reproduce any bugs before filing"
99
+		ewarn "them in Gentoo's Bugzilla or bugs.php.net."
100
+		ewarn "If you have conclusive evidence that a bug directly"
101
+		ewarn "derives from 'fastbuild', please file a bug in"
102
+		ewarn "Gentoo's Bugzilla only."
103
+		ewarn
104
+	fi
105
+
106
+	php5_2-sapi_pkg_setup
107
+}
108
+
109
+php_determine_sapis() {
110
+	# holds the list of sapis that we want to build
111
+	PHPSAPIS=
112
+
113
+	if use cli || phpconfutils_usecheck cli ; then
114
+		PHPSAPIS="${PHPSAPIS} cli"
115
+	fi
116
+
117
+	if use cgi ; then
118
+		PHPSAPIS="${PHPSAPIS} cgi"
119
+	fi
120
+
121
+	# note - apache SAPI comes after the simpler cli/cgi sapis
122
+	if use apache2 ; then
123
+		if [[ "${APACHE_VERSION}" != "0" ]] ; then
124
+			PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}"
125
+		fi
126
+	fi
127
+}
128
+
129
+src_unpack() {
130
+	if [[ "${PHP_PACKAGE}" == 1 ]] ; then
131
+		unpack ${A}
132
+	fi
133
+
134
+	cd "${S}"
135
+
136
+	# Concurrent PHP Apache2 modules support
137
+	if use apache2 ; then
138
+		if [[ "${APACHE_VERSION}" != "0" ]] ; 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
+	fi
148
+
149
+	# fastbuild support
150
+	if use fastbuild ; then
151
+		if [[ -n "${FASTBUILD_PATCH}" ]] && [[ -f "${WORKDIR}/${FASTBUILD_PATCH}" ]] ; then
152
+			epatch "${WORKDIR}/${FASTBUILD_PATCH}"
153
+		else
154
+			ewarn "There is no fastbuild patch available for this PHP release yet!"
155
+		fi
156
+	fi
157
+
158
+	# Now let the eclass do the rest and regenerate the configure
159
+	php5_2-sapi_src_unpack
160
+
161
+	# Fix Makefile.global:test to consider the CGI SAPI if present
162
+	if use cgi ; then
163
+		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
164
+		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
165
+	fi
166
+}
167
+
168
+src_compile() {
169
+	if use fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then
170
+		src_compile_fastbuild
171
+	else
172
+		src_compile_normal
173
+	fi
174
+}
175
+
176
+src_compile_fastbuild() {
177
+	php_determine_sapis
178
+
179
+	build_cli=0
180
+	build_cgi=0
181
+	build_apache2=0
182
+	my_conf=""
183
+
184
+	for x in ${PHPSAPIS} ; do
185
+		case ${x} in
186
+			cli)
187
+				build_cli=1
188
+				;;
189
+			cgi)
190
+				build_cgi=1
191
+				;;
192
+			apache2)
193
+				build_apache2=1
194
+				;;
195
+		esac
196
+	done
197
+
198
+	if [[ ${build_cli} = 1 ]] ; then
199
+		my_conf="${my_conf} --enable-cli"
200
+	else
201
+		my_conf="${my_conf} --disable-cli"
202
+	fi
203
+
204
+	if [[ ${build_cgi} = 1 ]] ; then
205
+		my_conf="${my_conf} --enable-cgi --enable-fastcgi"
206
+		phpconfutils_extension_enable "discard-path" "discard-path" 0
207
+		phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
208
+	else
209
+		my_conf="${my_conf} --disable-cgi"
210
+	fi
211
+
212
+	if [[ ${build_apache2} = 1 ]] ; then
213
+		my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2"
214
+
215
+		# Threaded Apache2 support
216
+		if use threads ; then
217
+			my_conf="${my_conf} --enable-maintainer-zts"
218
+			ewarn "Enabling ZTS for Apache2 MPM"
219
+		fi
220
+
221
+		# Concurrent PHP Apache2 modules support
222
+		if use concurrentmodphp ; then
223
+			append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
224
+		fi
225
+	fi
226
+
227
+	# Now we know what we are building, build it
228
+	php5_2-sapi_src_compile
229
+
230
+	# To keep the separate php.ini files for each SAPI, we change the
231
+	# build-defs.h and recompile
232
+
233
+	if [[ ${build_cli} = 1 ]] ; then
234
+		einfo
235
+		einfo "Building CLI SAPI"
236
+		einfo
237
+
238
+		sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php5"|g;' -i main/build-defs.h
239
+		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
240
+		for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
241
+			[[ -f ${x} ]] && rm -f ${x}
242
+		done
243
+		make sapi/cli/php || die "Unable to make CLI SAPI"
244
+		cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
245
+	fi
246
+
247
+	if [[ ${build_cgi} = 1 ]] ; then
248
+		einfo
249
+		einfo "Building CGI SAPI"
250
+		einfo
251
+
252
+		sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php5"|g;' -i main/build-defs.h
253
+		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
254
+		for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
255
+			[[ -f ${x} ]] && rm -f ${x}
256
+		done
257
+		make sapi/cgi/php-cgi || die "Unable to make CGI SAPI"
258
+		cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
259
+	fi
260
+
261
+	if [[ ${build_apache2} = 1 ]] ; then
262
+		einfo
263
+		einfo "Building apache${APACHE_VERSION} SAPI"
264
+		einfo
265
+
266
+		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
267
+		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
268
+		for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
269
+			[[ -f ${x} ]] && rm -f ${x}
270
+		done
271
+		make || die "Unable to make apache${APACHE_VERSION} SAPI"
272
+	fi
273
+}
274
+
275
+src_compile_normal() {
276
+	php_determine_sapis
277
+
278
+	CLEAN_REQUIRED=0
279
+	my_conf=""
280
+
281
+	# Support the Apache2 extras, they must be set globally for all
282
+	# SAPIs to work correctly, especially for external PHP extensions
283
+	if use apache2 ; then
284
+		if [[ "${APACHE_VERSION}" != "0" ]] ; then
285
+			# Concurrent PHP Apache2 modules support
286
+			if use concurrentmodphp ; then
287
+				append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
288
+			fi
289
+		fi
290
+	fi
291
+
292
+	for x in ${PHPSAPIS} ; do
293
+		# Support the Apache2 extras, they must be set globally for all
294
+		# SAPIs to work correctly, especially for external PHP extensions
295
+		if use apache2 ; then
296
+			if [[ "${APACHE_VERSION}" != "0" ]] ; then
297
+				# Threaded Apache2 support
298
+				if use threads ; then
299
+					my_conf="${my_conf} --enable-maintainer-zts"
300
+					ewarn "Enabling ZTS for Apache2 MPM"
301
+				fi
302
+			fi
303
+		fi
304
+
305
+		if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then
306
+			make clean
307
+		fi
308
+
309
+		PHPSAPI="${x}"
310
+
311
+		case ${x} in
312
+			cli)
313
+				my_conf="${my_conf} --enable-cli --disable-cgi"
314
+				php5_2-sapi_src_compile
315
+				cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
316
+				;;
317
+			cgi)
318
+				my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi"
319
+				phpconfutils_extension_enable "discard-path" "discard-path" 0
320
+				phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
321
+				php5_2-sapi_src_compile
322
+				cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
323
+				;;
324
+			apache2)
325
+				my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2"
326
+				php5_2-sapi_src_compile
327
+				;;
328
+		esac
329
+
330
+		CLEAN_REQUIRED=1
331
+		my_conf=""
332
+	done
333
+}
334
+
335
+src_install() {
336
+	php_determine_sapis
337
+
338
+	destdir=/usr/$(get_libdir)/php5
339
+
340
+	# Let the eclass do the common work
341
+	php5_2-sapi_src_install
342
+
343
+	einfo
344
+	einfo "Installing SAPI(s) ${PHPSAPIS}"
345
+	einfo
346
+
347
+	for x in ${PHPSAPIS} ; do
348
+
349
+		PHPSAPI="${x}"
350
+
351
+		case ${x} in
352
+			cli)
353
+				einfo "Installing CLI SAPI"
354
+				into ${destdir}
355
+				newbin php-cli php || die "Unable to install ${x} sapi"
356
+				php5_2-sapi_install_ini
357
+				;;
358
+			cgi)
359
+				einfo "Installing CGI SAPI"
360
+				into ${destdir}
361
+				dobin php-cgi || die "Unable to install ${x} sapi"
362
+				php5_2-sapi_install_ini
363
+				;;
364
+			apache2)
365
+				einfo "Installing Apache${APACHE_VERSION} SAPI"
366
+				make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"
367
+				if use concurrentmodphp ; then
368
+					einfo "Installing Apache${APACHE_VERSION} config file for PHP5-concurrent (70_mod_php5_concurr.conf)"
369
+					insinto ${APACHE_MODULES_CONFDIR}
370
+					newins "${FILESDIR}/70_mod_php5_concurr.conf-apache2" "70_mod_php5_concurr.conf"
371
+
372
+					# Put the ld version script in the right place so it's always accessible
373
+					insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
374
+					doins "${FILESDIR}/php5-ldvs"
375
+
376
+					# Redefine the extension dir to have the modphp suffix
377
+					PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`-versioned"
378
+				else
379
+					einfo "Installing Apache${APACHE_VERSION} config file for PHP5 (70_mod_php5.conf)"
380
+					insinto ${APACHE_MODULES_CONFDIR}
381
+					newins "${FILESDIR}/70_mod_php5.conf-apache2" "70_mod_php5.conf"
382
+				fi
383
+				php5_2-sapi_install_ini
384
+				;;
385
+		esac
386
+	done
387
+
388
+	# Install env.d files
389
+	newenvd "${FILESDIR}/20php5-envd" "20php5"
390
+	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${D}/etc/env.d/20php5"
391
+}
392
+
393
+pkg_postinst() {
394
+	# Output some general info to the user
395
+	if use apache2 ; then
396
+		APACHE2_MOD_DEFINE="PHP5"
397
+		if use concurrentmodphp ; then
398
+			APACHE2_MOD_CONF="70_mod_php5_concurr"
399
+		else
400
+			APACHE2_MOD_CONF="70_mod_php5"
401
+		fi
402
+		apache-module_pkg_postinst
403
+	fi
404
+
405
+	# Update Apache2 to use mod_php
406
+	if use apache2 ; then
407
+		"${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1
408
+		exitStatus=$?
409
+		if [[ ${exitStatus} == 2 ]] ; then
410
+			php-select apache2 php5
411
+		elif [[ ${exitStatus} == 4 ]] ; then
412
+			ewarn
413
+			ewarn "Apache2 is configured to load a different version of PHP."
414
+			ewarn "To make Apache2 use PHP v5, use php-select:"
415
+			ewarn
416
+			ewarn "    php-select apache2 php5"
417
+			ewarn
418
+		fi
419
+	fi
420
+
421
+	# Create the symlinks for php-cli
422
+	if use cli || phpconfutils_usecheck cli ; then
423
+		"${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1
424
+		exitStatus=$?
425
+		if [[ ${exitStatus} == 5 ]] ; then
426
+			php-select php php5
427
+		elif [[ ${exitStatus} == 4 ]] ; then
428
+			ewarn
429
+			ewarn "/usr/bin/php links to a different version of PHP."
430
+			ewarn "To make /usr/bin/php point to PHP v5, use php-select:"
431
+			ewarn
432
+			ewarn "    php-select php php5"
433
+			ewarn
434
+		fi
435
+	fi
436
+
437
+	# Create the symlinks for php-cgi
438
+	if use cgi ; then
439
+		"${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1
440
+		exitStatus=$?
441
+		if [[ ${exitStatus} == 5 ]] ; then
442
+			php-select php-cgi php5
443
+		elif [[ ${exitStatus} == 4 ]] ; then
444
+			ewarn
445
+			ewarn "/usr/bin/php-cgi links to a different version of PHP."
446
+			ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:"
447
+			ewarn
448
+			ewarn "    php-select php-cgi php5"
449
+			ewarn
450
+		fi
451
+	fi
452
+
453
+	# Create the symlinks for php-devel
454
+	"${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1
455
+	exitStatus=$?
456
+	if [[ $exitStatus == 5 ]] ; then
457
+		php-select php-devel php5
458
+	elif [[ $exitStatus == 4 ]] ; then
459
+		ewarn
460
+		ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a"
461
+		ewarn "different version of PHP. To make them point to PHP v5, use"
462
+		ewarn "php-select:"
463
+		ewarn
464
+		ewarn "    php-select php-devel php5"
465
+		ewarn
466
+	fi
467
+
468
+	php5_2-sapi_pkg_postinst
469
+}
470
+
471
+src_test() {
472
+	einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
473
+	if ! emake -j1 test ; then
474
+		hasq test ${FEATURES} && die "Make test failed. See above for details."
475
+		hasq test ${FEATURES} || eerror "Make test failed. See above for details."
476
+	fi
477
+}
0 478