Version bumps
authorOle Markus With <olemarkus@gentoo.org>
Fri, 20 Mar 2015 11:41:06 +0000 (11:41 +0000)
committerOle Markus With <olemarkus@gentoo.org>
Fri, 20 Mar 2015 11:41:06 +0000 (11:41 +0000)
Package-Manager: portage-2.2.14/cvs/Linux x86_64
Manifest-Sign-Key: 0xC4A92BF5

dev-lang/php/ChangeLog
dev-lang/php/Manifest
dev-lang/php/php-5.4.39.ebuild [new file with mode: 0644]
dev-lang/php/php-5.5.23.ebuild [new file with mode: 0644]
dev-lang/php/php-5.6.7.ebuild [new file with mode: 0644]

index f424a3ea8851ff1d0f670a3995a26e30ccdd30f9..f27e3f1c9d337afdd25770ec67054bcd5b1d5a20 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for dev-lang/php
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.938 2015/03/17 09:32:36 nativemad Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/ChangeLog,v 1.939 2015/03/20 11:38:06 olemarkus Exp $
+
+*php-5.4.39 (20 Mar 2015)
+*php-5.5.23 (20 Mar 2015)
+*php-5.6.7 (20 Mar 2015)
+
+  20 Mar 2015; Ole Markus With <olemarkus@gentoo.org> +php-5.4.39.ebuild,
+  +php-5.5.23.ebuild, +php-5.6.7.ebuild:
+  Version bumps
 
   17 Mar 2015; Andreas Schuerch <nativemad@gentoo.org> php-5.4.38.ebuild,
   php-5.5.22.ebuild:
index c6ec370475be14c76456b05a00ea670805b71983..9826cc3da4efd539b37e335373a9858f605ddaa4 100644 (file)
@@ -23,41 +23,43 @@ DIST php-5.3.29.tar.bz2 11396771 SHA256 c4e1cf6972b2a9c7f2777a18497d83bf713cdbec
 DIST php-5.4.36.tar.bz2 11892431 SHA256 b0951608c3e8afb978a624c7f79a889980210f5258f666c1d997bd6491e13241 SHA512 1c37c63d51c02ae307fbbbba29129690f9746d7a766f4ccd1f763a3be4119228882a345b38bdce65a60e528da30b70670528f641eca3254890657e38569d4122 WHIRLPOOL 21f0eaae7e2a8068ed69d0bb97aaceabf924c7f8d3f59f8dbcb400733052aa2a019e8d983c8563a764df6e6cc7b2718e3c3a18fe2825fe579623e19cc0ba7d4c
 DIST php-5.4.37.tar.bz2 12275113 SHA256 857bf6675eeb0ae9c3cd6f9ccdb2a9b7bf89dcfda7f0a80857638fe023f3a8ad SHA512 56c3fc81857c190c5485a880ddc890b01ae99c409805862b8d951156483a730324b43e5c252b55c59931e451592a8567ac2905d7d2d58d6bf27dc5568d972425 WHIRLPOOL c7915667a966bb6864fbc8d42be3c4ff2c51c65821d867395dcf7144e26c4e150d061028ff4d1711fb8fa680597a97ae3af3414dda8a8e87e596829f7de4bf79
 DIST php-5.4.38.tar.bz2 12273298 SHA256 abf37db0cfadc9bb814f9df35f6aa966ad63f4f4c4475e432ec625568a5d3e88 SHA512 92b2901117bbaa6c4749027e4a7dbb2f4bb50a3f60b52583051abdfcddafbe4715025a928ea9a6c70b51352e5e43f7ced626d78f5fff97cb1be34a9864f9ed6e WHIRLPOOL 73a5412895637c3256904f97b0be3791776673b77f0f95f03dad253868c1ab9a61e90ddcaff974653e073f3e33d53efc1bac2c9b6c3a29cc2fc5b594b989dc5d
+DIST php-5.4.39.tar.bz2 12271717 SHA256 7ceb76538e709c74533210ae41148d5c01c330ac8a73220954bbc4fcae69d77e SHA512 b944517b754fbdfc0b50dd18d2644edc9abe3a66ac9806c748b7b98f5c5c07eeaabdf7990799bb39ebf716b90b4e8b34e5fedb3379c1b05bce5530d3cdf4e42d WHIRLPOOL 28fdea55684c99b53545c83fffa686a76714846d2a0af0fa514f450fdf86faa3541f752113a51189a0ec7786a5d55171eaa7be3a8d0418b60fe920be552fcf22
 DIST php-5.5.20.tar.bz2 13240796 SHA256 f28a150d1cd8991bd1a41dce4fdff4e343d1dbe01a48b9b44bea74532ce0391a SHA512 13c780af7eea9f68cb3c3bf7087305ca6f23eecb349ab501e69ce593b3bde20f9b73c5a33dea6c7221fb09a5aab8c27de999503a58afbc4efd3a1f6814e6c35d WHIRLPOOL 5bd3aef2fc0cec7ee85be120e3a3ffadf6b46ed9f343f8dfc57bc665619f20ed0809bb585fd116b88561d5b32446b83c9420b9a8247e05e286b0d195301a292e
 DIST php-5.5.21.tar.bz2 13306064 SHA256 62e9429975c4ca5d7067a5052d5388fbf2ac8c51eeee581d59b04cc5a8da83fe SHA512 354eb21594377310e7171422e5fe7902360d7693bea79cb7271af0ca2bae91570e49e47824b421821a2c4b18fcb532199655113e330e2e4ed3ae3c2f673a5412 WHIRLPOOL 88d4e685c8cdba66c71cdecf8e4386786c0532288b4630ae441f4b0ee33775656b1c5c39e233b5d8fee3f1f4a402f282f226cb717699b16e6900f803be86ae38
 DIST php-5.5.22.tar.bz2 13305486 SHA256 c218c184bef2905bc79fcdda6040f3d1738261395fb706396935d1c6f6e162bb SHA512 3eabd6fa2cd10e83fc3c00fb43313feefbb8c2772778dc6f176612fcb449761e22b55053e5b0b7f6954c0c141ab6c799f08bdca1851078511b7ef9376dadefac WHIRLPOOL 7c36ba90ed40d315475d721a3827065ee0e8748315f100383d4481b8ff1fb9af2b2a25f4dec5f3c5d8f378ff2213ce80fdc4c624c8a51cc312d51d505118b514
+DIST php-5.5.23.tar.bz2 13308115 SHA256 a99ab264dcd40181baa9defeaa4b21eb2c20d4e9316b904cc05f628762e6ada7 SHA512 b72f74d91afa9d9cc2d7b24468a37382cce47d337c63cd6a4abeea0a1c1d4d4df4245fe085a685a16cc0197fb342211653d41007ff1a4439a664ee33a1525896 WHIRLPOOL b6668a847d4d8b984c2fae8187d81206af010d8334df46f99978a4ad59854f3909dbd8d462d2ad4d52b290abdeb77562cec691aa21432aefbd88474d9b4584a9
 DIST php-5.6.4.tar.bz2 13498882 SHA256 576f9001b612f5ddc22f447311bbec321e2c959b6a52259d664c4ba04ef044f1 SHA512 855f885c2d8ad6393a8fb1bfacdb83f8eef910966e6ab50cb3fc4bcbd5800d4f69a6c866623b517a0163ab1984402206f7a32c54acddcd5f9bcdcf77eb04abdf WHIRLPOOL b93d618f54e32ce838ecede0cd1c7afd7bf00a50dfac0ac79827f4364142d2ad0433f6cc7325ee870961afb32ad827ddc4f5190301c20c038e720bdb7ee5d0cb
 DIST php-5.6.5.tar.bz2 13556146 SHA256 adab4c0775512a5ca0ae74e08efdc941d92529b75283e0f44d3f53822cdfd06d SHA512 078a6712fc920430f81716d102ca7343587757bc7e379574c572c8f19e5e1bc41e3f552055922c148227211a352c952caa3ad5e7685504c942b5932a9a0b992f WHIRLPOOL 97a61d34e14f58bfc4eea98ec154f8bcce0eae2b1a76a0c32012333bf4db629c9bdbe477ed9683aad533524b78e20dafaf8756a7b883e27671bbd4e764f4d80c
 DIST php-5.6.6.tar.bz2 13687928 SHA256 09625c9b65e0c8198dc76995a35f0feec0e13ea4489526e64a00954b12adbb4c SHA512 2b305a3487464b35ae6a3b0cc1d4537649e1e49fd1cd8c2ca8f2b6b7dd7d02f1738b12dca484a0327766b6fe060d1e6a9250b65da5399ecf61e9f579aa486fb6 WHIRLPOOL 1039f1ae949ea845058da77786f0600891096a1e590a8eacb3cbe8e3e9d2465aeb224a79bb21807c3a1153c6ee0f1a5a032730f538e51d1dc0937f24c42a07f6
+DIST php-5.6.7.tar.bz2 13697400 SHA256 02954fb74c61a7879d48ebdcd4ecb78aa0056f4215ca9b096232de28eb8f17bc SHA512 594b306cd2bb1dd2034a39b13d3642d957869b305c5e169e6020472b659feb6d1a7a1d1a75bf71965335450caf4762d9a0db2585d68e95606e34e9d03580830f WHIRLPOOL a6155be31975d9e0af039e3974ede650c920dcfef9bd4224f1f997c190762838541bf9f3747ce52516aee40860833babf31f1fdadf86f81531ce6877cbbd0d9b
 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
 EBUILD php-5.3.29.ebuild 22246 SHA256 ae2851b568b98aa7ace3e1347f37b6ae1c5bee062e46fce659088f10b1499549 SHA512 e4c72e905de0cb6e210ee762c92afa11b8fc559bb571d9e8b6f98f35a41437b47f8b3c2d8c9744c0a2a500f86bf69e7481e95f8ab4b99cbf08ac33919ac631b4 WHIRLPOOL 8798b497435a945a2202dda092f9f7191c9c6e653ab07b3567f2f760c4fcdb3b70be85a38b91c9b84bee0f721cbacaf29584d1af508ace5da2068d7f9caf2931
 EBUILD php-5.4.36.ebuild 22377 SHA256 1ccdfcd41b96f68742f572d9c04eb6e9c595c259ef0f9dfdb3eae9708053d259 SHA512 87d54708dbfaaaf2fd2f7525c9b7bdf221873054f39285e3656ec0c8111f77dc4a8b3cfb4919de7c37a480ffa18dc04fcb67b4dfe998ad66049b6858900046d9 WHIRLPOOL a9028af8da2b3b2df2aba36f82c64f2af422b8b5a25e77d1e3b1f2a2d9820c407bc7bf7828d7b9bd1065ffc49f2a8bc8e2e7554ae6ab8d5611b9773cecd89207
 EBUILD php-5.4.37.ebuild 22393 SHA256 2ef8b57d25ee17d7d0b9c51befc4253261d674f6fe804562902fa04f64a0e4a1 SHA512 fdac0db1b0b059b0da424f5293a901b7f2101a9170bc29b0afa29068e8b74e964a35317025c01666a59fde442b6627767ea34e810f32954e3f5d46543602240a WHIRLPOOL 1cbcb32c28d9ee9ca0200070d39d3e073b0c5b744a9ffbe3bbb1ec580842d016a42e8682017270051987345f14c73a3f9dd1663c701f96de8dacf4bb4b171db9
 EBUILD php-5.4.38.ebuild 22398 SHA256 92b23b1195f73b14afb376234c088894c769395d32d890b82578409a67ff2731 SHA512 35572582f99535770d48236e3b2ea4a67e7042d3b97efff46257c855334136413c3eea31ad9f79e19118e2ce92bc61649c7183d0dff623b933940d5b6cf9187e WHIRLPOOL 34f30abd22faf810493adce0f0c81a8c09c3119d39fde32b05712c3c274f05a707f4446bb05240abfd40551f3312690bf8f0e248fea4d3917d004f630e27104a
+EBUILD php-5.4.39.ebuild 22402 SHA256 81065a80b500496cb5bad3d1cd5c673a09edeecdc17f3735213a38e5bf5f6779 SHA512 b16128cffaacf7ca4be7401d5a71b2b59617f4bb4c4c4bcd76fec0940b9279e0ec0282f826d3119e2db376d8ffca4cdfcd7dc0f41ae2c93428ddf7705c772c5e WHIRLPOOL fc01223ba4e31de1a79e75b2292d08db9f811501c3bda3360714232358a9f08e94dcfb77c1542ae6e0076f84fd1176cca8f3b06901012974ed5e632aeb5e7e63
 EBUILD php-5.5.20.ebuild 22311 SHA256 010bb641a42700948bf146826e1c21284d0a0cf5fdd47453bdf18fecddb7239f SHA512 92ce6eced80ab9859f04b044dcf6533505cf5c1a933aef3c6d599d0f2d156fe94dd494e03b88a69910fa6bbc23bb78b420995a13971b3cf6813301538408c794 WHIRLPOOL 13aa02b7f6495103ee36cea2861bb4cb25d38e33e94a3b6af7a9994c3c84526556352015fe45913794f74f15c517c090901535ee53dd7a508c799e3849df5cab
 EBUILD php-5.5.21.ebuild 22327 SHA256 7d689ea76263637e3341ae8ac9edb86e9a81cb333fef98dd913afee8212fc1f8 SHA512 0c63826c58bb6317494cc24c4b163573ba42c6f990183d2ab4de2fbc11031a1fe6afa3177a8f95218392e8bd6e75606bcdd7d52ea476661288202367b2bb3fcf WHIRLPOOL 6cbf7405e422cbcfa7d0098835e1d8475f4f6bd933978ccad041b4532f308267d039816eb4d324025c9e54f7f86297db82810ce8eb6d462b4b18a07a54847325
 EBUILD php-5.5.22.ebuild 22332 SHA256 b1cea5600dc665e1d3180eedb22b86ce168f17aad43db3a0f362de0dc94aeae8 SHA512 636700f630642ea4ac08d4f8a3af73ff7d90574fd1cd56b16a1507ca22775869250b2364a214ea16a334e20336df996a3590efacb10d1d5db38768416c600872 WHIRLPOOL 003e1a61ff470b4303b9f90f1f4111b16e5f647ab20fbce39adc35b313cf4f47bd338ed16ec37c116d82939a1412fcf1a15a40f710684089742b8ac292fea327
+EBUILD php-5.5.23.ebuild 22336 SHA256 720177c6696f78783b386ab4d46d0c4badab5b669e8ded1fe8720e2e60a41da1 SHA512 7f09b898dbf5ec695ec5a15c814c791d8cbe8cac74a8a684421082a9b842cd6835004cdb62ba4e9f0c424466a71b99f5e026aa3187bae09d30e3ccd17c412c4a WHIRLPOOL aff8f3ed152757b92e2b48e273149859b5bc7a1a218ad4bd3773c6f5f0817af6eaf1d208ece863b95a100ceb34fa03251b48a36d5ff8ee737c4692bc0b350513
 EBUILD php-5.6.4.ebuild 22318 SHA256 27aa7ce3432dca3ab4f7f78081109858f370de55380c273c8418355bce899bd9 SHA512 393d7aa225d3e0579994c963a668f71d54030f603d867c1e9a54a9cb1ed175b9dee5ce3052e01e2513efaf6ad5b20111a84aaee7217186b2467224e8c1f434d4 WHIRLPOOL 95522df7cfa84cd58976e27f2a06087360a68125b10e17b6e1d79051af2a59fde34807d3eafe4f6675595f24d4070c983d27075139805d7e83ad436237eb202b
 EBUILD php-5.6.5.ebuild 22335 SHA256 3b7a2087362fbe9397e6ecd662460d6447199557f4ca619d87e6a5eec9906cfc SHA512 09b855e50694941c26b32426b1f9576b9654b25425109dabf67f9e9fa07b54149f43a9b95a39c8fd393990aeb86e0acf76230a5b1e25ac2610a077e4b18afb82 WHIRLPOOL 65a320335124a0dc48ca3d9dc8de36b052bf5b2af60e21ca058dd93cb0aaa9781f8e09b925788e7b081b9e11164e249c9b8dd33f5cd22054a874d49c69629cbb
 EBUILD php-5.6.6.ebuild 22337 SHA256 42b11577986dbdb84aabf2b909a49b876f4dde9063d0b4e26549b7096f7dba13 SHA512 41a32f74a87b1c1526fbd1a3c7214f419bc8c6b3d2424fcc5b4e4e77b67d8e50e53dc8f90171460d1dc3f7698963a6efac81e2d4cb103d75a3ed2cab61e57f0e WHIRLPOOL dbb7b36554d04d0df6967ca114eac6dcfc8918531621d94e49652dbed021d4e1eb3f84e570ac57b68af5dc7ce8f59cc25e72409b6d90a40a1f1956c7c9fb3e52
-MISC ChangeLog 39024 SHA256 49e9cb5c87ea8a9d75021180cb72cbbebbdfc68ffa5abaf5a938ae1c1edd7da0 SHA512 0e26ce23244e89ec4ec736f6e8f5ebc8957347ae5b7140a532b276fd76a97905b032c913dc7a66d15e3738d256bc1d8bdb231d7e79d1614770c998f64c0c2f56 WHIRLPOOL 99c10b3f0d05e1e8d33702d9291b2698744a077d9cdf39f95c325ebf3ee12fb784e094d3e9e4467d534fa221f7750fbb207f5c3a0ebff312b780240659f20f75
+EBUILD php-5.6.7.ebuild 22335 SHA256 9ddee67e6be0187f654363c5a25f9d43113ce870e8b4ccb4453d20866b133cb5 SHA512 bde3d5db85b4f86633823ebe2d1c89b59f125f48ccd68ce688ba0cca20026f343408247b4cea35030be26aee5c99d74ff7cb4acca3922044eecac1a97aa26257 WHIRLPOOL 47cac868a3da5cb96ec5bda61e71a42e06ea6aac8d08c8ccd142fc2f0707584992cb2f92bdfed5feff165f27a39456bedf84a8749e1f2e721a8fa2ab2b7609d8
+MISC ChangeLog 39234 SHA256 53362f42cae6e1c38916c37522f5e0e5f089f0ddb44bfec2f54bb1f679154f88 SHA512 448c57aadb6b3d83b1c9a28b94a9121fdb73e31829ee37a94d2a395a366af64ca3b8ed1b6d7a98a20713e4565c49ca7959531e8e0799f58ecdab0b18ac04f955 WHIRLPOOL de97c04c46e669dcdc45c45cc483933b3b4dce42be766a2b1f703bc1390ec83a53d79262eb7453e93b3fb92518a75bb325eed7ec2b4766fdffe9c716fd31dd9b
 MISC ChangeLog-2012 108488 SHA256 c2eea36502d34eadc7995d546f78aaa553ba07beeb51ea738715ad7f2e51b08d SHA512 eb25224993eff1ea42ea133302991a3ffad3adda0bc524cfa4fae49574230a8e65b35b08750d780c11cc9c152435fadbf2c416241fac28dcbb025e060e96cd7a WHIRLPOOL 82f627853fa961f3f3707fb2c8757acbc8fc644e89121d78703b40ff0f668aa7d0f1aa26c77f8f503e4f6da22ed865e4cb7c02d5d112c89488b12aa6b0d80568
 MISC metadata.xml 1601 SHA256 0f0d69832d7bf8ca13c940247d67e184d866ae48f4f77167b3b6a508f4c0ebfe SHA512 744b80efb645e7c6e632101c98cb7bcaf2a6530d948e5cb320050cfe4ca3733e29b995e2b1e4677b648c7a9e051a8056c6f38ae03ae18656a9583b24c32b6056 WHIRLPOOL 8ba9c5edf403759541ea1aad65138f48ddc4e4bef73c3a43744e1d0513031ab431fe1e742a39125257c3545ae0a091118d1b36d04a28bdf96e9989185764ae50
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
+Version: GnuPG v2.0
 
-iQIcBAEBCAAGBQJVB/Q3AAoJEIug43o+kWud6PgP/j7+kh8ioRaBztTA+Zr3Axvj
-4zy3u6z8qEct/mZkV2S2nmyDOj7lBuqyJYTtsh/qscIiLurowkzTbQREfVHYYZyD
-qeXmc8FVn2wP9IRhrCh2mh0R40IJMGNq7KQmGkNqivk05B3hGKUqoRfpEaOFFa5Y
-87whco5ts3WvIas4sZu7DiS0clRYFNP6CYZhUfM4aaJ5C4g5cg42FE3Z+L0bfhDY
-mabVRwkTl+shh81v8BFzWGWZnL6tqhVQF9c1xfS3Vt6nkvqcwqIQwGPI6/+778ML
-jLjz3S4MV/0kIWBMtLV75TIibFRBBjyRz/072Vm01dt17lwkC73DtS7ptFi5pjd7
-dBct2tAP3rYlIxm4wmsyXzbR03jZFxSQndd03f5SEsWv9uIxWcwlknRi9ayl1d53
-p7dmoDWPYODvykpU4MwvMhlERX6XIzM3oQ5e7t/vyG4uRGHwSIG84+fno8XdezXl
-MeXzwAxtuD2wnIIXghg7uLo0GAsnb28kmUQURZz6XlFVGqynpk7GoRDRIPIGutT6
-gTkZKG75hn7IuTiKm15/CK+bPmMZHC3eS+peUoOV81lPoXDqyqewgLjOZHUcxVWv
-gKrTFNzosfRXuqehfkHFirh4tbpCvea3mVk/FyTAO7cDpgAuXRkGPwM5DAn85YZs
-paYqoVSs2lPywl5C1ap9
-=xGMU
+iQF8BAEBCABmBQJVDAbOXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
+ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyOEZEMjNGNzBENkE5N0Q2Q0ZFMkFDNDA2
+QkFCNEFFNUM0QTkyQkY1AAoJEGurSuXEqSv15KMIAIPo/3WpFyOhQopDreO60UUB
+NosG7izCwZtbDWoq8cVieYI/rEWbpIYqDuwY4mZkf9liw3JrQ14J2YgPD3hhOb4C
+cKxw3Jw/ufSrKiutW+sc3GLydN9Kx2uXBTmk7v+fsYCBupdydsbItNpVHO1LxG3h
+ZyQgc4n25tmGsicq2opnCpzqWR1HqM778+oiL7dXYIC4Pd7lUqejzYIsJr3uKQ15
+8HXx3gXrfbs8Y78HGZveg5taeVKh2tsXXsqvPymGkZo7ydOutUcyHqfFlBz1PaID
+D2zo+xIxCjkJtLHP/fCs+db80OmZQONmIl8Zzw2r8Iaz5thFBJfGEZuho/5h3Z4=
+=MLJH
 -----END PGP SIGNATURE-----
diff --git a/dev-lang/php/php-5.4.39.ebuild b/dev-lang/php/php-5.4.39.ebuild
new file mode 100644 (file)
index 0000000..c75ecd0
--- /dev/null
@@ -0,0 +1,802 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.4.39.ebuild,v 1.1 2015/03/20 11:38:06 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-2.4[apache2_modules_unixd,threads=]
+               <www-servers/apache-2.4[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 )
+       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 || use elibc_musl || 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.23.ebuild b/dev-lang/php/php-5.5.23.ebuild
new file mode 100644 (file)
index 0000000..5dcd8f5
--- /dev/null
@@ -0,0 +1,784 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.5.23.ebuild,v 1.1 2015/03/20 11:38:06 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 vpx 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-2.4[apache2_modules_unixd,threads=]
+               <www-servers/apache-2.4[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 )
+       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 )
+       vpx? ( media-libs/libvpx )
+       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 )
+       vpx? ( 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 || use elibc_musl || 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)
+       $(use_with vpx vpx-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
+}
diff --git a/dev-lang/php/php-5.6.7.ebuild b/dev-lang/php/php-5.6.7.ebuild
new file mode 100644 (file)
index 0000000..f06a222
--- /dev/null
@@ -0,0 +1,784 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.6.7.ebuild,v 1.1 2015/03/20 11:38:06 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 vpx 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-2.4[apache2_modules_unixd,threads=]
+               <www-servers/apache-2.4[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 )
+       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 )
+       vpx? ( media-libs/libvpx )
+       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 )
+       vpx? ( 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 || use elibc_musl || 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)
+       $(use_with vpx vpx-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
+}