diff options
author | Ole Markus With <olemarkus@gentoo.org> | 2014-02-07 14:43:27 +0000 |
---|---|---|
committer | Ole Markus With <olemarkus@gentoo.org> | 2014-02-07 14:43:27 +0000 |
commit | 4ef058375165ca7b3a5fdc79b5996fbce7ead683 (patch) | |
tree | e5fc1d9b8a55cf756f6fc82f5bf7293a09e8f2e3 /dev-lang/php | |
parent | bump to 28.3 (diff) | |
download | gentoo-2-4ef058375165ca7b3a5fdc79b5996fbce7ead683.tar.gz gentoo-2-4ef058375165ca7b3a5fdc79b5996fbce7ead683.tar.bz2 gentoo-2-4ef058375165ca7b3a5fdc79b5996fbce7ead683.zip |
Version bump
Diffstat (limited to 'dev-lang/php')
-rw-r--r-- | dev-lang/php/Manifest | 14 | ||||
-rw-r--r-- | dev-lang/php/php-5.4.25.ebuild | 801 | ||||
-rw-r--r-- | dev-lang/php/php-5.5.9.ebuild | 780 |
3 files changed, 1585 insertions, 10 deletions
diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest index 522ce875d8a6..2ad3bc492fdf 100644 --- a/dev-lang/php/Manifest +++ b/dev-lang/php/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA256 - AUX 20php5-envd 145 SHA256 efaae9e6ae5f7010e073c2ab6d8a9dda009f0707c7d7b0c027e142c94f7041a4 SHA512 581aa86479e3cd584ee1bc6dc6d4a135fe8ec343fe5519566d728d81f7018cfb23658bd0c0368951d380982c75adbb4f45acf3c146868aaf4e4ec8e9f2fad1ce WHIRLPOOL b9cfe0e80ba437bbc6008223c268bdafcde306ba8083dce96815804f3e1ec0937706e0db091149785a0076a6c6eaab8f7dff28578b706e84b4bb4e67850a4ecd AUX 70_mod_php5.conf-apache2 348 SHA256 5bb8a45570582b4389a7d3feea0398e1c13ed4ced96e559b9406ed8c965dea8c SHA512 c74ec09c3c4124a15e14ece4bb769bb889466160cc0878ca3d55d5afc30fd4c05673c40428b75be669f72e82ba29f60ed19767caca77bba8adc12aae1c83f6f3 WHIRLPOOL fd503ec904a3853b90f8f4cc2042cf9014fdb1383a508d22e680559009b5b1e0beb5a09909a393e53868a64712c63e35642915787fa4176af07cb594adedb441 AUX all_mysql_socket_location-gentoo.patch 633 SHA256 d1c0fcea4509cdb7504701e5b1996661483c3b5eea194c07fdaef91a1ce18a27 SHA512 cc55b3c1cd2e9fe4d4aa887146de9306afbbc44a3bd652225982cc04b9aefa8ca094448a765f52bc36e49726034cc702d9ef41e6da518946813103920f5ccf4e WHIRLPOOL e06c83a8852fcb1387a38774e91377464086a4908aee379d7196bc9ce2a76c6850399266aa0390e8f9885f6812c1ea717c8d98a4eb9949c3d86db357f95c18ac @@ -23,9 +20,11 @@ DIST php-5.3.28.tar.bz2 11051714 SHA256 0cac960c651c4fbb3d21cf2f2b279a06e21948fb DIST php-5.4.17.tar.bz2 11697434 SHA256 dc49935387a5d1f6ac798a3bb4902ca5020f3aa74117ea848b58d1bb61327eb4 SHA512 b35ab1d815bb56247c5f8842967859bfdf37ede5e4c5da4496e4f1540b2412ecb08028ed29a3cb5b79204cddc8c2f5f50a1a0dd1484ed449503945f2ec3f817a WHIRLPOOL 3fcb8094ef8e2123cb7a620df17d1e900b61765bb8127f93edcc5b124fc4233c02467e8d202bcec9a72b45347597a978b33b5323c3c5666da99987ebe2dc5994 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.5.2.tar.bz2 12292281 SHA256 e72aaf1fa96eac0bff127bfc74c174d1de50cd3f66d7e0e1ee919674ab463bb7 SHA512 87b0f0dd07b4efdc0c7dc6069081f7f02344d29372cc38bf0b1d1d9c1b73f56f62ee0b80f98cef37e2e13d41b30be256f1a8bff9a4f0fd7eb855d74e1376f261 WHIRLPOOL b88c03ec49c9269804e1f5aa5b5f499669f409c3fd76868d315c93c0acf4dd24d928836dd46cb948ce61c6553cc599d4bd377715d8534a6c71395e6f59e5878a 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 DIST php-5.6.0alpha1.tar.bz2 12989378 SHA256 17123fd1b07aa1cd16eedc9ae653dfbd560e2b7da95961f546334fda14bba804 SHA512 3cfa54c724f41790d2bbef5d9f5552ec17d6d5fdc75356ba41f747e161d5112ce46fc32f7300897227b61a959f6973558f8d67c7eb669d866569c44ad7507140 WHIRLPOOL f3fcfae2782e6de86e84913c2daaeefc03dd39796143c8001753b9e1dbd923c4f28f39beb81c05cca71d0642db283102f1dee3b4788791d6f478010335595a3e DIST php-patchset-5.3-r0.tar.bz2 7368 SHA256 1a67b34a681dea33ea38f0ffc32b70a78b4c5dc1c3603d1bba31bb130d803ef7 SHA512 765b0cf56a3e63ded4ad1d1ba67567881ad06bdc2814cc07004fa338f38fd69078819c7463d2c55e00805c8f33fa925b94228bf7bc3d223acc33c6cff540024c WHIRLPOOL 59e18b33e11d968fac2a4571173121bf8141bb2f1eab62192e15bc59e351d3ab973f04343b447681d8a2adddf0844edb8a481d027bfc14c7e1fd8222169094ec DIST php-patchset-5.4-r2.tar.bz2 5824 SHA256 4a47f4d31f50a244f85349486cdb3474cf315562e097ed4c116c2b9b5730ecef SHA512 3c2523458a627373da7acb93fb2cd621f50b19fe2ba1d30beb62eeaaa39045262b917cfd0b631046fec9c8027cfa99bd0426a079ab45eb172b21d25d6e085dde WHIRLPOOL fe4f015e2f0dc66cc23ef16fb5bb33117952593ae0770d4bcd37ecc1c431cbcc7874189d265696305c60b4e395e7ce902667e38203db46867304868271affdea @@ -37,19 +36,14 @@ EBUILD php-5.4.17.ebuild 22212 SHA256 38fda892fae11f0eea6aa5eec215fd517b39c6780d EBUILD php-5.4.23.ebuild 22006 SHA256 2643b2629cd18c7e2126b0613f4c4337c30c7094d8a4da9cfb1e5260029790d7 SHA512 093768d93d9e87d8006a776fce46425d76a12eacf735ec3db0c52936d5998eefe8e73f5b4902402b005c72a6ec8fb6f5a481ad15a7be15407ddfd0e5e0c28157 WHIRLPOOL 2b958dc64345f7b5566a87f5f2b0042ccc5467199e49238d0b0ac531f28b608d61d358b2ae538341f93bc11a3696146bd6faffef5aad0d6b40e2a228790ece69 EBUILD php-5.4.24-r1.ebuild 22328 SHA256 ca55b250048abcf35cf708d45f567b68b8077afd5fd7c593be12148018bba273 SHA512 ca078919fe747364925c1c3cb7999d5704aef29854dedab98ba70d42d2fc84147a5649875bbd2f5b98373ec89bdbfaf44bf07e3a14967b204040ef1f80660154 WHIRLPOOL 08b41e1b5c34568732e96536afeb7cb3ef1aff873cd23cb397f7d24003578e2d258d9b436474139128c64e38127bbd13b88aa0c2767738c41f61d89d8259100c EBUILD php-5.4.24.ebuild 22020 SHA256 c57ef8e048b1436ccd49ee6a2b82755b772278349cac777b6c52fec186c0cb48 SHA512 c0d72d4ad570938bdb96ae7334d27717cb98321d09a1b4e1f57fd11bd2fd1b5dd5349efa6281f62a1f80db53af3812f16216857ed31855d60d89d0d946cc4b16 WHIRLPOOL 460f83004719e84f518213e42a20b05a78e83cf2d1a3a60e653a9f321b5f004d14e9073721df3841d5bac460f1708a43f83732e63dd324a8da6bd869c355933a +EBUILD php-5.4.25.ebuild 22328 SHA256 ca55b250048abcf35cf708d45f567b68b8077afd5fd7c593be12148018bba273 SHA512 ca078919fe747364925c1c3cb7999d5704aef29854dedab98ba70d42d2fc84147a5649875bbd2f5b98373ec89bdbfaf44bf07e3a14967b204040ef1f80660154 WHIRLPOOL 08b41e1b5c34568732e96536afeb7cb3ef1aff873cd23cb397f7d24003578e2d258d9b436474139128c64e38127bbd13b88aa0c2767738c41f61d89d8259100c EBUILD php-5.5.2.ebuild 21996 SHA256 2876ab1cc77491871f23b4ffdde60e235026939bd64142e0752209639ff2a7c4 SHA512 3de61de19ad8f3266dadd18ae5d0739aa311621330ed5eb1e7c1c60a10a059de9e2322c1df5242517bd59f7958236c52e08787c7383d9190874008c0c18a4d07 WHIRLPOOL d34329ad2e926c6b10db7c97d66fe3a2ba22d8be923d41fb16539253aad0d337915985af3ab95c88e20e33297df0bfb9f6e73701d417bbc805adf22ae62ec856 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 22166 SHA256 eeb3f293dd9f4f519207b3c9bd96e3acc75d535501c38a1cdffbe05c06427a04 SHA512 be9ba08d662061e9f81b367ee101b6dfaf979ff51e28fc7a421a39b56ed324b540af7214a33caf92e67beb50a37f2ab2a765ec936ab2bd15a8486b0bc08ccaa9 WHIRLPOOL 4e5b42413b052454bc3f8eab35a136a82bfde54e8b6b3f91c2b5ac32e021dc8ed2c50e162ef8edb9ce21a325d63ce195bc6ff4f13132b5234a4e17374280071a 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 20150 SHA256 9aa6b12fb523e63fc4b483783e5ff4c086c0f34448e3894171aebf9fb5570532 SHA512 1a019fd4b7c7c2db6ccb7b7aa8dd1557d63e412d63a5b09f9e1e267b4060d934ba05f6a0c2ac80d3ec61d58c135b6dd3a684d3bf387cc66acaafe33d36942bf5 WHIRLPOOL 00c26296666f19124ed2729f52866af15f34e10380b6c1e668147f44fbf10f1f57de3aff101293eb489ab21bdad7deb8a712722aecccbaf09a94c0a9673404ba 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) - -iEYEAREIAAYFAlLutEAACgkQCaWpQKGI+9SC0ACdGo9aBMcDi/uqRhOAP2kmfFVz -RgAAmwbTMvp5EyjIMPOrj/eBM7kH3o0O -=TUFP ------END PGP SIGNATURE----- diff --git a/dev-lang/php/php-5.4.25.ebuild b/dev-lang/php/php-5.4.25.ebuild new file mode 100644 index 000000000000..8aaec0adb165 --- /dev/null +++ b/dev-lang/php/php-5.4.25.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.25.ebuild,v 1.1 2014/02/07 14:43:27 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 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 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.9.ebuild b/dev-lang/php/php-5.5.9.ebuild new file mode 100644 index 000000000000..f49a28ddaa96 --- /dev/null +++ b/dev-lang/php/php-5.5.9.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.9.ebuild,v 1.1 2014/02/07 14:43:27 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 +} |