1 |
olemarkus 13/10/29 07:21:39 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: php-5.4.21.ebuild |
5 |
Log: |
6 |
Version bump |
7 |
|
8 |
(Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key C4A92BF5) |
9 |
|
10 |
Revision Changes Path |
11 |
1.774 dev-lang/php/ChangeLog |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?rev=1.774&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?rev=1.774&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/ChangeLog?r1=1.773&r2=1.774 |
16 |
|
17 |
Index: ChangeLog |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v |
20 |
retrieving revision 1.773 |
21 |
retrieving revision 1.774 |
22 |
diff -u -r1.773 -r1.774 |
23 |
--- ChangeLog 18 Oct 2013 11:10:49 -0000 1.773 |
24 |
+++ ChangeLog 29 Oct 2013 07:21:39 -0000 1.774 |
25 |
@@ -1,6 +1,11 @@ |
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.773 2013/10/18 11:10:49 olemarkus Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.774 2013/10/29 07:21:39 olemarkus Exp $ |
30 |
+ |
31 |
+*php-5.4.21 (29 Oct 2013) |
32 |
+ |
33 |
+ 29 Oct 2013; Ole Markus With <olemarkus@g.o> +php-5.4.21.ebuild: |
34 |
+ Version bump |
35 |
|
36 |
*php-5.5.5 (18 Oct 2013) |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
1.1 dev-lang/php/php-5.4.21.ebuild |
42 |
|
43 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.4.21.ebuild?rev=1.1&view=markup |
44 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/php-5.4.21.ebuild?rev=1.1&content-type=text/plain |
45 |
|
46 |
Index: php-5.4.21.ebuild |
47 |
=================================================================== |
48 |
# Copyright 1999-2013 Gentoo Foundation |
49 |
# Distributed under the terms of the GNU General Public License v2 |
50 |
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.4.21.ebuild,v 1.1 2013/10/29 07:21:39 olemarkus Exp $ |
51 |
|
52 |
EAPI=5 |
53 |
|
54 |
inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool |
55 |
|
56 |
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" |
57 |
|
58 |
function php_get_uri () |
59 |
{ |
60 |
case "${1}" in |
61 |
"php-pre") |
62 |
echo "http://downloads.php.net/stas/${2}" |
63 |
;; |
64 |
"php") |
65 |
echo "http://www.php.net/distributions/${2}" |
66 |
;; |
67 |
"olemarkus") |
68 |
echo "http://dev.gentoo.org/~olemarkus/php/${2}" |
69 |
;; |
70 |
"gentoo") |
71 |
echo "mirror://gentoo/${2}" |
72 |
;; |
73 |
*) |
74 |
die "unhandled case in php_get_uri" |
75 |
;; |
76 |
esac |
77 |
} |
78 |
|
79 |
PHP_MV="$(get_major_version)" |
80 |
SLOT="$(get_version_component_range 1-2)" |
81 |
|
82 |
# alias, so we can handle different types of releases (finals, rcs, alphas, |
83 |
# betas, ...) w/o changing the whole ebuild |
84 |
PHP_PV="${PV/_rc/RC}" |
85 |
PHP_PV="${PHP_PV/_alpha/alpha}" |
86 |
PHP_PV="${PHP_PV/_beta/beta}" |
87 |
PHP_RELEASE="php" |
88 |
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
89 |
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
90 |
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
91 |
PHP_P="${PN}-${PHP_PV}" |
92 |
|
93 |
PHP_PATCHSET_LOC="olemarkus" |
94 |
|
95 |
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
96 |
|
97 |
PHP_PATCHSET="2" |
98 |
PHP_PATCHSET_URI=" |
99 |
$(php_get_uri "${PHP_PATCHSET_LOC}" "php-patchset-${SLOT}-r${PHP_PATCHSET}.tar.bz2")" |
100 |
|
101 |
PHP_FPM_INIT_VER="4" |
102 |
PHP_FPM_CONF_VER="1" |
103 |
|
104 |
SRC_URI=" |
105 |
${PHP_SRC_URI} |
106 |
${PHP_PATCHSET_URI}" |
107 |
|
108 |
DESCRIPTION="The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs." |
109 |
HOMEPAGE="http://php.net/" |
110 |
LICENSE="PHP-3" |
111 |
|
112 |
S="${WORKDIR}/${PHP_P}" |
113 |
|
114 |
# We can build the following SAPIs in the given order |
115 |
SAPIS="embed cli cgi fpm apache2" |
116 |
|
117 |
# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
118 |
IUSE="${IUSE} |
119 |
${SAPIS/cli/+cli} |
120 |
threads" |
121 |
|
122 |
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
123 |
crypt +ctype curl curlwrappers debug |
124 |
enchant exif frontbase +fileinfo +filter firebird |
125 |
flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
126 |
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash |
127 |
mssql mysql mysqlnd mysqli nls |
128 |
oci8-instant-client odbc pcntl pdo +phar +posix postgres qdbm |
129 |
readline recode selinux +session sharedmem |
130 |
+simplexml snmp soap sockets spell sqlite ssl |
131 |
sybase-ct sysvipc tidy +tokenizer truetype unicode wddx |
132 |
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
133 |
|
134 |
DEPEND=" |
135 |
>=app-admin/eselect-php-0.7.0[apache2?,fpm?] |
136 |
>=dev-libs/libpcre-8.32[unicode] |
137 |
apache2? ( www-servers/apache[threads=] ) |
138 |
berkdb? ( =sys-libs/db-4* ) |
139 |
bzip2? ( app-arch/bzip2 ) |
140 |
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
141 |
cjk? ( !gd? ( |
142 |
virtual/jpeg:0 |
143 |
media-libs/libpng:0= |
144 |
sys-libs/zlib |
145 |
) ) |
146 |
crypt? ( >=dev-libs/libmcrypt-2.4 ) |
147 |
curl? ( >=net-misc/curl-7.10.5 ) |
148 |
enchant? ( app-text/enchant ) |
149 |
exif? ( !gd? ( |
150 |
virtual/jpeg:0 |
151 |
media-libs/libpng:0= |
152 |
sys-libs/zlib |
153 |
) ) |
154 |
firebird? ( dev-db/firebird ) |
155 |
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
156 |
gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
157 |
gmp? ( >=dev-libs/gmp-4.1.2 ) |
158 |
iconv? ( virtual/libiconv ) |
159 |
imap? ( virtual/imap-c-client[ssl=] ) |
160 |
intl? ( dev-libs/icu:= ) |
161 |
iodbc? ( dev-db/libiodbc ) |
162 |
kerberos? ( virtual/krb5 ) |
163 |
ldap? ( >=net-nds/openldap-1.2.11 ) |
164 |
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
165 |
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
166 |
mssql? ( dev-db/freetds[mssql] ) |
167 |
!mysqlnd? ( |
168 |
mysql? ( virtual/mysql ) |
169 |
mysqli? ( >=virtual/mysql-4.1 ) |
170 |
) |
171 |
nls? ( sys-devel/gettext ) |
172 |
oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
173 |
odbc? ( >=dev-db/unixODBC-1.8.13 ) |
174 |
postgres? ( dev-db/postgresql-base ) |
175 |
qdbm? ( dev-db/qdbm ) |
176 |
readline? ( sys-libs/readline ) |
177 |
recode? ( app-text/recode ) |
178 |
sharedmem? ( dev-libs/mm ) |
179 |
simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
180 |
snmp? ( >=net-analyzer/net-snmp-5.2 ) |
181 |
soap? ( >=dev-libs/libxml2-2.6.8 ) |
182 |
spell? ( >=app-text/aspell-0.50 ) |
183 |
sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
184 |
ssl? ( >=dev-libs/openssl-0.9.7 ) |
185 |
sybase-ct? ( dev-db/freetds ) |
186 |
tidy? ( app-text/htmltidy ) |
187 |
truetype? ( |
188 |
=media-libs/freetype-2* |
189 |
>=media-libs/t1lib-5.0.0 |
190 |
!gd? ( |
191 |
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
192 |
) |
193 |
unicode? ( dev-libs/oniguruma ) |
194 |
wddx? ( >=dev-libs/libxml2-2.6.8 ) |
195 |
xml? ( >=dev-libs/libxml2-2.6.8 ) |
196 |
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
197 |
xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
198 |
xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
199 |
xpm? ( |
200 |
x11-libs/libXpm |
201 |
virtual/jpeg:0 |
202 |
media-libs/libpng:0= sys-libs/zlib |
203 |
) |
204 |
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
205 |
zip? ( sys-libs/zlib ) |
206 |
zlib? ( sys-libs/zlib ) |
207 |
virtual/mta |
208 |
" |
209 |
|
210 |
php="=${CATEGORY}/${PF}" |
211 |
|
212 |
REQUIRED_USE=" |
213 |
truetype? ( gd ) |
214 |
cjk? ( gd ) |
215 |
exif? ( gd ) |
216 |
|
217 |
xpm? ( gd ) |
218 |
gd? ( zlib ) |
219 |
simplexml? ( xml ) |
220 |
soap? ( xml ) |
221 |
wddx? ( xml ) |
222 |
xmlrpc? ( || ( xml iconv ) ) |
223 |
xmlreader? ( xml ) |
224 |
xslt? ( xml ) |
225 |
ldap-sasl? ( ldap ) |
226 |
mhash? ( hash ) |
227 |
phar? ( hash ) |
228 |
mysqlnd? ( || ( |
229 |
mysql |
230 |
mysqli |
231 |
pdo |
232 |
) ) |
233 |
|
234 |
qdbm? ( !gdbm ) |
235 |
readline? ( !libedit ) |
236 |
recode? ( !imap !mysql !mysqli ) |
237 |
sharedmem? ( !threads ) |
238 |
|
239 |
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
240 |
|
241 |
RDEPEND="${DEPEND}" |
242 |
|
243 |
RDEPEND="${RDEPEND} fpm? ( selinux? ( sec-policy/selinux-phpfpm ) )" |
244 |
|
245 |
DEPEND="${DEPEND} |
246 |
sys-devel/flex |
247 |
>=sys-devel/m4-1.4.3 |
248 |
>=sys-devel/libtool-1.5.18" |
249 |
|
250 |
# Allow users to install production version if they want to |
251 |
|
252 |
case "${PHP_INI_VERSION}" in |
253 |
production|development) |
254 |
;; |
255 |
*) |
256 |
PHP_INI_VERSION="development" |
257 |
;; |
258 |
esac |
259 |
|
260 |
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
261 |
PHP_INI_FILE="php.ini" |
262 |
|
263 |
want_apache |
264 |
|
265 |
pkg_setup() { |
266 |
depend.apache_pkg_setup |
267 |
} |
268 |
|
269 |
php_install_ini() { |
270 |
local phpsapi="${1}" |
271 |
|
272 |
# work out where we are installing the ini file |
273 |
php_set_ini_dir "${phpsapi}" |
274 |
|
275 |
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
276 |
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" |
277 |
|
278 |
# default to /tmp for save_path, bug #282768 |
279 |
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" |
280 |
|
281 |
# Set the extension dir |
282 |
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" |
283 |
|
284 |
# Set the include path to point to where we want to find PEAR packages |
285 |
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" |
286 |
|
287 |
if use_if_iuse opcache; then |
288 |
elog "Adding opcache to ${phpinisrc}" |
289 |
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> ${phpinisrc} |
290 |
fi |
291 |
|
292 |
dodir "${PHP_INI_DIR#${EPREFIX}}" |
293 |
insinto "${PHP_INI_DIR#${EPREFIX}}" |
294 |
newins "${phpinisrc}" "${PHP_INI_FILE}" |
295 |
|
296 |
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
297 |
elog |
298 |
|
299 |
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
300 |
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
301 |
|
302 |
# SAPI-specific handling |
303 |
|
304 |
if [[ "${sapi}" == "fpm" ]] ; then |
305 |
[[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 |
306 |
einfo "Installing FPM CGI config file php-fpm.conf" |
307 |
insinto "${PHP_INI_DIR#${EPREFIX}}" |
308 |
newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf |
309 |
|
310 |
# Remove bogus /etc/php-fpm.conf.default (bug 359906) |
311 |
[[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" |
312 |
fi |
313 |
|
314 |
# Install PHP ini files into /usr/share/php |
315 |
|
316 |
dodoc php.ini-development |
317 |
dodoc php.ini-production |
318 |
|
319 |
} |
320 |
|
321 |
php_set_ini_dir() { |
322 |
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
323 |
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
324 |
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
325 |
} |
326 |
|
327 |
src_prepare() { |
328 |
# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path |
329 |
# ([empty session.save_path]/session_mm_[sapi][gid].sem) |
330 |
# there is no easy way to circumvent that, all php calls during |
331 |
# install use -n, so no php.ini file will be used. |
332 |
# As such, this is the easiest way to get around |
333 |
addpredict /session_mm_cli250.sem |
334 |
addpredict /session_mm_cli0.sem |
335 |
|
336 |
# Change PHP branding |
337 |
# Get the alpha/beta/rc version |
338 |
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
339 |
-i configure.in || die "Unable to change PHP branding" |
340 |
|
341 |
# Patch PHP to show Gentoo as the server platform |
342 |
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
343 |
-i configure.in || die "Failed to fix server platform name" |
344 |
|
345 |
# Prevent PHP from activating the Apache config, |
346 |
# as we will do that ourselves |
347 |
sed -i \ |
348 |
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
349 |
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
350 |
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 |
351 |
|
352 |
# Patch PHP to support heimdal instead of mit-krb5 |
353 |
if has_version "app-crypt/heimdal" ; then |
354 |
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
355 |
|| die "Failed to fix heimdal libname" |
356 |
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
357 |
|| die "Failed to fix heimdal crypt library reference" |
358 |
fi |
359 |
|
360 |
#Add user patches #357637 |
361 |
epatch_user |
362 |
|
363 |
#force rebuilding aclocal.m4 |
364 |
rm aclocal.m4 |
365 |
eautoreconf |
366 |
|
367 |
if [[ ${CHOST} == *-darwin* ]] ; then |
368 |
# http://bugs.php.net/bug.php?id=48795, bug #343481 |
369 |
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
370 |
fi |
371 |
} |
372 |
|
373 |
src_configure() { |
374 |
addpredict /usr/share/snmp/mibs/.index |
375 |
addpredict /var/lib/net-snmp/mib_indexes |
376 |
|
377 |
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
378 |
|
379 |
# This is a global variable and should be in caps. It isn't because the |
380 |
# phpconfutils eclass relies on exactly this name... |
381 |
# for --with-libdir see bug #327025 |
382 |
my_conf=" |
383 |
--prefix="${PHP_DESTDIR}" |
384 |
--mandir="${PHP_DESTDIR}"/man |
385 |
--infodir="${PHP_DESTDIR}"/info |
386 |
--libdir="${PHP_DESTDIR}"/lib |
387 |
--with-libdir=$(get_libdir) |
388 |
--without-pear |
389 |
$(use_enable threads maintainer-zts)" |
390 |
|
391 |
# extension USE flag shared |
392 |
my_conf+=" |
393 |
$(use_enable bcmath bcmath ) |
394 |
$(use_with bzip2 bz2 "${EPREFIX}"/usr) |
395 |
$(use_enable calendar calendar ) |
396 |
$(use_enable ctype ctype ) |
397 |
$(use_with curl curl "${EPREFIX}"/usr) |
398 |
$(use_with curlwrappers curlwrappers "${EPREFIX}"/usr) |
399 |
$(use_enable xml dom ) |
400 |
$(use_with enchant enchant "${EPREFIX}"/usr) |
401 |
$(use_enable exif exif ) |
402 |
$(use_enable fileinfo fileinfo ) |
403 |
$(use_enable filter filter ) |
404 |
$(use_enable ftp ftp ) |
405 |
$(use_with nls gettext "${EPREFIX}"/usr) |
406 |
$(use_with gmp gmp "${EPREFIX}"/usr) |
407 |
$(use_enable hash hash ) |
408 |
$(use_with mhash mhash "${EPREFIX}"/usr) |
409 |
$(use_with iconv iconv $(use elibc_glibc || echo "${EPREFIX}"/usr)) |
410 |
$(use_enable intl intl ) |
411 |
$(use_enable ipv6 ipv6 ) |
412 |
$(use_enable json json ) |
413 |
$(use_with kerberos kerberos "${EPREFIX}"/usr) |
414 |
$(use_enable xml libxml ) |
415 |
$(use_with xml libxml-dir "${EPREFIX}"/usr) |
416 |
$(use_enable unicode mbstring ) |
417 |
$(use_with crypt mcrypt "${EPREFIX}"/usr) |
418 |
$(use_with mssql mssql "${EPREFIX}"/usr) |
419 |
$(use_with unicode onig "${EPREFIX}"/usr) |
420 |
$(use_with ssl openssl "${EPREFIX}"/usr) |
421 |
$(use_with ssl openssl-dir "${EPREFIX}"/usr) |
422 |
$(use_enable pcntl pcntl ) |
423 |
$(use_enable phar phar ) |
424 |
$(use_enable pdo pdo ) |
425 |
$(use_with postgres pgsql "${EPREFIX}"/usr) |
426 |
$(use_enable posix posix ) |
427 |
$(use_with spell pspell "${EPREFIX}"/usr) |
428 |
$(use_with recode recode "${EPREFIX}"/usr) |
429 |
$(use_enable simplexml simplexml ) |
430 |
$(use_enable sharedmem shmop ) |
431 |
$(use_with snmp snmp "${EPREFIX}"/usr) |
432 |
$(use_enable soap soap ) |
433 |
$(use_enable sockets sockets ) |
434 |
$(use_with sqlite sqlite3 "${EPREFIX}"/usr) |
435 |
$(use_with sybase-ct sybase-ct "${EPREFIX}"/usr) |
436 |
$(use_enable sysvipc sysvmsg ) |
437 |
$(use_enable sysvipc sysvsem ) |
438 |
$(use_enable sysvipc sysvshm ) |
439 |
$(use_with tidy tidy "${EPREFIX}"/usr) |
440 |
$(use_enable tokenizer tokenizer ) |
441 |
$(use_enable wddx wddx ) |
442 |
$(use_enable xml xml ) |
443 |
$(use_enable xmlreader xmlreader ) |
444 |
$(use_enable xmlwriter xmlwriter ) |
445 |
$(use_with xmlrpc xmlrpc) |
446 |
$(use_with xslt xsl "${EPREFIX}"/usr) |
447 |
$(use_enable zip zip ) |
448 |
$(use_with zlib zlib "${EPREFIX}"/usr) |
449 |
$(use_enable debug debug )" |
450 |
|
451 |
# DBA support |
452 |
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
453 |
|| use qdbm ; then |
454 |
my_conf="${my_conf} --enable-dba${shared}" |
455 |
fi |
456 |
|
457 |
# DBA drivers support |
458 |
my_conf+=" |
459 |
$(use_with cdb cdb) |
460 |
$(use_with berkdb db4 ${EPREFIX}/usr) |
461 |
$(use_enable flatfile flatfile ) |
462 |
$(use_with gdbm gdbm ${EPREFIX}/usr) |
463 |
$(use_enable inifile inifile ) |
464 |
$(use_with qdbm qdbm ${EPREFIX}/usr)" |
465 |
|
466 |
# Support for the GD graphics library |
467 |
my_conf+=" |
468 |
$(use_with truetype freetype-dir ${EPREFIX}/usr) |
469 |
$(use_with truetype t1lib ${EPREFIX}/usr) |
470 |
$(use_enable cjk gd-jis-conv ) |
471 |
$(use_with gd jpeg-dir ${EPREFIX}/usr) |
472 |
$(use_with gd png-dir ${EPREFIX}/usr) |
473 |
$(use_with xpm xpm-dir ${EPREFIX}/usr)" |
474 |
# enable gd last, so configure can pick up the previous settings |
475 |
my_conf+=" |
476 |
$(use_with gd gd)" |
477 |
|
478 |
# IMAP support |
479 |
if use imap ; then |
480 |
my_conf+=" |
481 |
$(use_with imap imap ${EPREFIX}/usr) |
482 |
$(use_with ssl imap-ssl ${EPREFIX}/usr)" |
483 |
fi |
484 |
|
485 |
# Interbase/firebird support |
486 |
|
487 |
if use firebird ; then |
488 |
my_conf+=" |
489 |
$(use_with firebird interbase ${EPREFIX}/usr)" |
490 |
fi |
491 |
|
492 |
# LDAP support |
493 |
if use ldap ; then |
494 |
my_conf+=" |
495 |
$(use_with ldap ldap ${EPREFIX}/usr) |
496 |
$(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)" |
497 |
fi |
498 |
|
499 |
# MySQL support |
500 |
if use mysql ; then |
501 |
if use mysqlnd ; then |
502 |
my_conf+=" |
503 |
$(use_with mysql mysql mysqlnd)" |
504 |
else |
505 |
my_conf+=" |
506 |
$(use_with mysql mysql ${EPREFIX}/usr)" |
507 |
fi |
508 |
my_conf+=" |
509 |
$(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)" |
510 |
fi |
511 |
|
512 |
# MySQLi support |
513 |
if use mysqlnd ; then |
514 |
my_conf+=" |
515 |
$(use_with mysqli mysqli mysqlnd)" |
516 |
else |
517 |
my_conf+=" |
518 |
$(use_with mysqli mysqli ${EPREFIX}/usr/bin/mysql_config)" |
519 |
fi |
520 |
|
521 |
# ODBC support |
522 |
if use odbc ; then |
523 |
my_conf+=" |
524 |
$(use_with odbc unixODBC ${EPREFIX}/usr)" |
525 |
fi |
526 |
|
527 |
if use iodbc ; then |
528 |
my_conf+=" |
529 |
$(use_with iodbc iodbc ${EPREFIX}/usr)" |
530 |
fi |
531 |
|
532 |
# Oracle support |
533 |
if use oci8-instant-client ; then |
534 |
my_conf+=" |
535 |
$(use_with oci8-instant-client oci8)" |
536 |
fi |
537 |
|
538 |
# PDO support |
539 |
if use pdo ; then |
540 |
my_conf+=" |
541 |
$(use_with mssql pdo-dblib )" |
542 |
if use mysqlnd ; then |
543 |
my_conf+=" |
544 |
$(use_with mysqlnd pdo-mysql mysqlnd)" |
545 |
else |
546 |
my_conf+=" |
547 |
$(use_with mysql pdo-mysql ${EPREFIX}/usr)" |
548 |
fi |
549 |
my_conf+=" |
550 |
$(use_with postgres pdo-pgsql ) |
551 |
$(use_with sqlite pdo-sqlite ${EPREFIX}/usr) |
552 |
$(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)" |
553 |
if use oci8-instant-client ; then |
554 |
my_conf+=" |
555 |
$(use_with oci8-instant-client pdo-oci)" |
556 |
fi |
557 |
fi |
558 |
|
559 |
# readline/libedit support |
560 |
my_conf+=" |
561 |
$(use_with readline readline ${EPREFIX}/usr) |
562 |
$(use_with libedit libedit ${EPREFIX}/usr)" |
563 |
|
564 |
# Session support |
565 |
if use session ; then |
566 |
my_conf+=" |
567 |
$(use_with sharedmem mm ${EPREFIX}/usr)" |
568 |
else |
569 |
my_conf+=" |
570 |
$(use_enable session session )" |
571 |
fi |
572 |
|
573 |
# Use pic for shared modules such as apache2's mod_php |
574 |
my_conf="${my_conf} --with-pic" |
575 |
|
576 |
# we use the system copy of pcre |
577 |
# --with-pcre-regex affects ext/pcre |
578 |
# --with-pcre-dir affects ext/filter and ext/zip |
579 |
my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr" |
580 |
|
581 |
# Catch CFLAGS problems |
582 |
# Fixes bug #14067. |
583 |
# Changed order to run it in reverse for bug #32022 and #12021. |
584 |
replace-cpu-flags "k6*" "i586" |
585 |
|
586 |
# Support user-passed configuration parameters |
587 |
my_conf="${my_conf} ${EXTRA_ECONF:-}" |
588 |
|
589 |
# Support the Apache2 extras, they must be set globally for all |
590 |
# SAPIs to work correctly, especially for external PHP extensions |
591 |
|
592 |
mkdir -p "${WORKDIR}/sapis-build" |
593 |
for one_sapi in $SAPIS ; do |
594 |
use "${one_sapi}" || continue |
595 |
php_set_ini_dir "${one_sapi}" |
596 |
|
597 |
cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" |
598 |
cd "${WORKDIR}/sapis-build/${one_sapi}" |
599 |
|
600 |
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} |
601 |
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" |
602 |
|
603 |
for sapi in $SAPIS ; do |
604 |
case "$sapi" in |
605 |
cli|cgi|embed|fpm) |
606 |
if [[ "${one_sapi}" == "${sapi}" ]] ; then |
607 |
sapi_conf="${sapi_conf} --enable-${sapi}" |
608 |
else |
609 |
sapi_conf="${sapi_conf} --disable-${sapi}" |
610 |
fi |
611 |
;; |
612 |
|
613 |
apache2) |
614 |
if [[ "${one_sapi}" == "${sapi}" ]] ; then |
615 |
sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs" |
616 |
else |
617 |
sapi_conf="${sapi_conf} --without-apxs2" |
618 |
fi |
619 |
;; |
620 |
esac |
621 |
done |
622 |
|
623 |
econf ${sapi_conf} |
624 |
done |
625 |
} |
626 |
|
627 |
src_compile() { |
628 |
# snmp seems to run during src_compile, too (bug #324739) |
629 |
addpredict /usr/share/snmp/mibs/.index |
630 |
addpredict /var/lib/net-snmp/mib_indexes |
631 |
|
632 |
for sapi in ${SAPIS} ; do |
633 |
if use "${sapi}"; then |
634 |
cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
635 |
emake || die "emake failed" |
636 |
fi |
637 |
done |
638 |
} |
639 |
|
640 |
src_install() { |
641 |
# see bug #324739 for what happens when we don't have that |
642 |
addpredict /usr/share/snmp/mibs/.index |
643 |
|
644 |
# grab the first SAPI that got built and install common files from there |
645 |
local first_sapi="" |
646 |
for sapi in $SAPIS ; do |
647 |
if use $sapi ; then |
648 |
first_sapi=$sapi |
649 |
break |
650 |
fi |
651 |
done |
652 |
|
653 |
# Makefile forgets to create this before trying to write to it... |
654 |
dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
655 |
|
656 |
# Install php environment (without any sapis) |
657 |
cd "${WORKDIR}/sapis-build/$first_sapi" |
658 |
emake INSTALL_ROOT="${D}" \ |
659 |
install-build install-headers install-programs \ |
660 |
|| die "emake install failed" |
661 |
|
662 |
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
663 |
|
664 |
# Create the directory where we'll put version-specific php scripts |
665 |
keepdir /usr/share/php${PHP_MV} |
666 |
|
667 |
local sapi="", file="" |
668 |
local sapi_list="" |
669 |
|
670 |
for sapi in ${SAPIS}; do |
671 |
if use "${sapi}" ; then |
672 |
einfo "Installing SAPI: ${sapi}" |
673 |
cd "${WORKDIR}/sapis-build/${sapi}" |
674 |
|
675 |
if [[ "${sapi}" == "apache2" ]] ; then |
676 |
# We're specifically not using emake install-sapi as libtool |
677 |
# may cause unnecessary relink failures (see bug #351266) |
678 |
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
679 |
newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" |
680 |
keepdir "/usr/$(get_libdir)/apache2/modules" |
681 |
else |
682 |
# needed each time, php_install_ini would reset it |
683 |
local dest="${PHP_DESTDIR#${EPREFIX}}" |
684 |
into "${dest}" |
685 |
case "$sapi" in |
686 |
cli) |
687 |
source="sapi/cli/php" |
688 |
;; |
689 |
cgi) |
690 |
source="sapi/cgi/php-cgi" |
691 |
;; |
692 |
fpm) |
693 |
source="sapi/fpm/php-fpm" |
694 |
;; |
695 |
embed) |
696 |
source="libs/libphp${PHP_MV}$(get_libname)" |
697 |
;; |
698 |
*) |
699 |
die "unhandled sapi in src_install" |
700 |
;; |
701 |
esac |
702 |
|
703 |
if [[ "${source}" == *"$(get_libname)" ]]; then |
704 |
dolib.so "${source}" || die "Unable to install ${sapi} sapi" |
705 |
else |
706 |
dobin "${source}" || die "Unable to install ${sapi} sapi" |
707 |
local name="$(basename ${source})" |
708 |
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
709 |
fi |
710 |
fi |
711 |
|
712 |
php_install_ini "${sapi}" |
713 |
|
714 |
# construct correct SAPI string for php-config |
715 |
# thanks to ferringb for the bash voodoo |
716 |
if [[ "${sapi}" == "apache2" ]]; then |
717 |
sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
718 |
else |
719 |
sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
720 |
fi |
721 |
fi |
722 |
done |
723 |
|
724 |
# Installing opcache module |
725 |
if use_if_iuse opcache ; then |
726 |
dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module" |
727 |
fi |
728 |
|
729 |
# Install env.d files |
730 |
newenvd "${FILESDIR}/20php5-envd" \ |
731 |
"20php${SLOT}" |
732 |
sed -e "s|/lib/|/$(get_libdir)/|g" -i \ |
733 |
"${ED}/etc/env.d/20php${SLOT}" |
734 |
sed -e "s|php5|php${SLOT}|g" -i \ |
735 |
"${ED}/etc/env.d/20php${SLOT}" |
736 |
|
737 |
# set php-config variable correctly (bug #278439) |
738 |
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
739 |
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" |
740 |
} |
741 |
|
742 |
src_test() { |
743 |
echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
744 |
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
745 |
if [[ ! -x "${PHP_BIN}" ]] ; then |
746 |
ewarn "Test phase requires USE=cli, skipping" |
747 |
return |
748 |
else |
749 |
export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
750 |
fi |
751 |
|
752 |
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
753 |
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
754 |
fi |
755 |
|
756 |
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ |
757 |
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}" |
758 |
|
759 |
for name in ${EXPECTED_TEST_FAILURES}; do |
760 |
mv "${name}.out" "${name}.out.orig" 2>/dev/null |
761 |
done |
762 |
|
763 |
local failed="$(find -name '*.out')" |
764 |
if [[ ${failed} != "" ]] ; then |
765 |
ewarn "The following test cases failed unexpectedly:" |
766 |
for name in ${failed}; do |
767 |
ewarn " ${name/.out/}" |
768 |
done |
769 |
else |
770 |
einfo "No unexpected test failures, all fine" |
771 |
fi |
772 |
|
773 |
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
774 |
local passed="" |
775 |
for name in ${EXPECTED_TEST_FAILURES}; do |
776 |
[[ -f "${name}.diff" ]] && continue |
777 |
passed="${passed} ${name}" |
778 |
done |
779 |
if [[ ${passed} != "" ]] ; then |
780 |
einfo "The following test cases passed unexpectedly:" |
781 |
for name in ${passed}; do |
782 |
ewarn " ${passed}" |
783 |
done |
784 |
else |
785 |
einfo "None of the known-to-fail tests passed, all fine" |
786 |
fi |
787 |
fi |
788 |
} |
789 |
|
790 |
pkg_postinst() { |
791 |
# Output some general info to the user |
792 |
if use apache2 ; then |
793 |
APACHE2_MOD_DEFINE="PHP5" |
794 |
APACHE2_MOD_CONF="70_mod_php5" |
795 |
apache-module_pkg_postinst |
796 |
fi |
797 |
|
798 |
# Create the symlinks for php |
799 |
for m in ${SAPIS}; do |
800 |
[[ ${m} == 'embed' ]] && continue; |
801 |
if use $m ; then |
802 |
local ci=$(eselect php show $m) |
803 |
if [[ -z $ci ]]; then |
804 |
eselect php set $m php${SLOT} |
805 |
einfo "Switched ${m} to use php:${SLOT}" |
806 |
einfo |
807 |
elif [[ $ci != "php${SLOT}" ]] ; then |
808 |
elog "To switch $m to use php:${SLOT}, run" |
809 |
elog " eselect php set $m php${SLOT}" |
810 |
elog |
811 |
fi |
812 |
fi |
813 |
done |
814 |
|
815 |
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order" |
816 |
elog "to compile extensions for the ${SLOT} ABI" |
817 |
elog |
818 |
if ! use readline && use cli ; then |
819 |
ewarn "Note that in order to use php interactivly, you need to enable" |
820 |
ewarn "the readline USE flag or php -a will hang" |
821 |
fi |
822 |
elog |
823 |
elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." |
824 |
elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" |
825 |
elog "'production' or 'development' in ${EPREFIX}/etc/make.conf" |
826 |
elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}" |
827 |
|
828 |
elog |
829 |
elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" |
830 |
elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml" |
831 |
elog |
832 |
} |
833 |
|
834 |
pkg_prerm() { |
835 |
eselect php cleanup |
836 |
} |