diff options
author | Ole Markus With <olemarkus@gentoo.org> | 2014-03-07 09:08:15 +0000 |
---|---|---|
committer | Ole Markus With <olemarkus@gentoo.org> | 2014-03-07 09:08:15 +0000 |
commit | 198a596de3171a71108d640d000982d0bd4889c2 (patch) | |
tree | 820f1055a521d3dfc8fe95701d9dec367b990cc7 /dev-lang/php | |
parent | Revbump to make easytag find its locales (bug #503698) (diff) | |
download | historical-198a596de3171a71108d640d000982d0bd4889c2.tar.gz historical-198a596de3171a71108d640d000982d0bd4889c2.tar.bz2 historical-198a596de3171a71108d640d000982d0bd4889c2.zip |
Version bumps
Package-Manager: portage-2.1.12.2/cvs/Linux x86_64
Manifest-Sign-Key: 0xC4A92BF5
Diffstat (limited to 'dev-lang/php')
-rw-r--r-- | dev-lang/php/ChangeLog | 9 | ||||
-rw-r--r-- | dev-lang/php/Manifest | 30 | ||||
-rw-r--r-- | dev-lang/php/php-5.4.26.ebuild | 801 | ||||
-rw-r--r-- | dev-lang/php/php-5.5.10.ebuild | 780 |
4 files changed, 1604 insertions, 16 deletions
diff --git a/dev-lang/php/ChangeLog b/dev-lang/php/ChangeLog index 30a0c1ddbbc1..8c97794bbaae 100644 --- a/dev-lang/php/ChangeLog +++ b/dev-lang/php/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-lang/php # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.806 2014/02/22 07:40:46 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.807 2014/03/07 09:06:24 olemarkus Exp $ + +*php-5.4.26 (07 Mar 2014) +*php-5.5.10 (07 Mar 2014) + + 07 Mar 2014; Ole Markus With <olemarkus@gentoo.org> +php-5.4.26.ebuild, + +php-5.5.10.ebuild: + Version bumps 22 Feb 2014; Agostino Sarubbo <ago@gentoo.org> php-5.5.9.ebuild: Stable for sparc, wrt bug #501312 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest index fc0ea07abd5e..70c009daf124 100644 --- a/dev-lang/php/Manifest +++ b/dev-lang/php/Manifest @@ -22,6 +22,8 @@ DIST php-5.3.28.tar.bz2 11051714 SHA256 0cac960c651c4fbb3d21cf2f2b279a06e21948fb DIST php-5.4.23.tar.bz2 12251671 SHA256 ae7c070fa9b9e16413ef944d910b68f3ba79192eca4010b0af132b8631bd91cc SHA512 3c306ba40e3649ef79a88534e1a12aa83c01f9edbbe9822a741af03e18c9a4e8587351e0f1760cc539b3b599209d546233e40d4d816f6a49cf81ad2d738486b7 WHIRLPOOL c6a6fc4ecd1a1fca1d4c317b37f5a4461bca580e64a4a3cb48c6efe327972ceccb2d6ecb2d632f945875c3df12dca3d37d6e57bf857fbc3d0a34149df644ea6b DIST php-5.4.24.tar.bz2 12256796 SHA256 97fe70eddaf5b93969714a551870fe03f6b0a387f85b83a6d63a40a76199a327 SHA512 c4bf209c9da183d0fa4aa96ea1e58e93f8034bd23dbe009dfc15a432416cb9fde441627d0068a9ddbd6e8ca273d97096e169dfe2c1a3cc99e49f2a181b664c6c WHIRLPOOL 9de9648a62a70d715ebe1e561cb9de040e359d7f7f55f5da8c09a596a3abac43d25a04723db472341c98be429bbf4ef94332539749cca871a11bcddeca64d8cc DIST php-5.4.25.tar.bz2 11739877 SHA256 b6c18c07c6bf34f75e601b28829d636e44c1c9f4267aac4ed013443c32a2245f SHA512 66694ff2bc6a91a9c702f4741fea1d0ce7e10b91051baedde0022b855c76e93efbde9719e333ffb504a6d801a6956404d606bfd174f46d94e6433d89f4c610db WHIRLPOOL 0683e485b9c043d49ee10d9616304fa73d3a0bbe7b6bfff6723ab857da7a8b37b60dbceecd70db9aff2a38611d768ac1514954de110e915d1ef83ced548454fa +DIST php-5.4.26.tar.bz2 12270535 SHA256 5053649317b9331df40bd836c976a32b31dbc5c5d68997d3ae01cb90db22d240 SHA512 9ff29943bfe283fc5b925a2d463a4bc6e4bd070909f202ce6e3a45a7281720b550d5569c5ee8e60412342739833d237974442182c392cfa1b2e9d73375f897ef WHIRLPOOL 83095a3ee4e2509c4e03e4ad1a658fe4d98e747193450227656a39368a9127ea56cf876b40384ff64327c19dc5107c99db75742acb14c34cf24adf921b56d598 +DIST php-5.5.10.tar.bz2 13102742 SHA256 bb34e61f8e6f56c612867bfe85d144d5045cd5e44497539bc126a4e8c6795419 SHA512 75d4a5b72c6a467030fe670af9ce162916c3bbd527499c8af08de38fde5d8ea6132de3a4f4ff685e8e0bd38b74acc763efe5accb0a7af222d1e33a46974866a6 WHIRLPOOL 26a44a881bcb3887383e7006eaf41c9364e23ae4727a7ad764dd3ca765d5bcb286c61831dfd7c62ab01250844401cc078bb1270183bf6da9f74178b5c55cad64 DIST php-5.5.7.tar.bz2 12991330 SHA256 2cb9425ef514b984dd233097d82a66f4623b9bf48f2ef265bc7ba25d697d6008 SHA512 0300f0a8b30fd83e80e8ff5fbb3008203e67fc7f740d18c265c9350c60839067996f57b7fe4758d2903f2844dee98303d6c373d4801724a8c38c1150d6479282 WHIRLPOOL ef83e902fccd307eb4f11c85eb8cd33363b3f0e4a8ab1f97b3131123848ab942ad71e337a5e8308b7f6ac03834f37cbfa42b5ba3cd9e0cb0a90133dca8ce600b DIST php-5.5.8.tar.bz2 13005675 SHA256 6d5f45659d13383fc8429f185cc9da0b30c7bb72dcae9baf568f0511eb7f8b68 SHA512 19749ee988d24838dd7b9de825ec839cc0125d2ee55f063504a75216503ec1fd3bf7cc3da5cd40140c826fe2ca9a734d7f7f5320fb2a2a8d78231a61178a7e22 WHIRLPOOL f79c5b08c420febfc4689ce6b460a8cf2d966abaee6ed2b3be329f4fd3261d0757da505c73c29bf2235ec792eee550f402415520a266d9b4da82a5827e77bdc6 DIST php-5.5.9.tar.bz2 13019443 SHA256 9d1dea5195e2bcd928416130a6e19173d02bd36fb76c382522bf145c458fbed3 SHA512 fc2b9f89412aecb2715fd1500f932e0e0c2ee1d2759351b71e07687716fc7df4a864cd3a970fd51056bc0988ab87a7221f787f6ecc90a94f9528bb993abc404b WHIRLPOOL 73c025aa0f7b998c695ae2d0617d828c2b03c8597462333eec1d4980e7a3a85ef97fffefb928fd65cc136cf67e01a37226a22003bc352853608a9b9f338e6409 @@ -35,29 +37,27 @@ EBUILD php-5.4.23.ebuild 22002 SHA256 917bf1d53c5cfb53f1b980abd2b9aef448a23978c5 EBUILD php-5.4.24-r1.ebuild 22322 SHA256 ca0a083dfef8ee834adfd846188524f0d22733f31ac03cb881b095609c23ab27 SHA512 d2bdc12062008e00bf83d0ab0c03a141ffae6d9c08cf26bdb5ce3e3573a8e8929167693dca20f4806ecb6d7cf673093222eb799441a06d84aad1c119bd4ea578 WHIRLPOOL 562dee9088023e76bca0d7f2c0b7c3012fd7bdef6c2ddb564ed87405db362cc7f9767a04bd11e3d30e1960533b5093bc7058004d4541fbacce0a6e93ddcf5b50 EBUILD php-5.4.24.ebuild 22010 SHA256 16a5e1d0f359a47f4c4ebb733d70cb857edaca253379da2a4f513b50a922b29c SHA512 a4ce7a9d86f6934a9d9bf754dd18859a2ae7d75224f33068dafc5d0467e48d31ffb0a5b33b580bb1657e460c92af6dfcd588dfa090b0d427d4f060ce37900d02 WHIRLPOOL 37146d81328e8138e4689c33b626fa6028b7d4d0eb3e36168e8730caca27b3b3ff34b6dbe2b3b18ca54db7c486d77038f2b3cb406c0ca179458b9d96f809f380 EBUILD php-5.4.25.ebuild 22319 SHA256 f3680add91942ee42643cb5cfcc926b7f7919f1d1265f4483e51efb5692c4aab SHA512 44916c850898c77ab6e48e2647feef1dcd654aad032316cf8fd3353869d2e8ce3310b75bc5ceaa499af7db8da505fc77bd0a2e04e268b336d343628537a7b7bc WHIRLPOOL bbbd026ae5fa00c3bab9d8c0c0c7ba21e96946eb7965509f08690ffdd8e6fc2aa7a1ebcfad405b8b617a6d34ad60a1b67b01dcec077a1cdb46e0c05ebe9ee0e8 +EBUILD php-5.4.26.ebuild 22319 SHA256 2059582b417961e0f40ad35c4e3a050a069fc7ce350ee30417fcfd8bb582a7d5 SHA512 aeb6669f2adfdb414535f05d8a58a23f9ee35fa74716097cb4446c916e124ab15ebbbcc84efd115c94035e21154b78dec52317902f034b7e6333da0441561128 WHIRLPOOL 33c2676a3042761f5912abcc3e10f6f0bcbe1f43a8b7624def4fd19044e622c348fbfbf492eb8e95e119095df8ed8b984319bdb501b6d16037b7a911dcca41ac +EBUILD php-5.5.10.ebuild 22168 SHA256 ee7759c602aa5beba1de8d630203b585f52eebf4357a1056ccd463a2dc15a96d SHA512 4135d088ed65cd5112ab73d11de5b342313660485ff97a6adf46c4ab8f39ac216a18ea3ea100d50fb06e6ffce3defed0d4dc6f99d389d58c3804439c8c9daa9e WHIRLPOOL fc0216881660720544418c6b9c78a76e6921a0297af9c253ae7caa9d8664097082d0bdeac1d89ed6be30e9fee6120d6b60f84050c14a230b63c14980bf52ce68 EBUILD php-5.5.7.ebuild 21850 SHA256 5dc5b76ac1b49fe81b56daa0243afd3bda108d002564f105f3510ffebbb05f93 SHA512 1062485865773b2f4eac485997a85e1c042555e42260656011bdd2fdb81c3ad824a3ebb5581f6fdf598595cae557e26e97dd829dd50bca3518a37f082c415753 WHIRLPOOL cd5da586eefcee2985d9c1ce53dc790e24707b614640e59f341908779819f3e61420cfe94a1bd476ba516f1ba87639e96ada939d1f84dd9f385dbb10909d52a1 EBUILD php-5.5.8-r1.ebuild 22166 SHA256 eeb3f293dd9f4f519207b3c9bd96e3acc75d535501c38a1cdffbe05c06427a04 SHA512 be9ba08d662061e9f81b367ee101b6dfaf979ff51e28fc7a421a39b56ed324b540af7214a33caf92e67beb50a37f2ab2a765ec936ab2bd15a8486b0bc08ccaa9 WHIRLPOOL 4e5b42413b052454bc3f8eab35a136a82bfde54e8b6b3f91c2b5ac32e021dc8ed2c50e162ef8edb9ce21a325d63ce195bc6ff4f13132b5234a4e17374280071a EBUILD php-5.5.8.ebuild 21858 SHA256 814fa2fdad7d2a6cb06b4ee2bf76d4e07086f6ea79a7313aa53181c39d8ea02e SHA512 4a48f213d4d91dc40a88f4d89fb052102c75c0fcaa74cdd27b6a82fefa66230655c8d4b55aa5aae20625dcebc63c90c5a0ed63944a931dcce0796c034ecc81b5 WHIRLPOOL 06315659fcc192fab80b71c144bcbb5287d1dff04bc250e6fc846fd9e3cf33fa395184878c1428f132f872057d39e25ccea0ffd47cdd0459018fd3faf6d5c6ce EBUILD php-5.5.9.ebuild 22153 SHA256 5204e7e76d7ed5be2dddc5a009e7e0c10f97317f4ec50584818f2815a1e44234 SHA512 aac8d3f25912cede211df52edbfedce4e8d14599cd93351b70f9c6155d44ad486eb685ac60600d9b9b4f7c82b0dd679cc7cab606d7b518b1761e151250823c55 WHIRLPOOL 0467a213dfa6014fd9cf5621a706e0b7dded804b2d8a1811efcef79ca6771949e5abbae4c7ce0015d2f00e62d64a18a5d778631919be9f892ed6251e1146da86 EBUILD php-5.6.0_alpha1-r1.ebuild 22176 SHA256 ad003ce3372deecf2931c767a3731b7ada756a8d900b45b08d5853a743b893a7 SHA512 f6b04f59440c3aa3b20fff6353729cd89d6c85a2d2cd0b519edfff04898538dc7b52b522a2f603ae141a23771f75e3b5b493fbe973e974982304d9776cc293e7 WHIRLPOOL 39126034861474c12c16abe21d53668c63efd6773fc344698359bf044cbf975f3f0beffc3950bec41fc732459f7b6d87ee180962322410b23f6e9beabdba2585 EBUILD php-5.6.0_alpha1.ebuild 21868 SHA256 1fe0d8f58096ade80ef7ab6bfae4a9a8eded7ea9880e49e4f6a4111d0effb40d SHA512 e0758a27128c4f49d3d108a5dd3256e1ccc154cf978e8cb987595e438367bd52522b4fab832be6aad9e421bc4ba33af458efb118484f60c69636e204de1e3356 WHIRLPOOL 81c632ac2f31a3c9d46a304794cbdb29671ef1de244b6918c70a55db13cd7043f4d619f59c01659f2e8978128d08d84264ff2b8c6a82ef34a5e3fad4930cfc7f -MISC ChangeLog 21611 SHA256 764b390e48a3da53af613b1ae0155392d57f93fec2bc75027493472422b26d44 SHA512 25ec27776be8352806920e1aceadb79881ff1b5e0f9b6d7dd5e514fabfc53323c209ea19e5658ed48976227b8a2b831b2ff61d73b4b8fed7e22c2c4738a59dfa WHIRLPOOL 3edc86eb64f2ce0c2f90284becbf9e96259cce5be26e8216f6d4e8759b7b2dd83d117c857ddc0fc58a3d6fae60a8dde1259a65254b9259758d4942370b5daabf +MISC ChangeLog 21783 SHA256 49510bfb5dd6e8e8e69d4ed640f696940d2743bc7793bfcdca26198457412b76 SHA512 779195c40746cb1ca08ec36cf53e0e9ad21d99501298184a51baed54a3c5296c99570ad8bf8d9cb7911fd952d02bbd2c3db46bb779e42f1579764344e843710f WHIRLPOOL b879363a661e1aff80629b647ef527a00b8b0b1d921318f93c5dd4723ba10d855c79339363e4edb3b9e85b7969d8d595e17488a0ec01f0b005a33ab2339fa5ee MISC ChangeLog-2012 108488 SHA256 c2eea36502d34eadc7995d546f78aaa553ba07beeb51ea738715ad7f2e51b08d SHA512 eb25224993eff1ea42ea133302991a3ffad3adda0bc524cfa4fae49574230a8e65b35b08750d780c11cc9c152435fadbf2c416241fac28dcbb025e060e96cd7a WHIRLPOOL 82f627853fa961f3f3707fb2c8757acbc8fc644e89121d78703b40ff0f668aa7d0f1aa26c77f8f503e4f6da22ed865e4cb7c02d5d112c89488b12aa6b0d80568 MISC metadata.xml 1547 SHA256 2ce287830b8238e330c0585ef3023f86a9e5d46204619c92588244c5d7fa2f77 SHA512 a3a1c2dfddb4d0d92eafa33d74dc0bb90f1a9976e1d2fe0d3717a0d94149d3023dfdc9e68d42d440873561b2e6c34969ae86cec24ac0f0bddcf9ba14103ba450 WHIRLPOOL d9d877b3ae1b304ff89f7b0dd3a1f23d78062280ee935eaaa02c44e8e1dc2fd78bf2c6336cfebb2d9e8dddc03414a7744114ecebee6e364e962c49ff5e2bdf57 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.22 (GNU/Linux) +Version: GnuPG v2.0.20 (GNU/Linux) -iQIcBAEBCAAGBQJTCFSAAAoJELp701BxlEWf8z4P/jGrcUidwnjKbeUrCASGZdQE -EeO6xYd4ET2/HvXZA/4RXIeOJIanP2BxWVSsB58Z0cLLzIUypGD3XiLO6A09XUMY -JbKlJ5si4vehkR1GzFyB9p9s6+HT1YJeFrqSRt5NsHnOwqmhbjKYnzFCRS32KWkz -zTYqGN3LvKUxeS5jl7ooQQOdxHhVwu37g+FkKaHa0k5Hz5DjFtlB0wAsKbeiy8Th -YNzTt5yUPJQ751EEPrmY5Ya+wcfBM9hV3DefO3ngrIi0hniNVZsre39chmwstNgf -ONwFAAUrcJmIN3vpUPIHbOip0YVtIgtSEU0CIyJwanVYlqHeDXqMc3YGVuqHHnG5 -9526tLVCmaCNeBj76EGhSTQNg5w8mS094V6MYleMaAy9bI9ZgISIYFujpe9BtLiq -PRaJt06Rb+Uiu9m2ez/64y3hMZcz7RTLobcoqy+ek38mhAcNRLe+lGrweCtSYpBy -CmawJ+AnezStfVHUAv7KSmD9ugTKCpcxe3wQzsGHqz06SZ7TXIaehjkEFRYf75Uh -LhlBh7suzre3YSrY8g3O4eEi1+M8dmdsL16SRhvT5qnF9vwug3T/5xcQqAUGaiS8 -4vOZOrBxVJdRbzmDtukrV0X28crLSIiJHqr1+pOnlvuY2P2J370NFN/+jGM6XLb/ -/oUbqDptYW9hHTUv8WkE -=2rSe +iQF8BAEBCABmBQJTGYx8XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyOEZEMjNGNzBENkE5N0Q2Q0ZFMkFDNDA2 +QkFCNEFFNUM0QTkyQkY1AAoJEGurSuXEqSv1QowH/j4LcCOnKYMeTQBzgwhFWegU +Y5JNmpTFYD0YAETaIIit+6XJt6kjd2eHNLBhLTjoUSUIm/OQ609TGZa0iEqykOpT +p2rPYBjdfUzEHcYGEEbYlYJ5BAdNvFlkS7vvfJ9HAtNvTm3mGNLM/HGfjZLermPu +hdG8SJ1fZOi+XzADsyCM8oE2MOOSrhJRMIeLh/MSlQRcBSsDKhcGI/Lvz5F/zqCJ +O8Oa05QlF9I/YzSghsHkWv6hXlyypuqSXkjiJYDFj463JJZQfWnkkG+sss5fhDOi +0PIWmNA9Jr660mlmFaYjD3ypx63vxPsS+S3ECAPftpV1aJRlIf1qXAOiIP2nmL0= +=+o0T -----END PGP SIGNATURE----- diff --git a/dev-lang/php/php-5.4.26.ebuild b/dev-lang/php/php-5.4.26.ebuild new file mode 100644 index 000000000000..210eb0bbd0c1 --- /dev/null +++ b/dev-lang/php/php-5.4.26.ebuild @@ -0,0 +1,801 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.4.26.ebuild,v 1.1 2014/03/07 09:06:24 olemarkus Exp $ + +EAPI=5 + +inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd + +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" + +function php_get_uri () +{ + case "${1}" in + "php-pre") + echo "http://downloads.php.net/stas/${2}" + ;; + "php") + echo "http://www.php.net/distributions/${2}" + ;; + "olemarkus") + echo "http://dev.gentoo.org/~olemarkus/php/${2}" + ;; + "gentoo") + echo "mirror://gentoo/${2}" + ;; + *) + die "unhandled case in php_get_uri" + ;; + esac +} + +PHP_MV="$(get_major_version)" +SLOT="$(get_version_component_range 1-2)" + +# alias, so we can handle different types of releases (finals, rcs, alphas, +# betas, ...) w/o changing the whole ebuild +PHP_PV="${PV/_rc/RC}" +PHP_PV="${PHP_PV/_alpha/alpha}" +PHP_PV="${PHP_PV/_beta/beta}" +PHP_RELEASE="php" +[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" +[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" +[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" +PHP_P="${PN}-${PHP_PV}" + +PHP_PATCHSET_LOC="olemarkus" + +PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" + +PHP_PATCHSET="2" +PHP_PATCHSET_URI=" + $(php_get_uri "${PHP_PATCHSET_LOC}" "php-patchset-${SLOT}-r${PHP_PATCHSET}.tar.bz2")" + +PHP_FPM_INIT_VER="4" +PHP_FPM_CONF_VER="1" + +SRC_URI=" + ${PHP_SRC_URI} + ${PHP_PATCHSET_URI}" + +DESCRIPTION="The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs." +HOMEPAGE="http://php.net/" +LICENSE="PHP-3" + +S="${WORKDIR}/${PHP_P}" + +# We can build the following SAPIs in the given order +SAPIS="embed cli cgi fpm apache2" + +# SAPIs and SAPI-specific USE flags (cli SAPI is default on): +IUSE="${IUSE} + ${SAPIS/cli/+cli} + threads" + +IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk + crypt +ctype curl curlwrappers debug + enchant exif +fileinfo +filter firebird + flatfile ftp gd gdbm gmp +hash +iconv imap inifile + intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash + mssql mysql mysqlnd mysqli nls + oci8-instant-client odbc pcntl pdo +phar +posix postgres qdbm + readline recode selinux +session sharedmem + +simplexml snmp soap sockets spell sqlite ssl + sybase-ct sysvipc systemd tidy +tokenizer truetype unicode wddx + +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" + +DEPEND=" + >=app-admin/eselect-php-0.7.1-r3[apache2?,fpm?] + >=dev-libs/libpcre-8.32[unicode] + apache2? ( www-servers/apache[threads=] ) + berkdb? ( =sys-libs/db-4* ) + bzip2? ( app-arch/bzip2 ) + cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) + cjk? ( !gd? ( + virtual/jpeg:0 + media-libs/libpng:0= + sys-libs/zlib + ) ) + crypt? ( >=dev-libs/libmcrypt-2.4 ) + curl? ( >=net-misc/curl-7.10.5 ) + enchant? ( app-text/enchant ) + exif? ( !gd? ( + virtual/jpeg:0 + media-libs/libpng:0= + sys-libs/zlib + ) ) + firebird? ( dev-db/firebird ) + gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) + gdbm? ( >=sys-libs/gdbm-1.8.0 ) + gmp? ( >=dev-libs/gmp-4.1.2 ) + iconv? ( virtual/libiconv ) + imap? ( virtual/imap-c-client[ssl=] ) + intl? ( dev-libs/icu:= ) + iodbc? ( dev-db/libiodbc ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11 ) + ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) + libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) + mssql? ( dev-db/freetds[mssql] ) + !mysqlnd? ( + mysql? ( virtual/mysql ) + mysqli? ( >=virtual/mysql-4.1 ) + ) + nls? ( sys-devel/gettext ) + oci8-instant-client? ( dev-db/oracle-instantclient-basic ) + odbc? ( >=dev-db/unixODBC-1.8.13 ) + postgres? ( dev-db/postgresql-base ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline ) + recode? ( app-text/recode ) + sharedmem? ( dev-libs/mm ) + simplexml? ( >=dev-libs/libxml2-2.6.8 ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + soap? ( >=dev-libs/libxml2-2.6.8 ) + spell? ( >=app-text/aspell-0.50 ) + sqlite? ( >=dev-db/sqlite-3.7.6.3 ) + ssl? ( >=dev-libs/openssl-0.9.7 ) + sybase-ct? ( dev-db/freetds ) + tidy? ( app-text/htmltidy ) + truetype? ( + =media-libs/freetype-2* + >=media-libs/t1lib-5.0.0 + !gd? ( + virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) + ) + unicode? ( dev-libs/oniguruma ) + wddx? ( >=dev-libs/libxml2-2.6.8 ) + xml? ( >=dev-libs/libxml2-2.6.8 ) + xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) + xmlreader? ( >=dev-libs/libxml2-2.6.8 ) + xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) + xpm? ( + x11-libs/libXpm + virtual/jpeg:0 + media-libs/libpng:0= sys-libs/zlib + ) + xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) + zip? ( sys-libs/zlib ) + zlib? ( sys-libs/zlib ) + virtual/mta +" + +php="=${CATEGORY}/${PF}" + +REQUIRED_USE=" + truetype? ( gd ) + cjk? ( gd ) + exif? ( gd ) + + xpm? ( gd ) + gd? ( zlib ) + simplexml? ( xml ) + soap? ( xml ) + wddx? ( xml ) + xmlrpc? ( || ( xml iconv ) ) + xmlreader? ( xml ) + xslt? ( xml ) + ldap-sasl? ( ldap ) + mhash? ( hash ) + phar? ( hash ) + mysqlnd? ( || ( + mysql + mysqli + pdo + ) ) + + qdbm? ( !gdbm ) + readline? ( !libedit ) + recode? ( !imap !mysql !mysqli ) + sharedmem? ( !threads ) + + !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" + +RDEPEND="${DEPEND}" + +RDEPEND="${RDEPEND} + fpm? ( + selinux? ( sec-policy/selinux-phpfpm ) + systemd? ( sys-apps/systemd ) )" + +DEPEND="${DEPEND} + sys-devel/flex + >=sys-devel/m4-1.4.3 + >=sys-devel/libtool-1.5.18" + +# Allow users to install production version if they want to + +case "${PHP_INI_VERSION}" in + production|development) + ;; + *) + PHP_INI_VERSION="development" + ;; +esac + +PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" +PHP_INI_FILE="php.ini" + +want_apache + +pkg_setup() { + depend.apache_pkg_setup +} + +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 /tmp for save_path, bug #282768 + sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|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 = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" + + if use_if_iuse opcache; then + elog "Adding opcache to ${phpinisrc}" + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> ${phpinisrc} + fi + + dodir "${PHP_INI_DIR#${EPREFIX}}" + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${phpinisrc}" "${PHP_INI_FILE}" + + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" + elog + + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" + + # SAPI-specific handling + + if [[ "${sapi}" == "fpm" ]] ; then + [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 + einfo "Installing FPM CGI config file php-fpm.conf" + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf + + # Remove bogus /etc/php-fpm.conf.default (bug 359906) + [[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" + fi + + # Install PHP ini files into /usr/share/php + + dodoc php.ini-development + dodoc php.ini-production + +} + +php_set_ini_dir() { + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" +} + +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 + + # Change PHP branding + # Get the alpha/beta/rc version + sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ + -i configure.in || die "Unable to change PHP branding" + + # 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 + + #Add user patches #357637 + epatch_user + + #force rebuilding aclocal.m4 + rm aclocal.m4 + eautoreconf + + if [[ ${CHOST} == *-darwin* ]] ; then + # http://bugs.php.net/bug.php?id=48795, bug #343481 + sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die + fi +} + +src_configure() { + addpredict /usr/share/snmp/mibs/.index + addpredict /var/lib/net-snmp/mib_indexes + + PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" + + # 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)" + + # extension USE flag shared + my_conf+=" + $(use_enable bcmath bcmath ) + $(use_with bzip2 bz2 "${EPREFIX}"/usr) + $(use_enable calendar calendar ) + $(use_enable ctype ctype ) + $(use_with curl curl "${EPREFIX}"/usr) + $(use_with curlwrappers curlwrappers "${EPREFIX}"/usr) + $(use_enable xml dom ) + $(use_with enchant enchant "${EPREFIX}"/usr) + $(use_enable exif exif ) + $(use_enable fileinfo fileinfo ) + $(use_enable filter filter ) + $(use_enable ftp ftp ) + $(use_with nls gettext "${EPREFIX}"/usr) + $(use_with gmp gmp "${EPREFIX}"/usr) + $(use_enable hash hash ) + $(use_with mhash mhash "${EPREFIX}"/usr) + $(use_with iconv iconv $(use elibc_glibc || echo "${EPREFIX}"/usr)) + $(use_enable intl intl ) + $(use_enable ipv6 ipv6 ) + $(use_enable json json ) + $(use_with kerberos kerberos "${EPREFIX}"/usr) + $(use_enable xml libxml ) + $(use_with xml libxml-dir "${EPREFIX}"/usr) + $(use_enable unicode mbstring ) + $(use_with crypt mcrypt "${EPREFIX}"/usr) + $(use_with mssql mssql "${EPREFIX}"/usr) + $(use_with unicode onig "${EPREFIX}"/usr) + $(use_with ssl openssl "${EPREFIX}"/usr) + $(use_with ssl openssl-dir "${EPREFIX}"/usr) + $(use_enable pcntl pcntl ) + $(use_enable phar phar ) + $(use_enable pdo pdo ) + $(use_with postgres pgsql "${EPREFIX}"/usr) + $(use_enable posix posix ) + $(use_with spell pspell "${EPREFIX}"/usr) + $(use_with recode recode "${EPREFIX}"/usr) + $(use_enable simplexml simplexml ) + $(use_enable sharedmem shmop ) + $(use_with snmp snmp "${EPREFIX}"/usr) + $(use_enable soap soap ) + $(use_enable sockets sockets ) + $(use_with sqlite sqlite3 "${EPREFIX}"/usr) + $(use_with sybase-ct sybase-ct "${EPREFIX}"/usr) + $(use_enable sysvipc sysvmsg ) + $(use_enable sysvipc sysvsem ) + $(use_enable sysvipc sysvshm ) + $(use_with systemd fpm-systemd) + $(use_with tidy tidy "${EPREFIX}"/usr) + $(use_enable tokenizer tokenizer ) + $(use_enable wddx wddx ) + $(use_enable xml xml ) + $(use_enable xmlreader xmlreader ) + $(use_enable xmlwriter xmlwriter ) + $(use_with xmlrpc xmlrpc) + $(use_with xslt xsl "${EPREFIX}"/usr) + $(use_enable zip zip ) + $(use_with zlib zlib "${EPREFIX}"/usr) + $(use_enable debug debug )" + + # 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 + my_conf+=" + $(use_with cdb cdb) + $(use_with berkdb db4 ${EPREFIX}/usr) + $(use_enable flatfile flatfile ) + $(use_with gdbm gdbm ${EPREFIX}/usr) + $(use_enable inifile inifile ) + $(use_with qdbm qdbm ${EPREFIX}/usr)" + + # Support for the GD graphics library + my_conf+=" + $(use_with truetype freetype-dir ${EPREFIX}/usr) + $(use_with truetype t1lib ${EPREFIX}/usr) + $(use_enable cjk gd-jis-conv ) + $(use_with gd jpeg-dir ${EPREFIX}/usr) + $(use_with gd png-dir ${EPREFIX}/usr) + $(use_with xpm xpm-dir ${EPREFIX}/usr)" + # enable gd last, so configure can pick up the previous settings + my_conf+=" + $(use_with gd gd)" + + # IMAP support + if use imap ; then + my_conf+=" + $(use_with imap imap ${EPREFIX}/usr) + $(use_with ssl imap-ssl ${EPREFIX}/usr)" + fi + + # Interbase/firebird support + + if use firebird ; then + my_conf+=" + $(use_with firebird interbase ${EPREFIX}/usr)" + fi + + # LDAP support + if use ldap ; then + my_conf+=" + $(use_with ldap ldap ${EPREFIX}/usr) + $(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)" + fi + + # MySQL support + if use mysql ; then + if use mysqlnd ; then + my_conf+=" + $(use_with mysql mysql mysqlnd)" + else + my_conf+=" + $(use_with mysql mysql ${EPREFIX}/usr)" + fi + my_conf+=" + $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)" + fi + + # MySQLi support + if use mysqlnd ; then + my_conf+=" + $(use_with mysqli mysqli mysqlnd)" + else + my_conf+=" + $(use_with mysqli mysqli ${EPREFIX}/usr/bin/mysql_config)" + fi + + # ODBC support + if use odbc ; then + my_conf+=" + $(use_with odbc unixODBC ${EPREFIX}/usr)" + fi + + if use iodbc ; then + my_conf+=" + $(use_with iodbc iodbc ${EPREFIX}/usr)" + fi + + # Oracle support + if use oci8-instant-client ; then + my_conf+=" + $(use_with oci8-instant-client oci8)" + fi + + # PDO support + if use pdo ; then + my_conf+=" + $(use_with mssql pdo-dblib )" + if use mysqlnd ; then + my_conf+=" + $(use_with mysqlnd pdo-mysql mysqlnd)" + else + my_conf+=" + $(use_with mysql pdo-mysql ${EPREFIX}/usr)" + fi + my_conf+=" + $(use_with postgres pdo-pgsql ) + $(use_with sqlite pdo-sqlite ${EPREFIX}/usr) + $(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)" + if use oci8-instant-client ; then + my_conf+=" + $(use_with oci8-instant-client pdo-oci)" + fi + fi + + # readline/libedit support + my_conf+=" + $(use_with readline readline ${EPREFIX}/usr) + $(use_with libedit libedit ${EPREFIX}/usr)" + + # Session support + if use session ; then + my_conf+=" + $(use_with sharedmem mm ${EPREFIX}/usr)" + else + my_conf+=" + $(use_enable session session )" + fi + + # Use pic for shared modules such as apache2's mod_php + my_conf="${my_conf} --with-pic" + + # 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=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr" + + # Catch CFLAGS problems + # Fixes bug #14067. + # Changed order to run it in reverse for bug #32022 and #12021. + replace-cpu-flags "k6*" "i586" + + # 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 + + mkdir -p "${WORKDIR}/sapis-build" + for one_sapi in $SAPIS ; do + use "${one_sapi}" || continue + php_set_ini_dir "${one_sapi}" + + cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" + cd "${WORKDIR}/sapis-build/${one_sapi}" + + sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} + --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" + + for sapi in $SAPIS ; do + case "$sapi" in + cli|cgi|embed|fpm) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf="${sapi_conf} --enable-${sapi}" + else + sapi_conf="${sapi_conf} --disable-${sapi}" + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs" + else + sapi_conf="${sapi_conf} --without-apxs2" + fi + ;; + esac + done + + econf ${sapi_conf} + done +} + +src_compile() { + # snmp seems to run during src_compile, too (bug #324739) + addpredict /usr/share/snmp/mibs/.index + addpredict /var/lib/net-snmp/mib_indexes + + for sapi in ${SAPIS} ; do + if use "${sapi}"; then + cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1" + emake || die "emake failed" + fi + done +} + +src_install() { + # see bug #324739 for what happens when we don't have that + addpredict /usr/share/snmp/mibs/.index + + # grab the first SAPI that got built and install common files from there + local first_sapi="" + for sapi in $SAPIS ; do + if use $sapi ; then + first_sapi=$sapi + break + fi + done + + # Makefile forgets to create this before trying to write to it... + dodir "${PHP_DESTDIR#${EPREFIX}}/bin" + + # Install php environment (without any sapis) + cd "${WORKDIR}/sapis-build/$first_sapi" + emake INSTALL_ROOT="${D}" \ + install-build install-headers install-programs \ + || die "emake install failed" + + local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" + + # 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}" + cd "${WORKDIR}/sapis-build/${sapi}" + + if [[ "${sapi}" == "apache2" ]] ; then + # We're specifically not using emake install-sapi as libtool + # may cause unnecessary relink failures (see bug #351266) + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" + newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" + keepdir "/usr/$(get_libdir)/apache2/modules" + else + # needed each time, php_install_ini would reset it + local dest="${PHP_DESTDIR#${EPREFIX}}" + into "${dest}" + 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}$(get_libname)" + ;; + *) + die "unhandled sapi in src_install" + ;; + esac + + if [[ "${source}" == *"$(get_libname)" ]]; then + dolib.so "${source}" || die "Unable to install ${sapi} sapi" + else + dobin "${source}" || die "Unable to install ${sapi} sapi" + local name="$(basename ${source})" + dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" + fi + 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 + + # Installing opcache module + if use_if_iuse opcache ; then + dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module" + fi + + # Install env.d files + newenvd "${FILESDIR}/20php5-envd" \ + "20php${SLOT}" + sed -e "s|/lib/|/$(get_libdir)/|g" -i \ + "${ED}/etc/env.d/20php${SLOT}" + sed -e "s|php5|php${SLOT}|g" -i \ + "${ED}/etc/env.d/20php${SLOT}" + + # set php-config variable correctly (bug #278439) + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" + + if use fpm ; then + if use systemd; then + systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service" + else + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service" + fi + fi +} + +src_test() { + echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" + if [[ ! -x "${PHP_BIN}" ]] ; then + ewarn "Test phase requires USE=cli, skipping" + return + else + export TEST_PHP_EXECUTABLE="${PHP_BIN}" + fi + + if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then + export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" + fi + + REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ + "${WORKDIR}/sapis-build/cli/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 +} + +pkg_postinst() { + # Output some general info to the user + if use apache2 ; then + APACHE2_MOD_DEFINE="PHP5" + APACHE2_MOD_CONF="70_mod_php5" + apache-module_pkg_postinst + fi + + # Create the symlinks for php + for m in ${SAPIS}; do + [[ ${m} == 'embed' ]] && continue; + if use $m ; then + local ci=$(eselect php show $m) + if [[ -z $ci ]]; then + eselect php set $m php${SLOT} + einfo "Switched ${m} to use php:${SLOT}" + einfo + elif [[ $ci != "php${SLOT}" ]] ; then + elog "To switch $m to use php:${SLOT}, run" + elog " eselect php set $m php${SLOT}" + elog + fi + fi + done + + elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order" + elog "to compile extensions for the ${SLOT} ABI" + elog + if ! use readline && use cli ; then + ewarn "Note that in order to use php interactivly, you need to enable" + ewarn "the readline USE flag or php -a will hang" + fi + elog + elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." + elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" + elog "'production' or 'development' in ${EPREFIX}/etc/make.conf" + elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}" + + elog + elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" + elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml" + elog +} + +pkg_prerm() { + eselect php cleanup +} diff --git a/dev-lang/php/php-5.5.10.ebuild b/dev-lang/php/php-5.5.10.ebuild new file mode 100644 index 000000000000..9c3399ad099b --- /dev/null +++ b/dev-lang/php/php-5.5.10.ebuild @@ -0,0 +1,780 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.5.10.ebuild,v 1.1 2014/03/07 09:06:24 olemarkus Exp $ + +EAPI=5 + +inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" + +function php_get_uri () +{ + case "${1}" in + "php-pre") + echo "http://downloads.php.net/dsp/${2}" + ;; + "php") + echo "http://www.php.net/distributions/${2}" + ;; + "olemarkus") + echo "http://dev.gentoo.org/~olemarkus/php/${2}" + ;; + "gentoo") + echo "mirror://gentoo/${2}" + ;; + *) + die "unhandled case in php_get_uri" + ;; + esac +} + +PHP_MV="$(get_major_version)" +SLOT="$(get_version_component_range 1-2)" + +# alias, so we can handle different types of releases (finals, rcs, alphas, +# betas, ...) w/o changing the whole ebuild +PHP_PV="${PV/_rc/RC}" +PHP_PV="${PHP_PV/_alpha/alpha}" +PHP_PV="${PHP_PV/_beta/beta}" +PHP_RELEASE="php" +[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" +[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" +[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" +PHP_P="${PN}-${PHP_PV}" + +PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" + +PHP_FPM_CONF_VER="1" + +SRC_URI="${PHP_SRC_URI}" + +DESCRIPTION="The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs." +HOMEPAGE="http://php.net/" +LICENSE="PHP-3" + +S="${WORKDIR}/${PHP_P}" + +# We can build the following SAPIs in the given order +SAPIS="embed cli cgi fpm apache2" + +# SAPIs and SAPI-specific USE flags (cli SAPI is default on): +IUSE="${IUSE} + ${SAPIS/cli/+cli} + threads" + +IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk + crypt +ctype curl debug + enchant exif frontbase +fileinfo +filter firebird + flatfile ftp gd gdbm gmp +hash +iconv imap inifile + intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash + mssql mysql libmysqlclient mysqli nls + oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm + readline recode selinux +session sharedmem + +simplexml snmp soap sockets spell sqlite ssl + sybase-ct sysvipc systemd tidy +tokenizer truetype unicode wddx + +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" + +DEPEND=" + >=app-admin/eselect-php-0.7.1-r3[apache2?,fpm?] + >=dev-libs/libpcre-8.32[unicode] + apache2? ( www-servers/apache[threads=] ) + berkdb? ( =sys-libs/db-4* ) + bzip2? ( app-arch/bzip2 ) + cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) + cjk? ( !gd? ( + virtual/jpeg:0 + media-libs/libpng:0= + sys-libs/zlib + ) ) + crypt? ( >=dev-libs/libmcrypt-2.4 ) + curl? ( >=net-misc/curl-7.10.5 ) + enchant? ( app-text/enchant ) + exif? ( !gd? ( + virtual/jpeg:0 + media-libs/libpng:0= + sys-libs/zlib + ) ) + firebird? ( dev-db/firebird ) + gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) + gdbm? ( >=sys-libs/gdbm-1.8.0 ) + gmp? ( >=dev-libs/gmp-4.1.2 ) + iconv? ( virtual/libiconv ) + imap? ( virtual/imap-c-client[ssl=] ) + intl? ( dev-libs/icu:= ) + iodbc? ( dev-db/libiodbc ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11 ) + ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) + libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) + mssql? ( dev-db/freetds[mssql] ) + libmysqlclient? ( + mysql? ( virtual/mysql ) + mysqli? ( >=virtual/mysql-4.1 ) + ) + nls? ( sys-devel/gettext ) + oci8-instant-client? ( dev-db/oracle-instantclient-basic ) + odbc? ( >=dev-db/unixODBC-1.8.13 ) + postgres? ( dev-db/postgresql-base ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline ) + recode? ( app-text/recode ) + sharedmem? ( dev-libs/mm ) + simplexml? ( >=dev-libs/libxml2-2.6.8 ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + soap? ( >=dev-libs/libxml2-2.6.8 ) + spell? ( >=app-text/aspell-0.50 ) + sqlite? ( >=dev-db/sqlite-3.7.6.3 ) + ssl? ( >=dev-libs/openssl-0.9.7 ) + sybase-ct? ( dev-db/freetds ) + tidy? ( app-text/htmltidy ) + truetype? ( + =media-libs/freetype-2* + >=media-libs/t1lib-5.0.0 + !gd? ( + virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) + ) + unicode? ( dev-libs/oniguruma ) + wddx? ( >=dev-libs/libxml2-2.6.8 ) + xml? ( >=dev-libs/libxml2-2.6.8 ) + xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) + xmlreader? ( >=dev-libs/libxml2-2.6.8 ) + xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) + xpm? ( + x11-libs/libXpm + virtual/jpeg:0 + media-libs/libpng:0= sys-libs/zlib + ) + xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) + zip? ( sys-libs/zlib ) + zlib? ( sys-libs/zlib ) + virtual/mta +" + +php="=${CATEGORY}/${PF}" + +REQUIRED_USE=" + truetype? ( gd ) + cjk? ( gd ) + exif? ( gd ) + + xpm? ( gd ) + gd? ( zlib ) + simplexml? ( xml ) + soap? ( xml ) + wddx? ( xml ) + xmlrpc? ( || ( xml iconv ) ) + xmlreader? ( xml ) + xslt? ( xml ) + ldap-sasl? ( ldap ) + mhash? ( hash ) + phar? ( hash ) + libmysqlclient? ( || ( + mysql + mysqli + pdo + ) ) + + qdbm? ( !gdbm ) + readline? ( !libedit ) + recode? ( !imap !mysql !mysqli ) + sharedmem? ( !threads ) + + !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" + +RDEPEND="${DEPEND}" + +RDEPEND="${RDEPEND} + fpm? ( + selinux? ( sec-policy/selinux-phpfpm ) + systemd? ( sys-apps/systemd ) )" + +DEPEND="${DEPEND} + sys-devel/flex + >=sys-devel/m4-1.4.3 + >=sys-devel/libtool-1.5.18" + +# Allow users to install production version if they want to + +case "${PHP_INI_VERSION}" in + production|development) + ;; + *) + PHP_INI_VERSION="development" + ;; +esac + +PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" +PHP_INI_FILE="php.ini" + +want_apache + +pkg_setup() { + depend.apache_pkg_setup +} + +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 /tmp for save_path, bug #282768 + sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|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 = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" + + dodir "${PHP_INI_DIR#${EPREFIX}}" + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${phpinisrc}" "${PHP_INI_FILE}" + + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" + elog + + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" + + if use_if_iuse opcache; then + elog "Adding opcache to $PHP_EXT_INI_DIR" + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini + dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" + fi + + # SAPI-specific handling + + if [[ "${sapi}" == "fpm" ]] ; then + [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 + einfo "Installing FPM CGI config file php-fpm.conf" + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf + + # Remove bogus /etc/php-fpm.conf.default (bug 359906) + [[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" + fi + + # Install PHP ini files into /usr/share/php + + dodoc php.ini-development + dodoc php.ini-production + +} + +php_set_ini_dir() { + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" +} + +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 + + # Change PHP branding + # Get the alpha/beta/rc version + sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ + -i configure.in || die "Unable to change PHP branding" + + # 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 + + #Add user patches #357637 + epatch_user + + #force rebuilding aclocal.m4 + rm aclocal.m4 + eautoreconf + + if [[ ${CHOST} == *-darwin* ]] ; then + # http://bugs.php.net/bug.php?id=48795, bug #343481 + sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die + fi +} + +src_configure() { + addpredict /usr/share/snmp/mibs/.index + addpredict /var/lib/net-snmp/mib_indexes + + PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" + + # 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)" + + # extension USE flag shared + my_conf+=" + $(use_enable bcmath bcmath ) + $(use_with bzip2 bz2 "${EPREFIX}"/usr) + $(use_enable calendar calendar ) + $(use_enable ctype ctype ) + $(use_with curl curl "${EPREFIX}"/usr) + $(use_enable xml dom ) + $(use_with enchant enchant "${EPREFIX}"/usr) + $(use_enable exif exif ) + $(use_enable fileinfo fileinfo ) + $(use_enable filter filter ) + $(use_enable ftp ftp ) + $(use_with nls gettext "${EPREFIX}"/usr) + $(use_with gmp gmp "${EPREFIX}"/usr) + $(use_enable hash hash ) + $(use_with mhash mhash "${EPREFIX}"/usr) + $(use_with iconv iconv $(use elibc_glibc || echo "${EPREFIX}"/usr)) + $(use_enable intl intl ) + $(use_enable ipv6 ipv6 ) + $(use_enable json json ) + $(use_with kerberos kerberos "${EPREFIX}"/usr) + $(use_enable xml libxml ) + $(use_with xml libxml-dir "${EPREFIX}"/usr) + $(use_enable unicode mbstring ) + $(use_with crypt mcrypt "${EPREFIX}"/usr) + $(use_with mssql mssql "${EPREFIX}"/usr) + $(use_with unicode onig "${EPREFIX}"/usr) + $(use_with ssl openssl "${EPREFIX}"/usr) + $(use_with ssl openssl-dir "${EPREFIX}"/usr) + $(use_enable pcntl pcntl ) + $(use_enable phar phar ) + $(use_enable pdo pdo ) + $(use_enable opcache opcache ) + $(use_with postgres pgsql "${EPREFIX}"/usr) + $(use_enable posix posix ) + $(use_with spell pspell "${EPREFIX}"/usr) + $(use_with recode recode "${EPREFIX}"/usr) + $(use_enable simplexml simplexml ) + $(use_enable sharedmem shmop ) + $(use_with snmp snmp "${EPREFIX}"/usr) + $(use_enable soap soap ) + $(use_enable sockets sockets ) + $(use_with sqlite sqlite3 "${EPREFIX}"/usr) + $(use_with sybase-ct sybase-ct "${EPREFIX}"/usr) + $(use_enable sysvipc sysvmsg ) + $(use_enable sysvipc sysvsem ) + $(use_enable sysvipc sysvshm ) + $(use_with systemd fpm-systemd) + $(use_with tidy tidy "${EPREFIX}"/usr) + $(use_enable tokenizer tokenizer ) + $(use_enable wddx wddx ) + $(use_enable xml xml ) + $(use_enable xmlreader xmlreader ) + $(use_enable xmlwriter xmlwriter ) + $(use_with xmlrpc xmlrpc) + $(use_with xslt xsl "${EPREFIX}"/usr) + $(use_enable zip zip ) + $(use_with zlib zlib "${EPREFIX}"/usr) + $(use_enable debug debug )" + + # 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 + my_conf+=" + $(use_with cdb cdb) + $(use_with berkdb db4 ${EPREFIX}/usr) + $(use_enable flatfile flatfile ) + $(use_with gdbm gdbm ${EPREFIX}/usr) + $(use_enable inifile inifile ) + $(use_with qdbm qdbm ${EPREFIX}/usr)" + + # Support for the GD graphics library + my_conf+=" + $(use_with truetype freetype-dir ${EPREFIX}/usr) + $(use_with truetype t1lib ${EPREFIX}/usr) + $(use_enable cjk gd-jis-conv ) + $(use_with gd jpeg-dir ${EPREFIX}/usr) + $(use_with gd png-dir ${EPREFIX}/usr) + $(use_with xpm xpm-dir ${EPREFIX}/usr)" + # enable gd last, so configure can pick up the previous settings + my_conf+=" + $(use_with gd gd)" + + # IMAP support + if use imap ; then + my_conf+=" + $(use_with imap imap ${EPREFIX}/usr) + $(use_with ssl imap-ssl ${EPREFIX}/usr)" + fi + + # Interbase/firebird support + + if use firebird ; then + my_conf+=" + $(use_with firebird interbase ${EPREFIX}/usr)" + fi + + # LDAP support + if use ldap ; then + my_conf+=" + $(use_with ldap ldap ${EPREFIX}/usr) + $(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)" + fi + + # MySQL support + local mysqllib="mysqlnd" + local mysqlilib="mysqlnd" + use libmysqlclient && mysqllib="${EPREFIX}/usr" + use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" + + my_conf+=" $(use_with mysql mysql $mysqllib)" + my_conf+=" $(use_with mysqli mysqli $mysqlilib)" + + local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)" + if use mysql ; then + my_conf+="${mysqlsock}" + elif use mysqli ; then + my_conf+="${mysqlsock}" + fi + + # ODBC support + if use odbc ; then + my_conf+=" + $(use_with odbc unixODBC ${EPREFIX}/usr)" + fi + + if use iodbc ; then + my_conf+=" + $(use_with iodbc iodbc ${EPREFIX}/usr)" + fi + + # Oracle support + if use oci8-instant-client ; then + my_conf+=" + $(use_with oci8-instant-client oci8)" + fi + + # PDO support + if use pdo ; then + my_conf+=" + $(use_with mssql pdo-dblib ) + $(use_with mysql pdo-mysql ${mysqllib}) + $(use_with postgres pdo-pgsql ) + $(use_with sqlite pdo-sqlite ${EPREFIX}/usr) + $(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)" + if use oci8-instant-client ; then + my_conf+=" + $(use_with oci8-instant-client pdo-oci)" + fi + fi + + # readline/libedit support + my_conf+=" + $(use_with readline readline ${EPREFIX}/usr) + $(use_with libedit libedit ${EPREFIX}/usr)" + + # Session support + if use session ; then + my_conf+=" + $(use_with sharedmem mm ${EPREFIX}/usr)" + else + my_conf+=" + $(use_enable session session )" + fi + + # Use pic for shared modules such as apache2's mod_php + my_conf="${my_conf} --with-pic" + + # 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=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr" + + # Catch CFLAGS problems + # Fixes bug #14067. + # Changed order to run it in reverse for bug #32022 and #12021. + replace-cpu-flags "k6*" "i586" + + # 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 + + mkdir -p "${WORKDIR}/sapis-build" + for one_sapi in $SAPIS ; do + use "${one_sapi}" || continue + php_set_ini_dir "${one_sapi}" + + cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" + cd "${WORKDIR}/sapis-build/${one_sapi}" + + sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} + --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" + + for sapi in $SAPIS ; do + case "$sapi" in + cli|cgi|embed|fpm) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf="${sapi_conf} --enable-${sapi}" + else + sapi_conf="${sapi_conf} --disable-${sapi}" + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs" + else + sapi_conf="${sapi_conf} --without-apxs2" + fi + ;; + esac + done + + econf ${sapi_conf} + done +} + +src_compile() { + # snmp seems to run during src_compile, too (bug #324739) + addpredict /usr/share/snmp/mibs/.index + addpredict /var/lib/net-snmp/mib_indexes + + for sapi in ${SAPIS} ; do + if use "${sapi}"; then + cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1" + emake || die "emake failed" + fi + done +} + +src_install() { + # see bug #324739 for what happens when we don't have that + addpredict /usr/share/snmp/mibs/.index + + # grab the first SAPI that got built and install common files from there + local first_sapi="" + for sapi in $SAPIS ; do + if use $sapi ; then + first_sapi=$sapi + break + fi + done + + # Makefile forgets to create this before trying to write to it... + dodir "${PHP_DESTDIR#${EPREFIX}}/bin" + + # Install php environment (without any sapis) + cd "${WORKDIR}/sapis-build/$first_sapi" + emake INSTALL_ROOT="${D}" \ + install-build install-headers install-programs \ + || die "emake install failed" + + local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" + + # 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}" + cd "${WORKDIR}/sapis-build/${sapi}" + + if [[ "${sapi}" == "apache2" ]] ; then + # We're specifically not using emake install-sapi as libtool + # may cause unnecessary relink failures (see bug #351266) + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" + newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" + keepdir "/usr/$(get_libdir)/apache2/modules" + else + # needed each time, php_install_ini would reset it + local dest="${PHP_DESTDIR#${EPREFIX}}" + into "${dest}" + 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}$(get_libname)" + ;; + *) + die "unhandled sapi in src_install" + ;; + esac + + if [[ "${source}" == *"$(get_libname)" ]]; then + dolib.so "${source}" || die "Unable to install ${sapi} sapi" + else + dobin "${source}" || die "Unable to install ${sapi} sapi" + local name="$(basename ${source})" + dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" + fi + 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 + + # Installing opcache module + if use_if_iuse opcache ; then + dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module" + fi + + # Install env.d files + newenvd "${FILESDIR}/20php5-envd" \ + "20php${SLOT}" + sed -e "s|/lib/|/$(get_libdir)/|g" -i \ + "${ED}/etc/env.d/20php${SLOT}" + sed -e "s|php5|php${SLOT}|g" -i \ + "${ED}/etc/env.d/20php${SLOT}" + + # set php-config variable correctly (bug #278439) + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" + + if use fpm ; then + if use systemd; then + systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service" + else + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service" + fi + fi +} + +src_test() { + echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" + if [[ ! -x "${PHP_BIN}" ]] ; then + ewarn "Test phase requires USE=cli, skipping" + return + else + export TEST_PHP_EXECUTABLE="${PHP_BIN}" + fi + + if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then + export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" + fi + + REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ + "${WORKDIR}/sapis-build/cli/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 +} + +pkg_postinst() { + # Output some general info to the user + if use apache2 ; then + APACHE2_MOD_DEFINE="PHP5" + APACHE2_MOD_CONF="70_mod_php5" + apache-module_pkg_postinst + fi + + # Create the symlinks for php + for m in ${SAPIS}; do + [[ ${m} == 'embed' ]] && continue; + if use $m ; then + local ci=$(eselect php show $m) + if [[ -z $ci ]]; then + eselect php set $m php${SLOT} + einfo "Switched ${m} to use php:${SLOT}" + einfo + elif [[ $ci != "php${SLOT}" ]] ; then + elog "To switch $m to use php:${SLOT}, run" + elog " eselect php set $m php${SLOT}" + elog + fi + fi + done + + elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order" + elog "to compile extensions for the ${SLOT} ABI" + elog + if ! use readline && use cli ; then + ewarn "Note that in order to use php interactivly, you need to enable" + ewarn "the readline USE flag or php -a will hang" + fi + elog + elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." + elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" + elog "'production' or 'development' in ${EPREFIX}/etc/make.conf" + elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}" + + elog + elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" + elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml" + elog +} + +pkg_prerm() { + eselect php cleanup +} |