aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2015-04-24 13:36:07 +0100
committerStuart Shelton <stuart@shelton.me>2015-04-24 13:36:07 +0100
commit8c69ce4a5d95e86c8be05ef8eca3f1d147f93714 (patch)
treecbe0dedbe0a12c328abb9fe68a64ab14db242c57
parentUpdate files for net-firewall/iptables-nftables (diff)
downloadsrcshelton-8c69ce4a5d95e86c8be05ef8eca3f1d147f93714.tar.gz
srcshelton-8c69ce4a5d95e86c8be05ef8eca3f1d147f93714.tar.bz2
srcshelton-8c69ce4a5d95e86c8be05ef8eca3f1d147f93714.zip
Add dev-lang/php, dev-php/PEAR-PEAR, media-libs/libvpx with 'addpredict' updates to allow '/var/state' to be used in place of '/var/lib'
-rw-r--r--README.md10
-rw-r--r--dev-lang/php/Manifest36
-rw-r--r--dev-lang/php/files/20php5-envd2
-rw-r--r--dev-lang/php/files/all_mysql_socket_location-gentoo.patch13
-rw-r--r--dev-lang/php/files/all_strict_aliasing.patch14
-rw-r--r--dev-lang/php/files/bison_any_version.patch16
-rw-r--r--dev-lang/php/files/bison_build_2.patch29
-rw-r--r--dev-lang/php/files/bison_build_2a.patch30
-rw-r--r--dev-lang/php/files/fix-libstdc++-underlinking.patch10
-rw-r--r--dev-lang/php/files/freetype-2.5.1-linking-fix.patch64
-rw-r--r--dev-lang/php/files/iodbc-pkgconfig-r1.patch52
-rw-r--r--dev-lang/php/files/iodbc-pkgconfig.patch52
-rw-r--r--dev-lang/php/files/missing-openssl-include.patch14
-rw-r--r--dev-lang/php/files/php-fpm-r1.conf311
-rwxr-xr-xdev-lang/php/files/php-fpm-r4.init47
-rw-r--r--dev-lang/php/files/php-fpm_at-simple.service13
-rw-r--r--dev-lang/php/files/php-fpm_at.service14
-rw-r--r--dev-lang/php/files/php-libvpx.patch24
-rw-r--r--dev-lang/php/files/php5-ldvs1
-rw-r--r--dev-lang/php/files/stricter-libc-client-symlink-check.patch15
-rw-r--r--dev-lang/php/php-5.3.29.ebuild827
-rw-r--r--dev-lang/php/php-5.4.39.ebuild812
-rw-r--r--dev-lang/php/php-5.4.40.ebuild812
-rw-r--r--dev-lang/php/php-5.5.22.ebuild794
-rw-r--r--dev-lang/php/php-5.5.23.ebuild794
-rw-r--r--dev-lang/php/php-5.5.24.ebuild794
-rw-r--r--dev-lang/php/php-5.6.7.ebuild797
-rw-r--r--dev-lang/php/php-5.6.8.ebuild797
-rw-r--r--dev-php/PEAR-PEAR/Manifest9
-rw-r--r--dev-php/PEAR-PEAR/PEAR-PEAR-1.9.4.ebuild116
-rw-r--r--dev-php/PEAR-PEAR/PEAR-PEAR-1.9.5.ebuild115
-rw-r--r--dev-php/PEAR-PEAR/files/gentoo-libtool-mismatch-fix-v2.patch15
-rw-r--r--dev-php/PEAR-PEAR/files/gentoo-libtool-mismatch-fix.patch31
-rw-r--r--dev-php/PEAR-PEAR/files/pear.conf2
-rw-r--r--dev-php/PEAR-PEAR/files/pear.conf-r12
-rw-r--r--dev-php/PEAR-PEAR/files/pear.conf-r22
-rw-r--r--eclass/php-ext-source-r2.eclass380
-rw-r--r--eclass/php-pear-lib-r1.eclass102
-rw-r--r--eclass/php-pear-r1.eclass123
-rw-r--r--media-libs/libvpx/Manifest19
-rw-r--r--media-libs/libvpx/files/libvpx-1.1.0-arm.patch38
-rw-r--r--media-libs/libvpx/files/libvpx-1.1.0-chost.patch36
-rw-r--r--media-libs/libvpx/files/libvpx-1.1.0-generic-gnu-shared.patch39
-rw-r--r--media-libs/libvpx/files/libvpx-1.1.0-x32.patch64
-rw-r--r--media-libs/libvpx/files/libvpx-1.2.0_pre20130625-armv7.patch41
-rw-r--r--media-libs/libvpx/files/libvpx-1.3.0-dash.patch16
-rw-r--r--media-libs/libvpx/files/libvpx-1.3.0-sparc-configure.patch10
-rw-r--r--media-libs/libvpx/libvpx-1.1.0.ebuild110
-rw-r--r--media-libs/libvpx/libvpx-1.2.0_pre20130625.ebuild125
-rw-r--r--media-libs/libvpx/libvpx-1.3.0.ebuild129
-rw-r--r--media-libs/libvpx/libvpx-1.4.0.ebuild127
-rw-r--r--media-libs/libvpx/libvpx-9999.ebuild124
52 files changed, 8967 insertions, 2 deletions
diff --git a/README.md b/README.md
index 6bef2fe4..ccfa9f76 100644
--- a/README.md
+++ b/README.md
@@ -223,8 +223,8 @@ A similar configuration file could be added for all packages which fail to compi
* Correct SNMP patch failure of version 3.14.12, make exposed configuration options more flexible;
* Provide more flexibility with finer-grained USE flags
-# Fixes for ebuilds using /run
-(... rather than /var/run)
+# Fixes for ebuilds using `/run`
+(... rather than `/var/run`)
* app-admin/eselect-php
* app-admin/syslog-ng
@@ -253,6 +253,12 @@ A similar configuration file could be added for all packages which fail to compi
* sys-power/acpid
* www-servers/lighttpd
+# Fixes to allow `/var/state` to be used in place of `/var/lib`
+
+* dev-lang/php
+* dev-php/PEAR-PEAR
+* media-libs/libpvx
+
# Fixes for MIPS n32 and x86_64 x32 ABIs
Included is a modified `eclass/multilib.eclass` that no longer overrides any amd64 `LIBDIR_*` environment variables, which may now usefully be set in `/etc/portage/make.conf`. For this to work universally, you may need to edit `/etc/portage/repos.conf` and add:
diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
new file mode 100644
index 00000000..f770ca29
--- /dev/null
+++ b/dev-lang/php/Manifest
@@ -0,0 +1,36 @@
+AUX 20php5-envd 145 SHA256 efaae9e6ae5f7010e073c2ab6d8a9dda009f0707c7d7b0c027e142c94f7041a4 SHA512 581aa86479e3cd584ee1bc6dc6d4a135fe8ec343fe5519566d728d81f7018cfb23658bd0c0368951d380982c75adbb4f45acf3c146868aaf4e4ec8e9f2fad1ce WHIRLPOOL b9cfe0e80ba437bbc6008223c268bdafcde306ba8083dce96815804f3e1ec0937706e0db091149785a0076a6c6eaab8f7dff28578b706e84b4bb4e67850a4ecd
+AUX all_mysql_socket_location-gentoo.patch 633 SHA256 d1c0fcea4509cdb7504701e5b1996661483c3b5eea194c07fdaef91a1ce18a27 SHA512 cc55b3c1cd2e9fe4d4aa887146de9306afbbc44a3bd652225982cc04b9aefa8ca094448a765f52bc36e49726034cc702d9ef41e6da518946813103920f5ccf4e WHIRLPOOL e06c83a8852fcb1387a38774e91377464086a4908aee379d7196bc9ce2a76c6850399266aa0390e8f9885f6812c1ea717c8d98a4eb9949c3d86db357f95c18ac
+AUX all_strict_aliasing.patch 463 SHA256 9be7ef7f2727b48b0416ccc613430da95a92b59158bc7dd77f16bb8fa879efdd SHA512 6c9aacb2175a4ca3169360fd33bc9c3cb6a3631e316f7d834e8a0711248e38a90e3eb7b482e0ec79ba1971384f352ac1b88ec4caf2a6e412caf144d767cc7bed WHIRLPOOL 6e24b92eee6463f7f58e136c66bf5c0f3b2b3cfcffdecb0fe42e81fe3ee3a23b3451d933cc4ba5d9e04f819776d3d00b1eb496e5efa7786f399b88fec25ecf88
+AUX bison_any_version.patch 569 SHA256 251065c4e721180942fa89bb039c3eae74153bac8c7685f270715fc9822be590 SHA512 de8a39d84f67f3787dfa52fbdb17e2d32ef23be2a6f910c046640be3208a58cba9352bc0235f7c67a103e1bb5012806341b914fe8a456c90ec4b7c6608a9068d WHIRLPOOL fb2501e1c7a8fe7228f9f7abc86935544af6661b4d8a39ed0b29652551da627803038d459af2190664b19cc938fefd55d8f2a388b4e3ee1032f1dc3ee3c69ef3
+AUX bison_build_2.patch 652 SHA256 6821e773183d12c5e9f94df929f50561fbb885192fbff071bd931fc643c5bd44 SHA512 01ebb99e7ea922a56e925ea9cd7b9edfa31b34d63069e7f418c1bcae86c9f927f835646855537af37519d1b0d2558d43e3eee5a4a1622605349ab1e2314d2142 WHIRLPOOL 45efdda59efb1eaf1a7c8a3b955e8a0401390e48e1941c0eacf55b725680a037e8057495341cb22f00c8eae55d13f1bb4db7a3a2507bd6dceb52764c0ad82604
+AUX bison_build_2a.patch 584 SHA256 a4abbb9ae4a7e29b3c5d099929fd4041c810d061dd2bb6c6c94cb9542d727bd2 SHA512 fb3c1a7ce77b8f0241dd519fc5de97a193c195e0a04f82f56444d6822298bf049f9232eceff678816f480d184e2a02d0161bdc2cf42f42c1b88c462833b3ce28 WHIRLPOOL 8585552b0a4eda2c45003e8ce148ce8dfe8bb78a1f81eb517260db91b84e61d337a50ba089b5b8e4248081af6ad33dca3fe097d19999663792353954e9b40815
+AUX fix-libstdc++-underlinking.patch 264 SHA256 c174fbe838373d3fad9536c621685426c71ccfea73371889f60d7bed07efc230 SHA512 3b91b6917c8d452cbeaf98c445b989f1e0d2c86a02598b5e6647625289868eaf51eee253db8909fb5faada3b588f22b3bfee44b679d6257bcc00c067a80938d6 WHIRLPOOL b7024c2f478e79967e81f938d36689c2cd968b3db2a05f9ce3a57721cd3727046b300d1b436e73cd0ae31393d3e572164743ffe139d36798f41a3e88e86c4239
+AUX freetype-2.5.1-linking-fix.patch 2513 SHA256 feb2957ddebe50e4ea06d9a5686a0502246f87809678ad2271c9a128718c5cd8 SHA512 b1f94d5bbc42c6b321bfb5160820ec6e71a04e6ed38f482edf446d5d0988f2154a4f43e11443b5123960b49d9a00e29a3d62e3558cd2ebe271a7520f303e677d WHIRLPOOL dcdbd97def1f026970f7b594b99452ac409c5d4f77dfdba09a459b9a3ad14de820c1e56de54c2c84766166d091e3ef3c9b27292fe1a142a845c8e73605827e37
+AUX iodbc-pkgconfig-r1.patch 1824 SHA256 c832037a42bf0b3e8e0e478a91e103520d10e65769382f8261987cb5a1cdcc4e SHA512 4030b7a06e6dc8f6e18dd53853e503b46428935bdb1e5b49c0471d942daf41ba7b563d2a88012497eae4392cbf74d659ff321e481aad8d17d622485e46b4bc40 WHIRLPOOL cbf678c30c55c1a076400dc32b7551cdc3cddb77aae401c93f6395ee9fe0a4f6c6bc4acf98b394e1993d16bcb1f94978149ce3a16cb9e64b6cd8b899b5223180
+AUX iodbc-pkgconfig.patch 1820 SHA256 11c4e2f1d0c34bd5a7264fed11bb1786af0341e9756649d842ef90eadc815be8 SHA512 283c06aaa01aac76b71cd30bc5a1e882f14c02c63696c4a349a3338163a216e1adcc1149c9c5be8fbcb40554717406c8a9d6c5f8f8aa5c01a155b9993f280966 WHIRLPOOL 2057400bfeac10b115b5705eefb824e945305594ade2536c3d88c29b988a841bda29a4f0b41895df10e4696204c08327d4d2da33c6596a43ab798f83eabdcc95
+AUX missing-openssl-include.patch 456 SHA256 40d7a7de8dfde9844c12a03f96c2b4c78b08b776505f94abdddb6f5c7617454c SHA512 e6c663e508772e403e540fc900f752f18d12eef35526154716728da0ba89a8eb48f12bbb7611c0672f22a1d0b6814365e90ecabb8b8e78411816b8b8889f03ea WHIRLPOOL 258448576333077c14ba5181ab4e6de2ecc75d4811aeac5fc2e71ba22e8f4644db43998c50db6423cda55c82039c1f6cf5ee16ef79b84bd4c3161b33776b9936
+AUX php-fpm-r1.conf 12966 SHA256 c4308a92ade93812c6579b74a72cd1f3e1a35f7e63289722f461771d5702448c SHA512 3d421c1e8b8f6ecffbf8284a7f79a1e5cc3f0893b1a47f5ccd980d554b058c363c1e236aa3157c2b66791b3291c6e98981cc527d501328ccc3ccb34eee2950ef WHIRLPOOL 1f591597698e28fc47197e02ba680728363c50781d146cf2598403f4678781eabc4f4d2abe2c0bfe9a25065491d3cb514cc5a9dcee4edd9d9438f51181f43b2a
+AUX php-fpm-r4.init 1157 SHA256 37e34461babfb5881169f9729fbdde7d4aba533f123e2c480fe25ac3b863d3e7 SHA512 3555a2210104185b93b3805400995ed987076429c47b0950f58396c535d7ea99a5d2e7eedde071e2de06f4e248e0cb9bd27ccbf01b5606152a2f559fe874afbe WHIRLPOOL 6f5f0e45004275c7c984e68c293282db23461a64965b7d7c4a0ded682140177989ed50217aea6253178cc18fa9f9d202a69383400dc1a53271f00e85884849a1
+AUX php-fpm_at-simple.service 316 SHA256 c11d3bb213993ad27642abf2fb13ab8d9bd3fd8ffb6c863ca0baa057555a2fa6 SHA512 7367a3f8d3874f8e0c76f331ba613a0250db02f60ad9f87affaf448dcb5bc34bcecb91d88f415764a12b24b46ae3d1b738a002af9f77a4b707e916e83a0021fd WHIRLPOOL bf78a0e1bc22525de1bfa6896ceeb39932f4a1507820667f5216af10f8de205436a82abefe55d4776d911de99070e6f6ed3dacc1708288323d8ad789dab57fb9
+AUX php-fpm_at.service 317 SHA256 6bbbbd7b6501305c17b7290bb2a83b0ebe492d421adaac8f394e387ed52e0d25 SHA512 27982f9e2d958bfa75c89c7d3531e48d17fc388b1cdcbc8e09051b236b1184ee2baabdfcc567c19d9fcd067d4b3b86f171015616d8da42fccdabd89432d865e8 WHIRLPOOL c101ad8eb7446a6fcb3dba6ec6caae12bd6c0a9d251e222c392abb37314fbc252321bdc7db1696480050ce543a154b7257e503d3065d9e238d1c5c76a74d65ff
+AUX php-libvpx.patch 959 SHA256 5dcb65276d46807817335aac280214e5681e3c7659bed33306f0bef5950a86b9 SHA512 4b16d5045d37e962e709de587f49c8c9320e2166e5245a42d8d005dcbb5f15d88dbac8ddee122694df5ae89209547f0217f5d108b4a9e41bffdb3e59e8f37f1a WHIRLPOOL ac4d3cb8369695dd8324c50fa3b74cd5288219236d4eb1c49db4fd9193a34d8532d1acf87849ce1919ee9cd9c9843a9c2b5d8751ddc9e9324b6f4393aa6c9389
+AUX php5-ldvs 22 SHA256 b79d0e52b1b3b4543b31ad45525ae1c2814a27ea8e676772ab10bf6fb12dfe79 SHA512 689a0a12b3527741d2e47870c125e93be73a127e5e798c4b685ccb11653be5a8615faf3178c71a6346fe264d3c4ec76601bc05878fef67b9dbd2e45be59a344d WHIRLPOOL b24f193a1067f699c8efb199ba4e3f1fdd22c13dff98655206b30072ce8c8035fb4ed9288f694856f9978bd9935d3a5589cd968316920e712779c45b44897634
+AUX stricter-libc-client-symlink-check.patch 786 SHA256 bc80d286ce3b2805ce41e46580f24c5ba8f613b670757f81e6b2b638aecbf0df SHA512 db94207a3fd883f78b20fd9261720c39ad097566ae4dd913fe33a12adcedaab943ca0975a4f6a4917d40f6fde61e9b5928378ad91f3afe62d84aba3c9351db03 WHIRLPOOL 1ee44c69658d844614b31d09b8ce945075c9491703c04cb57aceec2469a97db65bf80871e4cf2ba6c9d9fe19a4305906e09d0cc474a635c9a1a6001a4d8c982a
+DIST php-5.3.29.tar.bz2 11396771 SHA256 c4e1cf6972b2a9c7f2777a18497d83bf713cdbecabb65d3ff62ba441aebb0091 SHA512 c22c463df7371bbd97beb258f0a9b9d77ec5c3c733fc565091e2bfcda3da2f1d2ab406047afcc70a6da2331acd2698885328d5a334c9922fa7591852eefda5f7 WHIRLPOOL bb9db8ba267016af18d0d993e764561b11d6fc1302ed139d2b047ec84f139b078faf53d27a7dd394b0972199b3990c34a77ef1e2f7b632ceb5660cb1667bf0ab
+DIST php-5.4.39.tar.bz2 12271717 SHA256 7ceb76538e709c74533210ae41148d5c01c330ac8a73220954bbc4fcae69d77e SHA512 b944517b754fbdfc0b50dd18d2644edc9abe3a66ac9806c748b7b98f5c5c07eeaabdf7990799bb39ebf716b90b4e8b34e5fedb3379c1b05bce5530d3cdf4e42d WHIRLPOOL 28fdea55684c99b53545c83fffa686a76714846d2a0af0fa514f450fdf86faa3541f752113a51189a0ec7786a5d55171eaa7be3a8d0418b60fe920be552fcf22
+DIST php-5.4.40.tar.bz2 12272787 SHA256 4898ffe8ac3ccb2d8cc94f7d76a9ea0414d954f5d4479895ddfccdc2e158a51a SHA512 23fc43a310d8f05078c5a0fdc574a49d7037385f6c6fb154c1cb900d87b9f356d2fe8a708d7f20cb1304c4715f1c5bdd64063049f4d7fe157621e36e83cf7535 WHIRLPOOL b74c868e5991562ff0a019f438bc52d228fb17de95e252a7f1e2c323c0cf21da0be8a72f7f44f18051d7bb295974fc1ee605415658e2d5657eddb1e3726a233d
+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.5.24.tar.bz2 13337043 SHA256 801b5cf2e0c01b07314d4ac3c8a7c28d524bdd8263ebdd0e33a99008251316a2 SHA512 c43f03a93d0199cc174f1b00b4a34717a82500d5f2cd408d8e39f31cff171f8a2019f31beed044524a795e54fab344e55c41f5d1f3b9e9fea98e2cd04aba6152 WHIRLPOOL 8179016a5d6ebf4993137433bd92a01f162880b373b165be7b1702c5a3ddedd11c308e0e4c0c0b64f84a3cc9083e7e0647d2488997c59ebb126c4bff59d216de
+DIST php-5.6.7.tar.bz2 13697400 SHA256 02954fb74c61a7879d48ebdcd4ecb78aa0056f4215ca9b096232de28eb8f17bc SHA512 594b306cd2bb1dd2034a39b13d3642d957869b305c5e169e6020472b659feb6d1a7a1d1a75bf71965335450caf4762d9a0db2585d68e95606e34e9d03580830f WHIRLPOOL a6155be31975d9e0af039e3974ede650c920dcfef9bd4224f1f997c190762838541bf9f3747ce52516aee40860833babf31f1fdadf86f81531ce6877cbbd0d9b
+DIST php-5.6.8.tar.bz2 13724681 SHA256 0af0045745d61eeb74a3ea744529a2481b27cb689da720e6c0250675043724e4 SHA512 1d2466411b3704db8af5db5ed6b0a073510fbeda3c01036fda2b0f9cf6c8ccfb2039ea9ea2ff51769d228c06f9c43ad83c080d164c6981df46d48904e767e939 WHIRLPOOL 27600e85ece76e923b405c8402ebd54bcb738e23e0d646b13c1c656f24d724bc51e062fba0d307e88b0160ff357d0b29c8d4384695e11492b1cb04589d2c1fee
+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 22525 SHA256 f89b427e7e1a02a4ba251e4bf9fe06b799fc045bd057794e9a970d2a95368878 SHA512 8bff6692321467365e71162c0e0cffa32480b20fe4e8de4ef88e19e525c9761cd68724905e21dee4e5b1526b7b692621c91510859bf716b01a9aa8711cb5ed6f WHIRLPOOL 58292cb356a7517e04b1f606071e04a55e40bd991f4b4829d3a3a7a06804d5fee1dc260dd35e8349801a2df9eecaf0746311045f1f01a85d4d4f2873a01fc3f9
+EBUILD php-5.4.39.ebuild 22672 SHA256 9f899aed4b0a3dda70fd5811eb847d16f8a1c3e5f451323e49b54d50dbcc773e SHA512 74f0f3cffedfc1c8bdb435eee53eab3d5a74e09f377d2d041beed1911def70fbdb17fabdb70a6fbc4ca17793ef1f067bc163caec0b57869be923dfed75d9625b WHIRLPOOL 5265e7faef5aa2bef1cabc850febcec0f0398ec2233de58420910d9f74f895ebc3f47ba7b0c1febd6f210d9ec011a5a074aae4f41e0168416e77192b3645ecf2
+EBUILD php-5.4.40.ebuild 22678 SHA256 f841447e9efab8f70ed1e176e775223120cea4e0a4f642b02f8553e895a42360 SHA512 e3bdabefbbbe1b75ebcc8c81b6c9eab9c0dcb093b712038ef7754ec78cccd0f489397c9c143c0c1d1e9622aba762a36aceadd49f521902c4b99adae0ecb966b6 WHIRLPOOL 3fb42c7c1b0ac8693f631c56caec4a775d7d17f18538baf5c1094ca52562cf49815b72ed86b3b1a39ce541947e801b20294718a94c786351f14afa06e6563f69
+EBUILD php-5.5.22.ebuild 22610 SHA256 8b663e55fb8d4e6cea161fc3b8884b80b3b5a31dd6cc18c8e164b78577fe96a7 SHA512 e7104cc49ee04ff8cb13b98c589df8a45c171f27a8adf0d20985d8efa860df7daa9cf67402e3be54a5b31e43470435a55bedaa3788159d79f7e9371a67b2e67f WHIRLPOOL b57d28cb77d2b02c555f7ecddf37499d73bdb36082d8e8d3e0e00a446d4ca5c52051fe61be6a5c1171f0b7d4cd2e0330a4ceb51a216252427fc812c04f12e719
+EBUILD php-5.5.23.ebuild 22606 SHA256 cb4b91167ee29b6a9e10dc9272cbb43bb5ff0fc2918a8423bf98ce72fa4784d6 SHA512 c18bdb75e9dbe31d699a7d45a0cea79559c1e8ffe04c51e747164d790aa677f25e4e746b98dbe998b672aaced472cb2779c72764108121bc9baad10a608146c5 WHIRLPOOL 44dcb7b87160957395609c7f3d6729bfa7e08e8a901c161ec0c2ca42c9da27bd545ab14ffb6f67274b971573915a7155a55d117d76f06623e2c0d65ffd18aaa0
+EBUILD php-5.5.24.ebuild 22612 SHA256 5072ddc4fc409b8ad8a309962c602d070acb790e4e4b1beb9db766c6cc98c743 SHA512 243f45abd2a0b0b23ca42a5783d6462db67514e1dbc90eb4156c316205699650637c1166baea1dae6ce10c50a8cfe7401fd94bf96ddb19471d75150b4f758865 WHIRLPOOL cbf7bd5b32ed8876c3c4ca984eaea79c3570008b600d4cd86556820e4a4dfc2deb037604689f866e858ea3672df27bb7763bb37cf8f756d31bb62ec34a3d58e7
+EBUILD php-5.6.7.ebuild 22708 SHA256 e06fb34351a8fe0fd324cf5f0c22518e26753397bb46acd30b7fc1dabfbb8229 SHA512 f202edc4449c601183138021f9c02deec8e9df94d80667fc4086368123b4bc09cfa9f3362d14a7b3e51b81d5b5979e7bd54d7c000c8bed1f0dedce83fc977c35 WHIRLPOOL b7a9e3312e503ed7018a5b1b9f0ee173d8b01575830d265ea5b5e7104620f5a64f30a27e19d0742ce05a13822e51f902a16d956f2bc02bb1727d4de450acc8d6
+EBUILD php-5.6.8.ebuild 22707 SHA256 46245f6354109049f897f0cbe84e0a9c3b4224f154cbeb19ec5d0cb049221b3b SHA512 f8bc8b9d27c81c87aecc50c520ed69c091ea6064436accbf15d29a7d75877c3bf1c1d73684faedf69b04a6985b0cc95397415c1a91f473924568568dfe403e2e WHIRLPOOL 4f62458659259670bc411dc2bfd879e8b2bbe148991d0258408e756ac0ceaf3f3e0de0ad5d2b66732494a55a119460a44e5331b55650672fa7df436c4c17e298
diff --git a/dev-lang/php/files/20php5-envd b/dev-lang/php/files/20php5-envd
new file mode 100644
index 00000000..f6033ae5
--- /dev/null
+++ b/dev-lang/php/files/20php5-envd
@@ -0,0 +1,2 @@
+MANPATH="/usr/lib/php5/man/"
+CONFIG_PROTECT_MASK="/etc/php/cli-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/apache2-php5/ext-active/"
diff --git a/dev-lang/php/files/all_mysql_socket_location-gentoo.patch b/dev-lang/php/files/all_mysql_socket_location-gentoo.patch
new file mode 100644
index 00000000..bd179986
--- /dev/null
+++ b/dev-lang/php/files/all_mysql_socket_location-gentoo.patch
@@ -0,0 +1,13 @@
+diff -u a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
+--- a/ext/mysqlnd/mysqlnd.c 2010-10-22 17:46:26.000000000 +0200
++++ b/ext/mysqlnd/mysqlnd.c 2010-12-08 21:54:47.000000000 +0100
+@@ -619,7 +619,8 @@
+ if (host_len == sizeof("localhost") - 1 && !strncasecmp(host, "localhost", host_len)) {
+ DBG_INF_FMT("socket=%s", socket_or_pipe? socket_or_pipe:"n/a");
+ if (!socket_or_pipe) {
+- socket_or_pipe = "/tmp/mysql.sock";
++ // gentoo mysql default socket location
++ socket_or_pipe = "/var/run/mysqld/mysqld.sock";
+ }
+ transport_len = spprintf(&transport, 0, "unix://%s", socket_or_pipe);
+ unix_socket = TRUE;
diff --git a/dev-lang/php/files/all_strict_aliasing.patch b/dev-lang/php/files/all_strict_aliasing.patch
new file mode 100644
index 00000000..cfa60908
--- /dev/null
+++ b/dev-lang/php/files/all_strict_aliasing.patch
@@ -0,0 +1,14 @@
+upstream bug: http://bugs.php.net/bug.php?id=46311
+The current patch follows a suggestion from Siarhei Siamashka
+Adapted for php 5.5
+--- Zend/zend_execute.h.old 2013-01-01 13:49:04.587825704 +0100
++++ Zend/zend_execute.h 2013-01-01 13:53:28.762958578 +0100
+@@ -293,7 +293,7 @@
+ void **end = p - (int)(zend_uintptr_t)*p;
+
+ while (p != end) {
+- zval *q = *(zval **)(--p);
++ zval *q = (zval *)*(--p);
+ *p = NULL;
+ i_zval_ptr_dtor(q ZEND_FILE_LINE_CC);
+ }
diff --git a/dev-lang/php/files/bison_any_version.patch b/dev-lang/php/files/bison_any_version.patch
new file mode 100644
index 00000000..94271e51
--- /dev/null
+++ b/dev-lang/php/files/bison_any_version.patch
@@ -0,0 +1,16 @@
+--- ./Zend/acinclude.m4 2013-03-20 15:09:27.000000000 +0100
++++ ./Zend/acinclude.m4.new 2013-03-25 21:35:27.654016588 +0100
+@@ -17,12 +17,7 @@
+ if test -n "$bison_version_vars"; then
+ set $bison_version_vars
+ bison_version="${1}.${2}"
+- for bison_check_version in $bison_version_list; do
+- if test "$bison_version" = "$bison_check_version"; then
+- php_cv_bison_version="$bison_check_version (ok)"
+- break
+- fi
+- done
++ php_cv_bison_version="$bison_version (ok)"
+ fi
+ ])
+ fi
diff --git a/dev-lang/php/files/bison_build_2.patch b/dev-lang/php/files/bison_build_2.patch
new file mode 100644
index 00000000..dd2481df
--- /dev/null
+++ b/dev-lang/php/files/bison_build_2.patch
@@ -0,0 +1,29 @@
+diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
+index ccbc9b1..6a9a24a 100644
+--- a/Zend/zend_language_parser.y
++++ b/Zend/zend_language_parser.y
+@@ -41,17 +41,19 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
+
+ #define YYERROR_VERBOSE
+ #define YYSTYPE znode
+-#ifdef ZTS
+-# define YYPARSE_PARAM tsrm_ls
+-# define YYLEX_PARAM tsrm_ls
+-#endif
+-
+
+ %}
+
+ %pure_parser
+ %expect 3
+
++%code requires {
++#ifdef ZTS
++# define YYPARSE_PARAM tsrm_ls
++# define YYLEX_PARAM tsrm_ls
++#endif
++}
++
+ %token END 0 "end of file"
+ %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
+ %token T_INCLUDE "include (T_INCLUDE)"
diff --git a/dev-lang/php/files/bison_build_2a.patch b/dev-lang/php/files/bison_build_2a.patch
new file mode 100644
index 00000000..7dedd036
--- /dev/null
+++ b/dev-lang/php/files/bison_build_2a.patch
@@ -0,0 +1,30 @@
+Gentoo bug: #494240
+Upstream: #64503
+
+--- Zend/zend_language_parser.y.orig 2013-12-14 12:25:43.528989017 +0100
++++ Zend/zend_language_parser.y 2013-12-14 12:26:30.088988957 +0100
+@@ -38,10 +38,6 @@
+
+ #define YYERROR_VERBOSE
+ #define YYSTYPE znode
+-#ifdef ZTS
+-# define YYPARSE_PARAM tsrm_ls
+-# define YYLEX_PARAM tsrm_ls
+-#endif
+
+
+ %}
+@@ -49,6 +45,13 @@
+ %pure_parser
+ %expect 2
+
++%code requires {
++#ifdef ZTS
++# define YYPARSE_PARAM tsrm_ls
++# define YYLEX_PARAM tsrm_ls
++#endif
++}
++
+ %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
+ %left ','
+ %left T_LOGICAL_OR
diff --git a/dev-lang/php/files/fix-libstdc++-underlinking.patch b/dev-lang/php/files/fix-libstdc++-underlinking.patch
new file mode 100644
index 00000000..a35305a8
--- /dev/null
+++ b/dev-lang/php/files/fix-libstdc++-underlinking.patch
@@ -0,0 +1,10 @@
+--- acinclude.m4 2013-04-02 09:58:33.069274096 +0200
++++ acinclude.m4.new 2013-04-02 09:58:25.221240142 +0200
+@@ -762,6 +762,7 @@
+ if test -z "$php_cxx_done"; then
+ AC_PROG_CXX
+ AC_PROG_CXXCPP
++ PHP_ADD_LIBRARY(stdc++)
+ php_cxx_done=yes
+ fi
+ ])
diff --git a/dev-lang/php/files/freetype-2.5.1-linking-fix.patch b/dev-lang/php/files/freetype-2.5.1-linking-fix.patch
new file mode 100644
index 00000000..3b78f9b3
--- /dev/null
+++ b/dev-lang/php/files/freetype-2.5.1-linking-fix.patch
@@ -0,0 +1,64 @@
+From a0955f351c7eb1022da7ae36970ffef3b00c8aff Mon Sep 17 00:00:00 2001
+From: Adam Harvey <aharvey@php.net>
+Date: Sat, 7 Dec 2013 19:39:40 -0800
+Subject: [PATCH] Switch to using freetype-config for freetype detection.
+
+This fixes GD compilation against libfreetype 2.5.1 and later after they made
+the rather interesting decision to change their include directory layout in a
+point release.
+
+The original suggestion in the bug was to use pkg-config, but my inclination is
+to use freetype-config instead: we should be able to get the same configuration
+information without actually needing pkg-config installed, since pkg-config is
+by no means guaranteed to exist on many Unices and distros, whereas
+freetype-config should always be present if a libfreetype build environment is
+installed. Let's try it out and see what happens.
+
+Fixes bug #64405 (Use freetype-config for determining freetype2 dir(s)).
+
+diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
+index 0e35ece..732e14c 100644
+--- a/ext/gd/config.m4
++++ b/ext/gd/config.m4
+@@ -193,30 +193,25 @@ AC_DEFUN([PHP_GD_FREETYPE2],[
+ if test "$PHP_FREETYPE_DIR" != "no"; then
+
+ for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+- if test -f "$i/include/freetype2/freetype/freetype.h"; then
++ if test -f "$i/bin/freetype-config"; then
+ FREETYPE2_DIR=$i
+- FREETYPE2_INC_DIR=$i/include/freetype2
++ FREETYPE2_CONFIG="$i/bin/freetype-config"
+ break
+ fi
+ done
+
+ if test -z "$FREETYPE2_DIR"; then
+- AC_MSG_ERROR([freetype.h not found.])
++ AC_MSG_ERROR([freetype-config not found.])
+ fi
+
+- PHP_CHECK_LIBRARY(freetype, FT_New_Face,
+- [
+- PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
+- PHP_ADD_INCLUDE($FREETYPE2_DIR/include)
+- PHP_ADD_INCLUDE($FREETYPE2_INC_DIR)
+- AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
+- AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
+- AC_DEFINE(ENABLE_GD_TTF,1,[ ])
+- ],[
+- AC_MSG_ERROR([Problem with freetype.(a|so). Please check config.log for more information.])
+- ],[
+- -L$FREETYPE2_DIR/$PHP_LIBDIR
+- ])
++ FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
++ FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
++
++ PHP_EVAL_INCLINE($FREETYPE2_CFLAGS)
++ PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD)
++ AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
++ AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
++ AC_DEFINE(ENABLE_GD_TTF,1,[ ])
+ else
+ AC_MSG_RESULT([If configure fails try --with-freetype-dir=<DIR>])
+ fi
diff --git a/dev-lang/php/files/iodbc-pkgconfig-r1.patch b/dev-lang/php/files/iodbc-pkgconfig-r1.patch
new file mode 100644
index 00000000..b2159845
--- /dev/null
+++ b/dev-lang/php/files/iodbc-pkgconfig-r1.patch
@@ -0,0 +1,52 @@
+--- ext/odbc/config.m4.old 2013-04-06 11:26:04.047017826 +0200
++++ ext/odbc/config.m4 2013-04-06 12:29:47.180617161 +0200
+@@ -366,22 +366,37 @@
+
+ if test -z "$ODBC_TYPE"; then
+ PHP_ARG_WITH(iodbc,,
+-[ --with-iodbc[=DIR] Include iODBC support [/usr/local]])
++[ --with-iodbc[=DIR] Include iODBC support])
+
+ if test "$PHP_IODBC" != "no"; then
+ AC_MSG_CHECKING(for iODBC support)
+- if test "$PHP_IODBC" = "yes"; then
+- PHP_IODBC=/usr/local
++ if test -z "$PKG_CONFIG"; then
++ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
++ fi
++ if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then
++ PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
++ ODBC_TYPE=iodbc
++ ODBC_INCLUDE=`$PKG_CONFIG --cflags-only-I libiodbc`
++ ODBC_LFLAGS=`$PKG_CONFIG --libs-only-L libiodbc`
++ ODBC_LIBS=`$PKG_CONFIG --libs-only-l libiodbc`
++ PHP_EVAL_INCLINE($ODBC_INCLUDE)
++ AC_DEFINE(HAVE_IODBC,1,[ ])
++ AC_DEFINE(HAVE_ODBC2,1,[ ])
++ AC_MSG_RESULT([$ext_output])
++ else
++ if test "$PHP_IODBC" = "yes"; then
++ PHP_IODBC=/usr/local
++ fi
++ PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
++ PHP_ADD_INCLUDE($PHP_IODBC/include, 1)
++ ODBC_TYPE=iodbc
++ ODBC_INCLUDE=-I$PHP_IODBC/include
++ ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR
++ ODBC_LIBS=-liodbc
++ AC_DEFINE(HAVE_IODBC,1,[ ])
++ AC_DEFINE(HAVE_ODBC2,1,[ ])
++ AC_MSG_RESULT([$ext_output])
+ fi
+- PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
+- PHP_ADD_INCLUDE($PHP_IODBC/include, 1)
+- ODBC_TYPE=iodbc
+- ODBC_INCLUDE=-I$PHP_IODBC/include
+- ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR
+- ODBC_LIBS=-liodbc
+- AC_DEFINE(HAVE_IODBC,1,[ ])
+- AC_DEFINE(HAVE_ODBC2,1,[ ])
+- AC_MSG_RESULT([$ext_output])
+ fi
+ fi
+
diff --git a/dev-lang/php/files/iodbc-pkgconfig.patch b/dev-lang/php/files/iodbc-pkgconfig.patch
new file mode 100644
index 00000000..f32f8eb7
--- /dev/null
+++ b/dev-lang/php/files/iodbc-pkgconfig.patch
@@ -0,0 +1,52 @@
+--- ext/odbc/config.m4.old 2013-04-06 11:26:04.047017826 +0200
++++ ext/odbc/config.m4 2013-04-06 12:29:47.180617161 +0200
+@@ -366,22 +366,37 @@
+
+ if test -z "$ODBC_TYPE"; then
+ PHP_ARG_WITH(iodbc,,
+-[ --with-iodbc[=DIR] Include iODBC support [/usr/local]])
++[ --with-iodbc[=DIR] Include iODBC support])
+
+ if test "$PHP_IODBC" != "no"; then
+ AC_MSG_CHECKING(for iODBC support)
+- if test "$PHP_IODBC" = "yes"; then
+- PHP_IODBC=/usr/local
++ if test -z "$PKG_CONFIG"; then
++ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
++ fi
++ if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then
++ PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
++ ODBC_TYPE=iodbc
++ ODBC_INCLUDE=`$PKG_CONFIG --cflags-only-I libiodbc`
++ ODBC_LFLAGS=`$PKG_CONFIG --libs-only-L libiodbc`
++ ODBC_LIBS=`$PKG_CONFIG --libs-only-l libiodbc`
++ PHP_EVAL_INCLINE($ODBC_INCLUDE)
++ AC_DEFINE(HAVE_IODBC,1,[ ])
++ AC_DEFINE(HAVE_ODBC2,1,[ ])
++ AC_MSG_RESULT([$ext_output])
++ else
++ if test "$PHP_IODBC" = "yes"; then
++ PHP_IODBC=/usr/local
++ fi
++ PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
++ PHP_ADD_INCLUDE($PHP_IODBC/include, 1)
++ ODBC_TYPE=iodbc
++ ODBC_INCLUDE=-I$PHP_IODBC/include
++ ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR
++ ODBC_LIBS=-liodbc
++ AC_DEFINE(HAVE_IODBC,1,[ ])
++ AC_DEFINE(HAVE_ODBC2,1,[ ])
++ AC_MSG_RESULT([$ext_output])
+ fi
+- PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
+- PHP_ADD_INCLUDE($PHP_IODBC/include, 1)
+- ODBC_TYPE=iodbc
+- ODBC_INCLUDE=-I$PHP_IODBC/include
+- ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR
+- ODBC_LIBS=-liodbc
+- AC_DEFINE(HAVE_IODBC,1,[ ])
+- AC_DEFINE(HAVE_ODBC2,1,[ ])
+- AC_MSG_RESULT([$ext_output])
+ fi
+ fi
+
diff --git a/dev-lang/php/files/missing-openssl-include.patch b/dev-lang/php/files/missing-openssl-include.patch
new file mode 100644
index 00000000..28cc7dd6
--- /dev/null
+++ b/dev-lang/php/files/missing-openssl-include.patch
@@ -0,0 +1,14 @@
+--- acinclude.m4 2012-11-17 21:53:06.346408695 +0100
++++ acinclude.m4.new 2013-03-18 11:37:09.253432820 +0100
+@@ -2331,8 +2331,10 @@
+ AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
+ fi
+
+- if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then
++ if test -n "$OPENSSL_LIBS" ; then
+ PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
++ fi
++ if test -n "$OPENSSL_INCS" ; then
+ PHP_EVAL_INCLINE($OPENSSL_INCS)
+ fi
+ fi
diff --git a/dev-lang/php/files/php-fpm-r1.conf b/dev-lang/php/files/php-fpm-r1.conf
new file mode 100644
index 00000000..0b0a7f8b
--- /dev/null
+++ b/dev-lang/php/files/php-fpm-r1.conf
@@ -0,0 +1,311 @@
+;;;;;;;;;;;;;;;;;;;;;
+; FPM Configuration ;
+;;;;;;;;;;;;;;;;;;;;;
+
+; All relative paths in this configuration file are relative to PHP's install
+; prefix (/usr/lib/php5.3). This prefix can be dynamicaly changed by using the
+; '-p' argument from the command line.
+
+; Include one or more files. If glob(3) exists, it is used to include a bunch of
+; files from a glob(3) pattern. This directive can be used everywhere in the
+; file.
+; Relative path can also be used. They will be prefixed by:
+; - the global prefix if it's been set (-p arguement)
+; - /usr/lib/php5.3 otherwise
+;include=/etc/php/fpm-php5.3/fpm.d/*.conf
+
+;;;;;;;;;;;;;;;;;;
+; Global Options ;
+;;;;;;;;;;;;;;;;;;
+
+[global]
+; Pid file
+; Note: the default prefix is /var/lib
+; Default Value: none
+; Warning: pid file is overriden by the Gentoo init script.
+; FPM will refuse to start if you uncomment this settingi and make use of the
+; init script.
+; pid = /var/run/php-fpm.pid
+
+; Error log file
+; Note: the default prefix is /var/lib
+; Default Value: log/php-fpm.log
+error_log = /var/log/php-fpm.log
+
+; Log level
+; Possible Values: alert, error, warning, notice, debug
+; Default Value: notice
+;log_level = notice
+
+; If this number of child processes exit with SIGSEGV or SIGBUS within the time
+; interval set by emergency_restart_interval then FPM will restart. A value
+; of '0' means 'Off'.
+; Default Value: 0
+;emergency_restart_threshold = 0
+
+; Interval of time used by emergency_restart_interval to determine when
+; a graceful restart will be initiated. This can be useful to work around
+; accidental corruptions in an accelerator's shared memory.
+; Available Units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;emergency_restart_interval = 0
+
+; Time limit for child processes to wait for a reaction on signals from master.
+; Available units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;process_control_timeout = 0
+
+; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
+; Default Value: yes
+;daemonize = yes
+
+;;;;;;;;;;;;;;;;;;;;
+; Pool Definitions ;
+;;;;;;;;;;;;;;;;;;;;
+
+; Multiple pools of child processes may be started with different listening
+; ports and different management options. The name of the pool will be
+; used in logs and stats. There is no limitation on the number of pools which
+; FPM can handle. Your system will tell you anyway :)
+
+; Start a new pool named 'www'.
+; the variable $pool can we used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr/lib/php5.3) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses on a
+; specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = 127.0.0.1:9000
+
+; Set listen(2) backlog. A value of '-1' means unlimited.
+; Default Value: 128 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = -1
+
+; List of ipv4 addresses of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions.
+; Default Values: user and group are set as the running user
+; mode is set to 0666
+;listen.owner = nobody
+;listen.group = nobody
+;listen.mode = 0666
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = nobody
+group = nobody
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives:
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes to be created when pm is set to 'dynamic'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI.
+; Note: Used when pm is set to either 'static' or 'dynamic'
+; Note: This value is mandatory.
+pm.max_children = 50
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+;pm.start_servers = 20
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 5
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 35
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. By default, the status page shows the following
+; information:
+; accepted conn - the number of request accepted by the pool;
+; pool - the name of the pool;
+; process manager - static or dynamic;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes.
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic')
+; The values of 'idle processes', 'active processes' and 'total processes' are
+; updated each second. The value of 'accepted conn' is updated in real time.
+; Example output:
+; accepted conn: 12073
+; pool: www
+; process manager: static
+; idle processes: 35
+; active processes: 65
+; total processes: 100
+; max children reached: 1
+; By default the status page output is formatted as text/plain. Passing either
+; 'html' or 'json' as a query string will return the corresponding output
+; syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = /var/log/php-fpm-$pool.log.slow
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr/lib/php5.3)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/dev-lang/php/files/php-fpm-r4.init b/dev-lang/php/files/php-fpm-r4.init
new file mode 100755
index 00000000..a186d834
--- /dev/null
+++ b/dev-lang/php/files/php-fpm-r4.init
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+
+set_phpvars() {
+ PHPSLOT=${SVCNAME#php-fpm-}
+ [ ${PHPSLOT} = 'php-fpm' ] && PHPSLOT="$(eselect php show fpm)"
+
+ PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf"
+ PHP_FPM_PID="/var/run/php-fpm-${PHPSLOT}.pid"
+}
+
+extra_commands="depend"
+extra_started_commands="reload"
+
+depend() {
+ need net
+ use apache2 lighttpd nginx
+}
+
+start() {
+ ebegin "Starting PHP FastCGI Process Manager"
+ set_phpvars
+ start-stop-daemon --start --pidfile ${PHP_FPM_PID} --exec \
+ /usr/lib/${PHPSLOT}/bin/php-fpm -- -y "${PHP_FPM_CONF}" -g "${PHP_FPM_PID}"
+ local i=0
+ local timeout=5
+ while [ ! -f ${PHP_FPM_PID} ] && [ $i -le $timeout ]; do
+ sleep 1
+ i=$(($i + 1))
+ done
+
+ [ $timeout -gt $i ]
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PHP FastCGI Process Manager"
+ set_phpvars
+ start-stop-daemon --signal QUIT --stop --exec /usr/lib/${PHPSLOT}/bin/php-fpm --pidfile ${PHP_FPM_PID}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading PHP FastCGI Process Manager"
+ set_phpvars
+ [ -f ${PHP_FPM_PID} ] && kill -USR2 $(cat ${PHP_FPM_PID})
+ eend $?
+}
diff --git a/dev-lang/php/files/php-fpm_at-simple.service b/dev-lang/php/files/php-fpm_at-simple.service
new file mode 100644
index 00000000..5f0482e8
--- /dev/null
+++ b/dev-lang/php/files/php-fpm_at-simple.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=The PHP FastCGI Process Manager
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/run/php-fpm/php-fpm-%I.pid
+ExecStart=/usr/libexec/php-fpm-launcher php%I -y /etc/php/fpm-php%I/php-fpm.conf --nodaemonize
+ExecReload=/bin/kill -USR2 $MAINPID
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-lang/php/files/php-fpm_at.service b/dev-lang/php/files/php-fpm_at.service
new file mode 100644
index 00000000..152c1abe
--- /dev/null
+++ b/dev-lang/php/files/php-fpm_at.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=The PHP FastCGI Process Manager
+After=network.target
+
+[Service]
+Type=notify
+PIDFile=/run/php-fpm/php-fpm-%I.pid
+ExecStart=/usr/libexec/php-fpm-launcher php%I -y /etc/php/fpm-php%I/php-fpm.conf --nodaemonize
+ExecReload=/bin/kill -USR2 $MAINPID
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/dev-lang/php/files/php-libvpx.patch b/dev-lang/php/files/php-libvpx.patch
new file mode 100644
index 00000000..e23ae0ef
--- /dev/null
+++ b/dev-lang/php/files/php-libvpx.patch
@@ -0,0 +1,24 @@
+--- ext/gd/libgd/webpimg.c.orig 2015-04-10 17:33:03.864937281 +0300
++++ ext/gd/libgd/webpimg.c 2015-04-10 17:33:32.089873980 +0300
+@@ -706,14 +706,14 @@
+ codec_ctl(&enc, VP8E_SET_STATIC_THRESHOLD, 0);
+ codec_ctl(&enc, VP8E_SET_TOKEN_PARTITIONS, 2);
+
+- vpx_img_wrap(&img, IMG_FMT_I420,
++ vpx_img_wrap(&img, VPX_IMG_FMT_I420,
+ y_width, y_height, 16, (uint8*)(Y));
+- img.planes[PLANE_Y] = (uint8*)(Y);
+- img.planes[PLANE_U] = (uint8*)(U);
+- img.planes[PLANE_V] = (uint8*)(V);
+- img.stride[PLANE_Y] = y_stride;
+- img.stride[PLANE_U] = uv_stride;
+- img.stride[PLANE_V] = uv_stride;
++ img.planes[VPX_PLANE_Y] = (uint8*)(Y);
++ img.planes[VPX_PLANE_U] = (uint8*)(U);
++ img.planes[VPX_PLANE_V] = (uint8*)(V);
++ img.stride[VPX_PLANE_Y] = y_stride;
++ img.stride[VPX_PLANE_U] = uv_stride;
++ img.stride[VPX_PLANE_V] = uv_stride;
+
+ res = vpx_codec_encode(&enc, &img, 0, 1, 0, VPX_DL_BEST_QUALITY);
+
diff --git a/dev-lang/php/files/php5-ldvs b/dev-lang/php/files/php5-ldvs
new file mode 100644
index 00000000..783b0f63
--- /dev/null
+++ b/dev-lang/php/files/php5-ldvs
@@ -0,0 +1 @@
+PHP_5 { global: *; };
diff --git a/dev-lang/php/files/stricter-libc-client-symlink-check.patch b/dev-lang/php/files/stricter-libc-client-symlink-check.patch
new file mode 100644
index 00000000..7cf36643
--- /dev/null
+++ b/dev-lang/php/files/stricter-libc-client-symlink-check.patch
@@ -0,0 +1,15 @@
+Gentoo bugs: 88944 463800
+--- ext/imap/config.m4 2013-03-27 19:31:13.000000000 +0100
++++ ext/imap/config.m4.new 2013-03-30 18:34:17.581557062 +0100
+@@ -198,9 +198,9 @@
+ AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.)
+ fi
+
+- if test -r "$IMAP_DIR/c-client/c-client.a"; then
++ if test ! -r "$IMAP_DIR/c-client/libc-client.a" && -r "$IMAP_DIR/c-client/c-client.a" ; then
+ ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1
+- elif test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
++ elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
+ ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1
+ fi
+
diff --git a/dev-lang/php/php-5.3.29.ebuild b/dev-lang/php/php-5.3.29.ebuild
new file mode 100644
index 00000000..dfec750b
--- /dev/null
+++ b/dev-lang/php/php-5.3.29.ebuild
@@ -0,0 +1,827 @@
+# 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.3.29.ebuild,v 1.15 2015/04/05 22:15:41 sping 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"
+
+function php_get_uri ()
+{
+ case "${1}" in
+ "php-pre")
+ echo "http://downloads.php.net/johannes/${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="0"
+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 sqlite2 sqlite ssl
+ sybase-ct sysvipc tidy +tokenizer truetype unicode wddx
+ +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
+
+DEPEND="
+ >=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
+ >=dev-libs/libpcre-8.32[unicode]
+ apache2? ( www-servers/apache[threads=] )
+ berkdb? ( =sys-libs/db-4* )
+ bzip2? ( app-arch/bzip2 )
+ cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
+ cjk? ( !gd? (
+ virtual/jpeg:0
+ media-libs/libpng:0=
+ sys-libs/zlib
+ ) )
+ crypt? ( >=dev-libs/libmcrypt-2.4 )
+ curl? ( >=net-misc/curl-7.10.5 )
+ enchant? ( app-text/enchant )
+ exif? ( !gd? (
+ virtual/jpeg:0
+ media-libs/libpng:0=
+ sys-libs/zlib
+ ) )
+ firebird? ( dev-db/firebird )
+ gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
+ gdbm? ( >=sys-libs/gdbm-1.8.0 )
+ gmp? ( >=dev-libs/gmp-4.1.2 )
+ iconv? ( virtual/libiconv )
+ imap? ( virtual/imap-c-client[ssl=] )
+ intl? ( dev-libs/icu:= )
+ iodbc? ( dev-db/libiodbc )
+ kerberos? ( virtual/krb5 )
+ ldap? ( >=net-nds/openldap-1.2.11 )
+ ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
+ libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
+ mssql? ( dev-db/freetds[mssql] )
+ !mysqlnd? (
+ mysql? ( virtual/mysql )
+ mysqli? ( >=virtual/mysql-4.1 )
+ )
+ nls? ( sys-devel/gettext )
+ oci8-instant-client? ( dev-db/oracle-instantclient-basic )
+ odbc? ( >=dev-db/unixODBC-1.8.13 )
+ postgres? ( dev-db/postgresql )
+ 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 )
+ sqlite2? ( =dev-db/sqlite-2* )
+ sqlite? ( >=dev-db/sqlite-3.7.7.1 )
+ 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 ) )"
+
+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
+ sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
+ -i configure.in || die "Unable to change PHP branding"
+
+ # Apply generic PHP patches
+ EPATCH_SOURCE="${WORKDIR}/patches/generic" EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_MULTI_MSG="Applying generic patches and fixes from upstream..." epatch
+
+ #Fix bug 463498
+ epatch "${FILESDIR}/fix-libstdc++-underlinking.patch"
+
+ # Patch for pkg-config-0.28 (Bug 455040)
+ epatch "${FILESDIR}"/missing-openssl-include.patch
+
+ epatch "${FILESDIR}"/bison_build_2a.patch
+ epatch "${FILESDIR}"/bison_any_version.patch
+ rm Zend/zend_{language,ini}_parser.[ch]
+
+ # Fix for freetype-2.5.1 bug #494272
+ epatch "${FILESDIR}"/freetype-2.5.1-linking-fix.patch
+
+ # 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
+
+ # work around divert() issues with newer autoconf, bug #281697
+ if has_version '>=sys-devel/autoconf-2.64' ; then
+ sed -i -r \
+ -e 's:^((m4_)?divert)[(]([0-9]*)[)]:\1(600\3):' \
+ $(grep -l divert $(find . -name '*.m4') configure.in) || die
+ fi
+ eautoreconf --force -W no-cross
+}
+
+src_configure() {
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ PHP_DESTDIR="/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 )
+ $(use_enable calendar calendar )
+ $(use_enable ctype ctype )
+ $(use_with curl curl )
+ $(use_with curlwrappers curlwrappers )
+ $(use_enable xml dom )
+ $(use_with enchant enchant /usr)
+ $(use_enable exif exif )
+ $(use_enable fileinfo fileinfo )
+ $(use_enable filter filter )
+ $(use_enable ftp ftp )
+ $(use_with nls gettext )
+ $(use_with gmp gmp )
+ $(use_enable hash hash )
+ $(use_with mhash mhash )
+ $(use_with iconv iconv )
+ $(use_enable intl intl )
+ $(use_enable ipv6 ipv6 )
+ $(use_enable json json )
+ $(use_with kerberos kerberos /usr)
+ $(use_enable xml libxml )
+ $(use_enable unicode mbstring )
+ $(use_with crypt mcrypt )
+ $(use_with mssql mssql )
+ $(use_with unicode onig /usr)
+ $(use_with ssl openssl )
+ $(use_with ssl openssl-dir /usr)
+ $(use_enable pcntl pcntl )
+ $(use_enable phar phar )
+ $(use_enable pdo pdo )
+ $(use_with postgres pgsql )
+ $(use_enable posix posix )
+ $(use_with spell pspell )
+ $(use_with recode recode )
+ $(use_enable simplexml simplexml )
+ $(use_enable sharedmem shmop )
+ $(use_with snmp snmp )
+ $(use_enable soap soap )
+ $(use_enable sockets sockets )"
+ if version_is_at_least 5.3.16-r2; then
+ my_conf+=" $(use_with sqlite2 sqlite /usr) "
+ use sqlite2 && my_conf+=" $(use_enable unicode sqlite-utf8)"
+ else
+ my_conf+=" $(use_with sqlite sqlite /usr) "
+ use sqlite && my_conf+=" $(use_enable unicode sqlite-utf8)"
+ fi
+ my_conf+="
+ $(use_with sqlite sqlite3 /usr)
+ $(use_with sybase-ct sybase-ct /usr)
+ $(use_enable sysvipc sysvmsg )
+ $(use_enable sysvipc sysvsem )
+ $(use_enable sysvipc sysvshm )
+ $(use_with tidy tidy )
+ $(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 )
+ $(use_enable zip zip )
+ $(use_with zlib zlib )
+ $(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 )
+ $(use_enable flatfile flatfile )
+ $(use_with gdbm gdbm )
+ $(use_enable inifile inifile )
+ $(use_with qdbm qdbm )"
+
+ # Support for the GD graphics library
+ my_conf+="
+ $(use_with truetype freetype-dir /usr)
+ $(use_with truetype t1lib /usr)
+ $(use_enable cjk gd-jis-conv )
+ $(use_with gd jpeg-dir /usr)
+ $(use_with gd png-dir /usr)
+ $(use_with xpm xpm-dir /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 )
+ $(use_with ssl imap-ssl )"
+ fi
+
+ # Interbase/firebird support
+
+ if use firebird ; then
+ my_conf+="
+ $(use_with firebird interbase /usr)"
+ fi
+
+ # LDAP support
+ if use ldap ; then
+ my_conf+="
+ $(use_with ldap ldap )
+ $(use_with ldap-sasl ldap-sasl )"
+ fi
+
+ # MySQL support
+ if use mysql ; then
+ if use mysqlnd ; then
+ my_conf+="
+ $(use_with mysqlnd mysql mysqlnd)"
+ else
+ my_conf+="
+ $(use_with mysql mysql /usr)"
+ fi
+ my_conf+="
+ $(use_with mysql mysql-sock /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 /usr/bin/mysql_config)"
+ fi
+
+ # ODBC support
+ if use odbc ; then
+ my_conf+="
+ $(use_with odbc unixODBC /usr)"
+ fi
+
+ if use iodbc ; then
+ my_conf+="
+ $(use_with iodbc iodbc /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 mysql pdo-mysql mysqlnd)"
+ else
+ my_conf+="
+ $(use_with mysql pdo-mysql /usr)"
+ fi
+ my_conf+="
+ $(use_with postgres pdo-pgsql )
+ $(use_with sqlite pdo-sqlite /usr)
+ $(use_with odbc pdo-odbc unixODBC,/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 )
+ $(use_with libedit libedit )"
+
+ # Session support
+ if use session ; then
+ my_conf+="
+ $(use_with sharedmem mm )"
+ 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=/usr --with-pcre-dir=/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=/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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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"
+
+ use fpm && systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service"
+}
+
+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" # actually provided by app-eselect/eselect-php
+ 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 /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 /etc/make.conf"
+ ewarn "Both versions of php.ini can be found in /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.4.39.ebuild b/dev-lang/php/php-5.4.39.ebuild
new file mode 100644
index 00000000..401b2ff7
--- /dev/null
+++ b/dev-lang/php/php-5.4.39.ebuild
@@ -0,0 +1,812 @@
+# 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.12 2015/04/17 09:46:51 ago 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-eselect/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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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" # actually provided by app-eselect/eselect-php
+ 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.4.40.ebuild b/dev-lang/php/php-5.4.40.ebuild
new file mode 100644
index 00000000..373cd08a
--- /dev/null
+++ b/dev-lang/php/php-5.4.40.ebuild
@@ -0,0 +1,812 @@
+# 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.40.ebuild,v 1.3 2015/04/19 08:15:51 ago 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-eselect/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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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" # actually provided by app-eselect/eselect-php
+ 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.22.ebuild b/dev-lang/php/php-5.5.22.ebuild
new file mode 100644
index 00000000..01499b33
--- /dev/null
+++ b/dev-lang/php/php-5.5.22.ebuild
@@ -0,0 +1,794 @@
+# 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.22.ebuild,v 1.10 2015/04/05 22:15:41 sping 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-eselect/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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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" # actually provided by app-eselect/eselect-php
+ 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
index 00000000..9da97560
--- /dev/null
+++ b/dev-lang/php/php-5.5.23.ebuild
@@ -0,0 +1,794 @@
+# 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.12 2015/04/17 09:46:51 ago 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-eselect/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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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" # actually provided by app-eselect/eselect-php
+ 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.24.ebuild b/dev-lang/php/php-5.5.24.ebuild
new file mode 100644
index 00000000..84b5f0b4
--- /dev/null
+++ b/dev-lang/php/php-5.5.24.ebuild
@@ -0,0 +1,794 @@
+# 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.24.ebuild,v 1.3 2015/04/19 08:15:51 ago 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-eselect/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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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" # actually provided by app-eselect/eselect-php
+ 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
index 00000000..6e522cfc
--- /dev/null
+++ b/dev-lang/php/php-5.6.7.ebuild
@@ -0,0 +1,797 @@
+# 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.4 2015/04/17 04:55:28 phajdan.jr 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-eselect/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
+
+ # Fix build with libvpx-1.4.0, bug #545952 .
+ epatch "${FILESDIR}/${PN}-libvpx.patch"
+
+ #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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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" # actually provided by app-eselect/eselect-php
+ 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.8.ebuild b/dev-lang/php/php-5.6.8.ebuild
new file mode 100644
index 00000000..4c70107b
--- /dev/null
+++ b/dev-lang/php/php-5.6.8.ebuild
@@ -0,0 +1,797 @@
+# 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.8.ebuild,v 1.1 2015/04/18 10:56:15 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-eselect/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
+
+ # Fix build with libvpx-1.4.0, bug #545952 .
+ epatch "${FILESDIR}/${PN}-libvpx.patch"
+
+ #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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ 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" # actually provided by app-eselect/eselect-php
+ 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-php/PEAR-PEAR/Manifest b/dev-php/PEAR-PEAR/Manifest
new file mode 100644
index 00000000..9b690ce3
--- /dev/null
+++ b/dev-php/PEAR-PEAR/Manifest
@@ -0,0 +1,9 @@
+AUX gentoo-libtool-mismatch-fix-v2.patch 511 SHA256 a9feb3c0134f31c4a2370ac8f3d43bd81cae3850fbcd6ba4642382712c4b6d01 SHA512 aeecd3c54e7e7248eaf661770ed64c664a8c86e536812115f379682b464cbaf2fb36fe70bcb8e4c25391aed1efef9a7b5cb2a1fb4a4169b9ec011d82e000893b WHIRLPOOL 48a77d8bf8779d4718cc8e3c2d96f359f26ef9ef467d6121caa2f4cf3ca2bfc87c165563e5224934813542b83d5938fe3b62f39dcc20b6f9d44ebebfe118e665
+AUX gentoo-libtool-mismatch-fix.patch 718 SHA256 7ee96d72e09529f773c14db4da099fdb8beec12a370b76fb8901cc010cdb6fb5 SHA512 11fa9687c05ca448124b9b10801ca161ef1a5e77aa1aa9fe264a1e5ffa8947227e370a0f0d5f29d00bd5e7a280815dd43fc592996f52114cbf309556861db88e WHIRLPOOL 931d2d9c995dcaabaa2b5160a41146ad8771cb2b1947e2bd749b64be8c6520ad018ccc7bd8759aae7e3afeae78801c908b5362d089d89f55addaff1a7e1d1eeb
+AUX pear.conf 291 SHA256 cbe9363c760952d00b90070d4a41e88a175e12c65f99668fbe16d8158f5fa7ab SHA512 5422fccd07eb57b6e181bcf9e3a3c8b68458b5cd1750ee64551edae7513f6332043e8bdccef03ddafc2fe82dae7fad4d9dc2eb925329a8ee6079908df62baf3f WHIRLPOOL 36c6434da96bddd9edc42055897b4d93df74b35fe5243b67acfae900cb9f77eb9bc5952cdeacdf579e4b6470381daf64af7d8321f76077aea11efc4077e21b7e
+AUX pear.conf-r1 379 SHA256 43e78396b7b91cf16a3d33d36c19096c9e7281b7f771c379f383a16c7756c490 SHA512 e9748ee4b2ff415b84cd0fc237b31d2fc5e7614b6ba0f978c245c852be1318b47fae2464785534603084ee2ac9178fa847a8d0244d7069152dd341bd7ac89b07 WHIRLPOOL 5905c556d764dad3d74da14d9f5603e0b2af8c0e2476f475124d50f9e04db5befd40b5cf4967a63890bc2fd1e52971e5005ab6e563658c277905960ffde3cca4
+AUX pear.conf-r2 379 SHA256 33296ad828fdbe5447edc93aea6e81351f643fc2e845c6e4bdfad84b299023aa SHA512 81e4c95ccfd1a50d30d6e9db90fa099f3dd098bf4fa2c023f5369d0e96a197da91d2572ff3785bcfc83dba82abeca3932431083b5aa2aed155336697764666be WHIRLPOOL 23a9d300340b463064a4f26489386d786c151394d763a9bcdbb6d5fd6ef72536849c375edd48c57f7c58e63a80650a975fdb7d6cbb368f59471789da4c65ae9a
+DIST PEAR-1.9.4.tgz 296332 SHA256 80c329264a0363c6222b2f750e1646015161c9787bb4041f5ab41d95160bb93c SHA512 f4c8c6f24039940254cf774e51087a12e6b17f7cbd7308c814f8b43f1342ae68db6b2d94626a4d7ed05e8b537816da08459e2939689f15aef725504683657f47 WHIRLPOOL a640fa5dff5eda2801698094b3d99c7c63d9028727f323634dc6c17942d4cbf4fe76ddd35b89a11a8187de068201b875642bf90ea705544801d4ffaac3325828
+DIST PEAR-1.9.5.tgz 290006 SHA256 d4c27d7321f76527222eae3972c6ffb62412cc729105c858ae0bb0861d699bdb SHA512 73c5ef84c4ededa7bca81b1d94944e80ddf9dc40101c0727c5975d4ddb72f66a28aecafcefb7af8d1cc3b6fa7e488e704559a7efbebe860adfb8e9796cdf4933 WHIRLPOOL ea42f63e73d680985857f3e8e318e1f7d001edc843d12b94c9b7d3969c0793c0a9709d2dc8940b339be2f9e854cb2a3acb8c0e5cdef7ddc3cd06c9df97a3ee37
+EBUILD PEAR-PEAR-1.9.4.ebuild 4017 SHA256 2f337f133c91ed5d00639e143581cab90e0aac7d54081d8633b1910b3acd5ff4 SHA512 1aebbe63f5863c3b8d2243111f6339e315dd449f445622ab303c29b83a80f2f9e48a35d964bc959636e1eca85ae55bd371cfa55f6e94cb82d889bede19ae0658 WHIRLPOOL c14ff762535da89dacdabeac5b28e0faa3db3e099f31c7cf08b43120f291720de944cc35ae3680d0baed710cab6841dadb3dc04438bdc7a49e37b0149e199315
+EBUILD PEAR-PEAR-1.9.5.ebuild 3998 SHA256 03946334df2b4b03be9858a7152491214eeb04788016f88f00c46a4436a47cef SHA512 14e1819fa675ce46104466f230850f3482be610b61640d4da5a049fa2bf2efc7d0632405396f321045965620d836dd20f405a43d356cc474f81fa4a1161cc3be WHIRLPOOL 444cfa1c3183632bf4f7bc1e3e6bb0b0d0f469e5b6815d35d81f203d341e24fca6a6a7c6b183b23bf097baecab063f1b40d8ee290a06316e0e88efd7dbcc437d
diff --git a/dev-php/PEAR-PEAR/PEAR-PEAR-1.9.4.ebuild b/dev-php/PEAR-PEAR/PEAR-PEAR-1.9.4.ebuild
new file mode 100644
index 00000000..c977cf03
--- /dev/null
+++ b/dev-php/PEAR-PEAR/PEAR-PEAR-1.9.4.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-php/PEAR-PEAR/PEAR-PEAR-1.9.4.ebuild,v 1.12 2014/10/10 16:59:08 grknight Exp $
+
+EAPI="4"
+
+inherit depend.php eutils
+
+PEAR="${PV}"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~ia64-linux ~x86-linux ~x64-macos ~x86-macos"
+
+DESCRIPTION="PEAR Base System"
+HOMEPAGE="http://pear.php.net/package/PEAR"
+SRC_URI="http://pear.php.net/get/PEAR-${PEAR}.tgz"
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+
+DEPEND="|| ( <dev-lang/php-5.3[pcre] >=dev-lang/php-5.3 )
+ dev-lang/php[cli,xml,zlib]"
+
+RDEPEND="${DEPEND}"
+
+PDEPEND="dev-php/pear"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ has_php
+
+ [[ -z "${PEAR_CACHEDIR}" ]] && PEAR_CACHEDIR="${EPREFIX}/var/cache/pear"
+ [[ -z "${PEAR_DOWNLOADDIR}" ]] && PEAR_DOWNLOADDIR="${EPREFIX}/var/tmp/pear"
+ [[ -z "${PEAR_TEMPDIR}" ]] && PEAR_TEMPDIR="${EPREFIX}/tmp"
+
+ elog
+ elog "cache_dir is set to: ${PEAR_CACHEDIR}"
+ elog "download_dir is set to: ${PEAR_DOWNLOADDIR}"
+ elog "temp_dir is set to: ${PEAR_TEMPDIR}"
+ elog
+ elog "If you want to change the above values, you need to set"
+ elog "PEAR_CACHEDIR, PEAR_DOWNLOADDIR and PEAR_TEMPDIR variable(s)"
+ elog "accordingly in /etc/portage/make.conf and re-emerge ${PN}."
+ elog
+}
+
+src_prepare() {
+ cd PEAR-${PV}
+ epatch "${FILESDIR}/gentoo-libtool-mismatch-fix.patch"
+
+}
+
+src_install() {
+ # Prevent SNMP related sandbox violoation.
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ unset varlib
+
+ # install PEAR package
+ cd "${S}"/PEAR-${PEAR}
+
+ insinto /usr/share/php
+ doins -r PEAR/
+ doins -r OS/
+ doins PEAR.php PEAR5.php System.php
+ doins scripts/pearcmd.php
+ doins scripts/peclcmd.php
+
+ newbin scripts/pear.sh pear
+ newbin scripts/peardev.sh peardev
+ newbin scripts/pecl.sh pecl
+
+ # adjust some scripts for current version
+ for i in pearcmd.php peclcmd.php ; do
+ sed "s:@pear_version@:${PEAR}:g" -i "${D}/usr/share/php/${i}"
+ done
+
+ for i in pear peardev pecl ; do
+ sed "s:@bin_dir@:${EPREFIX}/usr/bin:g" -i "${D}/usr/bin/${i}"
+ sed "s:@php_dir@:${EPREFIX}/usr/share/php:g" -i "${D}/usr/bin/${i}"
+ done
+ sed "s:-d output_buffering=1:-d output_buffering=1 -d memory_limit=32M:g" -i "${D}/usr/bin/pear"
+
+ sed "s:@package_version@:${PEAR}:g" -i "${D}/usr/share/php/PEAR/Command/Package.php"
+ sed "s:@PEAR-VER@:${PEAR}:g" -i "${D}/usr/share/php/PEAR/Dependency2.php"
+ sed "s:@PEAR-VER@:${PEAR}:g" -i "${D}/usr/share/php/PEAR/PackageFile/Parser/v1.php"
+ sed "s:@PEAR-VER@:${PEAR}:g" -i "${D}/usr/share/php/PEAR/PackageFile/Parser/v2.php"
+
+ # finalize install
+ insinto /etc
+ newins "${FILESDIR}"/pear.conf-r2 pear.conf
+ sed "s|s:PHPCLILEN:\"PHPCLI\"|s:${#PHPCLI}:\"${PHPCLI}\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:CACHEDIRLEN:\"CACHEDIR\"|s:${#PEAR_CACHEDIR}:\"${PEAR_CACHEDIR}\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:DOWNLOADDIRLEN:\"DOWNLOADDIR\"|s:${#PEAR_DOWNLOADDIR}:\"${PEAR_DOWNLOADDIR}\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:TEMPDIRLEN:\"TEMPDIR\"|s:${#PEAR_TEMPDIR}:\"${PEAR_TEMPDIR}\"|g" -i "${D}/etc/pear.conf"
+
+ # Change the paths for eprefix!
+ sed "s|s:19:\"/usr/share/php/docs\"|s:$(( ${#EPREFIX}+19 )):\"${EPREFIX}/usr/share/php/docs\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:19:\"/usr/share/php/data\"|s:$(( ${#EPREFIX}+19 )):\"${EPREFIX}/usr/share/php/data\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:20:\"/usr/share/php/tests\"|s:$(( ${#EPREFIX}+20 )):\"${EPREFIX}/usr/share/php/tests\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:14:\"/usr/share/php\"|s:$(( ${#EPREFIX}+14 )):\"${EPREFIX}/usr/share/php\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:8:\"/usr/bin\"|s:$(( ${#EPREFIX}+8 )):\"${EPREFIX}/usr/bin\"|g" -i "${D}/etc/pear.conf"
+
+ [[ "${PEAR_TEMPDIR}" != "/tmp" ]] && keepdir "${PEAR_TEMPDIR#${EPREFIX}}"
+ keepdir "${PEAR_CACHEDIR#${EPREFIX}}"
+ diropts -m1777
+ keepdir "${PEAR_DOWNLOADDIR#${EPREFIX}}"
+}
+
+pkg_preinst() {
+ rm -f "${EROOT}/etc/pear.conf"
+}
diff --git a/dev-php/PEAR-PEAR/PEAR-PEAR-1.9.5.ebuild b/dev-php/PEAR-PEAR/PEAR-PEAR-1.9.5.ebuild
new file mode 100644
index 00000000..cfa813ca
--- /dev/null
+++ b/dev-php/PEAR-PEAR/PEAR-PEAR-1.9.5.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-php/PEAR-PEAR/PEAR-PEAR-1.9.5.ebuild,v 1.2 2015/04/14 18:03:37 grknight Exp $
+
+EAPI="5"
+
+inherit depend.php eutils
+
+PEAR="${PV}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux ~x64-macos ~x86-macos"
+
+DESCRIPTION="PEAR Base System"
+HOMEPAGE="http://pear.php.net/package/PEAR"
+SRC_URI="http://pear.php.net/get/PEAR-${PEAR}.tgz"
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-lang/php:*[cli,pcre(+),xml,zlib]"
+
+RDEPEND="${DEPEND}"
+
+PDEPEND="dev-php/pear"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ has_php
+
+ [[ -z "${PEAR_CACHEDIR}" ]] && PEAR_CACHEDIR="${EPREFIX}/var/cache/pear"
+ [[ -z "${PEAR_DOWNLOADDIR}" ]] && PEAR_DOWNLOADDIR="${EPREFIX}/var/tmp/pear"
+ [[ -z "${PEAR_TEMPDIR}" ]] && PEAR_TEMPDIR="${EPREFIX}/tmp"
+
+ elog
+ elog "cache_dir is set to: ${PEAR_CACHEDIR}"
+ elog "download_dir is set to: ${PEAR_DOWNLOADDIR}"
+ elog "temp_dir is set to: ${PEAR_TEMPDIR}"
+ elog
+ elog "If you want to change the above values, you need to set"
+ elog "PEAR_CACHEDIR, PEAR_DOWNLOADDIR and PEAR_TEMPDIR variable(s)"
+ elog "accordingly in /etc/portage/make.conf and re-emerge ${PN}."
+ elog
+}
+
+src_prepare() {
+ cd PEAR-${PV}
+ epatch "${FILESDIR}/gentoo-libtool-mismatch-fix-v2.patch"
+ epatch_user
+}
+
+src_install() {
+ # Prevent SNMP related sandbox violoation.
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ unset varlib
+
+ # install PEAR package
+ cd "${S}"/PEAR-${PEAR}
+
+ insinto /usr/share/php
+ doins -r PEAR/
+ doins -r OS/
+ doins PEAR.php PEAR5.php System.php
+ doins scripts/pearcmd.php
+ doins scripts/peclcmd.php
+
+ newbin scripts/pear.sh pear
+ newbin scripts/peardev.sh peardev
+ newbin scripts/pecl.sh pecl
+
+ # adjust some scripts for current version
+ for i in pearcmd.php peclcmd.php ; do
+ sed "s:@pear_version@:${PEAR}:g" -i "${D}/usr/share/php/${i}"
+ done
+
+ for i in pear peardev pecl ; do
+ sed "s:@bin_dir@:${EPREFIX}/usr/bin:g" -i "${D}/usr/bin/${i}"
+ sed "s:@php_dir@:${EPREFIX}/usr/share/php:g" -i "${D}/usr/bin/${i}"
+ done
+ sed "s:-d output_buffering=1:-d output_buffering=1 -d memory_limit=32M:g" -i "${D}/usr/bin/pear"
+
+ sed "s:@package_version@:${PEAR}:g" -i "${D}/usr/share/php/PEAR/Command/Package.php"
+ sed "s:@PEAR-VER@:${PEAR}:g" -i "${D}/usr/share/php/PEAR/Dependency2.php"
+ sed "s:@PEAR-VER@:${PEAR}:g" -i "${D}/usr/share/php/PEAR/PackageFile/Parser/v1.php"
+ sed "s:@PEAR-VER@:${PEAR}:g" -i "${D}/usr/share/php/PEAR/PackageFile/Parser/v2.php"
+
+ # finalize install
+ insinto /etc
+ newins "${FILESDIR}"/pear.conf-r2 pear.conf
+ sed "s|s:PHPCLILEN:\"PHPCLI\"|s:${#PHPCLI}:\"${PHPCLI}\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:CACHEDIRLEN:\"CACHEDIR\"|s:${#PEAR_CACHEDIR}:\"${PEAR_CACHEDIR}\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:DOWNLOADDIRLEN:\"DOWNLOADDIR\"|s:${#PEAR_DOWNLOADDIR}:\"${PEAR_DOWNLOADDIR}\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:TEMPDIRLEN:\"TEMPDIR\"|s:${#PEAR_TEMPDIR}:\"${PEAR_TEMPDIR}\"|g" -i "${D}/etc/pear.conf"
+
+ # Change the paths for eprefix!
+ sed "s|s:19:\"/usr/share/php/docs\"|s:$(( ${#EPREFIX}+19 )):\"${EPREFIX}/usr/share/php/docs\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:19:\"/usr/share/php/data\"|s:$(( ${#EPREFIX}+19 )):\"${EPREFIX}/usr/share/php/data\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:20:\"/usr/share/php/tests\"|s:$(( ${#EPREFIX}+20 )):\"${EPREFIX}/usr/share/php/tests\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:14:\"/usr/share/php\"|s:$(( ${#EPREFIX}+14 )):\"${EPREFIX}/usr/share/php\"|g" -i "${D}/etc/pear.conf"
+ sed "s|s:8:\"/usr/bin\"|s:$(( ${#EPREFIX}+8 )):\"${EPREFIX}/usr/bin\"|g" -i "${D}/etc/pear.conf"
+
+ [[ "${PEAR_TEMPDIR}" != "/tmp" ]] && keepdir "${PEAR_TEMPDIR#${EPREFIX}}"
+ keepdir "${PEAR_CACHEDIR#${EPREFIX}}"
+ diropts -m1777
+ keepdir "${PEAR_DOWNLOADDIR#${EPREFIX}}"
+}
+
+pkg_preinst() {
+ rm -f "${EROOT}/etc/pear.conf"
+}
diff --git a/dev-php/PEAR-PEAR/files/gentoo-libtool-mismatch-fix-v2.patch b/dev-php/PEAR-PEAR/files/gentoo-libtool-mismatch-fix-v2.patch
new file mode 100644
index 00000000..0a7effe9
--- /dev/null
+++ b/dev-php/PEAR-PEAR/files/gentoo-libtool-mismatch-fix-v2.patch
@@ -0,0 +1,15 @@
+diff -aruN PEAR.orig/Builder.php PEAR/Builder.php
+--- PEAR.orig/Builder.php 2014-07-12 08:25:32.000000000 -0400
++++ PEAR/Builder.php 2015-01-16 13:43:14.927894013 -0500
+@@ -340,6 +340,11 @@
+ }
+ // }}} end of interactive part
+
++ if (file_exists('aclocal.m4')) {
++ $this->_runCommand('rm aclocal.m4');
++ $this->_runCommand('autoreconf');
++ }
++
+ // FIXME make configurable
+ if (!$user=getenv('USER')) {
+ $user='defaultuser';
diff --git a/dev-php/PEAR-PEAR/files/gentoo-libtool-mismatch-fix.patch b/dev-php/PEAR-PEAR/files/gentoo-libtool-mismatch-fix.patch
new file mode 100644
index 00000000..53a33b83
--- /dev/null
+++ b/dev-php/PEAR-PEAR/files/gentoo-libtool-mismatch-fix.patch
@@ -0,0 +1,31 @@
+Fixed libtool mismatch issues.
+Gentoo bug: 344605
+
+*** PEAR/Builder.php.old Mon Nov 8 16:22:52 2010
+--- PEAR/Builder.php Mon Nov 8 16:20:22 2010
+***************
+*** 326,331 ****
+--- 326,336 ----
+ }
+ // }}} end of interactive part
+
++ if (file_exists('aclocal.m4')) {
++ $this->_runCommand('rm aclocal.m4');
++ $this->_runCommand('autoreconf');
++ }
++
+ // FIXME make configurable
+ if(!$user=getenv('USER')){
+ $user='defaultuser';
+***************
+*** 471,474 ****
+ }
+ return PEAR_Common::log($level, $msg);
+ }
+! }
+\ No newline at end of file
+--- 476,479 ----
+ }
+ return PEAR_Common::log($level, $msg);
+ }
+! }
diff --git a/dev-php/PEAR-PEAR/files/pear.conf b/dev-php/PEAR-PEAR/files/pear.conf
new file mode 100644
index 00000000..5a3c5298
--- /dev/null
+++ b/dev-php/PEAR-PEAR/files/pear.conf
@@ -0,0 +1,2 @@
+#PEAR_Config 0.9
+a:7:{s:7:"doc_dir";s:19:"/usr/share/php/docs";s:8:"data_dir";s:19:"/usr/share/php/data";s:8:"test_dir";s:20:"/usr/share/php/tests";s:7:"php_dir";s:14:"/usr/share/php";s:7:"bin_dir";s:8:"/usr/bin";s:7:"php_bin";s:PHPCLILEN:"PHPCLI";s:9:"cache_dir";s:CACHEDIRLEN:"CACHEDIR";}
diff --git a/dev-php/PEAR-PEAR/files/pear.conf-r1 b/dev-php/PEAR-PEAR/files/pear.conf-r1
new file mode 100644
index 00000000..78f69818
--- /dev/null
+++ b/dev-php/PEAR-PEAR/files/pear.conf-r1
@@ -0,0 +1,2 @@
+#PEAR_Config 0.9
+a:9:{s:7:"doc_dir";s:19:"/usr/share/php/docs";s:8:"data_dir";s:19:"/usr/share/php/data";s:8:"test_dir";s:20:"/usr/share/php/tests";s:7:"php_dir";s:14:"/usr/share/php";s:7:"bin_dir";s:8:"/usr/bin";s:7:"php_bin";s:PHPCLILEN:"PHPCLI";s:9:"cache_dir";s:CACHEDIRLEN:"CACHEDIR";s:12:"download_dir";s:DOWNLOADDIRLEN:"DOWNLOADDIR";s:8:"temp_dir";s:TEMPDIRLEN:"TEMPDIR";} \ No newline at end of file
diff --git a/dev-php/PEAR-PEAR/files/pear.conf-r2 b/dev-php/PEAR-PEAR/files/pear.conf-r2
new file mode 100644
index 00000000..277227b4
--- /dev/null
+++ b/dev-php/PEAR-PEAR/files/pear.conf-r2
@@ -0,0 +1,2 @@
+#PEAR_Config 0.9
+a:9:{s:7:"doc_dir";s:19:"/usr/share/php/docs";s:8:"data_dir";s:19:"/usr/share/php/data";s:8:"test_dir";s:20:"/usr/share/php/tests";s:7:"php_dir";s:14:"/usr/share/php";s:7:"bin_dir";s:8:"/usr/bin";s:7:"php_bin";s:12:"/usr/bin/php";s:9:"cache_dir";s:CACHEDIRLEN:"CACHEDIR";s:12:"download_dir";s:DOWNLOADDIRLEN:"DOWNLOADDIR";s:8:"temp_dir";s:TEMPDIRLEN:"TEMPDIR";}
diff --git a/eclass/php-ext-source-r2.eclass b/eclass/php-ext-source-r2.eclass
new file mode 100644
index 00000000..e36c1a76
--- /dev/null
+++ b/eclass/php-ext-source-r2.eclass
@@ -0,0 +1,380 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.34 2015/03/26 16:15:33 grknight Exp $
+
+# @ECLASS: php-ext-source-r2.eclass
+# @MAINTAINER:
+# Gentoo PHP team <php-bugs@gentoo.org>
+# @AUTHOR:
+# Author: Tal Peer <coredumb@gentoo.org>
+# Author: Stuart Herbert <stuart@gentoo.org>
+# Author: Luca Longinotti <chtekk@gentoo.org>
+# Author: Jakub Moc <jakub@gentoo.org> (documentation)
+# Author: Ole Markus With <olemarkus@gentoo.org>
+# @BLURB: A unified interface for compiling and installing standalone PHP extensions.
+# @DESCRIPTION:
+# This eclass provides a unified interface for compiling and installing standalone
+# PHP extensions (modules).
+
+inherit flag-o-matic autotools multilib eutils
+
+EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
+
+DEPEND=">=sys-devel/m4-1.4.3
+ >=sys-devel/libtool-1.5.18"
+RDEPEND=""
+
+# Because of USE deps, we require at least EAPI 2
+case ${EAPI} in
+ 4|5) ;;
+ *)
+ die "php-ext-source-r2 is not compatible with EAPI=${EAPI}"
+esac
+
+# @ECLASS-VARIABLE: PHP_EXT_NAME
+# @DESCRIPTION:
+# The extension name. This must be set, otherwise the eclass dies.
+# Only automagically set by php-ext-pecl-r2.eclass, so unless your ebuild
+# inherits that eclass, you must set this manually before inherit.
+[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-source-r2 eclass"
+
+# @ECLASS-VARIABLE: PHP_EXT_INI
+# @DESCRIPTION:
+# Controls whether or not to add a line to php.ini for the extension.
+# Defaults to "yes" and should not be changed in most cases.
+[[ -z "${PHP_EXT_INI}" ]] && PHP_EXT_INI="yes"
+
+# @ECLASS-VARIABLE: PHP_EXT_ZENDEXT
+# @DESCRIPTION:
+# Controls whether the extension is a ZendEngine extension or not.
+# Defaults to "no" and if you don't know what is it, you don't need it.
+[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no"
+
+# @ECLASS-VARIABLE: USE_PHP
+# @DESCRIPTION:
+# Lists the PHP slots compatibile the extension is compatibile with
+[[ -z "${USE_PHP}" ]] && USE_PHP="php5-3" \
+ && eqawarn "An empty USE_PHP is deprecated and support will be removed on 2015-05-01"
+
+# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE
+# @DESCRIPTION:
+# If set, this is the USE flag that the PHP dependencies are behind
+# Most commonly set as PHP_EXT_OPTIONAL_USE=php to get the dependencies behind
+# USE=php.
+
+# @ECLASS-VARIABLE: PHP_EXT_S
+# @DESCRIPTION:
+# The relative location of the temporary build directory for the PHP extension within
+# the source package. This is useful for packages that bundle the PHP extension.
+# Defaults to ${S}
+[[ -z "${PHP_EXT_S}" ]] && PHP_EXT_S="${S}"
+
+#Make sure at least one target is installed.
+REQUIRED_USE="${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }|| ( "
+for target in ${USE_PHP}; do
+ IUSE="${IUSE} php_targets_${target}"
+ target=${target/+}
+ REQUIRED_USE+="php_targets_${target} "
+ slot=${target/php}
+ slot=${slot/-/.}
+ PHPDEPEND="${PHPDEPEND}
+ php_targets_${target}? ( dev-lang/php:${slot} )"
+done
+REQUIRED_USE+=") ${PHP_EXT_OPTIONAL_USE:+ )}"
+
+RDEPEND="${RDEPEND}
+ ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
+ ${PHPDEPEND}
+ ${PHP_EXT_OPTIONAL_USE:+ )}"
+
+DEPEND="${DEPEND}
+ ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
+ ${PHPDEPEND}
+ ${PHP_EXT_OPTIONAL_USE:+ )}
+"
+
+# @FUNCTION: php-ext-source-r2_src_unpack
+# @DESCRIPTION:
+# runs standard src_unpack + _phpize
+
+# @VARIABLE: PHP_EXT_SKIP_PHPIZE
+# @DESCRIPTION:
+# phpize will be run by default for all ebuilds that use
+# php-ext-source-r2_src_unpack
+# Set PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run phpize.
+php-ext-source-r2_src_unpack() {
+ unpack ${A}
+ local slot orig_s="${PHP_EXT_S}"
+ for slot in $(php_get_slots); do
+ cp -r "${orig_s}" "${WORKDIR}/${slot}" || die "Failed to copy source ${orig_s} to PHP target directory"
+ done
+}
+
+php-ext-source-r2_src_prepare() {
+ local slot orig_s="${PHP_EXT_S}"
+ for slot in $(php_get_slots); do
+ php_init_slot_env ${slot}
+ php-ext-source-r2_phpize
+ done
+}
+
+# @FUNCTION: php-ext-source-r2_phpize
+# @DESCRIPTION:
+# Runs phpize and autotools in addition to the standard src_unpack
+php-ext-source-r2_phpize() {
+ if [[ "${PHP_EXT_SKIP_PHPIZE}" != 'yes' ]] ; then
+ # Create configure out of config.m4
+ # I wish I could run this to solve #329071, but I cannot
+ #autotools_run_tool ${PHPIZE}
+ ${PHPIZE}
+ # force run of libtoolize and regeneration of related autotools
+ # files (bug 220519)
+ rm aclocal.m4
+ eautoreconf
+ fi
+}
+
+# @FUNCTION: php-ext-source-r2_src_configure
+# @DESCRIPTION:
+# Takes care of standard configure for PHP extensions (modules).
+
+# @VARIABLE: my_conf
+# @DESCRIPTION:
+# Set this in the ebuild to pass configure options to econf.
+php-ext-source-r2_src_configure() {
+ # net-snmp creates this file #385403
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ local slot
+ for slot in $(php_get_slots); do
+ php_init_slot_env ${slot}
+ # Set the correct config options
+ econf --with-php-config=${PHPCONFIG} ${my_conf} || die "Unable to configure code to compile"
+ done
+}
+
+# @FUNCTION: php-ext-source-r2_src_compile
+# @DESCRIPTION:
+# Takes care of standard compile for PHP extensions (modules).
+php-ext-source-r2_src_compile() {
+ # net-snmp creates this file #324739
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+
+ # shm extension createss a semaphore file #173574
+ addpredict /session_mm_cli0.sem
+ local slot
+ for slot in $(php_get_slots); do
+ php_init_slot_env ${slot}
+ emake || die "Unable to make code"
+
+ done
+}
+
+# @FUNCTION: php-ext-source-r2_src_install
+# @DESCRIPTION:
+# Takes care of standard install for PHP extensions (modules).
+
+# @VARIABLE: DOCS
+# @DESCRIPTION:
+# Set in ebuild if you wish to install additional, package-specific documentation.
+php-ext-source-r2_src_install() {
+ local slot
+ for slot in $(php_get_slots); do
+ php_init_slot_env ${slot}
+
+ # Let's put the default module away
+ insinto "${EXT_DIR}"
+ newins "modules/${PHP_EXT_NAME}.so" "${PHP_EXT_NAME}.so" || die "Unable to install extension"
+
+ local doc
+ for doc in ${DOCS} ; do
+ [[ -s ${doc} ]] && dodoc ${doc}
+ done
+
+ INSTALL_ROOT="${D}" emake install-headers
+ done
+ php-ext-source-r2_createinifiles
+}
+
+
+php_get_slots() {
+ local s slot
+ for slot in ${USE_PHP}; do
+ use php_targets_${slot} && s+=" ${slot/-/.}"
+ done
+ echo $s
+}
+
+php_init_slot_env() {
+ libdir=$(get_libdir)
+
+ PHPIZE="/usr/${libdir}/${1}/bin/phpize"
+ PHPCONFIG="/usr/${libdir}/${1}/bin/php-config"
+ PHPCLI="/usr/${libdir}/${1}/bin/php"
+ PHPCGI="/usr/${libdir}/${1}/bin/php-cgi"
+ PHP_PKG="$(best_version =dev-lang/php-${1:3}*)"
+ PHPPREFIX="/usr/${libdir}/${slot}"
+ EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
+ PHP_CURRENTSLOT=${1:3}
+
+ PHP_EXT_S="${WORKDIR}/${1}"
+ cd "${PHP_EXT_S}"
+}
+
+php-ext-source-r2_buildinilist() {
+ # Work out the list of <ext>.ini files to edit/add to
+ if [[ -z "${PHPSAPILIST}" ]] ; then
+ PHPSAPILIST="apache2 cli cgi fpm embed"
+ fi
+
+ PHPINIFILELIST=""
+ local x
+ for x in ${PHPSAPILIST} ; do
+ if [[ -f "/etc/php/${x}-${1}/php.ini" ]] ; then
+ PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-${1}/ext/${PHP_EXT_NAME}.ini"
+ fi
+ done
+ PHPFULLINIFILELIST="${PHPFULLINIFILELIST} ${PHPINIFILELIST}"
+}
+
+# @FUNCTION: php-ext-source-r2_createinifiles
+# @DESCRIPTION:
+# Builds ini files for every enabled slot and SAPI
+php-ext-source-r2_createinifiles() {
+ local slot
+ for slot in $(php_get_slots); do
+ php_init_slot_env ${slot}
+ # Pull in the PHP settings
+
+ # Build the list of <ext>.ini files to edit/add to
+ php-ext-source-r2_buildinilist ${slot}
+
+
+ # Add the needed lines to the <ext>.ini files
+ local file
+ if [[ "${PHP_EXT_INI}" = "yes" ]] ; then
+ for file in ${PHPINIFILELIST}; do
+ php-ext-source-r2_addextension "${PHP_EXT_NAME}.so" "${file}"
+ done
+ fi
+
+ # Symlink the <ext>.ini files from ext/ to ext-active/
+ local inifile
+ for inifile in ${PHPINIFILELIST} ; do
+ if [[ -n "${PHP_EXT_INIFILE}" ]]; then
+ cat "${FILESDIR}/${PHP_EXT_INIFILE}" >> "${ED}/${inifile}"
+ einfo "Added content of ${FILESDIR}/${PHP_EXT_INIFILE} to ${inifile}"
+ fi
+ inidir="${inifile/${PHP_EXT_NAME}.ini/}"
+ inidir="${inidir/ext/ext-active}"
+ dodir "/${inidir}"
+ dosym "/${inifile}" "/${inifile/ext/ext-active}"
+ done
+
+ # Add support for installing PHP files into a version dependant directory
+ PHP_EXT_SHARED_DIR="/usr/share/php/${PHP_EXT_NAME}"
+ done
+}
+
+php-ext-source-r2_addextension() {
+ if [[ "${PHP_EXT_ZENDEXT}" = "yes" ]] ; then
+ # We need the full path for ZendEngine extensions
+ # and we need to check for debugging enabled!
+ if has_version "dev-lang/php:${PHP_CURRENTSLOT}[threads]" ; then
+ if has_version "dev-lang/php:${PHP_CURRENTSLOT}[debug]" ; then
+ ext_type="zend_extension_debug_ts"
+ else
+ ext_type="zend_extension_ts"
+ fi
+ ext_file="${EXT_DIR}/${1}"
+ else
+ if has_version "dev-lang/php:${PHP_CURRENTSLOT}[debug]"; then
+ ext_type="zend_extension_debug"
+ else
+ ext_type="zend_extension"
+ fi
+ ext_file="${EXT_DIR}/${1}"
+ fi
+
+ # php-5.3 unifies zend_extension loading and just requires the
+ # zend_extension keyword with no suffix
+ # TODO: drop previous code and this check once <php-5.3 support is
+ # discontinued
+ if has_version '>=dev-lang/php-5.3' ; then
+ ext_type="zend_extension"
+ fi
+ else
+ # We don't need the full path for normal extensions!
+ ext_type="extension"
+ ext_file="${1}"
+ fi
+
+ php-ext-source-r2_addtoinifile "${ext_type}" "${ext_file}" "${2}" "Extension added"
+}
+
+# $1 - Setting name
+# $2 - Setting value
+# $3 - File to add to
+# $4 - Sanitized text to output
+php-ext-source-r2_addtoinifile() {
+ local inifile="${WORKDIR}/${3}"
+ if [[ ! -d $(dirname ${inifile}) ]] ; then
+ mkdir -p $(dirname ${inifile})
+ fi
+
+ # Are we adding the name of a section?
+ if [[ ${1:0:1} == "[" ]] ; then
+ echo "${1}" >> "${inifile}"
+ my_added="${1}"
+ else
+ echo "${1}=${2}" >> "${inifile}"
+ my_added="${1}=${2}"
+ fi
+
+ if [[ -z "${4}" ]] ; then
+ einfo "Added '${my_added}' to /${3}"
+ else
+ einfo "${4} to /${3}"
+ fi
+
+ insinto /$(dirname ${3})
+ doins "${inifile}"
+}
+
+# @FUNCTION: php-ext-source-r2_addtoinifiles
+# @USAGE: <setting name> <setting value> [message to output]; or just [section name]
+# @DESCRIPTION:
+# Add value settings to php.ini file installed by the extension (module).
+# You can also add a [section], see examples below.
+#
+# @CODE
+# Add some settings for the extension:
+#
+# php-ext-source-r2_addtoinifiles "zend_optimizer.optimization_level" "15"
+# php-ext-source-r2_addtoinifiles "zend_optimizer.enable_loader" "0"
+# php-ext-source-r2_addtoinifiles "zend_optimizer.disable_licensing" "0"
+#
+# Adding values to a section in php.ini file installed by the extension:
+#
+# php-ext-source-r2_addtoinifiles "[Debugger]"
+# php-ext-source-r2_addtoinifiles "debugger.enabled" "on"
+# php-ext-source-r2_addtoinifiles "debugger.profiler_enabled" "on"
+# @CODE
+php-ext-source-r2_addtoinifiles() {
+ local x
+ for x in ${PHPFULLINIFILELIST} ; do
+ php-ext-source-r2_addtoinifile "${1}" "${2}" "${x}" "${3}"
+ done
+}
diff --git a/eclass/php-pear-lib-r1.eclass b/eclass/php-pear-lib-r1.eclass
new file mode 100644
index 00000000..bbd0b495
--- /dev/null
+++ b/eclass/php-pear-lib-r1.eclass
@@ -0,0 +1,102 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-lib-r1.eclass,v 1.28 2015/02/11 02:53:18 grknight Exp $
+
+# @ECLASS: php-pear-lib-r1.eclass
+# @MAINTAINER:
+# Gentoo PHP team <php-bugs@gentoo.org>
+# @AUTHOR:
+# Author: Luca Longinotti <chtekk@gentoo.org>
+# @BLURB: Provides means for an easy installation of PEAR-based libraries.
+# @DESCRIPTION:
+# This class provides means for an easy installation of PEAR-based libraries,
+# such as Creole, Jargon, Phing etc., while retaining the functionality to put
+# the libraries into version-dependant directories.
+
+inherit multilib
+
+EXPORT_FUNCTIONS pkg_setup src_install
+
+# Silence repoman warnings
+case "${EAPI:-0}" in
+ 5)
+ PHP_DEPEND="dev-lang/php:*"
+ ;;
+ *)
+ PHP_DEPEND="dev-lang/php"
+ ;;
+esac
+
+DEPEND="${PHP_DEPEND}
+ >=dev-php/pear-1.9.0"
+RDEPEND="${DEPEND}"
+
+if [[ -n $PHP_PEAR_CHANNEL ]] ; then
+ PHP_PEAR_PV=${PV/_rc/RC}
+ [[ -z ${PHP_PEAR_PN} ]] && die "Missing PHP_PEAR_PN. Please notify the maintainer"
+ PHP_PEAR_P=${PHP_PEAR_PN}-${PHP_PEAR_PV}
+
+ S="${WORKDIR}/${PHP_PEAR_P}"
+
+ SRC_URI="http://${PHP_PEAR_URI}/get/${PHP_PEAR_P}.tgz"
+fi
+
+
+# @FUNCTION: php-pear-lib-r1_pkg_setup
+# @DESCRIPTION:
+# Adds required PEAR channel if necessary
+php-pear-lib-r1_pkg_setup() {
+ if [[ -n $PHP_PEAR_CHANNEL ]] ; then
+ if [[ -f $PHP_PEAR_CHANNEL ]]; then
+ pear channel-add $PHP_PEAR_CHANNEL || einfo "Ignore any errors about existing channels"
+ else
+ die "Could not find channel file $PHP_PEAR_CHANNEL"
+ fi
+ fi
+}
+
+
+# @FUNCTION: php-pear-lib-r1_src_install
+# @DESCRIPTION:
+# Takes care of standard install for PEAR-based libraries.
+php-pear-lib-r1_src_install() {
+ # SNMP support
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+ addpredict /session_mm_cli0.sem
+
+ PHP_BIN="/usr/bin/php"
+
+ cd "${S}"
+
+ if [[ -f "${WORKDIR}"/package2.xml ]] ; then
+ mv -f "${WORKDIR}/package2.xml" "${S}"
+ local WWW_DIR="/usr/share/webapps/${PN}/${PVR}/htdocs"
+ peardev -d php_bin="${PHP_BIN}" -d www_dir="${WWW_DIR}" \
+ install --force --loose --nodeps --offline --packagingroot="${D}" \
+ "${S}/package2.xml" || die "Unable to install PEAR package"
+ else
+ mv -f "${WORKDIR}/package.xml" "${S}"
+ local WWW_DIR="/usr/share/webapps/${PN}/${PVR}/htdocs"
+ peardev -d php_bin="${PHP_BIN}" -d www_dir="${WWW_DIR}" \
+ install --force --loose --nodeps --offline --packagingroot="${D}" \
+ "${S}/package.xml" || die "Unable to install PEAR package"
+ fi
+
+ rm -Rf "${D}/usr/share/php/.channels" \
+ "${D}/usr/share/php/.depdblock" \
+ "${D}/usr/share/php/.depdb" \
+ "${D}/usr/share/php/.filemap" \
+ "${D}/usr/share/php/.lock" \
+ "${D}/usr/share/php/.registry"
+
+ einfo
+ einfo "Installing to /usr/share/php ..."
+ einfo
+}
diff --git a/eclass/php-pear-r1.eclass b/eclass/php-pear-r1.eclass
new file mode 100644
index 00000000..8e36913d
--- /dev/null
+++ b/eclass/php-pear-r1.eclass
@@ -0,0 +1,123 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-r1.eclass,v 1.33 2015/02/11 02:53:18 grknight Exp $
+
+# @ECLASS: php-pear-r1.eclass
+# @MAINTAINER:
+# Gentoo PHP Team <php-bugs@gentoo.org>
+# @AUTHOR:
+# Author: Tal Peer <coredumb@gentoo.org>
+# Author: Luca Longinotti <chtekk@gentoo.org>
+# @BLURB: Provides means for an easy installation of PEAR packages.
+# @DESCRIPTION:
+# This eclass provides means for an easy installation of PEAR packages.
+# For more information on PEAR, see http://pear.php.net/
+# Note that this eclass doesn't handle dependencies of PEAR packages
+# on purpose; please use (R)DEPEND to define them correctly!
+
+inherit multilib
+
+EXPORT_FUNCTIONS pkg_setup src_install
+
+# Silence repoman warnings
+case "${EAPI:-0}" in
+ 5)
+ PHP_DEPEND="dev-lang/php:*"
+ ;;
+ *)
+ PHP_DEPEND="dev-lang/php"
+ ;;
+esac
+
+DEPEND="${PHP_DEPEND}
+ >=dev-php/pear-1.8.1"
+RDEPEND="${DEPEND}"
+
+# @ECLASS-VARIABLE: PHP_PEAR_PKG_NAME
+# @DESCRIPTION:
+# Set this if the the PEAR package name differs from ${PN/PEAR-/}
+# (generally shouldn't be the case).
+[[ -z "${PHP_PEAR_PKG_NAME}" ]] && PHP_PEAR_PKG_NAME="${PN/PEAR-/}"
+
+fix_PEAR_PV() {
+ tmp="${PV}"
+ tmp="${tmp/_/}"
+ tmp="${tmp/rc/RC}"
+ tmp="${tmp/beta/b}"
+ tmp="${tmp/alpha/a}"
+ PEAR_PV="${tmp}"
+}
+
+# @ECLASS-VARIABLE: PEAR_PV
+# @DESCRIPTION:
+# Set in ebuild if the eclass ${PV} mangling breaks SRC_URI for alpha/beta/rc versions
+[[ -z "${PEAR_PV}" ]] && fix_PEAR_PV
+
+PEAR_PN="${PHP_PEAR_PKG_NAME}-${PEAR_PV}"
+: ${PHP_PEAR_URI:=pear.php.net}
+: ${PHP_PEAR_CHANNEL:=${FILESDIR}/channel.xml}
+
+[[ -z "${SRC_URI}" ]] && SRC_URI="http://${PHP_PEAR_URI}/get/${PEAR_PN}.tgz"
+[[ -z "${HOMEPAGE}" ]] && HOMEPAGE="http://${PHP_PEAR_URI}/${PHP_PEAR_PKG_NAME}"
+
+S="${WORKDIR}/${PEAR_PN}"
+
+# @FUNCTION: php-pear-lib-r1_pkg_setup
+# @DESCRIPTION:
+# Adds required PEAR channel if necessary
+php-pear-r1_pkg_setup() {
+ if [[ -f $PHP_PEAR_CHANNEL ]]; then
+ pear channel-add $PHP_PEAR_CHANNEL || einfo "Ignore any errors about existing channels"
+ fi
+}
+
+# @FUNCTION: php-pear-r1_src_install
+# @DESCRIPTION:
+# Takes care of standard install for PEAR packages.
+php-pear-r1_src_install() {
+ # SNMP support
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+ addpredict /session_mm_cli0.sem
+
+ PHP_BIN="/usr/bin/php"
+
+ cd "${S}"
+
+ if [[ -f "${WORKDIR}"/package2.xml ]] ; then
+ mv -f "${WORKDIR}/package2.xml" "${S}"
+ if has_version '>=dev-php/PEAR-PEAR-1.7.0' ; then
+ local WWW_DIR="/usr/share/webapps/${PN}/${PVR}/htdocs"
+ peardev -d php_bin="${PHP_BIN}" -d www_dir="${WWW_DIR}" \
+ install --force --loose --nodeps --offline --packagingroot="${D}" \
+ "${S}/package2.xml" || die "Unable to install PEAR package"
+ else
+ peardev -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" \
+ "${S}/package2.xml" || die "Unable to install PEAR package"
+ fi
+ else
+ mv -f "${WORKDIR}/package.xml" "${S}"
+ if has_version '>=dev-php/PEAR-PEAR-1.7.0' ; then
+ local WWW_DIR="/usr/share/webapps/${PN}/${PVR}/htdocs"
+ peardev -d php_bin="${PHP_BIN}" -d www_dir="${WWW_DIR}" \
+ install --force --loose --nodeps --offline --packagingroot="${D}" \
+ "${S}/package.xml" || die "Unable to install PEAR package"
+ else
+ peardev -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" \
+ "${S}/package.xml" || die "Unable to install PEAR package"
+ fi
+ fi
+
+ rm -Rf "${D}/usr/share/php/.channels" \
+ "${D}/usr/share/php/.depdblock" \
+ "${D}/usr/share/php/.depdb" \
+ "${D}/usr/share/php/.filemap" \
+ "${D}/usr/share/php/.lock" \
+ "${D}/usr/share/php/.registry"
+}
diff --git a/media-libs/libvpx/Manifest b/media-libs/libvpx/Manifest
new file mode 100644
index 00000000..5c604a17
--- /dev/null
+++ b/media-libs/libvpx/Manifest
@@ -0,0 +1,19 @@
+AUX libvpx-1.1.0-arm.patch 1159 SHA256 173d50ecf7806683f5729db95bf204430d7bd791d9a72840744a091b1ccfb0e6 SHA512 e8543709874ce1602f63161e7a75776e95bdc6321a66d19908b2d4664d715158e26808f658a33be859c0b234a889088cb7b9dc0c616437cc6aa7331c55834cdd WHIRLPOOL 310cd3b346ab864f22cbe88a462deaa9ace87d732ad031d90ca3180eff633bb5e14e99dfeaf55313c6e28a9b86149947af6cbfe673057e3bb73f17ae7e704697
+AUX libvpx-1.1.0-chost.patch 1441 SHA256 ad4f06433f403bffbe6e72809cae7d63545bb19a034bf87d8a6c0d09b183546e SHA512 3591bcbf4535c608eab2ff51befe60b492e0f1b738aaa864a02c463b89abebb38dde6e683fb92f47f6d5f6139cbc1feced6464c5f4501bdbeb91cc5b39ac9f3e WHIRLPOOL ecac0141e9688a12854813dbe7c57746e4ba096c91e38435fcb3e9d5a289b9c1b9cfb2498f42b4def899997e86fcd7441771a4c9d0514f9e49447711a423a8be
+AUX libvpx-1.1.0-generic-gnu-shared.patch 1466 SHA256 411335557d7b8f04f53c971dc7654fa04a5beaeab8114b6222cbf23c8f33958d SHA512 82d78a5c8acdd16bbecb250d049446d8a0804094311feec0ffb85865e1a90d5895833a410d88d036dc653971b43b69fbe947ceb21f8b82d3a79e0325e31daf68 WHIRLPOOL a500811c5560846930d3781558e0079b2fbbb7c98e646e930782f37ce67571e49c37fe549aee0aea72a36e522a9d8ecaf21c421c72ad9d020ff60b0b57f9eb34
+AUX libvpx-1.1.0-x32.patch 1768 SHA256 931c23ed8d45c878943c6c7d9c647295962ab81d4b71a737063da95fd105b45e SHA512 87fa2fe4e7e47df1fe5eabc852937be1d893585b21d0533f80e33fcdacfa45edb66755ff31276d9d42d2922d2cb086c69a0c00c598df52fc171deaf5f5138373 WHIRLPOOL 9dce21ca3d1602c6ecc657eb2aa145c5a2dabfb360107f881a6668b1549194b3c24aab6bb8c6c0d1906f1b51fc6f97860629ebcc2fae175b9555e1606829c2bc
+AUX libvpx-1.2.0_pre20130625-armv7.patch 1480 SHA256 80518bcba1f7e8dce0a89cf4c6933669be2090f5bd86230b6bf88ae7938ad6f9 SHA512 abe70c9adce2a95aafa7fba296247c5c006bb99765b657b674be83f8feb2df118710eaaed7ba0b68c196273b585552d7f085c889525acde226164ce24064905b WHIRLPOOL b4cd4065d403e87a3a31ab63b4c899cda68e3c6174238bab84209e5a4e6e1f47ed5e0b28cd5ee642d56b7fa6a6a8e7cd56450af3fa1adf744684bfb123f45f83
+AUX libvpx-1.3.0-dash.patch 387 SHA256 2cc615c50ea4eefad81757ee23342802b30da504ee573a8167e1d7cfac83fc2b SHA512 577a24f76e90b18a1e933cd31a20d99bc41728c2cdb8301ec260e0df643664fba65fc90d279e1fd54b1330bff6a297f5d2517184004568776807d38ab10cca60 WHIRLPOOL ab7b44552ca0f604d202309f4783226c333a4990ecafaa0e3310d43875ab78a098f6c93a17494d746d7b3f5e308a5b65c4e29991d9f8457663bb1ba01b23c1c0
+AUX libvpx-1.3.0-sparc-configure.patch 475 SHA256 0854c8886cd3b2e74fc284db5f17984ebbc4afbfd96a64f90aa9d5390c1c688e SHA512 39b3e5563db9410ec2cf39bc72276b0ccb8ac0ffff479b3896bc4243981d7d59a96523baac067823126b2dde88211a87b7f615ff7a021b774449cb00b01d5c64 WHIRLPOOL f074ce8a4790caf67091f03edcfcb657fb2cd830331926bffe6355811362f39abb6148302c99c45e96c50a507dcd3bef66ac5a8b04d3153ab72a7c0149ad5b72
+DIST libvpx-1.2.0_pre20130625.tar.bz2 1726341 SHA256 61e7a3b0e0587ed899fb5cc8240324a4f578489abf06c8916abcb59d322f6b58 SHA512 198575c2adec26e7772f59eb4915dda2fb0de04ca5980b51057557ba6a15f0fb6ca9a0db583866fcbe2585939b8cc09500642a0aea46ac2b696ec1ae54cf6c7f WHIRLPOOL 194df8c550a302e678aaf0959ea395185aea004206d24b969263ffedf77adfc76f04f5bc89cbbd66e9d7d925e07cedceb698507c92afba8d4096839b6575ae1f
+DIST libvpx-1.4.0.tar.bz2 1807989 SHA256 f582d9b2d60a592a4a3d8c32965ca2d2167e9ade38c6c30bac8801ff66a118e4 SHA512 70234220e0ed64db000689ec8bea02dadef938a4f4dea96e5781d361c15245456212c1b6aec2b698d32ed423e73917d2303009e49224a2237669cab416dd6984 WHIRLPOOL 309055669aea96f8ed051ae33d2b86c4aac2096be43ac7140812d2b42e0b1b6e609d86206a01268137f18769f967cbd074beb75fe5b059ced71a1caefb8dcb05
+DIST libvpx-testdata-1.2.0.tar.bz2 43521881 SHA256 41dc3eb8ad0b24177ccc43f7dd6ec7946f78e6aaa5ff94d0883487e02eb4da2c SHA512 77d909435137965d2d13d5bbd053e658664caa035dfc60b2ba91d075a37624ed27d75cac53f013c8043624fc9b56219ad0b0dd20dd4eecc471935b2757110637 WHIRLPOOL 19c3d8d27e03407098f9e9f3120c242b25bea442aa1fb1755b63fce875662ec00942949af3c5e499f6e18ccfef67f18e1403c226b288e925786ef6fc64e112e0
+DIST libvpx-testdata-1.3.0.tar.bz2 45380954 SHA256 0956429f629f068b734d760f6af49bbb679ee65f8d860bbf2cb4e2c574c03550 SHA512 fe96c16c8aea352dd145ee73058404024b13b9bee1d3431ac2513e3636d13880d1fa0eb9eeaea2805fbc2ec8dc6e2be381c6d50baac472a0de835b0563d63c94 WHIRLPOOL 0cc5a39405a0de6238beb7f3da5b01845e4bc39a3b9858b13c73dd69bed275964c13d62468c7fb3a1af33fb7bc5d65ddc5abfe87a71b21c5d3575924e29734da
+DIST libvpx-testdata-1.4.0.tar.bz2 113132379 SHA256 8458297dfe6ecc168a6bb3b41260aeef5c35296b99ced888767f70af40a50046 SHA512 5a0402ce1943fcd1a0e954a42728a409a512c9382883c227adea399f4ca4ff8b7d72d0247dce842c3e929dce86ca2bdad935fc82d3ee58ea72291c8fcdeca393 WHIRLPOOL b4b451be2074a1af1e36c757ac14dc41c764a32eeb4b4fed2bbb38030e51a18d0c37afd71db3118dc4af4546e212946fabc6e1cf453ebee88e66a43045c938be
+DIST libvpx-v1.1.0.tar.bz2 1653485 SHA256 9ce074cf4b3bcd9a49ff93e05485b71c273bfc3685a305e55a0e7fa51beb72c5 SHA512 5c165a1a171143f7c406ef899914a353d35f6dec0e3c49eec9a4f3311fd4072dea2e0da8ceb80651ad23e24cdbf2d6da328805bda8be042bbea2c65c9e53eaaa WHIRLPOOL 2dc8164e3f812903a1b52901438857bcdf172cb1d979f1ced45933fc12ffbb0c49e2a6c02b0c6f3360f48b146e1e5c6ea25c1613abafc3089030f6c1e7af92ed
+DIST libvpx-v1.3.0.tar.bz2 2084229 SHA256 d3dcc8d84af51c6c382b214397c62402e37a799e8ebcda6f4217aef0010451a9 SHA512 af26766a3336155c5bc7b8cce7c23228de054287b990f9cacdc35273384a7af4999c01bb623d12143f40107036308a8b3207081efe67936748503c30c985fd6b WHIRLPOOL 03de78d6701daab8847c453317d8cc0a22e4a332994b7e1f55c5d6953b7f3acf94f3c623943dd8588bb1a174df4f7d9a8b8bc889f50823d92767c40c96fc5e68
+EBUILD libvpx-1.1.0.ebuild 3063 SHA256 c2fbf3d729b57b6d73184419d0a3b1cb6a00eba5397ee95ddc0744b29630b3ad SHA512 150612ab729c30994a1737e8f5017584d971327c3625b8674f7632cc36f80bfc3aff03def4299a1a94adfb9c4a6c228d48cee4794c10b7a929d110554842459a WHIRLPOOL 8e2bad4611b668f86cf87b42d727156dd305c9efc62d96db8b5a10355a4f7d4ed2222a6786ece3f7f72bf6fe7f3f89b89eb0220a03856b9a7bfa42d1225a2901
+EBUILD libvpx-1.2.0_pre20130625.ebuild 3847 SHA256 17e8c5310a37f5ab090f7dc50123eb1cf82f034fd037e0eb62a94a7f0d789960 SHA512 d96803ef1246518b33b6aff8247b52f4d29c7446d62e16c95ed6c11c88c6d59602a5c9a1d1f55d9f2d2af51acfa2c2ad6b56c53356754b475c573148460da463 WHIRLPOOL f7295fd345bbb7a3046164933cf075235a6d4cc0ec04098034348b26c8a2871da01699d1127f6103c10ba805ef9c26a4273b83c0f66b12e0bee1cafd310d92d7
+EBUILD libvpx-1.3.0.ebuild 4138 SHA256 1f2ddd63f7f553ddefdcf532e770abe8b691c6c0bbf803f6587c9d77dd14597d SHA512 0ded9976f4e64a94f94055f5b2d9228bcb0606d234f3890b162d84bcc0c960be5e7aa4a21cd0f40b0186f1267faa4357acb769c004a6d0b69f9c4e8f5a04c28e WHIRLPOOL 5ab1f61ffe5ad46290e013cf472930dae4d67a2fc20204d40244c06a136c3f7a10144d515f1bbba55954007e174a9ae62b63a5b57192a4963106385a1f916f49
+EBUILD libvpx-1.4.0.ebuild 4113 SHA256 cd399e37f78be1a4f5126a7da8bd8fb0602321618f28e2788818db61924a6b7a SHA512 82a000356812c1e6117e45badda27adde6e393ff3c0f2773dde390698765be681f94a7ce7b1b2cfd17463127cbad8d8fac54212287054f82ecef39b7b467f9d5 WHIRLPOOL 320732320b9f2b0891898f674b1041aed5f963c1017a1e2f7276ef1ce785d66dbd5428f78923520a37d14571247c7f8182257f6d3ede43903f19fefa8e7bb6cc
+EBUILD libvpx-9999.ebuild 3991 SHA256 58641ada58bd4b9e80605a1d459e56254c6a379a01be42b5f5def34356224d75 SHA512 2410803ea4b77640003d87eb32b43d54840faffd4bb84ea3b5f8476f1217dc21645227123b694b6942212512caed8a6fc43db540d146cb7844ac6ba43f46ba5f WHIRLPOOL 486bdf0f67e9b571cfb0be674c0a5e678bcdde8575ed83571a242fa5e100a8c7c700b30fee6314b22cc8fb9babf48965a32f8c1db9b16dae25f8e41af88fa4b5
diff --git a/media-libs/libvpx/files/libvpx-1.1.0-arm.patch b/media-libs/libvpx/files/libvpx-1.1.0-arm.patch
new file mode 100644
index 00000000..698e65a2
--- /dev/null
+++ b/media-libs/libvpx/files/libvpx-1.1.0-arm.patch
@@ -0,0 +1,38 @@
+From 2b59e14a0023be9d084349d58ee156a49cc674bb Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Wed, 15 Aug 2012 11:55:31 -0400
+Subject: [PATCH] Parse out arm isa targets from dumpmachine
+
+The current parsing logic of the dumpmachine tuple lacks any arm
+cases which means tgt_isa never gets set, so for all arm targets,
+we get detected as generic-gnu. Add some basic arm checks here
+so the automatic detection logic works.
+
+Change-Id: Ie5e98142876025c6708604236bc519c0bdb09319
+---
+ build/make/configure.sh | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/build/make/configure.sh b/build/make/configure.sh
+index 26eb864..eeb959a 100755
+--- a/build/make/configure.sh
++++ b/build/make/configure.sh
+@@ -593,6 +593,15 @@ process_common_toolchain() {
+
+ # detect tgt_isa
+ case "$gcctarget" in
++ armv6*)
++ tgt_isa=armv6
++ ;;
++ armv7*)
++ tgt_isa=armv7
++ ;;
++ armv5te*)
++ tgt_isa=armv5te
++ ;;
+ *x86_64*|*amd64*)
+ tgt_isa=x86_64
+ ;;
+--
+1.7.9.7
+
diff --git a/media-libs/libvpx/files/libvpx-1.1.0-chost.patch b/media-libs/libvpx/files/libvpx-1.1.0-chost.patch
new file mode 100644
index 00000000..eb6b286c
--- /dev/null
+++ b/media-libs/libvpx/files/libvpx-1.1.0-chost.patch
@@ -0,0 +1,36 @@
+commit 871bd23e4c41bb0fb94b72832b270766de540dea
+Author: Alexis Ballier <alexis.ballier@gmail.com>
+Date: Sat May 12 15:45:13 2012 -0400
+
+ Allow target autodetection to work when cross-compiling.
+
+ Allow CHOST to override the gcc -dumpmachine output. This allows to
+ use the target autodetection code when cross compiling by setting the
+ CHOST variable.
+
+ On Gentoo, we would like to support easy cross-compilation, and for
+ libvpx this would basically mean copying the code in
+ build/make/configure.sh to setup the right --target option. It seems a
+ lot easier to let it guess by itself.
+
+ Another option I considered was using CROSS-gcc instead but this would
+ not work for our multilib setups: They use gcc -m32 to build 32bits
+ binaries and gcc -m32 -dumpmachine will output the 64bits version,
+ which would then make libvpx wrongly believe it is building for a
+ 64bits architecture.
+
+ Change-Id: I05a19be402228f749e23be7473ca53ae74fd2186
+
+diff --git a/build/make/configure.sh b/build/make/configure.sh
+index 3c772e5..3118c0a 100755
+--- a/build/make/configure.sh
++++ b/build/make/configure.sh
+@@ -549,7 +549,7 @@ setup_gnu_toolchain() {
+
+ process_common_toolchain() {
+ if [ -z "$toolchain" ]; then
+- gcctarget="$(gcc -dumpmachine 2> /dev/null)"
++ gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
+
+ # detect tgt_isa
+ case "$gcctarget" in
diff --git a/media-libs/libvpx/files/libvpx-1.1.0-generic-gnu-shared.patch b/media-libs/libvpx/files/libvpx-1.1.0-generic-gnu-shared.patch
new file mode 100644
index 00000000..84d536f5
--- /dev/null
+++ b/media-libs/libvpx/files/libvpx-1.1.0-generic-gnu-shared.patch
@@ -0,0 +1,39 @@
+From b4ab43f12cc44a24e8161eb2d0857b78c756b18c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Tue, 14 Aug 2012 14:24:28 -0400
+Subject: [PATCH] do not error out on generic-gnu + --enable-shared
+
+If you build with --enabled-shared on a Linux arch not explicitly
+listed, the configure script will abort because it didn't detect
+"linux" in the fallback generic-gnu tuple.
+
+Since this is the fallback tuple and people are passing
+--enable-shared, assume the user knows what they're in for.
+
+Change-Id: Ia35b657e7247c8855e3a94fca424c9884d4241e3
+---
+ configure | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 2e19e5b..dde215f 100755
+--- a/configure
++++ b/configure
+@@ -454,7 +454,13 @@ process_detect() {
+ # Can only build shared libs on a subset of platforms. Doing this check
+ # here rather than at option parse time because the target auto-detect
+ # magic happens after the command line has been parsed.
+- enabled linux || die "--enable-shared only supported on ELF for now"
++ if ! enabled linux; then
++ if enabled gnu; then
++ echo "--enable-shared is only supported on ELF; assuming this is OK"
++ else
++ die "--enable-shared only supported on ELF for now"
++ fi
++ fi
+ fi
+ if [ -z "$CC" ]; then
+ echo "Bypassing toolchain for environment detection."
+--
+1.7.9.7
+
diff --git a/media-libs/libvpx/files/libvpx-1.1.0-x32.patch b/media-libs/libvpx/files/libvpx-1.1.0-x32.patch
new file mode 100644
index 00000000..bcacdbf4
--- /dev/null
+++ b/media-libs/libvpx/files/libvpx-1.1.0-x32.patch
@@ -0,0 +1,64 @@
+https://bugs.gentoo.org/426248
+
+From c769945318b84b5c823091213634a4db0cdc5be5 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 25 Sep 2012 00:37:11 -0400
+Subject: [PATCH] check for x32 targets
+
+Add configure detection of the new x32 ABI.
+---
+ build/make/configure.sh | 5 +++++
+ vpx_ports/x86_abi_support.asm | 10 ++++++++++
+ 2 files changed, 15 insertions(+)
+
+diff --git a/build/make/configure.sh b/build/make/configure.sh
+index eeb959a..05bbabe 100755
+--- a/build/make/configure.sh
++++ b/build/make/configure.sh
+@@ -989,6 +989,11 @@ process_common_toolchain() {
+ x86*)
+ bits=32
+ enabled x86_64 && bits=64
++ check_cpp <<EOF && bits=x32
++#ifndef __ILP32__
++#error "not x32"
++#endif
++EOF
+ soft_enable runtime_cpu_detect
+ soft_enable mmx
+ soft_enable sse
+diff --git a/vpx_ports/x86_abi_support.asm b/vpx_ports/x86_abi_support.asm
+index e1a540c..0c9fe37 100644
+--- a/vpx_ports/x86_abi_support.asm
++++ b/vpx_ports/x86_abi_support.asm
+@@ -88,6 +88,8 @@
+ %define sym(x) x
+ %elifidn __OUTPUT_FORMAT__,elf64
+ %define sym(x) x
++%elifidn __OUTPUT_FORMAT__,elfx32
++%define sym(x) x
+ %elifidn __OUTPUT_FORMAT__,x64
+ %define sym(x) x
+ %else
+@@ -223,6 +227,9 @@
+ %ifidn __OUTPUT_FORMAT__,elf64
+ %define WRT_PLT wrt ..plt
+ %define HIDDEN_DATA(x) x:data hidden
++ %elifidn __OUTPUT_FORMAT__,elfx32
++ %define WRT_PLT wrt ..plt
++ %define HIDDEN_DATA(x) x:data hidden
+ %else
+ %define HIDDEN_DATA(x) x
+ %endif
+@@ -364,5 +371,8 @@ section .text
+ %elifidn __OUTPUT_FORMAT__,elf64
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ section .text
++%elifidn __OUTPUT_FORMAT__,elfx32
++section .note.GNU-stack noalloc noexec nowrite progbits
++section .text
+ %endif
+
+--
+1.7.12
+
diff --git a/media-libs/libvpx/files/libvpx-1.2.0_pre20130625-armv7.patch b/media-libs/libvpx/files/libvpx-1.2.0_pre20130625-armv7.patch
new file mode 100644
index 00000000..6e8eba90
--- /dev/null
+++ b/media-libs/libvpx/files/libvpx-1.2.0_pre20130625-armv7.patch
@@ -0,0 +1,41 @@
+commit af9dd50e42e0a7558d0d555ee12a1eb60e87a458
+Author: Luca Barbato <lu_zero@gentoo.org>
+Date: Thu Jan 10 05:13:57 2013 +0100
+
+ configure: support hardfloat armv7 CHOSTS
+
+ Many linux distribution for arm switched to armhf/hardfloat, support
+ them.
+
+ Change-Id: I8ab39d34782b4f24b7028ac76342118166fd5905
+
+diff --git a/build/make/configure.sh b/build/make/configure.sh
+index e27af96..f69b6d7 100755
+--- a/build/make/configure.sh
++++ b/build/make/configure.sh
+@@ -597,8 +597,13 @@ process_common_toolchain() {
+ armv6*)
+ tgt_isa=armv6
+ ;;
++ armv7*-hardfloat*)
++ tgt_isa=armv7
++ float_abi=hard
++ ;;
+ armv7*)
+ tgt_isa=armv7
++ float_abi=softfp
+ ;;
+ armv5te*)
+ tgt_isa=armv5te
+@@ -784,8 +789,9 @@ process_common_toolchain() {
+ check_add_asflags --defsym ARCHITECTURE=${arch_int}
+ tune_cflags="-mtune="
+ if [ ${tgt_isa} == "armv7" ]; then
+- check_add_cflags -march=armv7-a -mfloat-abi=softfp
+- check_add_asflags -march=armv7-a -mfloat-abi=softfp
++ [ -z "${float_abi}" ] && float_abi=softfp
++ check_add_cflags -march=armv7-a -mfloat-abi=${float_abi}
++ check_add_asflags -march=armv7-a -mfloat-abi=${float_abi}
+
+ if enabled neon
+ then
diff --git a/media-libs/libvpx/files/libvpx-1.3.0-dash.patch b/media-libs/libvpx/files/libvpx-1.3.0-dash.patch
new file mode 100644
index 00000000..fa021b65
--- /dev/null
+++ b/media-libs/libvpx/files/libvpx-1.3.0-dash.patch
@@ -0,0 +1,16 @@
+dash compat
+https://bugs.gentoo.org/show_bug.cgi?id=498136
+
+--- a/build/make/configure.sh
++++ b/build/make/configure.sh
+@@ -405,8 +405,8 @@
+ }
+
+ write_common_target_config_mk() {
+- local CC=${CC}
+- local CXX=${CXX}
++ local CC="${CC}"
++ local CXX="${CXX}"
+ enabled ccache && CC="ccache ${CC}"
+ enabled ccache && CXX="ccache ${CXX}"
+ print_webm_license $1 "##" ""
diff --git a/media-libs/libvpx/files/libvpx-1.3.0-sparc-configure.patch b/media-libs/libvpx/files/libvpx-1.3.0-sparc-configure.patch
new file mode 100644
index 00000000..dc3f6c93
--- /dev/null
+++ b/media-libs/libvpx/files/libvpx-1.3.0-sparc-configure.patch
@@ -0,0 +1,10 @@
+--- configure~ 2014-01-10 21:12:42.000000000 +0100
++++ configure 2014-04-05 12:51:51.794638686 +0200
+@@ -109,6 +109,7 @@
+ all_platforms="${all_platforms} ppc64-darwin9-gcc"
+ all_platforms="${all_platforms} ppc64-linux-gcc"
+ all_platforms="${all_platforms} sparc-solaris-gcc"
++all_platforms="${all_platforms} sparc-linux-gcc"
+ all_platforms="${all_platforms} x86-android-gcc"
+ all_platforms="${all_platforms} x86-darwin8-gcc"
+ all_platforms="${all_platforms} x86-darwin8-icc"
diff --git a/media-libs/libvpx/libvpx-1.1.0.ebuild b/media-libs/libvpx/libvpx-1.1.0.ebuild
new file mode 100644
index 00000000..429ab909
--- /dev/null
+++ b/media-libs/libvpx/libvpx-1.1.0.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libvpx/libvpx-1.1.0.ebuild,v 1.32 2015/02/02 14:27:33 jer Exp $
+
+EAPI=4
+inherit multilib toolchain-funcs base flag-o-matic
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-2
+ EGIT_REPO_URI="https://chromium.googlesource.com/webm/${PN}.git"
+elif [[ ${PV} == *pre* ]]; then
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ SRC_URI="http://webm.googlecode.com/files/${PN}-v${PV}.tar.bz2"
+ KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${PN}-v${PV}"
+fi
+
+DESCRIPTION="WebM VP8 Codec SDK"
+HOMEPAGE="http://www.webmproject.org"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="altivec debug doc cpu_flags_x86_mmx postproc cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 static-libs +threads"
+
+RDEPEND=""
+DEPEND="amd64? ( dev-lang/yasm )
+ x86? ( dev-lang/yasm )
+ x86-fbsd? ( dev-lang/yasm )
+ doc? (
+ app-doc/doxygen
+ dev-lang/php
+ )
+"
+
+REQUIRED_USE="
+ cpu_flags_x86_sse2? ( cpu_flags_x86_mmx )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-chost.patch"
+ "${FILESDIR}/${P}-generic-gnu-shared.patch"
+ "${FILESDIR}/${P}-arm.patch"
+ "${FILESDIR}/${P}-x32.patch"
+)
+
+src_configure() {
+ replace-flags -ggdb3 -g #402825
+
+ unset CODECS #357487
+
+ # let the build system decide which AS to use (it honours $AS but
+ # then feeds it with yasm flags without checking...) #345161
+ local a
+ tc-export AS
+ for a in {amd64,x86}{,-{fbsd,linux}} ; do
+ use ${a} && unset AS
+ done
+
+ # build verbose by default
+ MAKEOPTS="${MAKEOPTS} verbose=yes"
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=384585
+ # https://bugs.gentoo.org/show_bug.cgi?id=465988
+ # copied from php-pear-r1.eclass
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+ addpredict /session_mm_cli0.sem
+
+ # Build with correct toolchain.
+ tc-export CC AR NM
+ # Link with gcc by default, the build system should override this if needed.
+ export LD="${CC}"
+
+ set -- \
+ ./configure \
+ --prefix="${EPREFIX}"/usr \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --enable-pic \
+ --enable-vp8 \
+ --enable-shared \
+ --extra-cflags="${CFLAGS}" \
+ $(use_enable altivec) \
+ $(use_enable debug debug-libs) \
+ $(use_enable debug) \
+ $(use_enable doc install-docs) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable postproc) \
+ $(use_enable cpu_flags_x86_sse sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable cpu_flags_x86_sse3 sse3) \
+ $(use_enable cpu_flags_x86_sse4_1 sse4_1) \
+ $(use_enable cpu_flags_x86_ssse3 ssse3) \
+ $(use_enable static-libs static ) \
+ $(use_enable threads multithread)
+ echo "$@"
+ "$@" || die
+}
+
+src_install() {
+ # Override base.eclass's src_install.
+ default
+}
diff --git a/media-libs/libvpx/libvpx-1.2.0_pre20130625.ebuild b/media-libs/libvpx/libvpx-1.2.0_pre20130625.ebuild
new file mode 100644
index 00000000..762f909e
--- /dev/null
+++ b/media-libs/libvpx/libvpx-1.2.0_pre20130625.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libvpx/libvpx-1.2.0_pre20130625.ebuild,v 1.7 2015/02/02 14:27:33 jer Exp $
+
+EAPI=4
+inherit multilib toolchain-funcs multilib-minimal eutils
+
+LIBVPX_TESTDATA_VER=1.2.0
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-2
+ EGIT_REPO_URI="https://chromium.googlesource.com/webm/${PN}.git"
+elif [[ ${PV} == *pre* ]]; then
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ SRC_URI="http://webm.googlecode.com/files/${PN}-v${PV}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${PN}-v${PV}"
+fi
+# generated by: make LIBVPX_TEST_DATA_PATH=libvpx-testdata testdata + tar'ing
+# it.
+SRC_URI="${SRC_URI}
+ test? ( mirror://gentoo/${PN}-testdata-${LIBVPX_TESTDATA_VER}.tar.bz2 )"
+
+DESCRIPTION="WebM VP8 Codec SDK"
+HOMEPAGE="http://www.webmproject.org"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="altivec doc cpu_flags_x86_mmx postproc cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 static-libs test +threads"
+
+RDEPEND="abi_x86_32? ( !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+DEPEND="abi_x86_32? ( dev-lang/yasm )
+ abi_x86_64? ( dev-lang/yasm )
+ x86-fbsd? ( dev-lang/yasm )
+ amd64-fbsd? ( dev-lang/yasm )
+ doc? (
+ app-doc/doxygen
+ dev-lang/php
+ )
+"
+
+REQUIRED_USE="
+ cpu_flags_x86_sse2? ( cpu_flags_x86_mmx )
+ cpu_flags_x86_ssse3? ( cpu_flags_x86_sse2 )
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-armv7.patch"
+}
+
+multilib_src_configure() {
+ unset CODECS #357487
+
+ # let the build system decide which AS to use (it honours $AS but
+ # then feeds it with yasm flags without checking...) #345161
+ tc-export AS
+ case "${CHOST}" in
+ i?86*) export AS=yasm;;
+ x86_64*) export AS=yasm;;
+ esac
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=384585
+ # https://bugs.gentoo.org/show_bug.cgi?id=465988
+ # copied from php-pear-r1.eclass
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+ addpredict /session_mm_cli0.sem
+
+ # Build with correct toolchain.
+ tc-export CC CXX AR NM
+ # Link with gcc by default, the build system should override this if needed.
+ export LD="${CC}"
+
+ local myconf
+ if [ "${ABI}" = "${DEFAULT_ABI}" ] ; then
+ myconf+=" $(use_enable doc install-docs) $(use_enable doc docs)"
+ else
+ # not needed for multilib and will be overwritten anyway.
+ myconf+=" --disable-examples --disable-install-docs --disable-docs"
+ fi
+
+ "${S}/configure" \
+ --prefix="${EPREFIX}"/usr \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --enable-pic \
+ --enable-vp8 \
+ --enable-shared \
+ --extra-cflags="${CFLAGS}" \
+ $(use_enable altivec) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable postproc) \
+ $(use_enable cpu_flags_x86_sse sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable cpu_flags_x86_sse3 sse3) \
+ $(use_enable cpu_flags_x86_sse4_1 sse4_1) \
+ $(use_enable cpu_flags_x86_ssse3 ssse3) \
+ $(use_enable static-libs static) \
+ $(use_enable test unit-tests) \
+ $(use_enable threads multithread) \
+ ${myconf} \
+ || die
+}
+
+multilib_src_compile() {
+ # build verbose by default and do not build examples that will not be installed
+ emake verbose=yes GEN_EXAMPLES=
+}
+
+multilib_src_test() {
+ LD_LIBRARY_PATH="${BUILD_DIR}:${LD_LIBRARY_PATH}" \
+ emake verbose=yes GEN_EXAMPLES= LIBVPX_TEST_DATA_PATH="${WORKDIR}/${PN}-testdata" test
+}
+
+multilib_src_install() {
+ emake verbose=yes GEN_EXAMPLES= DESTDIR="${D}" install
+ [ "${ABI}" = "${DEFAULT_ABI}" ] && use doc && dohtml docs/html/*
+}
diff --git a/media-libs/libvpx/libvpx-1.3.0.ebuild b/media-libs/libvpx/libvpx-1.3.0.ebuild
new file mode 100644
index 00000000..9d4f6f0f
--- /dev/null
+++ b/media-libs/libvpx/libvpx-1.3.0.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libvpx/libvpx-1.3.0.ebuild,v 1.19 2015/02/05 16:00:23 mgorny Exp $
+
+EAPI=4
+inherit eutils multilib toolchain-funcs multilib-minimal
+
+LIBVPX_TESTDATA_VER=1.3.0
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-2
+ EGIT_REPO_URI="https://chromium.googlesource.com/webm/${PN}.git"
+elif [[ ${PV} == *pre* ]]; then
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ SRC_URI="http://webm.googlecode.com/files/${PN}-v${PV}.tar.bz2"
+ KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${PN}-v${PV}"
+fi
+# generated by: make LIBVPX_TEST_DATA_PATH=libvpx-testdata testdata + tar'ing
+# it.
+SRC_URI="${SRC_URI}
+ test? ( mirror://gentoo/${PN}-testdata-${LIBVPX_TESTDATA_VER}.tar.bz2 )"
+
+DESCRIPTION="WebM VP8 Codec SDK"
+HOMEPAGE="http://www.webmproject.org"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="altivec cpu_flags_x86_avx cpu_flags_x86_avx2 doc cpu_flags_x86_mmx postproc cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 static-libs test +threads"
+
+RDEPEND="abi_x86_32? ( !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+DEPEND="abi_x86_32? ( dev-lang/yasm )
+ abi_x86_64? ( dev-lang/yasm )
+ x86-fbsd? ( dev-lang/yasm )
+ amd64-fbsd? ( dev-lang/yasm )
+ doc? (
+ app-doc/doxygen
+ dev-lang/php
+ )
+"
+
+REQUIRED_USE="
+ cpu_flags_x86_sse2? ( cpu_flags_x86_mmx )
+ cpu_flags_x86_ssse3? ( cpu_flags_x86_sse2 )
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/libvpx-1.3.0-dash.patch"
+ epatch "${FILESDIR}/libvpx-1.3.0-sparc-configure.patch" # 501010
+}
+
+multilib_src_configure() {
+ unset CODECS #357487
+
+ # let the build system decide which AS to use (it honours $AS but
+ # then feeds it with yasm flags without checking...) #345161
+ tc-export AS
+ case "${CHOST}" in
+ i?86*) export AS=yasm;;
+ x86_64*) export AS=yasm;;
+ esac
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=384585
+ # https://bugs.gentoo.org/show_bug.cgi?id=465988
+ # copied from php-pear-r1.eclass
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+ addpredict /session_mm_cli0.sem
+
+ # Build with correct toolchain.
+ tc-export CC CXX AR NM
+ # Link with gcc by default, the build system should override this if needed.
+ export LD="${CC}"
+
+ local myconf
+ if [ "${ABI}" = "${DEFAULT_ABI}" ] ; then
+ myconf+=" $(use_enable doc install-docs) $(use_enable doc docs)"
+ else
+ # not needed for multilib and will be overwritten anyway.
+ myconf+=" --disable-examples --disable-install-docs --disable-docs"
+ fi
+
+ # #498364: sse doesn't work without sse2 enabled,
+ "${S}/configure" \
+ --prefix="${EPREFIX}"/usr \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --enable-pic \
+ --enable-vp8 \
+ --enable-shared \
+ --extra-cflags="${CFLAGS}" \
+ $(use_enable altivec) \
+ $(use_enable cpu_flags_x86_avx avx) \
+ $(use_enable cpu_flags_x86_avx2 avx2) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable postproc) \
+ $(use cpu_flags_x86_sse2 && use_enable cpu_flags_x86_sse sse || echo --disable-sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable cpu_flags_x86_sse3 sse3) \
+ $(use_enable cpu_flags_x86_sse4_1 sse4_1) \
+ $(use_enable cpu_flags_x86_ssse3 ssse3) \
+ $(use_enable static-libs static) \
+ $(use_enable test unit-tests) \
+ $(use_enable threads multithread) \
+ ${myconf} \
+ || die
+}
+
+multilib_src_compile() {
+ # build verbose by default and do not build examples that will not be installed
+ emake verbose=yes GEN_EXAMPLES=
+}
+
+multilib_src_test() {
+ LD_LIBRARY_PATH="${BUILD_DIR}:${LD_LIBRARY_PATH}" \
+ emake verbose=yes GEN_EXAMPLES= LIBVPX_TEST_DATA_PATH="${WORKDIR}/${PN}-testdata" test
+}
+
+multilib_src_install() {
+ emake verbose=yes GEN_EXAMPLES= DESTDIR="${D}" install
+ [ "${ABI}" = "${DEFAULT_ABI}" ] && use doc && dohtml docs/html/*
+}
diff --git a/media-libs/libvpx/libvpx-1.4.0.ebuild b/media-libs/libvpx/libvpx-1.4.0.ebuild
new file mode 100644
index 00000000..c6086f8e
--- /dev/null
+++ b/media-libs/libvpx/libvpx-1.4.0.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libvpx/libvpx-1.4.0.ebuild,v 1.1 2015/04/07 20:34:20 phajdan.jr Exp $
+
+EAPI=5
+inherit eutils multilib toolchain-funcs multilib-minimal
+
+LIBVPX_TESTDATA_VER=1.4.0
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-2
+ EGIT_REPO_URI="https://chromium.googlesource.com/webm/${PN}.git"
+elif [[ ${PV} == *pre* ]]; then
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ SRC_URI="http://storage.googleapis.com/downloads.webmproject.org/releases/webm/${P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+fi
+# generated by: make LIBVPX_TEST_DATA_PATH=libvpx-testdata testdata + tar'ing
+# it.
+SRC_URI="${SRC_URI}
+ test? ( mirror://gentoo/${PN}-testdata-${LIBVPX_TESTDATA_VER}.tar.bz2 )"
+
+DESCRIPTION="WebM VP8 Codec SDK"
+HOMEPAGE="http://www.webmproject.org"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="altivec cpu_flags_x86_avx cpu_flags_x86_avx2 doc cpu_flags_x86_mmx postproc cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 static-libs test +threads"
+
+RDEPEND="abi_x86_32? ( !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+DEPEND="abi_x86_32? ( dev-lang/yasm )
+ abi_x86_64? ( dev-lang/yasm )
+ x86-fbsd? ( dev-lang/yasm )
+ amd64-fbsd? ( dev-lang/yasm )
+ doc? (
+ app-doc/doxygen
+ dev-lang/php
+ )
+"
+
+REQUIRED_USE="
+ cpu_flags_x86_sse2? ( cpu_flags_x86_mmx )
+ cpu_flags_x86_ssse3? ( cpu_flags_x86_sse2 )
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/libvpx-1.3.0-sparc-configure.patch" # 501010
+}
+
+multilib_src_configure() {
+ unset CODECS #357487
+
+ # let the build system decide which AS to use (it honours $AS but
+ # then feeds it with yasm flags without checking...) #345161
+ tc-export AS
+ case "${CHOST}" in
+ i?86*) export AS=yasm;;
+ x86_64*) export AS=yasm;;
+ esac
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=384585
+ # https://bugs.gentoo.org/show_bug.cgi?id=465988
+ # copied from php-pear-r1.eclass
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+ addpredict /session_mm_cli0.sem
+
+ # Build with correct toolchain.
+ tc-export CC CXX AR NM
+ # Link with gcc by default, the build system should override this if needed.
+ export LD="${CC}"
+
+ local myconf
+ if [ "${ABI}" = "${DEFAULT_ABI}" ] ; then
+ myconf+=" $(use_enable doc install-docs) $(use_enable doc docs)"
+ else
+ # not needed for multilib and will be overwritten anyway.
+ myconf+=" --disable-examples --disable-install-docs --disable-docs"
+ fi
+
+ # #498364: sse doesn't work without sse2 enabled,
+ "${S}/configure" \
+ --prefix="${EPREFIX}"/usr \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --enable-pic \
+ --enable-vp8 \
+ --enable-shared \
+ --extra-cflags="${CFLAGS}" \
+ $(use_enable altivec) \
+ $(use_enable cpu_flags_x86_avx avx) \
+ $(use_enable cpu_flags_x86_avx2 avx2) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable postproc) \
+ $(use cpu_flags_x86_sse2 && use_enable cpu_flags_x86_sse sse || echo --disable-sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable cpu_flags_x86_sse3 sse3) \
+ $(use_enable cpu_flags_x86_sse4_1 sse4_1) \
+ $(use_enable cpu_flags_x86_ssse3 ssse3) \
+ $(use_enable static-libs static) \
+ $(use_enable test unit-tests) \
+ $(use_enable threads multithread) \
+ ${myconf} \
+ || die
+}
+
+multilib_src_compile() {
+ # build verbose by default and do not build examples that will not be installed
+ emake verbose=yes GEN_EXAMPLES=
+}
+
+multilib_src_test() {
+ LD_LIBRARY_PATH="${BUILD_DIR}:${LD_LIBRARY_PATH}" \
+ emake verbose=yes GEN_EXAMPLES= LIBVPX_TEST_DATA_PATH="${WORKDIR}/${PN}-testdata" test
+}
+
+multilib_src_install() {
+ emake verbose=yes GEN_EXAMPLES= DESTDIR="${D}" install
+ [ "${ABI}" = "${DEFAULT_ABI}" ] && use doc && dohtml docs/html/*
+}
diff --git a/media-libs/libvpx/libvpx-9999.ebuild b/media-libs/libvpx/libvpx-9999.ebuild
new file mode 100644
index 00000000..6cb6d6ce
--- /dev/null
+++ b/media-libs/libvpx/libvpx-9999.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libvpx/libvpx-9999.ebuild,v 1.53 2015/02/05 16:00:23 mgorny Exp $
+
+EAPI=4
+inherit multilib toolchain-funcs multilib-minimal
+
+LIBVPX_TESTDATA_VER=1.3.0
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-2
+ EGIT_REPO_URI="https://chromium.googlesource.com/webm/${PN}.git"
+elif [[ ${PV} == *pre* ]]; then
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ SRC_URI="http://webm.googlecode.com/files/${PN}-v${PV}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${PN}-v${PV}"
+fi
+# generated by: make LIBVPX_TEST_DATA_PATH=libvpx-testdata testdata + tar'ing
+# it.
+SRC_URI="${SRC_URI}
+ test? ( mirror://gentoo/${PN}-testdata-${LIBVPX_TESTDATA_VER}.tar.bz2 )"
+
+DESCRIPTION="WebM VP8 Codec SDK"
+HOMEPAGE="http://www.webmproject.org"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="altivec cpu_flags_x86_avx cpu_flags_x86_avx2 doc cpu_flags_x86_mmx postproc cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 static-libs test +threads"
+
+RDEPEND="abi_x86_32? ( !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+DEPEND="abi_x86_32? ( dev-lang/yasm )
+ abi_x86_64? ( dev-lang/yasm )
+ x86-fbsd? ( dev-lang/yasm )
+ amd64-fbsd? ( dev-lang/yasm )
+ doc? (
+ app-doc/doxygen
+ dev-lang/php
+ )
+"
+
+REQUIRED_USE="
+ cpu_flags_x86_sse2? ( cpu_flags_x86_mmx )
+ cpu_flags_x86_ssse3? ( cpu_flags_x86_sse2 )
+"
+
+multilib_src_configure() {
+ unset CODECS #357487
+
+ # let the build system decide which AS to use (it honours $AS but
+ # then feeds it with yasm flags without checking...) #345161
+ tc-export AS
+ case "${CHOST}" in
+ i?86*) export AS=yasm;;
+ x86_64*) export AS=yasm;;
+ esac
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=384585
+ # https://bugs.gentoo.org/show_bug.cgi?id=465988
+ # copied from php-pear-r1.eclass
+ addpredict /usr/share/snmp/mibs/.index
+ local varlib="/var/lib"
+ if [[ -L "${varlib}" ]]; then
+ varlib="$( readlink -e "${varlib}" )"
+ fi
+ addpredict "${varlib}"/net-snmp/
+ addpredict "${varlib}"/net-snmp/mib_indexes
+ unset varlib
+ addpredict /session_mm_cli0.sem
+
+ # Build with correct toolchain.
+ tc-export CC CXX AR NM
+ # Link with gcc by default, the build system should override this if needed.
+ export LD="${CC}"
+
+ local myconf
+ if [ "${ABI}" = "${DEFAULT_ABI}" ] ; then
+ myconf+=" $(use_enable doc install-docs) $(use_enable doc docs)"
+ else
+ # not needed for multilib and will be overwritten anyway.
+ myconf+=" --disable-examples --disable-install-docs --disable-docs"
+ fi
+
+ # #498364: sse doesn't work without sse2 enabled,
+ "${S}/configure" \
+ --prefix="${EPREFIX}"/usr \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --enable-pic \
+ --enable-vp8 \
+ --enable-shared \
+ --extra-cflags="${CFLAGS}" \
+ $(use_enable altivec) \
+ $(use_enable cpu_flags_x86_avx avx) \
+ $(use_enable cpu_flags_x86_avx2 avx2) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable postproc) \
+ $(use cpu_flags_x86_sse2 && use_enable cpu_flags_x86_sse sse || echo --disable-sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable cpu_flags_x86_sse3 sse3) \
+ $(use_enable cpu_flags_x86_sse4_1 sse4_1) \
+ $(use_enable cpu_flags_x86_ssse3 ssse3) \
+ $(use_enable static-libs static) \
+ $(use_enable test unit-tests) \
+ $(use_enable threads multithread) \
+ ${myconf} \
+ || die
+}
+
+multilib_src_compile() {
+ # build verbose by default and do not build examples that will not be installed
+ emake verbose=yes GEN_EXAMPLES=
+}
+
+multilib_src_test() {
+ LD_LIBRARY_PATH="${BUILD_DIR}:${LD_LIBRARY_PATH}" \
+ emake verbose=yes GEN_EXAMPLES= LIBVPX_TEST_DATA_PATH="${WORKDIR}/${PN}-testdata" test
+}
+
+multilib_src_install() {
+ emake verbose=yes GEN_EXAMPLES= DESTDIR="${D}" install
+ [ "${ABI}" = "${DEFAULT_ABI}" ] && use doc && dohtml docs/html/*
+}