add php with gmp5 patch
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@2282 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
parent
051bd41945
commit
2c417cf616
17
dev-lang/php/ChangeLog
Normal file
17
dev-lang/php/ChangeLog
Normal file
@ -0,0 +1,17 @@
|
||||
# ChangeLog for dev-lang/php
|
||||
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.395 2010/07/26 13:42:13 mabi Exp $
|
||||
|
||||
26 Jul 2010; Matti Bickel <mabi@gentoo.org>
|
||||
files/eblits/src_compile-v1.eblit, files/eblits/src_configure-v1.eblit,
|
||||
files/eblits/src_install-v1.eblit, +files/php-fpm.init,
|
||||
+files/php-fpm-gentooified.patch, metadata.xml:
|
||||
update fpm description, actually support fpm in the eblits
|
||||
|
||||
*php-5.3.3 (26 Jul 2010)
|
||||
|
||||
26 Jul 2010; Matti Bickel <mabi@gentoo.org> php-5.3.2.ebuild,
|
||||
+php-5.3.3.ebuild, metadata.xml:
|
||||
version bump, simplify postgres deps (bug #326967), fixes strict aliasing
|
||||
issues (#329753), version bump is a security update
|
||||
|
32
dev-lang/php/Manifest
Normal file
32
dev-lang/php/Manifest
Normal file
@ -0,0 +1,32 @@
|
||||
AUX 20php5-envd 145 RMD160 8c81fb7dc1d1ddf16fd956d748514db3bcb27603 SHA1 f1cef57c0def8e2c5422aaf136f40b4ff47801d2 SHA256 efaae9e6ae5f7010e073c2ab6d8a9dda009f0707c7d7b0c027e142c94f7041a4
|
||||
AUX 70_mod_php5.conf-apache2 348 RMD160 9f3f49a52ebf92c2650501c5ceb6f95ce4bb2e76 SHA1 62992e793446b4a9a64900d1ecba7bae06873382 SHA256 5bb8a45570582b4389a7d3feea0398e1c13ed4ced96e559b9406ed8c965dea8c
|
||||
AUX 70_mod_php5.conf-apache2-r1 374 RMD160 ca06cdc9d1a3dc4129a60c938ee3a1b542497fbb SHA1 4733066b6324c5870e716485484c44c7c26a9ff1 SHA256 815c1ca23c9afe8479568ceaac4057eb91ea5444fbd863866b29adb4eea2c82b
|
||||
AUX 70_mod_php5_concurr.conf-apache2 348 RMD160 9f3f49a52ebf92c2650501c5ceb6f95ce4bb2e76 SHA1 62992e793446b4a9a64900d1ecba7bae06873382 SHA256 5bb8a45570582b4389a7d3feea0398e1c13ed4ced96e559b9406ed8c965dea8c
|
||||
AUX 70_mod_php5_concurr.conf-apache2-r1 376 RMD160 4f7de5c0784b6191450b5c1a7de7ad941620e199 SHA1 c42a23bd7a1d3e8c7e0ac906f50f180116349f76 SHA256 c05f499d9c8927391c586b94716a9f59d63767165552ea527ec7ff63c36eaa40
|
||||
AUX eblits/common-v1.eblit 376 RMD160 524d38035ef01b215c6dc06699c41550c246de9d SHA1 b85091f9e56b20217e5c2d3e25cef055642cd088 SHA256 d395752919fe05fa64a0e09deaf690e008a04f2c580f42233b5a854a1012045e
|
||||
AUX eblits/pkg_postinst-v1.eblit 2184 RMD160 ce65ba811eab10862d067c7e2b4bdc8d2b0aee56 SHA1 11c14f2235041cfb08e33cf2550bebef2037e92b SHA256 9e1cd81be4f051f3156de0ce5398a338b2ab6f8e73047c5983beda47f2f762b0
|
||||
AUX eblits/pkg_setup-v1.eblit 777 RMD160 aa63e7ab1bae34feffbbfaae902f11c6e797ba9d SHA1 f7334a4750b1a1bb2f24021dff884733a88ac347 SHA256 2613f51ee9e3a258dbab38ff2df724f2971a50a5ad8c097cb5a4e3744df5fc8a
|
||||
AUX eblits/src_compile-v1.eblit 1897 RMD160 45aa94bdf920a567ab9002309f6afbed8ba13abb SHA1 83c7fce59355d4bc7684bcfad975a147426f7911 SHA256 0fe6bfd4734f0dfe0bf420b09a5e19698490a8441c1ee20d7446bcceee480336
|
||||
AUX eblits/src_configure-v1.eblit 10019 RMD160 32f9cf226742689ed0ddf8c2fe87fa3233f83071 SHA1 2e027b84a318452068dcee0a1d1934d1b4b14e03 SHA256 540e9e770a8039aa4b40f9f915cb839e7f2ed8c05a06b9cf87f41253f0ccb5bc
|
||||
AUX eblits/src_install-v1.eblit 4415 RMD160 dc02d3abc3aa3dae2208675c4f00b3d616d1262b SHA1 f41b3430e0054866dbfbdbac5ce11127d4963112 SHA256 0dba349226de4559cd62c73572cb5c1d8213d7ce9f7d5338887d71158f2da64e
|
||||
AUX eblits/src_prepare-v1.eblit 2616 RMD160 ccff64d09cc90ada1ea5d1311457cf9a05f12f8e SHA1 7db40d0ca7ef01e5b61962f261511803f768f1bc SHA256 915b9755a37f7670f6e436fe5072dae8f5e6b437ccdfbff835e26bb2f9d22b1e
|
||||
AUX eblits/src_test-v1.eblit 1480 RMD160 68ef731042ef236efee923649b318239c0219d52 SHA1 81c047f180e43eb1e6b0309ee8d6751950ce1b97 SHA256 ddc836ca2e7b2abac20450fc6eb8c7d30277c567d23051016b903ece1d07a6b2
|
||||
AUX php-5.2.10-pdo_dblib.patch 559 RMD160 062604e291113b2bb86044b5eeffb72fad210fbc SHA1 d59d26e6557dac86e582e1a6ed7bb4795cf150c6 SHA256 0548d63d7379cd19f7ade6ca1222b1b577f684b142ff6b0e8e23742b1f7f9794
|
||||
AUX php-5.2.12-libpng14.patch 222 RMD160 d63bd712d077d9606a02d6620c7084bca7197c01 SHA1 a25a47386d625a47698094fc4825208c6ec8f2a4 SHA256 af94a9c2a104dcb037aa059dd46b6f534adb939ea44ad4cb9e3a0a7c49b64fab
|
||||
AUX php-fpm-gentooified.patch 1846 RMD160 60b07cfcf41d41f453aba9a2747dc3d0a26fa016 SHA1 997e4e15057e497a8513a51225cdb9bd29fedd0a SHA256 262c02ad320408314e7635d403bd89b711374fcee09ecb37375e3406a0cc944a
|
||||
AUX php-fpm.init 385 RMD160 0e266738ceb3853ce335db6375b5438bdea597db SHA1 bce556ebbd17e5192250f70ead99e8c70d9529c1 SHA256 baba8dab2cadc8bdf107e6fe5cede2f5faaabff1281781a0a30b3be79964c94e
|
||||
AUX php5-ldvs 22 RMD160 5846dab2745b68a88175dd4e72d0b8cf4756dd46 SHA1 592398c92575adb14ec972847ce2aca28a7b9c2c SHA256 b79d0e52b1b3b4543b31ad45525ae1c2814a27ea8e676772ab10bf6fb12dfe79
|
||||
DIST php-5.2.13.tar.bz2 9084518 RMD160 9e21d32a7b757d25ed827834b26235ea1eebfcc8 SHA1 7127a21f1b493e3cd43f45cadecdb46b623eb1fb SHA256 2b50a2535e3bb9a98cd4d1633f9452d877276c40b385915261f040d535c7eadb
|
||||
DIST php-5.3.2.tar.bz2 10477662 RMD160 60a8aac0d51511ecaf8dcad9d31bdf072c0c99cf SHA1 79ea4ee3da3a7542d1e348ac963a5b38bcbb4b6b SHA256 9a380a574adcb3a9abe3226e7c3a9bae619e8a1b90842ec2a7edf0ad92afdeda
|
||||
DIST php-5.3.3.tar.bz2 10662227 RMD160 9edb51663feac9b787f8382012893f1ac98fec6a SHA1 9f66716b341119e4e4f8fe3d81b7d0a5daf3cbc8 SHA256 f2876750f3c54854a20e26a03ca229f2fbf89b8ee6176b9c0586cb9b2f0b3f9a
|
||||
DIST php-patchset-5.2.13-r0.tar.bz2 10207 RMD160 b367c17742553fcfbf4cb1b76f8dd4aae9f08cf8 SHA1 20b60e3aef34d0b558f0c896c6981957490b2ba9 SHA256 c71dad65178186786393164a0cb4f056b85f0e00579da3dc2dbe5b863ec4262b
|
||||
DIST php-patchset-5.3.2-r1.tar.bz2 9702 RMD160 40cdb57493dc44640cf0b9ab545d0206e24e2316 SHA1 c60b29edb9cc28658b8da63a82800cd90eef12d4 SHA256 5c75dd05000c90e55a11295ead6aae5aea238001d852c14cb821abd2730aef67
|
||||
DIST php-patchset-5.3.3-r1.tar.bz2 9315 RMD160 965f4a5c2d122be2efd81f69a2357778e1906b09 SHA1 a09146d0f9ee4d3904c62281f1e359fe19f2cfae SHA256 4c7588d2a2c36d30d0a47a097faf6648c9e975e5daab25c3cfcf6de3902e06b3
|
||||
DIST suhosin-patch-5.2.13-0.9.7.patch.gz 22989 RMD160 63a022a5bf0fb8c6688f4c0ebcfaa8a437ea6935 SHA1 e2faf8db2d7facbd44cee2f737ce87732835d341 SHA256 787743e5d201ab2ce3fcc3f252eedd7f167470fa1f55af0646d7f03aab89d184
|
||||
DIST suhosin-patch-5.3.2-0.9.9.1.patch.gz 40847 RMD160 64d8b7ec2ec91fd7a43b0cd95c0aa0df5b666768 SHA1 c48d3f24341d3b0214ca3e980320b23864aa93ba SHA256 a61f081022888bf78997e434744d6c0604194c73a00e70c1165524a0a6329de2
|
||||
DIST suhosin-patch-5.3.3-0.9.10.patch.gz 41298 RMD160 8dcd8b51ea0357b6cc51e70e495e18f341c62f7c SHA1 76675242cfdeff763767900213346af622002490 SHA256 f48489ff7d3fd3fc30429f7349f181c84caf2e03e672eb2d2b55b46adf6f602c
|
||||
EBUILD php-5.2.13.ebuild 16859 RMD160 e899ea551626ec77614931e052189a51b52cac5f SHA1 9092d7dd5eb208954096f67df1a36eef8be37ffa SHA256 95e359d899c9e42e358789029e535a4b54d8ab428a3c83503e0964831ed1775d
|
||||
EBUILD php-5.3.2.ebuild 9228 RMD160 a809dae438ea243e519b4b46d00ebe1cd3eb09ee SHA1 ea00f7476447459337e3c967948293d67ff32818 SHA256 868a4e6dc6a158bcdba7dc4178e2f317273775675caf061e0796ea8ec9f406f0
|
||||
EBUILD php-5.3.3.ebuild 9462 RMD160 115a020c9add0e527cf07b36337875e50d3d68be SHA1 3432126e712aa08e946a99c4b0e38ab6ce9f62a8 SHA256 251baf09c687eec87a475b67710d54140f902c3dcd00c6617bb4588d5f0e31a5
|
||||
MISC ChangeLog 743 RMD160 a227231a1d1d2481b9db728bf1af6d7a478a63a0 SHA1 e92308e32cb15df50feafd9a635f0d6cfac43d4e SHA256 4591c14ab2fe0cb26f815242618e4eb0d25a67720ca2599f37ba2f751976500e
|
||||
MISC metadata.xml 2251 RMD160 4167b367fe5472e090fec27c09a465e558b8caf9 SHA1 059e3863cc1e500cf438f12ca98fe7f4ebd24722 SHA256 f402e3753e18c32922a694ab1bbde615754f26bbebc401b90b18f57bf5e49342
|
2
dev-lang/php/files/20php5-envd
Normal file
2
dev-lang/php/files/20php5-envd
Normal file
@ -0,0 +1,2 @@
|
||||
MANPATH="/usr/lib/php5/man/"
|
||||
CONFIG_PROTECT_MASK="/etc/php/cli-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/apache2-php5/ext-active/"
|
14
dev-lang/php/files/70_mod_php5.conf-apache2
Normal file
14
dev-lang/php/files/70_mod_php5.conf-apache2
Normal file
@ -0,0 +1,14 @@
|
||||
<IfDefine PHP5>
|
||||
# Load the module first
|
||||
<IfModule !mod_php5.c>
|
||||
LoadModule php5_module modules/libphp5.so
|
||||
</IfModule>
|
||||
|
||||
# Set it to handle the files
|
||||
<IfModule mod_mime.c>
|
||||
AddHandler application/x-httpd-php .php .php5 .phtml
|
||||
AddHandler application/x-httpd-php-source .phps
|
||||
</IfModule>
|
||||
|
||||
DirectoryIndex index.php index.phtml
|
||||
</IfDefine>
|
17
dev-lang/php/files/70_mod_php5.conf-apache2-r1
Normal file
17
dev-lang/php/files/70_mod_php5.conf-apache2-r1
Normal file
@ -0,0 +1,17 @@
|
||||
<IfDefine PHP5>
|
||||
# Load the module first
|
||||
<IfModule !mod_php5.c>
|
||||
LoadModule php5_module modules/libphp5.so
|
||||
</IfModule>
|
||||
|
||||
# Set it to handle the files
|
||||
<FilesMatch "\.ph(p5?|tml)$">
|
||||
SetHandler application/x-httpd-php
|
||||
</FilesMatch>
|
||||
|
||||
<FilesMatch "\.phps$">
|
||||
SetHandler application/x-httpd-php-source
|
||||
</FilesMatch>
|
||||
|
||||
DirectoryIndex index.php index.phtml
|
||||
</IfDefine>
|
14
dev-lang/php/files/70_mod_php5_concurr.conf-apache2
Normal file
14
dev-lang/php/files/70_mod_php5_concurr.conf-apache2
Normal file
@ -0,0 +1,14 @@
|
||||
<IfDefine PHP5>
|
||||
# Load the module first
|
||||
<IfModule !mod_php5.c>
|
||||
LoadModule php5_module modules/libphp5.so
|
||||
</IfModule>
|
||||
|
||||
# Set it to handle the files
|
||||
<IfModule mod_mime.c>
|
||||
AddHandler application/x-httpd-php .php .php5 .phtml
|
||||
AddHandler application/x-httpd-php-source .phps
|
||||
</IfModule>
|
||||
|
||||
DirectoryIndex index.php index.phtml
|
||||
</IfDefine>
|
17
dev-lang/php/files/70_mod_php5_concurr.conf-apache2-r1
Normal file
17
dev-lang/php/files/70_mod_php5_concurr.conf-apache2-r1
Normal file
@ -0,0 +1,17 @@
|
||||
<IfDefine PHP5>
|
||||
# Load the module first
|
||||
<IfModule !mod_php5.c>
|
||||
LoadModule php5_module modules/libphp5.so
|
||||
</IfModule>
|
||||
|
||||
# Set it to handle the files
|
||||
<FilesMatch "\.ph(p5?|tml)$">
|
||||
SetHandler application/x-httpd-php5
|
||||
</FilesMatch>
|
||||
|
||||
<FilesMatch "\.phps$">
|
||||
SetHandler application/x-httpd-php5-source
|
||||
</FilesMatch>
|
||||
|
||||
DirectoryIndex index.php index.phtml
|
||||
</IfDefine>
|
9
dev-lang/php/files/eblits/common-v1.eblit
Normal file
9
dev-lang/php/files/eblits/common-v1.eblit
Normal file
@ -0,0 +1,9 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/common-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
|
||||
|
||||
php_set_ini_dir() {
|
||||
PHP_INI_DIR="/etc/php/${1}-php${PHP_MV}"
|
||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
||||
}
|
72
dev-lang/php/files/eblits/pkg_postinst-v1.eblit
Normal file
72
dev-lang/php/files/eblits/pkg_postinst-v1.eblit
Normal file
@ -0,0 +1,72 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/pkg_postinst-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
|
||||
|
||||
eblit-php-pkg_postinst() {
|
||||
# Output some general info to the user
|
||||
if use apache2 ; then
|
||||
APACHE2_MOD_DEFINE="PHP${PHP_MV}"
|
||||
if use concurrentmodphp ; then
|
||||
APACHE2_MOD_CONF="70_mod_php${PHP_MV}_concurr"
|
||||
else
|
||||
APACHE2_MOD_CONF="70_mod_php${PHP_MV}"
|
||||
fi
|
||||
apache-module_pkg_postinst
|
||||
fi
|
||||
|
||||
# Update Apache2 to use mod_php
|
||||
if use apache2 ; then
|
||||
"${ROOT}/usr/sbin/php-select" -t apache2 php${PHP_MV} > /dev/null 2>&1
|
||||
exitStatus=$?
|
||||
if [[ ${exitStatus} == 2 ]] ; then
|
||||
php-select apache2 php${PHP_MV}
|
||||
elif [[ ${exitStatus} == 4 ]] ; then
|
||||
ewarn "To make Apache2 use php-${PHP_MV}, use"
|
||||
ewarn " php-select apache2 php${PHP_MV}"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the symlinks for php-cli
|
||||
if use cli ; then
|
||||
"${ROOT}/usr/sbin/php-select" -t php php${PHP_MV} > /dev/null 2>&1
|
||||
exitStatus=$?
|
||||
if [[ ${exitStatus} == 5 ]] ; then
|
||||
php-select php php${PHP_MV}
|
||||
elif [[ ${exitStatus} == 4 ]] ; then
|
||||
ewarn "To make usr/bin/php point to php-${PHP_MV}, use"
|
||||
ewarn " php-select php php${PHP_MV}"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the symlinks for php-cgi
|
||||
if use cgi ; then
|
||||
"${ROOT}/usr/sbin/php-select" -t php-cgi php${PHP_MV} > /dev/null 2>&1
|
||||
exitStatus=$?
|
||||
if [[ ${exitStatus} == 5 ]] ; then
|
||||
php-select php-cgi php${PHP_MV}
|
||||
elif [[ ${exitStatus} == 4 ]] ; then
|
||||
ewarn "To make usr/bin/php-cgi point to php-${PHP_MV}, use"
|
||||
ewarn " php-select php-cgi php${PHP_MV}"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the symlinks for php-devel
|
||||
"${ROOT}/usr/sbin/php-select" -t php-devel php${PHP_MV} > /dev/null 2>&1
|
||||
exitStatus=$?
|
||||
if [[ $exitStatus == 5 ]] ; then
|
||||
php-select php-devel php${PHP_MV}
|
||||
elif [[ $exitStatus == 4 ]] ; then
|
||||
ewarn "To make usr/bin/php-config and usr/bin/phpize point to php-${PHP_MV}, use"
|
||||
ewarn " php-select php-devel php${PHP_MV}"
|
||||
ewarn
|
||||
fi
|
||||
|
||||
ewarn "You may have to recompile third-party extensions now"
|
||||
ewarn "(includes every dev-php5/pecl-* package and probably others in that category)"
|
||||
ewarn
|
||||
}
|
||||
|
||||
|
28
dev-lang/php/files/eblits/pkg_setup-v1.eblit
Normal file
28
dev-lang/php/files/eblits/pkg_setup-v1.eblit
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/pkg_setup-v1.eblit,v 1.2 2010/07/08 22:39:52 mabi Exp $
|
||||
|
||||
eblit-php-pkg_setup() {
|
||||
if use concurrentmodphp || use kolab ; then
|
||||
ewarn "concurrentmodphp and kolab are Gentoo-specific experimental"
|
||||
ewarn "patches. Before reporting any bugs to bugs.php.net, make sure to"
|
||||
ewarn "rebuild PHP with those USE flags disabled"
|
||||
ewarn
|
||||
fi
|
||||
|
||||
# Mail support
|
||||
php_check_mta
|
||||
|
||||
# imap support
|
||||
# if virtuals/imap-c-client goes to new style virtual, we can exchange this
|
||||
# for proper use-deps
|
||||
php_check_imap
|
||||
|
||||
# Oracle support
|
||||
php_check_oracle_8
|
||||
|
||||
phpconfutils_warn_about_external_deps
|
||||
depend.apache_pkg_setup
|
||||
}
|
||||
|
||||
|
90
dev-lang/php/files/eblits/src_compile-v1.eblit
Normal file
90
dev-lang/php/files/eblits/src_compile-v1.eblit
Normal file
@ -0,0 +1,90 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_compile-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
|
||||
|
||||
eblit-php-src_compile() {
|
||||
SAPI_DIR="${WORKDIR}/sapis"
|
||||
local is_first_sapi=1
|
||||
|
||||
for sapi in ${SAPIS} ; do
|
||||
use "${sapi}" || continue
|
||||
if [[ ${is_first_sapi} == 1 ]]; then
|
||||
is_first_sapi=0
|
||||
else
|
||||
emake clean
|
||||
fi
|
||||
|
||||
php_sapi_build "${sapi}"
|
||||
php_sapi_copy "${sapi}"
|
||||
done
|
||||
}
|
||||
|
||||
php_sapi_build() {
|
||||
local sapi="$1"
|
||||
php_set_ini_dir "${sapi}"
|
||||
|
||||
mkdir -p "${SAPI_DIR}/${sapi}"
|
||||
|
||||
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
|
||||
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
|
||||
|
||||
for one_sapi in $SAPIS ; do
|
||||
case "$one_sapi" in
|
||||
cli|cgi|embed|fpm)
|
||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
||||
sapi_conf="${sapi_conf} --enable-${one_sapi}"
|
||||
else
|
||||
sapi_conf="${sapi_conf} --disable-${one_sapi}"
|
||||
fi
|
||||
;;
|
||||
|
||||
apache2)
|
||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
||||
sapi_conf="${sapi_conf} --with-apxs2=/usr/sbin/apxs"
|
||||
else
|
||||
sapi_conf="${sapi_conf} --without-apxs2"
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
done
|
||||
|
||||
econf ${sapi_conf}
|
||||
emake || die "emake failed"
|
||||
}
|
||||
|
||||
php_sapi_copy() {
|
||||
local sapi="$1"
|
||||
local source=""
|
||||
|
||||
case "$sapi" in
|
||||
cli)
|
||||
source="sapi/cli/php"
|
||||
;;
|
||||
cgi)
|
||||
source="sapi/cgi/php-cgi"
|
||||
;;
|
||||
fpm)
|
||||
source="sapi/fpm/php-fpm"
|
||||
;;
|
||||
embed)
|
||||
source="libs/libphp${PHP_MV}.so"
|
||||
;;
|
||||
|
||||
apache2)
|
||||
# apache2 is a special case; the necessary files
|
||||
# (yes, multiple) are copied by make install, not
|
||||
# by the ebuild; that's the reason, why apache2 has
|
||||
# to be the last sapi
|
||||
emake INSTALL_ROOT="${SAPI_DIR}/${sapi}/" install-sapi
|
||||
;;
|
||||
|
||||
*)
|
||||
die "unhandled sapi in php_sapi_copy"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "${source}" ]] ; then
|
||||
cp "$source" "${SAPI_DIR}/$sapi" || die "Unable to copy ${sapi} SAPI"
|
||||
fi
|
||||
}
|
246
dev-lang/php/files/eblits/src_configure-v1.eblit
Normal file
246
dev-lang/php/files/eblits/src_configure-v1.eblit
Normal file
@ -0,0 +1,246 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_configure-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
|
||||
|
||||
eblit-php-src_configure() {
|
||||
PHP_DESTDIR="/usr/$(get_libdir)/php${PHP_MV}"
|
||||
|
||||
# This is a global variable and should be in caps. It isn't because the
|
||||
# phpconfutils eclass relies on exactly this name...
|
||||
# for --with-libdir see bug #327025
|
||||
my_conf="
|
||||
--prefix="${PHP_DESTDIR}"
|
||||
--mandir="${PHP_DESTDIR}"/man
|
||||
--infodir="${PHP_DESTDIR}"/info
|
||||
--libdir="${PHP_DESTDIR}"/lib
|
||||
--with-libdir=$(get_libdir)
|
||||
--without-pear
|
||||
$(use_enable threads maintainer-zts)"
|
||||
|
||||
phpconfutils_init
|
||||
|
||||
# extension USE flag shared
|
||||
phpconfutils_extension_enable "bcmath" "bcmath" 1
|
||||
phpconfutils_extension_with "bz2" "bzip2" 1
|
||||
phpconfutils_extension_enable "calendar" "calendar" 1
|
||||
phpconfutils_extension_disable "ctype" "ctype" 0
|
||||
phpconfutils_extension_with "curl" "curl" 1
|
||||
phpconfutils_extension_with "curlwrappers" "curlwrappers" 0
|
||||
phpconfutils_extension_disable "dom" "xml" 0
|
||||
phpconfutils_extension_with "enchant" "enchant" 1 "/usr"
|
||||
phpconfutils_extension_enable "exif" "exif" 1
|
||||
phpconfutils_extension_disable "fileinfo" "fileinfo" 1
|
||||
phpconfutils_extension_disable "filter" "filter" 0
|
||||
phpconfutils_extension_enable "ftp" "ftp" 1
|
||||
phpconfutils_extension_with "gettext" "nls" 1
|
||||
phpconfutils_extension_with "gmp" "gmp" 1
|
||||
phpconfutils_extension_disable "hash" "hash" 0
|
||||
phpconfutils_extension_without "iconv" "iconv" 0
|
||||
phpconfutils_extension_enable "intl" "intl" 1
|
||||
phpconfutils_extension_disable "ipv6" "ipv6" 0
|
||||
phpconfutils_extension_disable "json" "json" 0
|
||||
phpconfutils_extension_with "kerberos" "kerberos" 0 "/usr"
|
||||
phpconfutils_extension_disable "libxml" "xml" 0
|
||||
phpconfutils_extension_enable "mbstring" "unicode" 1
|
||||
phpconfutils_extension_with "mcrypt" "crypt" 1
|
||||
phpconfutils_extension_with "mssql" "mssql" 1
|
||||
phpconfutils_extension_with "onig" "unicode" 0 "/usr"
|
||||
phpconfutils_extension_with "openssl" "ssl" 0
|
||||
phpconfutils_extension_with "openssl-dir" "ssl" 0 "/usr"
|
||||
phpconfutils_extension_enable "pcntl" "pcntl" 1
|
||||
phpconfutils_extension_disable "phar" "phar" 1
|
||||
phpconfutils_extension_disable "pdo" "pdo" 0
|
||||
phpconfutils_extension_with "pgsql" "postgres" 1
|
||||
phpconfutils_extension_disable "posix" "posix" 0
|
||||
phpconfutils_extension_with "pspell" "spell" 1
|
||||
phpconfutils_extension_with "recode" "recode" 1
|
||||
phpconfutils_extension_disable "simplexml" "simplexml" 0
|
||||
phpconfutils_extension_enable "shmop" "sharedmem" 0
|
||||
phpconfutils_extension_with "snmp" "snmp" 1
|
||||
phpconfutils_extension_enable "soap" "soap" 1
|
||||
phpconfutils_extension_enable "sockets" "sockets" 1
|
||||
phpconfutils_extension_without "sqlite3" "sqlite3" 1 "/usr"
|
||||
phpconfutils_extension_with "sybase-ct" "sybase-ct" 1
|
||||
phpconfutils_extension_enable "sysvmsg" "sysvipc" 1
|
||||
phpconfutils_extension_enable "sysvsem" "sysvipc" 1
|
||||
phpconfutils_extension_enable "sysvshm" "sysvipc" 1
|
||||
phpconfutils_extension_with "tidy" "tidy" 1
|
||||
phpconfutils_extension_disable "tokenizer" "tokenizer" 0
|
||||
phpconfutils_extension_enable "wddx" "wddx" 1
|
||||
phpconfutils_extension_disable "xml" "xml" 0
|
||||
phpconfutils_extension_disable "xmlreader" "xmlreader" 0
|
||||
phpconfutils_extension_disable "xmlwriter" "xmlwriter" 0
|
||||
phpconfutils_extension_with "xmlrpc" "xmlrpc" 1
|
||||
phpconfutils_extension_with "xsl" "xsl" 1
|
||||
phpconfutils_extension_enable "zip" "zip" 1
|
||||
phpconfutils_extension_with "zlib" "zlib" 1
|
||||
phpconfutils_extension_enable "debug" "debug" 0
|
||||
|
||||
# DBA support
|
||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
||||
|| use qdbm ; then
|
||||
my_conf="${my_conf} --enable-dba${shared}"
|
||||
fi
|
||||
|
||||
# DBA drivers support
|
||||
phpconfutils_extension_with "cdb" "cdb" 0
|
||||
phpconfutils_extension_with "db4" "berkdb" 0
|
||||
phpconfutils_extension_enable "flatfile" "flatfile" 0
|
||||
phpconfutils_extension_with "gdbm" "gdbm" 0
|
||||
phpconfutils_extension_enable "inifile" "inifile" 0
|
||||
phpconfutils_extension_with "qdbm" "qdbm" 0
|
||||
|
||||
# Support for the GD graphics library
|
||||
if use gd-external ; then
|
||||
phpconfutils_extension_with "freetype-dir" "truetype" 0 "/usr"
|
||||
phpconfutils_extension_with "t1lib" "truetype" 0 "/usr"
|
||||
phpconfutils_extension_enable "gd-jis-conv" "cjk" 0
|
||||
phpconfutils_extension_with "gd" "gd-external" 1 "/usr"
|
||||
else
|
||||
phpconfutils_extension_with "freetype-dir" "truetype" 0 "/usr"
|
||||
phpconfutils_extension_with "t1lib" "truetype" 0 "/usr"
|
||||
phpconfutils_extension_enable "gd-jis-conv" "cjk" 0
|
||||
phpconfutils_extension_with "jpeg-dir" "gd" 0 "/usr"
|
||||
phpconfutils_extension_with "png-dir" "gd" 0 "/usr"
|
||||
phpconfutils_extension_with "xpm-dir" "xpm" 0 "/usr"
|
||||
# enable gd last, so configure can pick up the previous settings
|
||||
phpconfutils_extension_with "gd" "gd" 0
|
||||
fi
|
||||
|
||||
# IMAP support
|
||||
if use imap ; then
|
||||
phpconfutils_extension_with "imap" "imap" 1
|
||||
phpconfutils_extension_with "imap-ssl" "ssl" 0
|
||||
fi
|
||||
|
||||
phpconfutils_extension_with "interbase" "interbase" 0 "/opt"
|
||||
phpconfutils_extension_with "interbase" "firebird" 0 "/usr"
|
||||
|
||||
# LDAP support
|
||||
if use ldap ; then
|
||||
if use oci8 ; then
|
||||
phpconfutils_extension_with "ldap" "ldap" 1 "${ORACLE_HOME}"
|
||||
else
|
||||
phpconfutils_extension_with "ldap" "ldap" 1
|
||||
phpconfutils_extension_with "ldap-sasl" "ldap-sasl" 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# MySQL support
|
||||
if use mysql ; then
|
||||
if use mysqlnd ; then
|
||||
phpconfutils_extension_with "mysql" "mysql" 1 "mysqlnd"
|
||||
else
|
||||
phpconfutils_extension_with "mysql" "mysql" 1 "/usr"
|
||||
fi
|
||||
phpconfutils_extension_with "mysql-sock" "mysql" 0 "/var/run/mysqld/mysqld.sock"
|
||||
fi
|
||||
|
||||
# MySQLi support
|
||||
if use mysqlnd ; then
|
||||
phpconfutils_extension_with "mysqli" "mysqli" 1 "mysqlnd"
|
||||
else
|
||||
phpconfutils_extension_with "mysqli" "mysqli" 1 "/usr/bin/mysql_config"
|
||||
fi
|
||||
|
||||
# ODBC support
|
||||
if use odbc ; then
|
||||
phpconfutils_extension_with "unixODBC" "odbc" 1 "/usr"
|
||||
phpconfutils_extension_with "adabas" "adabas" 1
|
||||
phpconfutils_extension_with "birdstep" "birdstep" 1
|
||||
phpconfutils_extension_with "dbmaker" "dbmaker" 1
|
||||
phpconfutils_extension_with "empress" "empress" 1
|
||||
if use empress ; then
|
||||
phpconfutils_extension_with "empress-bcs" "empress-bcs" 0
|
||||
fi
|
||||
phpconfutils_extension_with "esoob" "esoob" 1
|
||||
phpconfutils_extension_with "ibm-db2" "db2" 1
|
||||
phpconfutils_extension_with "sapdb" "sapdb" 1
|
||||
phpconfutils_extension_with "solid" "solid" 1
|
||||
fi
|
||||
|
||||
if use iodbc ; then
|
||||
phpconfutils_extension_with "iodbc" "iodbc" 1 "/usr"
|
||||
fi
|
||||
|
||||
# Oracle support
|
||||
phpconfutils_extension_with "oci8" "oci8" 1
|
||||
if use oci8-instant-client ; then
|
||||
OCI8IC_PKG="$(best_version dev-db/oracle-instantclient-basic | \
|
||||
sed -e 's|dev-db/oracle-instantclient-basic-||g' | \
|
||||
sed -e 's|-r.*||g')"
|
||||
|
||||
phpconfutils_extension_with "oci8" "oci8-instant-client" 1 \
|
||||
"instantclient,/usr/lib/oracle/${OCI8IC_PKG}/client/lib"
|
||||
fi
|
||||
|
||||
# PDO support
|
||||
if use pdo ; then
|
||||
phpconfutils_extension_with "pdo-dblib" "mssql" 1
|
||||
if use mysqlnd ; then
|
||||
phpconfutils_extension_with "pdo-mysql" "mysql" 1 "mysqlnd"
|
||||
else
|
||||
phpconfutils_extension_with "pdo-mysql" "mysql" 1 "/usr"
|
||||
fi
|
||||
phpconfutils_extension_with "pdo-pgsql" "postgres" 1
|
||||
phpconfutils_extension_with "pdo-sqlite" "sqlite" 1 "/usr"
|
||||
phpconfutils_extension_with "pdo-odbc" "odbc" 1 "unixODBC,/usr"
|
||||
if use oci8 ; then
|
||||
phpconfutils_extension_with "pdo-oci" "oci8" 1
|
||||
fi
|
||||
if use oci8-instant-client ; then
|
||||
phpconfutils_extension_with "pdo-oci" "oci8-instant-client" 1 \
|
||||
"instantclient,/usr,${OCI8IC_PKG}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# readline/libedit support
|
||||
phpconfutils_extension_with "readline" "readline" 0
|
||||
phpconfutils_extension_with "libedit" "libedit" 0
|
||||
|
||||
# Session support
|
||||
if use session ; then
|
||||
phpconfutils_extension_with "mm" "sharedmem" 0
|
||||
else
|
||||
phpconfutils_extension_disable "session" "session" 0
|
||||
fi
|
||||
|
||||
# SQLite support
|
||||
if use sqlite ; then
|
||||
phpconfutils_extension_with "sqlite" "sqlite" 0 "/usr"
|
||||
phpconfutils_extension_enable "sqlite-utf8" "unicode" 0
|
||||
else
|
||||
phpconfutils_extension_without "sqlite" "sqlite" 0
|
||||
fi
|
||||
|
||||
if use pic ; then
|
||||
my_conf="${my_conf} --with-pic"
|
||||
fi
|
||||
|
||||
if has fpm ${IUSE//+} && use fpm ; then
|
||||
my_conf="${my_conf} --with-libevent-dir=/usr/lib"
|
||||
fi
|
||||
|
||||
|
||||
# we use the system copy of pcre
|
||||
# --with-pcre-regex affects ext/pcre
|
||||
# --with-pcre-dir affects ext/filter and ext/zip
|
||||
my_conf="${my_conf} --with-pcre-regex=/usr --with-pcre-dir=/usr"
|
||||
|
||||
# Catch CFLAGS problems
|
||||
php_check_cflags
|
||||
|
||||
# Support user-passed configuration parameters
|
||||
my_conf="${my_conf} ${EXTRA_ECONF:-}"
|
||||
|
||||
# Support the Apache2 extras, they must be set globally for all
|
||||
# SAPIs to work correctly, especially for external PHP extensions
|
||||
if use apache2 ; then
|
||||
# Concurrent PHP Apache2 modules support
|
||||
if use concurrentmodphp ; then
|
||||
append-ldflags "-Wl,--version-script=${FILESDIR}/php${PHP_MV}-ldvs"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
140
dev-lang/php/files/eblits/src_install-v1.eblit
Normal file
140
dev-lang/php/files/eblits/src_install-v1.eblit
Normal file
@ -0,0 +1,140 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_install-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
|
||||
|
||||
eblit-php-src_install() {
|
||||
# Makefile forgets to create this before trying to write to it...
|
||||
dodir "${PHP_DESTDIR}/bin"
|
||||
|
||||
# Install php environment (without any sapis)
|
||||
emake INSTALL_ROOT="${D}" \
|
||||
install-build install-headers install-programs \
|
||||
|| die "emake install failed"
|
||||
|
||||
local extension_dir="$("${D}/${PHP_DESTDIR}/bin/php-config" --extension-dir)"
|
||||
|
||||
# And install the modules to it
|
||||
if use sharedext ; then
|
||||
insinto "${extension_dir}"
|
||||
doins "${S}/modules/"*.so
|
||||
fi
|
||||
|
||||
# Generate the USE file for PHP
|
||||
phpconfutils_generate_usefile
|
||||
|
||||
# Create the directory where we'll put version-specific php scripts
|
||||
keepdir /usr/share/php${PHP_MV}
|
||||
|
||||
local sapi="", file=""
|
||||
local sapi_list=""
|
||||
|
||||
for sapi in ${SAPIS}; do
|
||||
if use "${sapi}" ; then
|
||||
einfo "Installing SAPI: ${sapi}"
|
||||
# needed each time, php_install_ini would reset it
|
||||
into "${PHP_DESTDIR}"
|
||||
file=$(find "${SAPI_DIR}/${sapi}/" -type f | head -n 1)
|
||||
|
||||
if [[ "${file: -3}" == ".so" ]]; then
|
||||
if [[ "${sapi}" == "apache2" ]]; then
|
||||
insinto "${PHP_DESTDIR}/../apache2/modules/"
|
||||
newins "${file}" "${file/*\/}"
|
||||
else
|
||||
dolib.so "${file}" || die "Unable to install ${sapi} sapi"
|
||||
fi
|
||||
else
|
||||
dobin "${file}" || die "Unable to install ${sapi} sapi"
|
||||
fi
|
||||
|
||||
php_install_ini "${sapi}"
|
||||
|
||||
# construct correct SAPI string for php-config
|
||||
# thanks to ferringb for the bash voodoo
|
||||
if [[ "${sapi}" == "apache2" ]]; then
|
||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
||||
else
|
||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Install env.d files
|
||||
newenvd "${FILESDIR}/20php${PHP_MV}-envd" \
|
||||
"20php${PHP_MV}"
|
||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i \
|
||||
"${D}/etc/env.d/20php${PHP_MV}"
|
||||
|
||||
# set php-config variable correctly (bug #278439)
|
||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
||||
"${D}/usr/$(get_libdir)/php5/bin/php-config"
|
||||
}
|
||||
|
||||
php_install_ini() {
|
||||
local phpsapi="${1}"
|
||||
|
||||
# work out where we are installing the ini file
|
||||
php_set_ini_dir "${phpsapi}"
|
||||
|
||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
|
||||
|
||||
# default to expose_php=Off, bug 300695
|
||||
sed -e 's|^expose_php .*|expose_php = Off|g' -i "${phpinisrc}"
|
||||
|
||||
# Set the extension dir
|
||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
|
||||
|
||||
# Set the include path to point to where we want to find PEAR packages
|
||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php'${PHP_MV}':/usr/share/php"|' -i "${phpinisrc}"
|
||||
|
||||
dodir "${PHP_INI_DIR}"
|
||||
insinto "${PHP_INI_DIR}"
|
||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
||||
|
||||
dodir "${PHP_EXT_INI_DIR}"
|
||||
dodir "${PHP_EXT_INI_DIR_ACTIVE}"
|
||||
|
||||
# Install any extensions built as shared objects
|
||||
if use sharedext ; then
|
||||
insinto "${PHP_EXT_INI_DIR}"
|
||||
for extension in "${D}/${extension_dir}/"*.so ; do
|
||||
extension="${extension##*/}"
|
||||
inifilename="${extension/.so/.ini}"
|
||||
echo "extension=${extension}" > "${S}/modules/$inifilename"
|
||||
doins "${S}/modules/$inifilename"
|
||||
dosym "${PHP_EXT_INI_DIR}/${inifilename}" "${PHP_EXT_INI_DIR_ACTIVE}/${inifilename}"
|
||||
done
|
||||
fi
|
||||
|
||||
# SAPI-specific handling
|
||||
if [[ "${sapi}" == "apache2" ]] ; then
|
||||
if use concurrentmodphp ; then
|
||||
einfo "Installing Apache2 config file 70_mod_php${PHP_MV}_concurr.conf"
|
||||
insinto "${APACHE_MODULES_CONFDIR}"
|
||||
newins "${FILESDIR}/70_mod_php${PHP_MV}_concurr.conf-apache2" \
|
||||
"70_mod_php${PHP_MV}_concurr.conf"
|
||||
|
||||
# Put the ld version script in the right place so
|
||||
# it's always accessible
|
||||
insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
|
||||
doins "${FILESDIR}/php${PHP_MV}-ldvs"
|
||||
else
|
||||
einfo "Installing Apache2 config 70_mod_php${PHP_MV}.conf)"
|
||||
insinto ${APACHE_MODULES_CONFDIR}
|
||||
newins "${FILESDIR}/70_mod_php${PHP_MV}.conf-apache2" \
|
||||
"70_mod_php${PHP_MV}.conf"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${sapi}" == "fpm" ]] ; then
|
||||
einfo "Installing FPM CGI config file php-fpm.conf"
|
||||
epatch "${FILESDIR}/php-fpm-gentooified.patch"
|
||||
insinto ${PHP_INI_DIR}
|
||||
doins "${S}/sapi/fpm/php-fpm.conf"
|
||||
dodir "/etc/init.d"
|
||||
insinto "/etc/init.d"
|
||||
newins "${FILESDIR}/php-fpm.init" "php-fpm"
|
||||
fperms 755 "/etc/init.d/php-fpm"
|
||||
dosym "${PHP_DESTDIR}/bin/php-fpm" "/usr/bin/php-fpm"
|
||||
fi
|
||||
}
|
70
dev-lang/php/files/eblits/src_prepare-v1.eblit
Normal file
70
dev-lang/php/files/eblits/src_prepare-v1.eblit
Normal file
@ -0,0 +1,70 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_prepare-v1.eblit,v 1.3 2010/06/01 16:17:05 mabi Exp $
|
||||
|
||||
eblit-php-src_prepare() {
|
||||
# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
|
||||
# ([empty session.save_path]/session_mm_[sapi][gid].sem)
|
||||
# there is no easy way to circumvent that, all php calls during
|
||||
# install use -n, so no php.ini file will be used.
|
||||
# As such, this is the easiest way to get around
|
||||
addpredict /session_mm_cli250.sem
|
||||
addpredict /session_mm_cli0.sem
|
||||
|
||||
# Concurrent PHP Apache2 modules support
|
||||
use apache2 && use concurrentmodphp && \
|
||||
epatch "${WORKDIR}/${PV}/opt/concurrent_apache_modules.patch"
|
||||
|
||||
# kolab support (support for imap annotations)
|
||||
use kolab && epatch "${WORKDIR}/${PV}/opt/imap-kolab-annotations.patch"
|
||||
|
||||
# Change PHP branding
|
||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1${PHP_EXTRA_BRANDING}-pl${PR/r/}-gentoo\2|g" \
|
||||
-i configure.in || die "Unable to change PHP branding"
|
||||
|
||||
# Apply generic PHP patches
|
||||
EPATCH_SOURCE="${WORKDIR}/${PV}/generic" EPATCH_SUFFIX="patch" \
|
||||
EPATCH_FORCE="yes" \
|
||||
EPATCH_MULTI_MSG="Applying generic patches and fixes from upstream..." epatch
|
||||
|
||||
# Patch PHP to show Gentoo as the server platform
|
||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
||||
-i configure.in || die "Failed to fix server platform name"
|
||||
|
||||
# Prevent PHP from activating the Apache config,
|
||||
# as we will do that ourselves
|
||||
sed -i \
|
||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4
|
||||
|
||||
# Patch PHP to support heimdal instead of mit-krb5
|
||||
if has_version "app-crypt/heimdal" ; then
|
||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
||||
|| die "Failed to fix heimdal libname"
|
||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
||||
|| die "Failed to fix heimdal crypt library reference"
|
||||
fi
|
||||
|
||||
# Suhosin support
|
||||
if use suhosin ; then
|
||||
epatch "${WORKDIR}/${SUHOSIN_PATCH}"
|
||||
fi
|
||||
|
||||
# rebuild the whole autotools stuff as we are heavily patching it
|
||||
# (suhosin, fastbuild, ...)
|
||||
|
||||
# eaclocal doesn't accept --force, so we try to force re-generation
|
||||
# this way
|
||||
rm aclocal.m4
|
||||
|
||||
# work around divert() issues with newer autoconf, bug #281697
|
||||
if has_version '>=sys-devel/autoconf-2.64' ; then
|
||||
sed -i -r \
|
||||
-e 's:^((m4_)?divert)[(]([0-9]*)[)]:\1(600\3):' \
|
||||
$(grep -l divert $(find . -name '*.m4') configure.in) || die
|
||||
fi
|
||||
eautoreconf --force -W no-cross
|
||||
}
|
||||
|
||||
|
54
dev-lang/php/files/eblits/src_test-v1.eblit
Normal file
54
dev-lang/php/files/eblits/src_test-v1.eblit
Normal file
@ -0,0 +1,54 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_test-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
|
||||
|
||||
eblit-php-src_test() {
|
||||
vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
||||
|
||||
if [[ ! -x "${S}/sapi/cli/php" ]] ; then
|
||||
ewarn "Test phase requires USE=cli, skipping"
|
||||
return
|
||||
else
|
||||
export TEST_PHP_EXECUTABLE="${S}/sapi/cli/php"
|
||||
fi
|
||||
|
||||
if [[ -x "${S}/sapi/cgi/php-cgi" ]] ; then
|
||||
export TEST_PHP_CGI_EXECUTABLE="${S}/sapi/cgi/php-cgi"
|
||||
fi
|
||||
|
||||
|
||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \
|
||||
"${S}/run-tests.php" -n -q -d "session.save_path=${T}"
|
||||
|
||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null
|
||||
done
|
||||
|
||||
local failed="$(find -name '*.out')"
|
||||
if [[ ${failed} != "" ]] ; then
|
||||
ewarn "The following test cases failed unexpectedly:"
|
||||
for name in ${failed}; do
|
||||
ewarn " ${name/.out/}"
|
||||
done
|
||||
else
|
||||
einfo "No unexpected test failures, all fine"
|
||||
fi
|
||||
|
||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
||||
local passed=""
|
||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
||||
[[ -f "${name}.diff" ]] && continue
|
||||
passed="${passed} ${name}"
|
||||
done
|
||||
if [[ ${passed} != "" ]] ; then
|
||||
einfo "The following test cases passed unexpectedly:"
|
||||
for name in ${passed}; do
|
||||
ewarn " ${passed}"
|
||||
done
|
||||
else
|
||||
einfo "None of the known-to-fail tests passed, all fine"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
16
dev-lang/php/files/php-5.2.10-pdo_dblib.patch
Normal file
16
dev-lang/php/files/php-5.2.10-pdo_dblib.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff -Naur php-5.2.10.old/ext/pdo_dblib/dblib_driver.c php-5.2.10/ext/pdo_dblib/dblib_driver.c
|
||||
--- php-5.2.10.old/ext/pdo_dblib/dblib_driver.c 2009-03-20 23:14:17.000000000 +0100
|
||||
+++ php-5.2.10/ext/pdo_dblib/dblib_driver.c 2009-09-25 00:19:31.000000000 +0200
|
||||
@@ -230,9 +230,9 @@
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
- if (DBSETOPT(H->link, DBTEXTLIMIT, "2147483647") == FAIL) {
|
||||
- goto cleanup;
|
||||
- }
|
||||
+// if (DBSETOPT(H->link, DBTEXTLIMIT, "2147483647") == FAIL) {
|
||||
+// goto cleanup;
|
||||
+// }
|
||||
|
||||
if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) {
|
||||
goto cleanup;
|
11
dev-lang/php/files/php-5.2.12-libpng14.patch
Normal file
11
dev-lang/php/files/php-5.2.12-libpng14.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- ext/gd/libgd/gd_png.c
|
||||
+++ ext/gd/libgd/gd_png.c
|
||||
@@ -139,7 +139,7 @@
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- if (!png_check_sig (sig, 8)) { /* bad signature */
|
||||
+ if (png_sig_cmp (sig, 0, 8)) { /* bad signature */
|
||||
return NULL;
|
||||
}
|
||||
|
12
dev-lang/php/files/php-5.2.13-gmp5.patch
Normal file
12
dev-lang/php/files/php-5.2.13-gmp5.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr php-5.2.13/ext/gmp/gmp.c php-5.2.13.orig//ext/gmp/gmp.c
|
||||
--- php-5.2.13/ext/gmp/gmp.c 2010-07-27 11:39:15.000000000 +0200
|
||||
+++ php-5.2.13.orig//ext/gmp/gmp.c 2010-07-27 11:37:40.000000000 +0200
|
||||
@@ -1396,7 +1396,7 @@
|
||||
|
||||
GMPG(rand_initialized) = 1;
|
||||
}
|
||||
- mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * __GMP_BITS_PER_MP_LIMB);
|
||||
+ mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS);
|
||||
|
||||
ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp);
|
||||
}
|
55
dev-lang/php/files/php-fpm-gentooified.patch
Normal file
55
dev-lang/php/files/php-fpm-gentooified.patch
Normal file
@ -0,0 +1,55 @@
|
||||
--- sapi/fpm/php-fpm.conf.orig 2010-06-03 21:04:30.000000000 +0200
|
||||
+++ sapi/fpm/php-fpm.conf 2010-06-03 22:40:41.000000000 +0200
|
||||
@@ -8,7 +8,7 @@
|
||||
; Include one or more files. If glob(3) exists, it is used to include a bunch of
|
||||
; files from a glob(3) pattern. This directive can be used everywhere in the
|
||||
; file.
|
||||
-;include=/etc/fpm.d/*.conf
|
||||
+;include=/etc/php/fpm-php5/fpm.d/*.conf
|
||||
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
; Global Options ;
|
||||
@@ -17,11 +17,11 @@
|
||||
[global]
|
||||
; Pid file
|
||||
; Default Value: none
|
||||
-;pid = /var/lib/run/php-fpm.pid
|
||||
+;pid = /var/run/php-fpm.pid
|
||||
|
||||
; Error log file
|
||||
; Default Value: /var/lib/log/php-fpm.log
|
||||
-;error_log = /var/lib/log/php-fpm.log
|
||||
+error_log = /var/log/php-fpm.log
|
||||
|
||||
; Log level
|
||||
; Possible Values: alert, error, warning, notice, debug
|
||||
@@ -133,17 +133,17 @@
|
||||
; The number of child processes created on startup.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
|
||||
-;pm.start_servers = 20
|
||||
+pm.start_servers = 20
|
||||
|
||||
; The desired minimum number of idle server processes.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Note: Mandatory when pm is set to 'dynamic'
|
||||
-;pm.min_spare_servers = 5
|
||||
+pm.min_spare_servers = 5
|
||||
|
||||
; The desired maximum number of idle server processes.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Note: Mandatory when pm is set to 'dynamic'
|
||||
-;pm.max_spare_servers = 35
|
||||
+pm.max_spare_servers = 35
|
||||
|
||||
; The number of requests each child process should execute before respawning.
|
||||
; This can be useful to work around memory leaks in 3rd party libraries. For
|
||||
@@ -213,7 +213,7 @@
|
||||
|
||||
; The log file for slow requests
|
||||
; Default Value: /var/lib/log/php-fpm.log.slow
|
||||
-;slowlog = /var/lib/log/php-fpm.log.slow
|
||||
+;slowlog = /var/log/php-fpm.log.slow
|
||||
|
||||
; Set open file descriptor rlimit.
|
||||
; Default Value: system defined value
|
22
dev-lang/php/files/php-fpm.init
Executable file
22
dev-lang/php/files/php-fpm.init
Executable file
@ -0,0 +1,22 @@
|
||||
#!/sbin/runscript
|
||||
|
||||
PHP_FPM_CONF="/etc/php/fpm-php5/php-fpm.conf"
|
||||
|
||||
opts="depend start stop reload"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use apache2 lighttpd nginx
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting PHP FastCGI server"
|
||||
start-stop-daemon --start --exec /usr/bin/php-fpm -- -y "${PHP_FPM_CONF}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping PHP FastCGI server"
|
||||
start-stop-daemon --stop --name php-fpm
|
||||
eend $?
|
||||
}
|
1
dev-lang/php/files/php5-ldvs
Normal file
1
dev-lang/php/files/php5-ldvs
Normal file
@ -0,0 +1 @@
|
||||
PHP_5 { global: *; };
|
34
dev-lang/php/metadata.xml
Normal file
34
dev-lang/php/metadata.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<herd>php</herd>
|
||||
<use>
|
||||
<flag name='cli'>Enable CLI SAPI</flag>
|
||||
<flag name='concurrentmodphp'>Make it possible to load both mod_php4 and mod_php5 into the same Apache2 instance (experimental)</flag>
|
||||
<flag name='discard-path'>Switch on common security setting for CGI SAPI</flag>
|
||||
<flag name='embed'>Enable embed SAPI</flag>
|
||||
<flag name='enchant'>Add supports Enchant spelling library.</flag>
|
||||
<flag name='fastbuild'>Build PHP quicker (experimental)</flag>
|
||||
<flag name='fdftk'>Add supports for Adobe's FDF toolkit.</flag>
|
||||
<flag name='fileinfo'>Add fileinfo extension support</flag>
|
||||
<flag name='filter'>Add filter extension support</flag>
|
||||
<flag name='force-cgi-redirect'>Switch on common security setting for CGI SAPI</flag>
|
||||
<flag name='fpm'>Enable the FastCGI Process Manager SAPI</flag>
|
||||
<flag name='hash'>Enable the hash extension</flag>
|
||||
<flag name='intl'>Enables the intl extension for extended internalization support</flag>
|
||||
<flag name='java-external'>Use the external java extension rather than the bundled one</flag>
|
||||
<flag name='json'>Enable JSON support</flag>
|
||||
<flag name='ldap-sasl'>Add SASL support for the PHP LDAP extension</flag>
|
||||
<flag name='mysqlnd'>Use native driver for mysql, mysqli, PDO_Mysql</flag>
|
||||
<flag name='pcre'>Adds support for Perl Compatible Regular Expressions (deprecated: always "on" in php 5.3)</flag>
|
||||
<flag name='pic'>Force shared modules to build as PIC on x86 (speed tradeoff with memory usage)</flag>
|
||||
<flag name='pdo'>Enable the bundled PDO extensions</flag>
|
||||
<flag name='phar'>Enables the phar extension to provide phar archive support</flag>
|
||||
<flag name='reflection'>Enable the reflection extension (Reflection API) (deprecated: always "on" in php 5.3)</flag>
|
||||
<flag name='spl'>Adds support for the Standard PHP Library (deprecated: always "on" in php 5.3)</flag>
|
||||
<flag name='suhosin'>Add Suhosin support (patch and extension from http://www.suhosin.org/)</flag>
|
||||
<flag name='xmlreader'>Enable XMLReader support</flag>
|
||||
<flag name='xmlwriter'>Enable XMLWriter support</flag>
|
||||
<flag name='zip'>Enable ZIP file support</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
552
dev-lang/php/php-5.2.13.ebuild
Normal file
552
dev-lang/php/php-5.2.13.ebuild
Normal file
@ -0,0 +1,552 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.2.13.ebuild,v 1.8 2010/07/05 23:19:20 mabi Exp $
|
||||
|
||||
CGI_SAPI_USE="discard-path force-cgi-redirect"
|
||||
APACHE2_SAPI_USE="concurrentmodphp threads"
|
||||
IUSE="cli cgi ${CGI_SAPI_USE} ${APACHE2_SAPI_USE} fastbuild"
|
||||
|
||||
KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
|
||||
|
||||
# NOTE: Portage doesn't support setting PROVIDE based on the USE flags
|
||||
# that have been enabled, so we have to PROVIDE everything for now
|
||||
# and hope for the best
|
||||
PROVIDE="virtual/php"
|
||||
|
||||
# php package settings
|
||||
SLOT="5"
|
||||
MY_PHP_PV="${PV}"
|
||||
MY_PHP_P="php-${MY_PHP_PV}"
|
||||
PHP_PACKAGE="1"
|
||||
# php patch settings, general
|
||||
PHP_PATCHSET_REV="${PR/r/}"
|
||||
PHP_PATCHSET_URI="http://dev.gentoo.org/~keytoaster/distfiles/php-patchset-${PV}-r${PHP_PATCHSET_REV}.tar.bz2"
|
||||
SUHOSIN_PATCH="suhosin-patch-5.2.13-0.9.7.patch.gz"
|
||||
MULTILIB_PATCH="${MY_PHP_PV}/opt/multilib-search-path.patch"
|
||||
# php patch settings, ebuild specific
|
||||
FASTBUILD_PATCH="${MY_PHP_PV}/opt/fastbuild.patch"
|
||||
CONCURRENTMODPHP_PATCH="${MY_PHP_PV}/opt/concurrent_apache_modules.patch"
|
||||
# kolab patch - http://kolab.org/cgi-bin/viewcvs-kolab.cgi/server/patches/php/
|
||||
# bugs about this go to wrobel@gentoo.org
|
||||
KOLAB_PATCH="${MY_PHP_PV}/opt/kolab-imap-annotations.patch"
|
||||
|
||||
inherit versionator php5_2-sapi apache-module
|
||||
|
||||
# Suhosin patch support
|
||||
[[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? (
|
||||
http://download.suhosin.org/${SUHOSIN_PATCH} )"
|
||||
|
||||
DESCRIPTION="The PHP language runtime engine: CLI, CGI and Apache2 SAPIs."
|
||||
|
||||
DEPEND="app-admin/php-toolkit
|
||||
imap? ( >=virtual/imap-c-client-2006k )
|
||||
pcre? ( >=dev-libs/libpcre-7.8 )
|
||||
xml? ( >=dev-libs/libxml2-2.7.2-r2 )
|
||||
xmlrpc? ( >=dev-libs/libxml2-2.7.2-r2 virtual/libiconv )"
|
||||
|
||||
RDEPEND="${DEPEND}"
|
||||
if [[ -n "${KOLAB_PATCH}" ]] ; then
|
||||
IUSE="${IUSE} kolab"
|
||||
DEPEND="${DEPEND}
|
||||
kolab? ( >=net-libs/c-client-2004g-r1 )"
|
||||
fi
|
||||
|
||||
PDEPEND="suhosin? ( >=dev-php5/suhosin-0.9.29 )"
|
||||
|
||||
want_apache
|
||||
|
||||
pkg_setup() {
|
||||
PHPCONFUTILS_AUTO_USE=""
|
||||
|
||||
# Make sure the user has specified at least one SAPI
|
||||
einfo "Determining SAPI(s) to build"
|
||||
phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache2
|
||||
|
||||
# Threaded Apache2 support
|
||||
if use apache2 ; then
|
||||
has_apache_threads
|
||||
fi
|
||||
|
||||
# Concurrent PHP Apache2 modules support
|
||||
if use apache2 ; then
|
||||
if use concurrentmodphp ; then
|
||||
ewarn
|
||||
ewarn "'concurrentmodphp' makes it possible to load multiple, differently"
|
||||
ewarn "versioned mod_php's into the same Apache instance. This is done with"
|
||||
ewarn "a few linker tricks and workarounds, and is not guaranteed to always"
|
||||
ewarn "work correctly, so use it at your own risk. Especially, do not use"
|
||||
ewarn "this in conjunction with PHP modules (PECL, ...) other than the ones"
|
||||
ewarn "you may find in the Portage tree or the PHP Overlay!"
|
||||
ewarn "This is an experimental feature, so please rebuild PHP"
|
||||
ewarn "without the 'concurrentmodphp' USE flag if you experience"
|
||||
ewarn "any problems, and then reproduce any bugs before filing"
|
||||
ewarn "them in Gentoo's Bugzilla or bugs.php.net."
|
||||
ewarn "If you have conclusive evidence that a bug directly"
|
||||
ewarn "derives from 'concurrentmodphp', please file a bug in"
|
||||
ewarn "Gentoo's Bugzilla only."
|
||||
ewarn
|
||||
ebeep 5
|
||||
fi
|
||||
fi
|
||||
|
||||
# fastbuild support
|
||||
if use fastbuild ; then
|
||||
ewarn
|
||||
ewarn "'fastbuild' attempts to build all SAPIs in a single pass."
|
||||
ewarn "This is an experimental feature, so please rebuild PHP"
|
||||
ewarn "without the 'fastbuild' USE flag if you experience"
|
||||
ewarn "any problems, and then reproduce any bugs before filing"
|
||||
ewarn "them in Gentoo's Bugzilla or bugs.php.net."
|
||||
ewarn "If you have conclusive evidence that a bug directly"
|
||||
ewarn "derives from 'fastbuild', please file a bug in"
|
||||
ewarn "Gentoo's Bugzilla only."
|
||||
ewarn
|
||||
fi
|
||||
|
||||
if use pcre ; then
|
||||
built_with_use dev-libs/libpcre unicode || \
|
||||
die "Please rebuild dev-libs/libpcre with USE=unicode"
|
||||
fi
|
||||
|
||||
depend.apache_pkg_setup
|
||||
php5_2-sapi_pkg_setup
|
||||
}
|
||||
|
||||
php_determine_sapis() {
|
||||
# holds the list of sapis that we want to build
|
||||
PHPSAPIS=
|
||||
|
||||
if use cli || phpconfutils_usecheck cli ; then
|
||||
PHPSAPIS="${PHPSAPIS} cli"
|
||||
fi
|
||||
|
||||
if use cgi ; then
|
||||
PHPSAPIS="${PHPSAPIS} cgi"
|
||||
fi
|
||||
|
||||
# note - apache SAPI comes after the simpler cli/cgi sapis
|
||||
if use apache2 ; then
|
||||
PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ "${PHP_PACKAGE}" == 1 ]] ; then
|
||||
unpack ${A}
|
||||
fi
|
||||
|
||||
cd "${S}"
|
||||
|
||||
epatch "${FILESDIR}"/${PN}-5.2.12-libpng14.patch
|
||||
epatch "${FILESDIR}"/${PN}-5.2.13-gmp5.patch
|
||||
|
||||
# Concurrent PHP Apache2 modules support
|
||||
if use apache2 ; then
|
||||
if use concurrentmodphp ; then
|
||||
if [[ -n "${CONCURRENTMODPHP_PATCH}" ]] && [[ -f "${WORKDIR}/${CONCURRENTMODPHP_PATCH}" ]] ; then
|
||||
epatch "${WORKDIR}/${CONCURRENTMODPHP_PATCH}"
|
||||
else
|
||||
ewarn "There is no concurrent mod_php patch available for this PHP release yet!"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# fastbuild support
|
||||
if use fastbuild ; then
|
||||
if [[ -n "${FASTBUILD_PATCH}" ]] && [[ -f "${WORKDIR}/${FASTBUILD_PATCH}" ]] ; then
|
||||
epatch "${WORKDIR}/${FASTBUILD_PATCH}"
|
||||
else
|
||||
ewarn "There is no fastbuild patch available for this PHP release yet!"
|
||||
fi
|
||||
fi
|
||||
|
||||
# kolab support
|
||||
if [[ -n "${KOLAB_PATCH}" ]] ; then
|
||||
use kolab && epatch "${WORKDIR}/${KOLAB_PATCH}"
|
||||
fi
|
||||
|
||||
# pretend to not have flex, bug 221357
|
||||
sed -re 's:( +)PHP_SUBST\(LEX\):\1LEX="exit 0;"\n\0:' -i acinclude.m4
|
||||
|
||||
# Now let the eclass do the rest and regenerate the configure
|
||||
php5_2-sapi_src_unpack
|
||||
|
||||
# Fix Makefile.global:test to consider the CGI SAPI if present
|
||||
if use cgi ; then
|
||||
sed -e "s|test \! -z \"\$(top_builddir)/php-cli\" \&\& test -x \"\$(top_builddir)/php-cli\"|test \! -z \"\$(top_builddir)/php-cli\" \&\& test -x \"\$(top_builddir)/php-cli\" \&\& test \! -z \"\$(top_builddir)/php-cgi\" \&\& test -x \"\$(top_builddir)/php-cgi\"|g" -i Makefile.global
|
||||
sed -e "s|TEST_PHP_EXECUTABLE=\"\$(top_builddir)/php-cli\"|TEST_PHP_EXECUTABLE=\"\$(top_builddir)/php-cli\" TEST_PHP_CGI_EXECUTABLE=\"\$(top_builddir)/php-cgi\"|g" -i Makefile.global
|
||||
fi
|
||||
|
||||
# try to fix some test cases which fail because of sandbox otherwise
|
||||
sed -e 's:/no/such/:.\0:' -i ext/standard/tests/file/005_error.phpt \
|
||||
ext/standard/tests/file/006_error.phpt \
|
||||
ext/standard/tests/file/touch.phpt
|
||||
|
||||
# REMOVING BROKEN TESTS:
|
||||
# removing this test as it has been broken for ages and is not easily
|
||||
# fixable (depends on a lot of factors)
|
||||
rm ext/standard/tests/general_functions/phpinfo.phpt
|
||||
|
||||
# never worked properly, no easy fix
|
||||
rm ext/iconv/tests/iconv_stream_filter.phpt
|
||||
|
||||
# needs write access to /tmp and others
|
||||
rm ext/session/tests/session_save_path_variation5.phpt
|
||||
|
||||
# new tests since 5.2.7 which have never been working for me
|
||||
rm ext/spl/tests/arrayObject___construct_basic4.phpt \
|
||||
ext/spl/tests/arrayObject___construct_basic5.phpt \
|
||||
ext/spl/tests/arrayObject_exchangeArray_basic3.phpt \
|
||||
ext/spl/tests/arrayObject_setFlags_basic1.phpt
|
||||
|
||||
# those might as well be related to suhosin
|
||||
rm ext/session/tests/session_decode_variation3.phpt \
|
||||
ext/session/tests/session_encode_variation8.phpt
|
||||
|
||||
# missing skipif
|
||||
use reflection || \
|
||||
rm ext/standard/tests/directory/DirectoryClass_basic_001.phpt
|
||||
|
||||
# sandbox-related (sandbox checks for permissions before even looking
|
||||
# at the fs, but the tests expect "No such file or directory"
|
||||
sed -e 's:/blah:./bla:' -i \
|
||||
ext/session/tests/session_save_path_variation{2,3}.phpt
|
||||
rm ext/standard/tests/file/rename_variation13.phpt
|
||||
|
||||
# test passes, but run-tests.php claims failure
|
||||
rm ext/standard/tests/file/tempnam_variation4.phpt
|
||||
|
||||
# these tests behave differently with suhosin enabled, adapting them...
|
||||
use suhosin && sed -e 's:File(\.\./):File(..):g' -i \
|
||||
tests/security/open_basedir*{.inc,.phpt}
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# bug 217392 (autconf-2.62 behavior changes)
|
||||
export CFLAGS="${CFLAGS} -D_GNU_SOURCE"
|
||||
export CXXFLAGS="${CXXFLAGS} -D_GNU_SOURCE"
|
||||
if use fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then
|
||||
src_compile_fastbuild
|
||||
else
|
||||
src_compile_normal
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile_fastbuild() {
|
||||
php_determine_sapis
|
||||
|
||||
build_cli=0
|
||||
build_cgi=0
|
||||
build_apache2=0
|
||||
my_conf=""
|
||||
|
||||
for x in ${PHPSAPIS} ; do
|
||||
case ${x} in
|
||||
cli)
|
||||
build_cli=1
|
||||
;;
|
||||
cgi)
|
||||
build_cgi=1
|
||||
;;
|
||||
apache2)
|
||||
build_apache2=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ${build_cli} = 1 ]] ; then
|
||||
my_conf="${my_conf} --enable-cli"
|
||||
else
|
||||
my_conf="${my_conf} --disable-cli"
|
||||
fi
|
||||
|
||||
if [[ ${build_cgi} = 1 ]] ; then
|
||||
my_conf="${my_conf} --enable-cgi --enable-fastcgi"
|
||||
phpconfutils_extension_enable "discard-path" "discard-path" 0
|
||||
phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
|
||||
else
|
||||
my_conf="${my_conf} --disable-cgi"
|
||||
fi
|
||||
|
||||
if [[ ${build_apache2} = 1 ]] ; then
|
||||
my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2"
|
||||
|
||||
# Threaded Apache2 support
|
||||
if use threads ; then
|
||||
my_conf="${my_conf} --enable-maintainer-zts"
|
||||
ewarn "Enabling ZTS for Apache2 MPM"
|
||||
fi
|
||||
|
||||
# Concurrent PHP Apache2 modules support
|
||||
if use concurrentmodphp ; then
|
||||
append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
|
||||
fi
|
||||
fi
|
||||
|
||||
if use pcre || phpconfutils_usecheck pcre ; then
|
||||
myconf="${my_conf} --with-pcre-dir=/usr"
|
||||
phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr"
|
||||
fi
|
||||
|
||||
# Now we know what we are building, build it
|
||||
php5_2-sapi_src_compile
|
||||
|
||||
# To keep the separate php.ini files for each SAPI, we change the
|
||||
# build-defs.h and recompile
|
||||
|
||||
if [[ ${build_cli} = 1 ]] ; then
|
||||
einfo
|
||||
einfo "Building CLI SAPI"
|
||||
einfo
|
||||
|
||||
sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cli-php5"|g;' -i main/build-defs.h
|
||||
sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/cli-php5/ext-active"|g;' -i main/build-defs.h
|
||||
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
|
||||
[[ -f ${x} ]] && rm -f ${x}
|
||||
done
|
||||
make sapi/cli/php || die "Unable to make CLI SAPI"
|
||||
cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
|
||||
fi
|
||||
|
||||
if [[ ${build_cgi} = 1 ]] ; then
|
||||
einfo
|
||||
einfo "Building CGI SAPI"
|
||||
einfo
|
||||
|
||||
sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/cgi-php5"|g;' -i main/build-defs.h
|
||||
sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/cgi-php5/ext-active"|g;' -i main/build-defs.h
|
||||
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
|
||||
[[ -f ${x} ]] && rm -f ${x}
|
||||
done
|
||||
make sapi/cgi/php-cgi || die "Unable to make CGI SAPI"
|
||||
cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
|
||||
fi
|
||||
|
||||
if [[ ${build_apache2} = 1 ]] ; then
|
||||
einfo
|
||||
einfo "Building apache${APACHE_VERSION} SAPI"
|
||||
einfo
|
||||
|
||||
sed -e "s|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH \"/etc/php/apache${APACHE_VERSION}-php5\"|g;" -i main/build-defs.h
|
||||
sed -e "s|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR \"/etc/php/apache${APACHE_VERSION}-php5/ext-active\"|g;" -i main/build-defs.h
|
||||
for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
|
||||
[[ -f ${x} ]] && rm -f ${x}
|
||||
done
|
||||
make || die "Unable to make apache${APACHE_VERSION} SAPI"
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile_normal() {
|
||||
php_determine_sapis
|
||||
|
||||
CLEAN_REQUIRED=0
|
||||
my_conf=""
|
||||
|
||||
# Support the Apache2 extras, they must be set globally for all
|
||||
# SAPIs to work correctly, especially for external PHP extensions
|
||||
if use apache2 ; then
|
||||
# Concurrent PHP Apache2 modules support
|
||||
if use concurrentmodphp ; then
|
||||
append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
|
||||
fi
|
||||
fi
|
||||
|
||||
for x in ${PHPSAPIS} ; do
|
||||
if use pcre || phpconfutils_usecheck pcre ; then
|
||||
myconf="${my_conf} --with-pcre-dir=/usr"
|
||||
phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr"
|
||||
fi
|
||||
|
||||
# Support the Apache2 extras, they must be set globally for all
|
||||
# SAPIs to work correctly, especially for external PHP extensions
|
||||
if use apache2 ; then
|
||||
# Threaded Apache2 support
|
||||
if use threads ; then
|
||||
my_conf="${my_conf} --enable-maintainer-zts"
|
||||
ewarn "Enabling ZTS for Apache2 MPM"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then
|
||||
make clean
|
||||
fi
|
||||
|
||||
PHPSAPI="${x}"
|
||||
|
||||
case ${x} in
|
||||
cli)
|
||||
my_conf="${my_conf} --enable-cli --disable-cgi"
|
||||
php5_2-sapi_src_compile
|
||||
cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
|
||||
;;
|
||||
cgi)
|
||||
my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi"
|
||||
phpconfutils_extension_enable "discard-path" "discard-path" 0
|
||||
phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
|
||||
php5_2-sapi_src_compile
|
||||
cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
|
||||
;;
|
||||
apache2)
|
||||
my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2"
|
||||
php5_2-sapi_src_compile
|
||||
;;
|
||||
esac
|
||||
|
||||
CLEAN_REQUIRED=1
|
||||
my_conf=""
|
||||
done
|
||||
}
|
||||
|
||||
src_install() {
|
||||
php_determine_sapis
|
||||
|
||||
destdir=/usr/$(get_libdir)/php5
|
||||
|
||||
# Let the eclass do the common work
|
||||
php5_2-sapi_src_install
|
||||
|
||||
einfo
|
||||
einfo "Installing SAPI(s) ${PHPSAPIS}"
|
||||
einfo
|
||||
|
||||
for x in ${PHPSAPIS} ; do
|
||||
|
||||
PHPSAPI="${x}"
|
||||
|
||||
case ${x} in
|
||||
cli)
|
||||
einfo "Installing CLI SAPI"
|
||||
into ${destdir}
|
||||
newbin php-cli php || die "Unable to install ${x} sapi"
|
||||
php5_2-sapi_install_ini
|
||||
;;
|
||||
cgi)
|
||||
einfo "Installing CGI SAPI"
|
||||
into ${destdir}
|
||||
dobin php-cgi || die "Unable to install ${x} sapi"
|
||||
php5_2-sapi_install_ini
|
||||
;;
|
||||
apache2)
|
||||
einfo "Installing Apache${APACHE_VERSION} SAPI"
|
||||
make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"
|
||||
if use concurrentmodphp ; then
|
||||
einfo "Installing Apache${APACHE_VERSION} config file for PHP5-concurrent (70_mod_php5_concurr.conf)"
|
||||
insinto ${APACHE_MODULES_CONFDIR}
|
||||
newins "${FILESDIR}/70_mod_php5_concurr.conf-apache2-r1" "70_mod_php5_concurr.conf"
|
||||
|
||||
# Put the ld version script in the right place so it's always accessible
|
||||
insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
|
||||
doins "${FILESDIR}/php5-ldvs"
|
||||
|
||||
# Redefine the extension dir to have the modphp suffix
|
||||
PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`-versioned"
|
||||
else
|
||||
einfo "Installing Apache${APACHE_VERSION} config file for PHP5 (70_mod_php5.conf)"
|
||||
insinto ${APACHE_MODULES_CONFDIR}
|
||||
newins "${FILESDIR}/70_mod_php5.conf-apache2-r1" "70_mod_php5.conf"
|
||||
fi
|
||||
php5_2-sapi_install_ini
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Install env.d files
|
||||
newenvd "${FILESDIR}/20php5-envd" "20php5"
|
||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${D}/etc/env.d/20php5"
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Output some general info to the user
|
||||
if use apache2 ; then
|
||||
APACHE2_MOD_DEFINE="PHP5"
|
||||
if use concurrentmodphp ; then
|
||||
APACHE2_MOD_CONF="70_mod_php5_concurr"
|
||||
else
|
||||
APACHE2_MOD_CONF="70_mod_php5"
|
||||
fi
|
||||
apache-module_pkg_postinst
|
||||
fi
|
||||
|
||||
# Update Apache2 to use mod_php
|
||||
if use apache2 ; then
|
||||
"${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1
|
||||
exitStatus=$?
|
||||
if [[ ${exitStatus} == 2 ]] ; then
|
||||
php-select apache2 php5
|
||||
elif [[ ${exitStatus} == 4 ]] ; then
|
||||
ewarn
|
||||
ewarn "Apache2 is configured to load a different version of PHP."
|
||||
ewarn "To make Apache2 use PHP v5, use php-select:"
|
||||
ewarn
|
||||
ewarn " php-select apache2 php5"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the symlinks for php-cli
|
||||
if use cli || phpconfutils_usecheck cli ; then
|
||||
"${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1
|
||||
exitStatus=$?
|
||||
if [[ ${exitStatus} == 5 ]] ; then
|
||||
php-select php php5
|
||||
elif [[ ${exitStatus} == 4 ]] ; then
|
||||
ewarn
|
||||
ewarn "/usr/bin/php links to a different version of PHP."
|
||||
ewarn "To make /usr/bin/php point to PHP v5, use php-select:"
|
||||
ewarn
|
||||
ewarn " php-select php php5"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the symlinks for php-cgi
|
||||
if use cgi ; then
|
||||
"${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1
|
||||
exitStatus=$?
|
||||
if [[ ${exitStatus} == 5 ]] ; then
|
||||
php-select php-cgi php5
|
||||
elif [[ ${exitStatus} == 4 ]] ; then
|
||||
ewarn
|
||||
ewarn "/usr/bin/php-cgi links to a different version of PHP."
|
||||
ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:"
|
||||
ewarn
|
||||
ewarn " php-select php-cgi php5"
|
||||
ewarn
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the symlinks for php-devel
|
||||
"${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1
|
||||
exitStatus=$?
|
||||
if [[ $exitStatus == 5 ]] ; then
|
||||
php-select php-devel php5
|
||||
elif [[ $exitStatus == 4 ]] ; then
|
||||
ewarn
|
||||
ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a"
|
||||
ewarn "different version of PHP. To make them point to PHP v5, use"
|
||||
ewarn "php-select:"
|
||||
ewarn
|
||||
ewarn " php-select php-devel php5"
|
||||
ewarn
|
||||
fi
|
||||
|
||||
php5_2-sapi_pkg_postinst
|
||||
}
|
||||
|
||||
src_test() {
|
||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
||||
if [[ ! -x "${S}"/php-cli ]]; then
|
||||
ewarn "Running the php test suite requires USE=cli"
|
||||
return
|
||||
fi
|
||||
|
||||
export TEST_PHP_EXECUTABLE="${S}"/php-cli
|
||||
if [[ -x "${S}"/php-cgi ]]; then
|
||||
export TEST_PHP_CGI_EXECUTABLE="${S}"/php-cgi
|
||||
fi
|
||||
REPORT_EXIT_STATUS=1 "${S}"/php-cli -n "${S}"/run-tests.php -n
|
||||
|
||||
if [[ $? != 0 ]] ; then
|
||||
eerror "Not all tests were successful!"
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue
Block a user