1 |
olemarkus 13/03/04 11:45:07 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: php-5.4.12.ebuild php-5.3.22.ebuild |
5 |
Log: |
6 |
5.4 and 5.3 version bump |
7 |
|
8 |
(Portage version: 2.1.11.50/cvs/Linux x86_64, signed Manifest commit with key C4A92BF5) |
9 |
|
10 |
Revision Changes Path |
11 |
1.673 dev-lang/php/ChangeLog |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?rev=1.673&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?rev=1.673&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?r1=1.672&r2=1.673 |
16 |
|
17 |
Index: ChangeLog |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v |
20 |
retrieving revision 1.672 |
21 |
retrieving revision 1.673 |
22 |
diff -u -r1.672 -r1.673 |
23 |
--- ChangeLog 7 Feb 2013 13:58:17 -0000 1.672 |
24 |
+++ ChangeLog 4 Mar 2013 11:45:07 -0000 1.673 |
25 |
@@ -1,6 +1,13 @@ |
26 |
# ChangeLog for dev-lang/php |
27 |
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.672 2013/02/07 13:58:17 olemarkus Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.673 2013/03/04 11:45:07 olemarkus Exp $ |
30 |
+ |
31 |
+*php-5.3.22 (04 Mar 2013) |
32 |
+*php-5.4.12 (04 Mar 2013) |
33 |
+ |
34 |
+ 04 Mar 2013; Ole Markus With <olemarkus@g.o> +php-5.3.22.ebuild, |
35 |
+ +php-5.4.12.ebuild: |
36 |
+ 5.4 and 5.3 version bump |
37 |
|
38 |
*php-5.5.0_alpha4 (07 Feb 2013) |
39 |
*php-5.4.11-r2 (07 Feb 2013) |
40 |
|
41 |
|
42 |
|
43 |
1.1 dev-lang/php/php-5.4.12.ebuild |
44 |
|
45 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.4.12.ebuild?rev=1.1&view=markup |
46 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.4.12.ebuild?rev=1.1&content-type=text/plain |
47 |
|
48 |
Index: php-5.4.12.ebuild |
49 |
=================================================================== |
50 |
# Copyright 1999-2013 Gentoo Foundation |
51 |
# Distributed under the terms of the GNU General Public License v2 |
52 |
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.4.12.ebuild,v 1.1 2013/03/04 11:45:07 olemarkus Exp $ |
53 |
|
54 |
EAPI=5 |
55 |
|
56 |
inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool |
57 |
|
58 |
SUHOSIN_VERSION="" |
59 |
FPM_VERSION="builtin" |
60 |
EXPECTED_TEST_FAILURES="" |
61 |
|
62 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
63 |
|
64 |
function php_get_uri () |
65 |
{ |
66 |
case "${1}" in |
67 |
"php-pre") |
68 |
echo "http://downloads.php.net/stas/${2}" |
69 |
;; |
70 |
"php") |
71 |
echo "http://www.php.net/distributions/${2}" |
72 |
;; |
73 |
"suhosin") |
74 |
echo "http://download.suhosin.org/${2}" |
75 |
;; |
76 |
"olemarkus") |
77 |
echo "http://dev.gentoo.org/~olemarkus/php/${2}" |
78 |
;; |
79 |
"gentoo") |
80 |
echo "mirror://gentoo/${2}" |
81 |
;; |
82 |
*) |
83 |
die "unhandled case in php_get_uri" |
84 |
;; |
85 |
esac |
86 |
} |
87 |
|
88 |
PHP_MV="$(get_major_version)" |
89 |
SLOT="$(get_version_component_range 1-2)" |
90 |
|
91 |
# alias, so we can handle different types of releases (finals, rcs, alphas, |
92 |
# betas, ...) w/o changing the whole ebuild |
93 |
PHP_PV="${PV/_rc/RC}" |
94 |
PHP_PV="${PHP_PV/_alpha/alpha}" |
95 |
PHP_PV="${PHP_PV/_beta/beta}" |
96 |
PHP_RELEASE="php" |
97 |
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
98 |
PHP_P="${PN}-${PHP_PV}" |
99 |
|
100 |
PHP_PATCHSET_LOC="olemarkus" |
101 |
|
102 |
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
103 |
|
104 |
PHP_PATCHSET="2" |
105 |
PHP_PATCHSET_URI=" |
106 |
$(php_get_uri "${PHP_PATCHSET_LOC}" "php-patchset-${SLOT}-r${PHP_PATCHSET}.tar.bz2")" |
107 |
|
108 |
PHP_FPM_INIT_VER="4" |
109 |
PHP_FPM_CONF_VER="1" |
110 |
|
111 |
if [[ ${SUHOSIN_VERSION} == *-gentoo ]]; then |
112 |
# in some cases we use our own suhosin patch (very recent version, |
113 |
# patch conflicts, etc.) |
114 |
SUHOSIN_TYPE="olemarkus" |
115 |
else |
116 |
SUHOSIN_TYPE="suhosin" |
117 |
fi |
118 |
|
119 |
if [[ -n ${SUHOSIN_VERSION} ]]; then |
120 |
SUHOSIN_PATCH="suhosin-patch-${SUHOSIN_VERSION}.patch"; |
121 |
SUHOSIN_URI="$(php_get_uri ${SUHOSIN_TYPE} ${SUHOSIN_PATCH}.gz )" |
122 |
fi |
123 |
|
124 |
SRC_URI=" |
125 |
${PHP_SRC_URI} |
126 |
${PHP_PATCHSET_URI}" |
127 |
|
128 |
if [[ -n ${SUHOSIN_VERSION} ]]; then |
129 |
SRC_URI="${SRC_URI} |
130 |
suhosin? ( ${SUHOSIN_URI} )" |
131 |
fi |
132 |
|
133 |
DESCRIPTION="The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs." |
134 |
HOMEPAGE="http://php.net/" |
135 |
LICENSE="PHP-3" |
136 |
|
137 |
S="${WORKDIR}/${PHP_P}" |
138 |
|
139 |
# We can build the following SAPIs in the given order |
140 |
SAPIS="embed cli cgi fpm apache2" |
141 |
|
142 |
# Gentoo-specific, common features |
143 |
IUSE="kolab" |
144 |
|
145 |
# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
146 |
IUSE="${IUSE} |
147 |
${SAPIS/cli/+cli} |
148 |
threads" |
149 |
|
150 |
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
151 |
crypt +ctype curl curlwrappers debug doc |
152 |
enchant exif frontbase +fileinfo +filter firebird |
153 |
flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
154 |
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash |
155 |
mssql mysql mysqlnd mysqli nls |
156 |
oci8-instant-client odbc pcntl pdo +phar pic +posix postgres qdbm |
157 |
readline recode selinux +session sharedmem |
158 |
+simplexml snmp soap sockets spell sqlite ssl |
159 |
sybase-ct sysvipc tidy +tokenizer truetype unicode wddx |
160 |
+xml xmlreader xmlwriter xmlrpc xpm xsl zip zlib" |
161 |
|
162 |
# Enable suhosin if available |
163 |
[[ -n $SUHOSIN_VERSION ]] && IUSE="${IUSE} suhosin" |
164 |
|
165 |
DEPEND=" |
166 |
>=app-admin/eselect-php-0.6.2 |
167 |
>=dev-libs/libpcre-8.12[unicode] |
168 |
apache2? ( www-servers/apache[threads=] ) |
169 |
berkdb? ( =sys-libs/db-4* ) |
170 |
bzip2? ( app-arch/bzip2 ) |
171 |
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
172 |
cjk? ( !gd? ( |
173 |
virtual/jpeg |
174 |
media-libs/libpng |
175 |
sys-libs/zlib |
176 |
) ) |
177 |
crypt? ( >=dev-libs/libmcrypt-2.4 ) |
178 |
curl? ( >=net-misc/curl-7.10.5 ) |
179 |
enchant? ( app-text/enchant ) |
180 |
exif? ( !gd? ( |
181 |
virtual/jpeg |
182 |
media-libs/libpng |
183 |
sys-libs/zlib |
184 |
) ) |
185 |
firebird? ( dev-db/firebird ) |
186 |
gd? ( virtual/jpeg media-libs/libpng sys-libs/zlib ) |
187 |
gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
188 |
gmp? ( >=dev-libs/gmp-4.1.2 ) |
189 |
iconv? ( virtual/libiconv ) |
190 |
imap? ( virtual/imap-c-client[ssl=] ) |
191 |
intl? ( dev-libs/icu:= ) |
192 |
iodbc? ( dev-db/libiodbc ) |
193 |
kerberos? ( virtual/krb5 ) |
194 |
kolab? ( >=net-libs/c-client-2004g-r1 ) |
195 |
ldap? ( >=net-nds/openldap-1.2.11 ) |
196 |
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
197 |
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
198 |
mssql? ( dev-db/freetds[mssql] ) |
199 |
!mysqlnd? ( |
200 |
mysql? ( virtual/mysql ) |
201 |
mysqli? ( >=virtual/mysql-4.1 ) |
202 |
) |
203 |
nls? ( sys-devel/gettext ) |
204 |
oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
205 |
odbc? ( >=dev-db/unixODBC-1.8.13 ) |
206 |
postgres? ( dev-db/postgresql-base ) |
207 |
qdbm? ( dev-db/qdbm ) |
208 |
readline? ( sys-libs/readline ) |
209 |
recode? ( app-text/recode ) |
210 |
sharedmem? ( dev-libs/mm ) |
211 |
simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
212 |
snmp? ( >=net-analyzer/net-snmp-5.2 ) |
213 |
soap? ( >=dev-libs/libxml2-2.6.8 ) |
214 |
spell? ( >=app-text/aspell-0.50 ) |
215 |
sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
216 |
ssl? ( >=dev-libs/openssl-0.9.7 ) |
217 |
sybase-ct? ( dev-db/freetds ) |
218 |
tidy? ( app-text/htmltidy ) |
219 |
truetype? ( |
220 |
=media-libs/freetype-2* |
221 |
>=media-libs/t1lib-5.0.0 |
222 |
!gd? ( |
223 |
virtual/jpeg media-libs/libpng sys-libs/zlib ) |
224 |
) |
225 |
unicode? ( dev-libs/oniguruma ) |
226 |
wddx? ( >=dev-libs/libxml2-2.6.8 ) |
227 |
xml? ( >=dev-libs/libxml2-2.6.8 ) |
228 |
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
229 |
xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
230 |
xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
231 |
xpm? ( |
232 |
x11-libs/libXpm |
233 |
virtual/jpeg |
234 |
media-libs/libpng sys-libs/zlib |
235 |
) |
236 |
xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
237 |
zip? ( sys-libs/zlib ) |
238 |
zlib? ( sys-libs/zlib ) |
239 |
virtual/mta |
240 |
" |
241 |
|
242 |
php="=${CATEGORY}/${PF}" |
243 |
|
244 |
REQUIRED_USE=" |
245 |
truetype? ( gd ) |
246 |
cjk? ( gd ) |
247 |
exif? ( gd ) |
248 |
|
249 |
xpm? ( gd ) |
250 |
gd? ( zlib ) |
251 |
simplexml? ( xml ) |
252 |
soap? ( xml ) |
253 |
wddx? ( xml ) |
254 |
xmlrpc? ( || ( xml iconv ) ) |
255 |
xmlreader? ( xml ) |
256 |
xsl? ( xml ) |
257 |
ldap-sasl? ( ldap ) |
258 |
kolab? ( imap ) |
259 |
mhash? ( hash ) |
260 |
phar? ( hash ) |
261 |
mysqlnd? ( || ( |
262 |
mysql |
263 |
mysqli |
264 |
pdo |
265 |
) ) |
266 |
|
267 |
qdbm? ( !gdbm ) |
268 |
readline? ( !libedit ) |
269 |
recode? ( !imap !mysql !mysqli ) |
270 |
sharedmem? ( !threads ) |
271 |
|
272 |
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
273 |
|
274 |
RDEPEND="${DEPEND}" |
275 |
|
276 |
[[ -n $SUHOSIN_VERSION ]] && RDEPEND="${RDEPEND} suhosin? ( |
277 |
=${CATEGORY}/${PN}-${SLOT}*[unicode] )" |
278 |
|
279 |
RDEPEND="${RDEPEND} fpm? ( selinux? ( sec-policy/selinux-phpfpm ) )" |
280 |
|
281 |
DEPEND="${DEPEND} |
282 |
sys-devel/flex |
283 |
>=sys-devel/m4-1.4.3 |
284 |
>=sys-devel/libtool-1.5.18" |
285 |
|
286 |
# They are in PDEPEND because we need PHP installed first! |
287 |
PDEPEND="doc? ( app-doc/php-docs )" |
288 |
|
289 |
# No longer depend on the extension. The suhosin USE flag only installs the |
290 |
# patch |
291 |
#[[ -n $SUHOSIN_VERSION ]] && PDEPEND="${PDEPEND} suhosin? ( dev-php${PHP_MV}/suhosin )" |
292 |
|
293 |
# Allow users to install production version if they want to |
294 |
|
295 |
case "${PHP_INI_VERSION}" in |
296 |
production|development) |
297 |
;; |
298 |
*) |
299 |
PHP_INI_VERSION="development" |
300 |
;; |
301 |
esac |
302 |
|
303 |
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
304 |
PHP_INI_FILE="php.ini" |
305 |
|
306 |
want_apache |
307 |
|
308 |
pkg_setup() { |
309 |
depend.apache_pkg_setup |
310 |
} |
311 |
|
312 |
php_install_ini() { |
313 |
local phpsapi="${1}" |
314 |
|
315 |
# work out where we are installing the ini file |
316 |
php_set_ini_dir "${phpsapi}" |
317 |
|
318 |
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
319 |
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" |
320 |
|
321 |
# default to /tmp for save_path, bug #282768 |
322 |
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" |
323 |
|
324 |
# Set the extension dir |
325 |
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" |
326 |
|
327 |
# Set the include path to point to where we want to find PEAR packages |
328 |
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" |
329 |
|
330 |
dodir "${PHP_INI_DIR#${EPREFIX}}" |
331 |
insinto "${PHP_INI_DIR#${EPREFIX}}" |
332 |
newins "${phpinisrc}" "${PHP_INI_FILE}" |
333 |
|
334 |
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
335 |
elog |
336 |
|
337 |
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
338 |
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
339 |
|
340 |
# SAPI-specific handling |
341 |
if [[ "${sapi}" == "apache2" ]] ; then |
342 |
insinto "${APACHE_MODULES_CONFDIR#${EPREFIX}}" |
343 |
newins "${FILESDIR}/70_mod_php${PHP_MV}.conf-apache2" \ |
344 |
"70_mod_php${PHP_MV}.conf" |
345 |
fi |
346 |
|
347 |
if [[ "${sapi}" == "fpm" ]] ; then |
348 |
[[ -z ${PHP_FPM_INIT_VER} ]] && PHP_FPM_INIT_VER=3 |
349 |
[[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 |
350 |
einfo "Installing FPM CGI config file php-fpm.conf" |
351 |
insinto "${PHP_INI_DIR#${EPREFIX}}" |
352 |
newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf |
353 |
dodir "/etc/init.d" |
354 |
insinto "/etc/init.d" |
355 |
newinitd "${FILESDIR}/php-fpm-r${PHP_FPM_INIT_VER}.init" "php-fpm" |
356 |
# dosym "${PHP_DESTDIR#${EPREFIX}}/bin/php-fpm" "/usr/bin/php-fpm" |
357 |
|
358 |
# Remove bogus /etc/php-fpm.conf.default (bug 359906) |
359 |
[[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" |
360 |
fi |
361 |
|
362 |
# Install PHP ini files into /usr/share/php |
363 |
|
364 |
dodoc php.ini-development |
365 |
dodoc php.ini-production |
366 |
|
367 |
} |
368 |
|
369 |
php_set_ini_dir() { |
370 |
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
371 |
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
372 |
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
373 |
} |
374 |
|
375 |
src_prepare() { |
376 |
# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path |
377 |
# ([empty session.save_path]/session_mm_[sapi][gid].sem) |
378 |
# there is no easy way to circumvent that, all php calls during |
379 |
# install use -n, so no php.ini file will be used. |
380 |
# As such, this is the easiest way to get around |
381 |
addpredict /session_mm_cli250.sem |
382 |
addpredict /session_mm_cli0.sem |
383 |
|
384 |
# kolab support (support for imap annotations) |
385 |
use kolab && epatch "${WORKDIR}/patches/opt/imap-kolab-annotations.patch" |
386 |
|
387 |
# Change PHP branding |
388 |
# Get the alpha/beta/rc version |
389 |
local ver=$(get_version_component_range 4) |
390 |
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1${PHP_EXTRA_BRANDING}-${ver}-pl${PR/r/}-gentoo\2|g" \ |
391 |
-i configure.in || die "Unable to change PHP branding" |
392 |
|
393 |
# Apply generic PHP patches |
394 |
EPATCH_SOURCE="${WORKDIR}/patches/generic" EPATCH_SUFFIX="patch" \ |
395 |
EPATCH_FORCE="yes" \ |
396 |
EPATCH_MULTI_MSG="Applying generic patches and fixes from upstream..." epatch |
397 |
|
398 |
# Patch PHP to show Gentoo as the server platform |
399 |
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
400 |
-i configure.in || die "Failed to fix server platform name" |
401 |
|
402 |
# Prevent PHP from activating the Apache config, |
403 |
# as we will do that ourselves |
404 |
sed -i \ |
405 |
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
406 |
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
407 |
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 |
408 |
|
409 |
# Patch PHP to support heimdal instead of mit-krb5 |
410 |
if has_version "app-crypt/heimdal" ; then |
411 |
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
412 |
|| die "Failed to fix heimdal libname" |
413 |
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
414 |
|| die "Failed to fix heimdal crypt library reference" |
415 |
fi |
416 |
|
417 |
# Suhosin support |
418 |
if [[ -n $SUHOSIN_VERSION ]] ; then |
419 |
if use suhosin ; then |
420 |
epatch "${WORKDIR}/${SUHOSIN_PATCH}" |
421 |
fi |
422 |
else |
423 |
ewarn "Please note that this version of PHP does not yet come with a suhosin patch" |
424 |
fi |
425 |
|
426 |
#Add user patches #357637 |
427 |
epatch_user |
428 |
|
429 |
#force rebuilding aclocal.m4 |
430 |
rm aclocal.m4 |
431 |
eautoreconf |
432 |
|
433 |
if [[ ${CHOST} == *-darwin* ]] ; then |
434 |
# http://bugs.php.net/bug.php?id=48795, bug #343481 |
435 |
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
436 |
fi |
437 |
} |
438 |
|
439 |
src_configure() { |
440 |
addpredict /usr/share/snmp/mibs/.index |
441 |
addpredict /var/lib/net-snmp/mib_indexes |
442 |
|
443 |
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
444 |
|
445 |
# This is a global variable and should be in caps. It isn't because the |
446 |
# phpconfutils eclass relies on exactly this name... |
447 |
# for --with-libdir see bug #327025 |
448 |
my_conf=" |
449 |
--prefix="${PHP_DESTDIR}" |
450 |
--mandir="${PHP_DESTDIR}"/man |
451 |
--infodir="${PHP_DESTDIR}"/info |
452 |
--libdir="${PHP_DESTDIR}"/lib |
453 |
--with-libdir=$(get_libdir) |
454 |
--without-pear |
455 |
$(use_enable threads maintainer-zts)" |
456 |
|
457 |
# extension USE flag shared |
458 |
my_conf+=" |
459 |
$(use_enable bcmath bcmath ) |
460 |
$(use_with bzip2 bz2 "${EPREFIX}"/usr) |
461 |
$(use_enable calendar calendar ) |
462 |
$(use_enable ctype ctype ) |
463 |
$(use_with curl curl "${EPREFIX}"/usr) |
464 |
$(use_with curlwrappers curlwrappers "${EPREFIX}"/usr) |
465 |
$(use_enable xml dom ) |
466 |
$(use_with enchant enchant "${EPREFIX}"/usr) |
467 |
$(use_enable exif exif ) |
468 |
$(use_enable fileinfo fileinfo ) |
469 |
$(use_enable filter filter ) |
470 |
$(use_enable ftp ftp ) |
471 |
$(use_with nls gettext "${EPREFIX}"/usr) |
472 |
$(use_with gmp gmp "${EPREFIX}"/usr) |
473 |
$(use_enable hash hash ) |
474 |
$(use_with mhash mhash "${EPREFIX}"/usr) |
475 |
$(use_with iconv iconv ) |
476 |
$(use_enable intl intl ) |
477 |
$(use_enable ipv6 ipv6 ) |
478 |
$(use_enable json json ) |
479 |
$(use_with kerberos kerberos "${EPREFIX}"/usr) |
480 |
$(use_enable xml libxml ) |
481 |
$(use_with xml libxml-dir "${EPREFIX}"/usr) |
482 |
$(use_enable unicode mbstring ) |
483 |
$(use_with crypt mcrypt "${EPREFIX}"/usr) |
484 |
$(use_with mssql mssql "${EPREFIX}"/usr) |
485 |
$(use_with unicode onig "${EPREFIX}"/usr) |
486 |
$(use_with ssl openssl "${EPREFIX}"/usr) |
487 |
$(use_with ssl openssl-dir "${EPREFIX}"/usr) |
488 |
$(use_enable pcntl pcntl ) |
489 |
$(use_enable phar phar ) |
490 |
$(use_enable pdo pdo ) |
491 |
$(use_with postgres pgsql "${EPREFIX}"/usr) |
492 |
$(use_enable posix posix ) |
493 |
$(use_with spell pspell "${EPREFIX}"/usr) |
494 |
$(use_with recode recode "${EPREFIX}"/usr) |
495 |
$(use_enable simplexml simplexml ) |
496 |
$(use_enable sharedmem shmop ) |
497 |
$(use_with snmp snmp "${EPREFIX}"/usr) |
498 |
$(use_enable soap soap ) |
499 |
$(use_enable sockets sockets ) |
500 |
$(use_with sqlite sqlite3 "${EPREFIX}"/usr) |
501 |
$(use_with sybase-ct sybase-ct "${EPREFIX}"/usr) |
502 |
$(use_enable sysvipc sysvmsg ) |
503 |
$(use_enable sysvipc sysvsem ) |
504 |
$(use_enable sysvipc sysvshm ) |
505 |
$(use_with tidy tidy "${EPREFIX}"/usr) |
506 |
$(use_enable tokenizer tokenizer ) |
507 |
$(use_enable wddx wddx ) |
508 |
$(use_enable xml xml ) |
509 |
$(use_enable xmlreader xmlreader ) |
510 |
$(use_enable xmlwriter xmlwriter ) |
511 |
$(use_with xmlrpc xmlrpc) |
512 |
$(use_with xsl xsl "${EPREFIX}"/usr) |
513 |
$(use_enable zip zip ) |
514 |
$(use_with zlib zlib "${EPREFIX}"/usr) |
515 |
$(use_enable debug debug )" |
516 |
|
517 |
# DBA support |
518 |
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
519 |
|| use qdbm ; then |
520 |
my_conf="${my_conf} --enable-dba${shared}" |
521 |
fi |
522 |
|
523 |
# DBA drivers support |
524 |
my_conf+=" |
525 |
$(use_with cdb cdb) |
526 |
$(use_with berkdb db4 ${EPREFIX}/usr) |
527 |
$(use_enable flatfile flatfile ) |
528 |
$(use_with gdbm gdbm ${EPREFIX}/usr) |
529 |
$(use_enable inifile inifile ) |
530 |
$(use_with qdbm qdbm ${EPREFIX}/usr)" |
531 |
|
532 |
# Support for the GD graphics library |
533 |
my_conf+=" |
534 |
$(use_with truetype freetype-dir ${EPREFIX}/usr) |
535 |
$(use_with truetype t1lib ${EPREFIX}/usr) |
536 |
$(use_enable cjk gd-jis-conv ) |
537 |
$(use_with gd jpeg-dir ${EPREFIX}/usr) |
538 |
$(use_with gd png-dir ${EPREFIX}/usr) |
539 |
$(use_with xpm xpm-dir ${EPREFIX}/usr)" |
540 |
# enable gd last, so configure can pick up the previous settings |
541 |
my_conf+=" |
542 |
$(use_with gd gd)" |
543 |
|
544 |
# IMAP support |
545 |
if use imap ; then |
546 |
my_conf+=" |
547 |
$(use_with imap imap ${EPREFIX}/usr) |
548 |
$(use_with ssl imap-ssl ${EPREFIX}/usr)" |
549 |
fi |
550 |
|
551 |
# Interbase/firebird support |
552 |
|
553 |
if use firebird ; then |
554 |
my_conf+=" |
555 |
$(use_with firebird interbase ${EPREFIX}/usr)" |
556 |
fi |
557 |
|
558 |
# LDAP support |
559 |
if use ldap ; then |
560 |
my_conf+=" |
561 |
$(use_with ldap ldap ${EPREFIX}/usr) |
562 |
$(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)" |
563 |
fi |
564 |
|
565 |
# MySQL support |
566 |
if use mysql ; then |
567 |
if use mysqlnd ; then |
568 |
my_conf+=" |
569 |
$(use_with mysql mysql mysqlnd)" |
570 |
else |
571 |
my_conf+=" |
572 |
$(use_with mysql mysql ${EPREFIX}/usr)" |
573 |
fi |
574 |
my_conf+=" |
575 |
$(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)" |
576 |
fi |
577 |
|
578 |
# MySQLi support |
579 |
if use mysqlnd ; then |
580 |
my_conf+=" |
581 |
$(use_with mysqli mysqli mysqlnd)" |
582 |
else |
583 |
my_conf+=" |
584 |
$(use_with mysqli mysqli ${EPREFIX}/usr/bin/mysql_config)" |
585 |
fi |
586 |
|
587 |
# ODBC support |
588 |
if use odbc ; then |
589 |
my_conf+=" |
590 |
$(use_with odbc unixODBC ${EPREFIX}/usr)" |
591 |
fi |
592 |
|
593 |
if use iodbc ; then |
594 |
my_conf+=" |
595 |
$(use_with iodbc iodbc ${EPREFIX}/usr)" |
596 |
fi |
597 |
|
598 |
# Oracle support |
599 |
if use oci8-instant-client ; then |
600 |
my_conf+=" |
601 |
$(use_with oci8-instant-client oci8)" |
602 |
fi |
603 |
|
604 |
# PDO support |
605 |
if use pdo ; then |
606 |
my_conf+=" |
607 |
$(use_with mssql pdo-dblib )" |
608 |
if use mysqlnd ; then |
609 |
my_conf+=" |
610 |
$(use_with mysqlnd pdo-mysql mysqlnd)" |
611 |
else |
612 |
my_conf+=" |
613 |
$(use_with mysql pdo-mysql ${EPREFIX}/usr)" |
614 |
fi |
615 |
my_conf+=" |
616 |
$(use_with postgres pdo-pgsql ) |
617 |
$(use_with sqlite pdo-sqlite ${EPREFIX}/usr) |
618 |
$(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)" |
619 |
if use oci8-instant-client ; then |
620 |
my_conf+=" |
621 |
$(use_with oci8-instant-client pdo-oci)" |
622 |
fi |
623 |
fi |
624 |
|
625 |
# readline/libedit support |
626 |
my_conf+=" |
627 |
$(use_with readline readline ${EPREFIX}/usr) |
628 |
$(use_with libedit libedit ${EPREFIX}/usr)" |
629 |
|
630 |
# Session support |
631 |
if use session ; then |
632 |
my_conf+=" |
633 |
$(use_with sharedmem mm ${EPREFIX}/usr)" |
634 |
else |
635 |
my_conf+=" |
636 |
$(use_enable session session )" |
637 |
fi |
638 |
|
639 |
if use pic ; then |
640 |
my_conf="${my_conf} --with-pic" |
641 |
fi |
642 |
|
643 |
# we use the system copy of pcre |
644 |
# --with-pcre-regex affects ext/pcre |
645 |
# --with-pcre-dir affects ext/filter and ext/zip |
646 |
my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr" |
647 |
|
648 |
# Catch CFLAGS problems |
649 |
# Fixes bug #14067. |
650 |
# Changed order to run it in reverse for bug #32022 and #12021. |
651 |
replace-cpu-flags "k6*" "i586" |
652 |
|
653 |
# Support user-passed configuration parameters |
654 |
my_conf="${my_conf} ${EXTRA_ECONF:-}" |
655 |
|
656 |
# Support the Apache2 extras, they must be set globally for all |
657 |
# SAPIs to work correctly, especially for external PHP extensions |
658 |
|
659 |
mkdir -p "${WORKDIR}/sapis-build" |
660 |
for one_sapi in $SAPIS ; do |
661 |
use "${one_sapi}" || continue |
662 |
php_set_ini_dir "${one_sapi}" |
663 |
|
664 |
cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" |
665 |
cd "${WORKDIR}/sapis-build/${one_sapi}" |
666 |
|
667 |
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} |
668 |
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" |
669 |
|
670 |
for sapi in $SAPIS ; do |
671 |
case "$sapi" in |
672 |
cli|cgi|embed|fpm) |
673 |
if [[ "${one_sapi}" == "${sapi}" ]] ; then |
674 |
sapi_conf="${sapi_conf} --enable-${sapi}" |
675 |
else |
676 |
sapi_conf="${sapi_conf} --disable-${sapi}" |
677 |
fi |
678 |
;; |
679 |
|
680 |
apache2) |
681 |
if [[ "${one_sapi}" == "${sapi}" ]] ; then |
682 |
sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs" |
683 |
else |
684 |
sapi_conf="${sapi_conf} --without-apxs2" |
685 |
fi |
686 |
;; |
687 |
esac |
688 |
done |
689 |
|
690 |
econf ${sapi_conf} |
691 |
done |
692 |
} |
693 |
|
694 |
src_compile() { |
695 |
# snmp seems to run during src_compile, too (bug #324739) |
696 |
addpredict /usr/share/snmp/mibs/.index |
697 |
addpredict /var/lib/net-snmp/mib_indexes |
698 |
|
699 |
for sapi in ${SAPIS} ; do |
700 |
if use "${sapi}"; then |
701 |
cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
702 |
emake || die "emake failed" |
703 |
fi |
704 |
done |
705 |
} |
706 |
|
707 |
src_install() { |
708 |
# see bug #324739 for what happens when we don't have that |
709 |
addpredict /usr/share/snmp/mibs/.index |
710 |
|
711 |
# grab the first SAPI that got built and install common files from there |
712 |
local first_sapi="" |
713 |
for sapi in $SAPIS ; do |
714 |
if use $sapi ; then |
715 |
first_sapi=$sapi |
716 |
break |
717 |
fi |
718 |
done |
719 |
|
720 |
# Makefile forgets to create this before trying to write to it... |
721 |
dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
722 |
|
723 |
# Install php environment (without any sapis) |
724 |
cd "${WORKDIR}/sapis-build/$first_sapi" |
725 |
emake INSTALL_ROOT="${D}" \ |
726 |
install-build install-headers install-programs \ |
727 |
|| die "emake install failed" |
728 |
|
729 |
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
730 |
|
731 |
# Create the directory where we'll put version-specific php scripts |
732 |
keepdir /usr/share/php${PHP_MV} |
733 |
|
734 |
local sapi="", file="" |
735 |
local sapi_list="" |
736 |
|
737 |
for sapi in ${SAPIS}; do |
738 |
if use "${sapi}" ; then |
739 |
einfo "Installing SAPI: ${sapi}" |
740 |
cd "${WORKDIR}/sapis-build/${sapi}" |
741 |
|
742 |
if [[ "${sapi}" == "apache2" ]] ; then |
743 |
# We're specifically not using emake install-sapi as libtool |
744 |
# may cause unnecessary relink failures (see bug #351266) |
745 |
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
746 |
newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" |
747 |
keepdir "/usr/$(get_libdir)/apache2/modules" |
748 |
else |
749 |
# needed each time, php_install_ini would reset it |
750 |
into "${PHP_DESTDIR#${EPREFIX}}" |
751 |
case "$sapi" in |
752 |
cli) |
753 |
source="sapi/cli/php" |
754 |
;; |
755 |
cgi) |
756 |
source="sapi/cgi/php-cgi" |
757 |
;; |
758 |
fpm) |
759 |
source="sapi/fpm/php-fpm" |
760 |
;; |
761 |
embed) |
762 |
source="libs/libphp${PHP_MV}$(get_libname)" |
763 |
;; |
764 |
*) |
765 |
die "unhandled sapi in src_install" |
766 |
;; |
767 |
esac |
768 |
|
769 |
if [[ "${source}" == *"$(get_libname)" ]]; then |
770 |
dolib.so "${source}" || die "Unable to install ${sapi} sapi" |
771 |
else |
772 |
dobin "${source}" || die "Unable to install ${sapi} sapi" |
773 |
fi |
774 |
fi |
775 |
|
776 |
php_install_ini "${sapi}" |
777 |
|
778 |
# construct correct SAPI string for php-config |
779 |
# thanks to ferringb for the bash voodoo |
780 |
if [[ "${sapi}" == "apache2" ]]; then |
781 |
sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
782 |
else |
783 |
sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
784 |
fi |
785 |
fi |
786 |
done |
787 |
|
788 |
# Install env.d files |
789 |
newenvd "${FILESDIR}/20php5-envd" \ |
790 |
"20php${SLOT}" |
791 |
sed -e "s|/lib/|/$(get_libdir)/|g" -i \ |
792 |
"${ED}/etc/env.d/20php${SLOT}" |
793 |
sed -e "s|php5|php${SLOT}|g" -i \ |
794 |
"${ED}/etc/env.d/20php${SLOT}" |
795 |
|
796 |
# set php-config variable correctly (bug #278439) |
797 |
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
798 |
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" |
799 |
} |
800 |
|
801 |
src_test() { |
802 |
echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
803 |
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
804 |
if [[ ! -x "${PHP_BIN}" ]] ; then |
805 |
ewarn "Test phase requires USE=cli, skipping" |
806 |
return |
807 |
else |
808 |
export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
809 |
fi |
810 |
|
811 |
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
812 |
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
813 |
fi |
814 |
|
815 |
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ |
816 |
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}" |
817 |
|
818 |
for name in ${EXPECTED_TEST_FAILURES}; do |
819 |
mv "${name}.out" "${name}.out.orig" 2>/dev/null |
820 |
done |
821 |
|
822 |
local failed="$(find -name '*.out')" |
823 |
if [[ ${failed} != "" ]] ; then |
824 |
ewarn "The following test cases failed unexpectedly:" |
825 |
for name in ${failed}; do |
826 |
ewarn " ${name/.out/}" |
827 |
done |
828 |
else |
829 |
einfo "No unexpected test failures, all fine" |
830 |
fi |
831 |
|
832 |
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
833 |
local passed="" |
834 |
for name in ${EXPECTED_TEST_FAILURES}; do |
835 |
[[ -f "${name}.diff" ]] && continue |
836 |
passed="${passed} ${name}" |
837 |
done |
838 |
if [[ ${passed} != "" ]] ; then |
839 |
einfo "The following test cases passed unexpectedly:" |
840 |
for name in ${passed}; do |
841 |
ewarn " ${passed}" |
842 |
done |
843 |
else |
844 |
einfo "None of the known-to-fail tests passed, all fine" |
845 |
fi |
846 |
fi |
847 |
} |
848 |
|
849 |
pkg_postinst() { |
850 |
# Output some general info to the user |
851 |
if use apache2 ; then |
852 |
APACHE2_MOD_DEFINE="PHP5" |
853 |
APACHE2_MOD_CONF="70_mod_php5" |
854 |
apache-module_pkg_postinst |
855 |
fi |
856 |
|
857 |
# Create the symlinks for php |
858 |
for m in ${SAPIS}; do |
859 |
[[ ${m} == 'embed' ]] && continue; |
860 |
if use $m ; then |
861 |
local ci=$(eselect php show $m) |
862 |
if [[ -z $ci ]]; then |
863 |
eselect php set $m php${SLOT} |
864 |
einfo "Switched ${m} to use php:${SLOT}" |
865 |
einfo |
866 |
elif [[ $ci != "php${SLOT}" ]] ; then |
867 |
elog "To switch $m to use php:${SLOT}, run" |
868 |
elog " eselect php set $m php${SLOT}" |
869 |
elog |
870 |
fi |
871 |
fi |
872 |
done |
873 |
|
874 |
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order" |
875 |
elog "to compile extensions for the ${SLOT} ABI" |
876 |
elog |
877 |
if ! use readline && use cli ; then |
878 |
ewarn "Note that in order to use php interactivly, you need to enable" |
879 |
ewarn "the readline USE flag or php -a will hang" |
880 |
fi |
881 |
elog |
882 |
elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." |
883 |
elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" |
884 |
elog "'production' or 'development' in ${EPREFIX}/etc/make.conf" |
885 |
elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}" |
886 |
|
887 |
elog |
888 |
elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" |
889 |
elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml" |
890 |
elog |
891 |
|
892 |
if ( [[ -z SUHOSIN_VERSION ]] && use suhosin && version_is_at_least 5.3.6_rc1 ) ; then |
893 |
ewarn |
894 |
ewarn "The suhosin USE flag now only installs the suhosin patch!" |
895 |
ewarn "If you want the suhosin extension, make sure you install" |
896 |
ewarn " dev-php/suhosin" |
897 |
ewarn |
898 |
fi |
899 |
} |
900 |
|
901 |
pkg_prerm() { |
902 |
local sapi |
903 |
local slot |
904 |
for sapi in ${SAPIS}; do |
905 |
slot=$(eselect php show $sapi 2> /dev/null) |
906 |
slot=${slot/php/} |
907 |
if [[ $slot == $SLOT ]]; then |
908 |
ewarn "You have removed the active version of the $sapi SAPI" |
909 |
ewarn "Fix the issue using \`eselect php\`" |
910 |
fi |
911 |
done |
912 |
} |
913 |
|
914 |
|
915 |
|
916 |
1.1 dev-lang/php/php-5.3.22.ebuild |
917 |
|
918 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.3.22.ebuild?rev=1.1&view=markup |
919 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.3.22.ebuild?rev=1.1&content-type=text/plain |
920 |
|
921 |
Index: php-5.3.22.ebuild |
922 |
=================================================================== |
923 |
# Copyright 1999-2013 Gentoo Foundation |
924 |
# Distributed under the terms of the GNU General Public License v2 |
925 |
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.3.22.ebuild,v 1.1 2013/03/04 11:45:07 olemarkus Exp $ |
926 |
|
927 |
EAPI=5 |
928 |
|
929 |
inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool |
930 |
|
931 |
SUHOSIN_VERSION="" |
932 |
FPM_VERSION="builtin" |
933 |
EXPECTED_TEST_FAILURES="" |
934 |
|
935 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd" |
936 |
|
937 |
function php_get_uri () |
938 |
{ |
939 |
case "${1}" in |
940 |
"php-pre") |
941 |
echo "http://downloads.php.net/johannes/${2}" |
942 |
;; |
943 |
"php") |
944 |
echo "http://www.php.net/distributions/${2}" |
945 |
;; |
946 |
"suhosin") |
947 |
echo "http://download.suhosin.org/${2}" |
948 |
;; |
949 |
"olemarkus") |
950 |
echo "http://dev.gentoo.org/~olemarkus/php/${2}" |
951 |
;; |
952 |
"gentoo") |
953 |
echo "mirror://gentoo/${2}" |
954 |
;; |
955 |
*) |
956 |
die "unhandled case in php_get_uri" |
957 |
;; |
958 |
esac |
959 |
} |
960 |
|
961 |
PHP_MV="$(get_major_version)" |
962 |
SLOT="$(get_version_component_range 1-2)" |
963 |
|
964 |
# alias, so we can handle different types of releases (finals, rcs, alphas, |
965 |
# betas, ...) w/o changing the whole ebuild |
966 |
PHP_PV="${PV/_rc/RC}" |
967 |
PHP_PV="${PHP_PV/_alpha/alpha}" |
968 |
PHP_PV="${PHP_PV/_beta/beta}" |
969 |
PHP_RELEASE="php" |
970 |
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
971 |
PHP_P="${PN}-${PHP_PV}" |
972 |
|
973 |
PHP_PATCHSET_LOC="olemarkus" |
974 |
|
975 |
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
976 |
|
977 |
PHP_PATCHSET="0" |
978 |
PHP_PATCHSET_URI=" |
979 |
$(php_get_uri "${PHP_PATCHSET_LOC}" "php-patchset-${SLOT}-r${PHP_PATCHSET}.tar.bz2")" |
980 |
|
981 |
PHP_FPM_INIT_VER="4" |
982 |
PHP_FPM_CONF_VER="1" |
983 |
|
984 |
if [[ ${SUHOSIN_VERSION} == *-gentoo ]]; then |
985 |
# in some cases we use our own suhosin patch (very recent version, |
986 |
# patch conflicts, etc.) |
987 |
SUHOSIN_TYPE="olemarkus" |
988 |
else |
989 |
SUHOSIN_TYPE="suhosin" |
990 |
fi |
991 |
|
992 |
if [[ -n ${SUHOSIN_VERSION} ]]; then |
993 |
SUHOSIN_PATCH="suhosin-patch-${SUHOSIN_VERSION}.patch"; |
994 |
SUHOSIN_URI="$(php_get_uri ${SUHOSIN_TYPE} ${SUHOSIN_PATCH}.gz )" |
995 |
fi |
996 |
|
997 |
SRC_URI=" |
998 |
${PHP_SRC_URI} |
999 |
${PHP_PATCHSET_URI}" |
1000 |
|
1001 |
if [[ -n ${SUHOSIN_VERSION} ]]; then |
1002 |
SRC_URI="${SRC_URI} |
1003 |
suhosin? ( ${SUHOSIN_URI} )" |
1004 |
fi |
1005 |
|
1006 |
DESCRIPTION="The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs." |
1007 |
HOMEPAGE="http://php.net/" |
1008 |
LICENSE="PHP-3" |
1009 |
|
1010 |
S="${WORKDIR}/${PHP_P}" |
1011 |
|
1012 |
# We can build the following SAPIs in the given order |
1013 |
SAPIS="embed cli cgi fpm apache2" |
1014 |
|
1015 |
# Gentoo-specific, common features |
1016 |
IUSE="kolab" |
1017 |
|
1018 |
# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
1019 |
IUSE="${IUSE} |
1020 |
${SAPIS/cli/+cli} |
1021 |
threads" |
1022 |
|
1023 |
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
1024 |
crypt +ctype curl curlwrappers debug doc |
1025 |
enchant exif frontbase +fileinfo +filter firebird |
1026 |
flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
1027 |
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash |
1028 |
mssql mysql mysqlnd mysqli nls |
1029 |
oci8-instant-client odbc pcntl pdo +phar pic +posix postgres qdbm |
1030 |
readline recode selinux +session sharedmem |
1031 |
+simplexml snmp soap sockets spell sqlite2 sqlite ssl |
1032 |
sybase-ct sysvipc tidy +tokenizer truetype unicode wddx |
1033 |
+xml xmlreader xmlwriter xmlrpc xpm xsl zip zlib" |
1034 |
|
1035 |
# Enable suhosin if available |
1036 |
[[ -n $SUHOSIN_VERSION ]] && IUSE="${IUSE} suhosin" |
1037 |
|
1038 |
DEPEND="!dev-lang/php:5 |
1039 |
>=app-admin/eselect-php-0.6.2 |
1040 |
>=dev-libs/libpcre-8.12[unicode] |
1041 |
apache2? ( www-servers/apache[threads=] ) |
1042 |
berkdb? ( =sys-libs/db-4* ) |
1043 |
bzip2? ( app-arch/bzip2 ) |
1044 |
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
1045 |
cjk? ( !gd? ( |
1046 |
virtual/jpeg |
1047 |
media-libs/libpng |
1048 |
sys-libs/zlib |
1049 |
) ) |
1050 |
crypt? ( >=dev-libs/libmcrypt-2.4 ) |
1051 |
curl? ( >=net-misc/curl-7.10.5 ) |
1052 |
enchant? ( app-text/enchant ) |
1053 |
exif? ( !gd? ( |
1054 |
virtual/jpeg |
1055 |
media-libs/libpng |
1056 |
sys-libs/zlib |
1057 |
) ) |
1058 |
firebird? ( dev-db/firebird ) |
1059 |
gd? ( virtual/jpeg media-libs/libpng sys-libs/zlib ) |
1060 |
gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
1061 |
gmp? ( >=dev-libs/gmp-4.1.2 ) |
1062 |
iconv? ( virtual/libiconv ) |
1063 |
imap? ( virtual/imap-c-client[ssl=] ) |
1064 |
intl? ( dev-libs/icu:= ) |
1065 |
iodbc? ( dev-db/libiodbc ) |
1066 |
kerberos? ( virtual/krb5 ) |
1067 |
kolab? ( >=net-libs/c-client-2004g-r1 ) |
1068 |
ldap? ( >=net-nds/openldap-1.2.11 ) |
1069 |
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
1070 |
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
1071 |
mssql? ( dev-db/freetds[mssql] ) |
1072 |
!mysqlnd? ( |
1073 |
mysql? ( virtual/mysql ) |
1074 |
mysqli? ( >=virtual/mysql-4.1 ) |
1075 |
) |
1076 |
nls? ( sys-devel/gettext ) |
1077 |
oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
1078 |
odbc? ( >=dev-db/unixODBC-1.8.13 ) |
1079 |
postgres? ( dev-db/postgresql-base ) |
1080 |
qdbm? ( dev-db/qdbm ) |
1081 |
readline? ( sys-libs/readline ) |
1082 |
recode? ( app-text/recode ) |
1083 |
sharedmem? ( dev-libs/mm ) |
1084 |
simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
1085 |
snmp? ( >=net-analyzer/net-snmp-5.2 ) |
1086 |
soap? ( >=dev-libs/libxml2-2.6.8 ) |
1087 |
spell? ( >=app-text/aspell-0.50 ) |
1088 |
sqlite2? ( =dev-db/sqlite-2* ) |
1089 |
sqlite? ( >=dev-db/sqlite-3.7.7.1 ) |
1090 |
ssl? ( >=dev-libs/openssl-0.9.7 ) |
1091 |
sybase-ct? ( dev-db/freetds ) |
1092 |
tidy? ( app-text/htmltidy ) |
1093 |
truetype? ( |
1094 |
=media-libs/freetype-2* |
1095 |
>=media-libs/t1lib-5.0.0 |
1096 |
!gd? ( |
1097 |
virtual/jpeg media-libs/libpng sys-libs/zlib ) |
1098 |
) |
1099 |
unicode? ( dev-libs/oniguruma ) |
1100 |
wddx? ( >=dev-libs/libxml2-2.6.8 ) |
1101 |
xml? ( >=dev-libs/libxml2-2.6.8 ) |
1102 |
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
1103 |
xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
1104 |
xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
1105 |
xpm? ( |
1106 |
x11-libs/libXpm |
1107 |
virtual/jpeg |
1108 |
media-libs/libpng sys-libs/zlib |
1109 |
) |
1110 |
xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
1111 |
zip? ( sys-libs/zlib ) |
1112 |
zlib? ( sys-libs/zlib ) |
1113 |
virtual/mta |
1114 |
" |
1115 |
|
1116 |
php="=${CATEGORY}/${PF}" |
1117 |
|
1118 |
REQUIRED_USE=" |
1119 |
truetype? ( gd ) |
1120 |
cjk? ( gd ) |
1121 |
exif? ( gd ) |
1122 |
|
1123 |
xpm? ( gd ) |
1124 |
gd? ( zlib ) |
1125 |
simplexml? ( xml ) |
1126 |
soap? ( xml ) |
1127 |
wddx? ( xml ) |
1128 |
xmlrpc? ( || ( xml iconv ) ) |
1129 |
xmlreader? ( xml ) |
1130 |
xsl? ( xml ) |
1131 |
ldap-sasl? ( ldap ) |
1132 |
kolab? ( imap ) |
1133 |
mhash? ( hash ) |
1134 |
phar? ( hash ) |
1135 |
mysqlnd? ( || ( |
1136 |
mysql |
1137 |
mysqli |
1138 |
pdo |
1139 |
) ) |
1140 |
|
1141 |
qdbm? ( !gdbm ) |
1142 |
readline? ( !libedit ) |
1143 |
recode? ( !imap !mysql !mysqli ) |
1144 |
sharedmem? ( !threads ) |
1145 |
|
1146 |
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
1147 |
|
1148 |
RDEPEND="${DEPEND}" |
1149 |
|
1150 |
[[ -n $SUHOSIN_VERSION ]] && RDEPEND="${RDEPEND} suhosin? ( =${CATEGORY}/${PN}-${SLOT}*[unicode] )" |
1151 |
|
1152 |
RDEPEND="${RDEPEND} fpm? ( selinux? ( sec-policy/selinux-phpfpm ) )" |
1153 |
|
1154 |
DEPEND="${DEPEND} |
1155 |
sys-devel/flex |
1156 |
>=sys-devel/m4-1.4.3 |
1157 |
>=sys-devel/libtool-1.5.18" |
1158 |
|
1159 |
# They are in PDEPEND because we need PHP installed first! |
1160 |
PDEPEND="doc? ( app-doc/php-docs )" |
1161 |
|
1162 |
# No longer depend on the extension. The suhosin USE flag only installs the |
1163 |
# patch |
1164 |
#[[ -n $SUHOSIN_VERSION ]] && PDEPEND="${PDEPEND} suhosin? ( dev-php${PHP_MV}/suhosin )" |
1165 |
|
1166 |
# Allow users to install production version if they want to |
1167 |
|
1168 |
case "${PHP_INI_VERSION}" in |
1169 |
production|development) |
1170 |
;; |
1171 |
*) |
1172 |
PHP_INI_VERSION="development" |
1173 |
;; |
1174 |
esac |
1175 |
|
1176 |
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
1177 |
PHP_INI_FILE="php.ini" |
1178 |
|
1179 |
want_apache |
1180 |
|
1181 |
pkg_setup() { |
1182 |
depend.apache_pkg_setup |
1183 |
} |
1184 |
|
1185 |
php_install_ini() { |
1186 |
local phpsapi="${1}" |
1187 |
|
1188 |
# work out where we are installing the ini file |
1189 |
php_set_ini_dir "${phpsapi}" |
1190 |
|
1191 |
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
1192 |
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" |
1193 |
|
1194 |
# default to /tmp for save_path, bug #282768 |
1195 |
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" |
1196 |
|
1197 |
# Set the extension dir |
1198 |
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" |
1199 |
|
1200 |
# Set the include path to point to where we want to find PEAR packages |
1201 |
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" |
1202 |
|
1203 |
dodir "${PHP_INI_DIR#${EPREFIX}}" |
1204 |
insinto "${PHP_INI_DIR#${EPREFIX}}" |
1205 |
newins "${phpinisrc}" "${PHP_INI_FILE}" |
1206 |
|
1207 |
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
1208 |
elog |
1209 |
|
1210 |
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
1211 |
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
1212 |
|
1213 |
# SAPI-specific handling |
1214 |
if [[ "${sapi}" == "apache2" ]] ; then |
1215 |
insinto "${APACHE_MODULES_CONFDIR#${EPREFIX}}" |
1216 |
newins "${FILESDIR}/70_mod_php${PHP_MV}.conf-apache2" \ |
1217 |
"70_mod_php${PHP_MV}.conf" |
1218 |
fi |
1219 |
|
1220 |
if [[ "${sapi}" == "fpm" ]] ; then |
1221 |
[[ -z ${PHP_FPM_INIT_VER} ]] && PHP_FPM_INIT_VER=3 |
1222 |
[[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 |
1223 |
einfo "Installing FPM CGI config file php-fpm.conf" |
1224 |
insinto "${PHP_INI_DIR#${EPREFIX}}" |
1225 |
newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf |
1226 |
dodir "/etc/init.d" |
1227 |
insinto "/etc/init.d" |
1228 |
newinitd "${FILESDIR}/php-fpm-r${PHP_FPM_INIT_VER}.init" "php-fpm" |
1229 |
# dosym "${PHP_DESTDIR#${EPREFIX}}/bin/php-fpm" "/usr/bin/php-fpm" |
1230 |
|
1231 |
# Remove bogus /etc/php-fpm.conf.default (bug 359906) |
1232 |
[[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" |
1233 |
fi |
1234 |
|
1235 |
# Install PHP ini files into /usr/share/php |
1236 |
|
1237 |
dodoc php.ini-development |
1238 |
dodoc php.ini-production |
1239 |
|
1240 |
} |
1241 |
|
1242 |
php_set_ini_dir() { |
1243 |
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
1244 |
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
1245 |
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
1246 |
} |
1247 |
|
1248 |
src_prepare() { |
1249 |
# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path |
1250 |
# ([empty session.save_path]/session_mm_[sapi][gid].sem) |
1251 |
# there is no easy way to circumvent that, all php calls during |
1252 |
# install use -n, so no php.ini file will be used. |
1253 |
# As such, this is the easiest way to get around |
1254 |
addpredict /session_mm_cli250.sem |
1255 |
addpredict /session_mm_cli0.sem |
1256 |
|
1257 |
# kolab support (support for imap annotations) |
1258 |
use kolab && epatch "${WORKDIR}/patches/opt/imap-kolab-annotations.patch" |
1259 |
|
1260 |
# Change PHP branding |
1261 |
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1${PHP_EXTRA_BRANDING}-pl${PR/r/}-gentoo\2|g" \ |
1262 |
-i configure.in || die "Unable to change PHP branding" |
1263 |
|
1264 |
# Apply generic PHP patches |
1265 |
EPATCH_SOURCE="${WORKDIR}/patches/generic" EPATCH_SUFFIX="patch" \ |
1266 |
EPATCH_FORCE="yes" \ |
1267 |
EPATCH_MULTI_MSG="Applying generic patches and fixes from upstream..." epatch |
1268 |
|
1269 |
# Patch PHP to show Gentoo as the server platform |
1270 |
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
1271 |
-i configure.in || die "Failed to fix server platform name" |
1272 |
|
1273 |
# Prevent PHP from activating the Apache config, |
1274 |
# as we will do that ourselves |
1275 |
sed -i \ |
1276 |
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1277 |
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1278 |
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 |
1279 |
|
1280 |
# Patch PHP to support heimdal instead of mit-krb5 |
1281 |
if has_version "app-crypt/heimdal" ; then |
1282 |
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
1283 |
|| die "Failed to fix heimdal libname" |
1284 |
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
1285 |
|| die "Failed to fix heimdal crypt library reference" |
1286 |
fi |
1287 |
|
1288 |
# Suhosin support |
1289 |
if [[ -n $SUHOSIN_VERSION ]] ; then |
1290 |
if use suhosin ; then |
1291 |
epatch "${WORKDIR}/${SUHOSIN_PATCH}" |
1292 |
fi |
1293 |
else |
1294 |
ewarn "Please note that this version of PHP does not yet come with a suhosin patch" |
1295 |
fi |
1296 |
|
1297 |
#Add user patches #357637 |
1298 |
epatch_user |
1299 |
|
1300 |
# rebuild the whole autotools stuff as we are heavily patching it |
1301 |
# (suhosin, fastbuild, ...) |
1302 |
|
1303 |
# eaclocal doesn't accept --force, so we try to force re-generation |
1304 |
# this way |
1305 |
rm aclocal.m4 |
1306 |
|
1307 |
# work around divert() issues with newer autoconf, bug #281697 |
1308 |
if has_version '>=sys-devel/autoconf-2.64' ; then |
1309 |
sed -i -r \ |
1310 |
-e 's:^((m4_)?divert)[(]([0-9]*)[)]:\1(600\3):' \ |
1311 |
$(grep -l divert $(find . -name '*.m4') configure.in) || die |
1312 |
fi |
1313 |
eautoreconf --force -W no-cross |
1314 |
} |
1315 |
|
1316 |
src_configure() { |
1317 |
addpredict /usr/share/snmp/mibs/.index |
1318 |
addpredict /var/lib/net-snmp/mib_indexes |
1319 |
|
1320 |
PHP_DESTDIR="/usr/$(get_libdir)/php${SLOT}" |
1321 |
|
1322 |
# This is a global variable and should be in caps. It isn't because the |
1323 |
# phpconfutils eclass relies on exactly this name... |
1324 |
# for --with-libdir see bug #327025 |
1325 |
my_conf="--prefix=${PHP_DESTDIR} |
1326 |
--mandir=${PHP_DESTDIR}/man |
1327 |
--infodir=${PHP_DESTDIR}/info |
1328 |
--libdir=${PHP_DESTDIR}/lib |
1329 |
--with-libdir=$(get_libdir) |
1330 |
--without-pear |
1331 |
$(use_enable threads maintainer-zts)" |
1332 |
|
1333 |
# extension USE flag shared |
1334 |
my_conf+=" |
1335 |
$(use_enable bcmath bcmath ) |
1336 |
$(use_with bzip2 bz2 ) |
1337 |
$(use_enable calendar calendar ) |
1338 |
$(use_enable ctype ctype ) |
1339 |
$(use_with curl curl ) |
1340 |
$(use_with curlwrappers curlwrappers ) |
1341 |
$(use_enable xml dom ) |
1342 |
$(use_with enchant enchant /usr) |
1343 |
$(use_enable exif exif ) |
1344 |
$(use_enable fileinfo fileinfo ) |
1345 |
$(use_enable filter filter ) |
1346 |
$(use_enable ftp ftp ) |
1347 |
$(use_with nls gettext ) |
1348 |
$(use_with gmp gmp ) |
1349 |
$(use_enable hash hash ) |
1350 |
$(use_with mhash mhash ) |
1351 |
$(use_with iconv iconv ) |
1352 |
$(use_enable intl intl ) |
1353 |
$(use_enable ipv6 ipv6 ) |
1354 |
$(use_enable json json ) |
1355 |
$(use_with kerberos kerberos /usr) |
1356 |
$(use_enable xml libxml ) |
1357 |
$(use_enable unicode mbstring ) |
1358 |
$(use_with crypt mcrypt ) |
1359 |
$(use_with mssql mssql ) |
1360 |
$(use_with unicode onig /usr) |
1361 |
$(use_with ssl openssl ) |
1362 |
$(use_with ssl openssl-dir /usr) |
1363 |
$(use_enable pcntl pcntl ) |
1364 |
$(use_enable phar phar ) |
1365 |
$(use_enable pdo pdo ) |
1366 |
$(use_with postgres pgsql ) |
1367 |
$(use_enable posix posix ) |
1368 |
$(use_with spell pspell ) |
1369 |
$(use_with recode recode ) |
1370 |
$(use_enable simplexml simplexml ) |
1371 |
$(use_enable sharedmem shmop ) |
1372 |
$(use_with snmp snmp ) |
1373 |
$(use_enable soap soap ) |
1374 |
$(use_enable sockets sockets )" |
1375 |
if version_is_at_least 5.3.16-r2; then |
1376 |
my_conf+=" $(use_with sqlite2 sqlite /usr) " |
1377 |
use sqlite2 && my_conf+=" $(use_enable unicode sqlite-utf8)" |
1378 |
else |
1379 |
my_conf+=" $(use_with sqlite sqlite /usr) " |
1380 |
use sqlite && my_conf+=" $(use_enable unicode sqlite-utf8)" |
1381 |
fi |
1382 |
my_conf+=" |
1383 |
$(use_with sqlite sqlite3 /usr) |
1384 |
$(use_with sybase-ct sybase-ct /usr) |
1385 |
$(use_enable sysvipc sysvmsg ) |
1386 |
$(use_enable sysvipc sysvsem ) |
1387 |
$(use_enable sysvipc sysvshm ) |
1388 |
$(use_with tidy tidy ) |
1389 |
$(use_enable tokenizer tokenizer ) |
1390 |
$(use_enable wddx wddx ) |
1391 |
$(use_enable xml xml ) |
1392 |
$(use_enable xmlreader xmlreader ) |
1393 |
$(use_enable xmlwriter xmlwriter ) |
1394 |
$(use_with xmlrpc xmlrpc ) |
1395 |
$(use_with xsl xsl ) |
1396 |
$(use_enable zip zip ) |
1397 |
$(use_with zlib zlib ) |
1398 |
$(use_enable debug debug )" |
1399 |
|
1400 |
# DBA support |
1401 |
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
1402 |
|| use qdbm ; then |
1403 |
my_conf="${my_conf} --enable-dba${shared}" |
1404 |
fi |
1405 |
|
1406 |
# DBA drivers support |
1407 |
my_conf+=" |
1408 |
$(use_with cdb cdb ) |
1409 |
$(use_with berkdb db4 ) |
1410 |
$(use_enable flatfile flatfile ) |
1411 |
$(use_with gdbm gdbm ) |
1412 |
$(use_enable inifile inifile ) |
1413 |
$(use_with qdbm qdbm )" |
1414 |
|
1415 |
# Support for the GD graphics library |
1416 |
my_conf+=" |
1417 |
$(use_with truetype freetype-dir /usr) |
1418 |
$(use_with truetype t1lib /usr) |
1419 |
$(use_enable cjk gd-jis-conv ) |
1420 |
$(use_with gd jpeg-dir /usr) |
1421 |
$(use_with gd png-dir /usr) |
1422 |
$(use_with xpm xpm-dir /usr)" |
1423 |
# enable gd last, so configure can pick up the previous settings |
1424 |
my_conf+=" |
1425 |
$(use_with gd gd )" |
1426 |
|
1427 |
# IMAP support |
1428 |
if use imap ; then |
1429 |
my_conf+=" |
1430 |
$(use_with imap imap ) |
1431 |
$(use_with ssl imap-ssl )" |
1432 |
fi |
1433 |
|
1434 |
# Interbase/firebird support |
1435 |
|
1436 |
if use firebird ; then |
1437 |
my_conf+=" |
1438 |
$(use_with firebird interbase /usr)" |
1439 |
fi |
1440 |
|
1441 |
# LDAP support |
1442 |
if use ldap ; then |
1443 |
my_conf+=" |
1444 |
$(use_with ldap ldap ) |
1445 |
$(use_with ldap-sasl ldap-sasl )" |
1446 |
fi |
1447 |
|
1448 |
# MySQL support |
1449 |
if use mysql ; then |
1450 |
if use mysqlnd ; then |
1451 |
my_conf+=" |
1452 |
$(use_with mysqlnd mysql mysqlnd)" |
1453 |
else |
1454 |
my_conf+=" |
1455 |
$(use_with mysql mysql /usr)" |
1456 |
fi |
1457 |
my_conf+=" |
1458 |
$(use_with mysql mysql-sock /var/run/mysqld/mysqld.sock)" |
1459 |
fi |
1460 |
|
1461 |
# MySQLi support |
1462 |
if use mysqlnd ; then |
1463 |
my_conf+=" |
1464 |
$(use_with mysqli mysqli mysqlnd)" |
1465 |
else |
1466 |
my_conf+=" |
1467 |
$(use_with mysqli mysqli /usr/bin/mysql_config)" |
1468 |
fi |
1469 |
|
1470 |
# ODBC support |
1471 |
if use odbc ; then |
1472 |
my_conf+=" |
1473 |
$(use_with odbc unixODBC /usr)" |
1474 |
fi |
1475 |
|
1476 |
if use iodbc ; then |
1477 |
my_conf+=" |
1478 |
$(use_with iodbc iodbc /usr)" |
1479 |
fi |
1480 |
|
1481 |
# Oracle support |
1482 |
if use oci8-instant-client ; then |
1483 |
my_conf+=" |
1484 |
$(use_with oci8-instant-client oci8)" |
1485 |
fi |
1486 |
|
1487 |
# PDO support |
1488 |
if use pdo ; then |
1489 |
my_conf+=" |
1490 |
$(use_with mssql pdo-dblib )" |
1491 |
if use mysqlnd ; then |
1492 |
my_conf+=" |
1493 |
$(use_with mysql pdo-mysql mysqlnd)" |
1494 |
else |
1495 |
my_conf+=" |
1496 |
$(use_with mysql pdo-mysql /usr)" |
1497 |
fi |
1498 |
my_conf+=" |
1499 |
$(use_with postgres pdo-pgsql ) |
1500 |
$(use_with sqlite pdo-sqlite /usr) |
1501 |
$(use_with odbc pdo-odbc unixODBC,/usr)" |
1502 |
if use oci8-instant-client ; then |
1503 |
my_conf+=" |
1504 |
$(use_with oci8-instant-client pdo-oci)" |
1505 |
fi |
1506 |
fi |
1507 |
|
1508 |
# readline/libedit support |
1509 |
my_conf+=" |
1510 |
$(use_with readline readline ) |
1511 |
$(use_with libedit libedit )" |
1512 |
|
1513 |
# Session support |
1514 |
if use session ; then |
1515 |
my_conf+=" |
1516 |
$(use_with sharedmem mm )" |
1517 |
else |
1518 |
my_conf+=" |
1519 |
$(use_enable session session )" |
1520 |
fi |
1521 |
|
1522 |
if use pic ; then |
1523 |
my_conf="${my_conf} --with-pic" |
1524 |
fi |
1525 |
|
1526 |
# we use the system copy of pcre |
1527 |
# --with-pcre-regex affects ext/pcre |
1528 |
# --with-pcre-dir affects ext/filter and ext/zip |
1529 |
my_conf="${my_conf} --with-pcre-regex=/usr --with-pcre-dir=/usr" |
1530 |
|
1531 |
# Catch CFLAGS problems |
1532 |
# Fixes bug #14067. |
1533 |
# Changed order to run it in reverse for bug #32022 and #12021. |
1534 |
replace-cpu-flags "k6*" "i586" |
1535 |
|
1536 |
# Support user-passed configuration parameters |
1537 |
my_conf="${my_conf} ${EXTRA_ECONF:-}" |
1538 |
|
1539 |
# Support the Apache2 extras, they must be set globally for all |
1540 |
# SAPIs to work correctly, especially for external PHP extensions |
1541 |
|
1542 |
mkdir -p "${WORKDIR}/sapis-build" |
1543 |
for one_sapi in $SAPIS ; do |
1544 |
use "${one_sapi}" || continue |
1545 |
php_set_ini_dir "${one_sapi}" |
1546 |
|
1547 |
cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" |
1548 |
cd "${WORKDIR}/sapis-build/${one_sapi}" |
1549 |
|
1550 |
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} |
1551 |
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" |
1552 |
|
1553 |
for sapi in $SAPIS ; do |
1554 |
case "$sapi" in |
1555 |
cli|cgi|embed|fpm) |
1556 |
if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1557 |
sapi_conf="${sapi_conf} --enable-${sapi}" |
1558 |
else |
1559 |
sapi_conf="${sapi_conf} --disable-${sapi}" |
1560 |
fi |
1561 |
;; |
1562 |
|
1563 |
apache2) |
1564 |
if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1565 |
sapi_conf="${sapi_conf} --with-apxs2=/usr/sbin/apxs" |
1566 |
else |
1567 |
sapi_conf="${sapi_conf} --without-apxs2" |
1568 |
fi |
1569 |
;; |
1570 |
esac |
1571 |
done |
1572 |
|
1573 |
econf ${sapi_conf} |
1574 |
done |
1575 |
} |
1576 |
|
1577 |
src_compile() { |
1578 |
# snmp seems to run during src_compile, too (bug #324739) |
1579 |
addpredict /usr/share/snmp/mibs/.index |
1580 |
addpredict /var/lib/net-snmp/mibs/.index |
1581 |
|
1582 |
SAPI_DIR="${WORKDIR}/sapis" |
1583 |
|
1584 |
for sapi in ${SAPIS} ; do |
1585 |
use "${sapi}" || continue |
1586 |
|
1587 |
php_sapi_build "${sapi}" |
1588 |
php_sapi_copy "${sapi}" |
1589 |
done |
1590 |
} |
1591 |
|
1592 |
php_sapi_build() { |
1593 |
mkdir -p "${SAPI_DIR}/$1" |
1594 |
|
1595 |
cd "${WORKDIR}/sapis-build/$1" |
1596 |
emake || die "emake failed" |
1597 |
} |
1598 |
|
1599 |
php_sapi_copy() { |
1600 |
local sapi="$1" |
1601 |
local source="" |
1602 |
|
1603 |
case "$sapi" in |
1604 |
cli) |
1605 |
source="sapi/cli/php" |
1606 |
;; |
1607 |
cgi) |
1608 |
source="sapi/cgi/php-cgi" |
1609 |
;; |
1610 |
fpm) |
1611 |
source="sapi/fpm/php-fpm" |
1612 |
;; |
1613 |
embed) |
1614 |
source="libs/libphp${PHP_MV}.so" |
1615 |
;; |
1616 |
|
1617 |
apache2) |
1618 |
# apache2 is a special case; the necessary files |
1619 |
# (yes, multiple) are copied by make install, not |
1620 |
# by the ebuild; that's the reason, why apache2 has |
1621 |
# to be the last sapi |
1622 |
emake INSTALL_ROOT="${SAPI_DIR}/${sapi}/" install-sapi |
1623 |
;; |
1624 |
|
1625 |
*) |
1626 |
die "unhandled sapi in php_sapi_copy" |
1627 |
;; |
1628 |
esac |
1629 |
|
1630 |
if [[ "${source}" ]] ; then |
1631 |
cp "$source" "${SAPI_DIR}/$sapi" || die "Unable to copy ${sapi} SAPI" |
1632 |
fi |
1633 |
} |
1634 |
|
1635 |
src_install() { |
1636 |
# see bug #324739 for what happens when we don't have that |
1637 |
addpredict /usr/share/snmp/mibs/.index |
1638 |
|
1639 |
# grab the first SAPI that got built and install common files from there |
1640 |
local first_sapi="" |
1641 |
for sapi in $SAPIS ; do |
1642 |
if use $sapi ; then |
1643 |
first_sapi=$sapi |
1644 |
break |
1645 |
fi |
1646 |
done |
1647 |
|
1648 |
# Makefile forgets to create this before trying to write to it... |
1649 |
dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
1650 |
|
1651 |
# Install php environment (without any sapis) |
1652 |
cd "${WORKDIR}/sapis-build/$first_sapi" |
1653 |
emake INSTALL_ROOT="${D}" \ |
1654 |
install-build install-headers install-programs \ |
1655 |
|| die "emake install failed" |
1656 |
|
1657 |
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
1658 |
|
1659 |
# Create the directory where we'll put version-specific php scripts |
1660 |
keepdir /usr/share/php${PHP_MV} |
1661 |
|
1662 |
local sapi="", file="" |
1663 |
local sapi_list="" |
1664 |
|
1665 |
for sapi in ${SAPIS}; do |
1666 |
if use "${sapi}" ; then |
1667 |
einfo "Installing SAPI: ${sapi}" |
1668 |
cd "${WORKDIR}/sapis-build/${sapi}" |
1669 |
|
1670 |
if [[ "${sapi}" == "apache2" ]] ; then |
1671 |
# We're specifically not using emake install-sapi as libtool |
1672 |
# may cause unnecessary relink failures (see bug #351266) |
1673 |
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
1674 |
newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" |
1675 |
keepdir "/usr/$(get_libdir)/apache2/modules" |
1676 |
else |
1677 |
# needed each time, php_install_ini would reset it |
1678 |
into "${PHP_DESTDIR#${EPREFIX}}" |
1679 |
case "$sapi" in |
1680 |
cli) |
1681 |
source="sapi/cli/php" |
1682 |
;; |
1683 |
cgi) |
1684 |
source="sapi/cgi/php-cgi" |
1685 |
;; |
1686 |
fpm) |
1687 |
source="sapi/fpm/php-fpm" |
1688 |
;; |
1689 |
embed) |
1690 |
source="libs/libphp${PHP_MV}$(get_libname)" |
1691 |
;; |
1692 |
*) |
1693 |
die "unhandled sapi in src_install" |
1694 |
;; |
1695 |
esac |
1696 |
|
1697 |
if [[ "${source}" == *"$(get_libname)" ]]; then |
1698 |
dolib.so "${source}" || die "Unable to install ${sapi} sapi" |
1699 |
else |
1700 |
dobin "${source}" || die "Unable to install ${sapi} sapi" |
1701 |
fi |
1702 |
fi |
1703 |
|
1704 |
php_install_ini "${sapi}" |
1705 |
|
1706 |
# construct correct SAPI string for php-config |
1707 |
# thanks to ferringb for the bash voodoo |
1708 |
if [[ "${sapi}" == "apache2" ]]; then |
1709 |
sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
1710 |
else |
1711 |
sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
1712 |
fi |
1713 |
fi |
1714 |
done |
1715 |
|
1716 |
# Install env.d files |
1717 |
newenvd "${FILESDIR}/20php5-envd" \ |
1718 |
"20php${SLOT}" |
1719 |
sed -e "s|/lib/|/$(get_libdir)/|g" -i \ |
1720 |
"${ED}/etc/env.d/20php${SLOT}" |
1721 |
sed -e "s|php5|php${SLOT}|g" -i \ |
1722 |
"${ED}/etc/env.d/20php${SLOT}" |
1723 |
|
1724 |
# set php-config variable correctly (bug #278439) |
1725 |
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
1726 |
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" |
1727 |
} |
1728 |
|
1729 |
src_test() { |
1730 |
echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
1731 |
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
1732 |
if [[ ! -x "${PHP_BIN}" ]] ; then |
1733 |
ewarn "Test phase requires USE=cli, skipping" |
1734 |
return |
1735 |
else |
1736 |
export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
1737 |
fi |
1738 |
|
1739 |
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
1740 |
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
1741 |
fi |
1742 |
|
1743 |
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ |
1744 |
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}" |
1745 |
|
1746 |
for name in ${EXPECTED_TEST_FAILURES}; do |
1747 |
mv "${name}.out" "${name}.out.orig" 2>/dev/null |
1748 |
done |
1749 |
|
1750 |
local failed="$(find -name '*.out')" |
1751 |
if [[ ${failed} != "" ]] ; then |
1752 |
ewarn "The following test cases failed unexpectedly:" |
1753 |
for name in ${failed}; do |
1754 |
ewarn " ${name/.out/}" |
1755 |
done |
1756 |
else |
1757 |
einfo "No unexpected test failures, all fine" |
1758 |
fi |
1759 |
|
1760 |
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
1761 |
local passed="" |
1762 |
for name in ${EXPECTED_TEST_FAILURES}; do |
1763 |
[[ -f "${name}.diff" ]] && continue |
1764 |
passed="${passed} ${name}" |
1765 |
done |
1766 |
if [[ ${passed} != "" ]] ; then |
1767 |
einfo "The following test cases passed unexpectedly:" |
1768 |
for name in ${passed}; do |
1769 |
ewarn " ${passed}" |
1770 |
done |
1771 |
else |
1772 |
einfo "None of the known-to-fail tests passed, all fine" |
1773 |
fi |
1774 |
fi |
1775 |
} |
1776 |
|
1777 |
#Do not use eblit for this because it will not get sourced when installing from |
1778 |
#binary package (bug #380845) |
1779 |
pkg_postinst() { |
1780 |
# Output some general info to the user |
1781 |
if use apache2 ; then |
1782 |
APACHE2_MOD_DEFINE="PHP5" |
1783 |
APACHE2_MOD_CONF="70_mod_php5" |
1784 |
apache-module_pkg_postinst |
1785 |
fi |
1786 |
|
1787 |
# Create the symlinks for php |
1788 |
for m in ${SAPIS}; do |
1789 |
[[ ${m} == 'embed' ]] && continue; |
1790 |
if use $m ; then |
1791 |
local ci=$(eselect php show $m) |
1792 |
if [[ -z $ci ]]; then |
1793 |
eselect php set $m php${SLOT} |
1794 |
einfo "Switched ${m} to use php:${SLOT}" |
1795 |
einfo |
1796 |
elif [[ $ci != "php${SLOT}" ]] ; then |
1797 |
elog "To switch $m to use php:${SLOT}, run" |
1798 |
elog " eselect php set $m php${SLOT}" |
1799 |
elog |
1800 |
fi |
1801 |
fi |
1802 |
done |
1803 |
|
1804 |
elog "Make sure that PHP_TARGETS in /etc/make.conf includes php${SLOT/./-} in order" |
1805 |
elog "to compile extensions for the ${SLOT} ABI" |
1806 |
elog |
1807 |
if ! use readline && use cli ; then |
1808 |
ewarn "Note that in order to use php interactivly, you need to enable" |
1809 |
ewarn "the readline USE flag or php -a will hang" |
1810 |
fi |
1811 |
elog |
1812 |
elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." |
1813 |
elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" |
1814 |
elog "'production' or 'development' in /etc/make.conf" |
1815 |
ewarn "Both versions of php.ini can be found in /usr/share/doc/${PF}" |
1816 |
|
1817 |
# check for not yet migrated old style config dirs |
1818 |
ls "${ROOT}"/etc/php/*-php5 &>/dev/null |
1819 |
if [[ $? -eq 0 ]]; then |
1820 |
ewarn "Make sure to migrate your config files, starting with php-5.3.4 and php-5.2.16 config" |
1821 |
ewarn "files are now kept at ${ROOT}etc/php/{apache2,cli,cgi,fpm}-php5.x" |
1822 |
fi |
1823 |
elog |
1824 |
elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" |
1825 |
elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml" |
1826 |
elog |
1827 |
|
1828 |
if ( [[ -z SUHOSIN_VERSION ]] && use suhosin && version_is_at_least 5.3.6_rc1 ) ; then |
1829 |
ewarn "The suhosin USE flag now only installs the suhosin patch!" |
1830 |
ewarn "If you want the suhosin extension, make sure you install" |
1831 |
ewarn " dev-php5/suhosin" |
1832 |
ewarn |
1833 |
fi |
1834 |
} |