diff options
author | 2014-04-25 18:33:52 +0000 | |
---|---|---|
committer | 2014-04-25 18:33:52 +0000 | |
commit | 4146d989132c492254dc379d8452d552678b5f60 (patch) | |
tree | 08799942c19a4b3f56cb95ac88ca34e01c1ec0d7 /dev-lang | |
parent | Drop old (diff) | |
download | historical-4146d989132c492254dc379d8452d552678b5f60.tar.gz historical-4146d989132c492254dc379d8452d552678b5f60.tar.bz2 historical-4146d989132c492254dc379d8452d552678b5f60.zip |
Revision bump, add patch for CVE-2014-1912 (bug #500518)
Package-Manager: portage-2.2.10/cvs/Linux x86_64
Manifest-Sign-Key: 0xE3F69979BB4B8928DA78E3D17CBF44EF
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/python/ChangeLog | 8 | ||||
-rw-r--r-- | dev-lang/python/Manifest | 30 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.7.6-recvfrom_into_buffer_overflow.patch | 17 | ||||
-rw-r--r-- | dev-lang/python/python-2.7.6-r1.ebuild | 360 |
4 files changed, 400 insertions, 15 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog index 929fb902292a..f0c289e34596 100644 --- a/dev-lang/python/ChangeLog +++ b/dev-lang/python/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-lang/python # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.756 2014/04/06 14:57:22 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.757 2014/04/25 18:33:36 chutzpah Exp $ + +*python-2.7.6-r1 (25 Apr 2014) + + 25 Apr 2014; Patrick McLean <chutzpah@gentoo.org> +python-2.7.6-r1.ebuild, + +files/python-2.7.6-recvfrom_into_buffer_overflow.patch: + Revision bump, add patch for CVE-2014-1912 (bug #500518) 06 Apr 2014; Mike Frysinger <vapier@gentoo.org> python-2.7.6.ebuild: Mark arm64/m68k/s390/sh stable. diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 30cc5172f949..c864eaebdc22 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -12,6 +12,7 @@ AUX python-2.7-issue18851.patch 11805 SHA256 4ecff8db20cdc4d9b0692a126859c318a9b AUX python-2.7.5-library-path.patch 991 SHA256 ff7a4a1846ebcadc2dbf979ea619072caac22e47909fe188fc4b6becce6ea2eb SHA512 74916d541eb38c526dc1243fe5e5a9de3a7875f02c53e5f49e60182ba042de2f15514364e7fbd821146dcf92db2bba88d8a9f46d4c71237b73fd39cbabf93d85 WHIRLPOOL 62bb1c85941ccaac7ca6f6fb2d93dc27f206cf9f815b90ef1f89748dfdd1d38deda9f6bf7eb2ce9fd8635d1a77576819192e8049ec5de52fdeb9f981dfb32f9f AUX python-2.7.5-nonfatal-compileall.patch 750 SHA256 3f5a137602f1b3f0522f561c168a740f0080b29c2c888cb3a8dbbcc4407c2d9e SHA512 d2e93e2a6fcd55d516df0ddaca31af97faed677ea6b4be282eb99e7864f8a7399b5ca11139844a4b3c264832183483b0f4c8c9865c05de0e8520e6d2c8f1dbc6 WHIRLPOOL ab576e3a4e67f881d6d5c705503230ace125fe94d907d7f69bb573dd492070b8b34078a2b1205f315eb45244fbae8855c0f15ce35158f1d356f1bd4acf83b3c2 AUX python-2.7.5-re_unsigned_ptrdiff.patch 941 SHA256 5b0c0465a23d27e1c8f0961a8d88b3af75fbc9933ab60c2a71091720a3681079 SHA512 d46fbbc8411fae78cdfca2564faca42f32bb95ee348b9aa3fd1ca90b346cc52cd468945cee07e6df4dff46c10cee6856a58004f8e453960f6dca2751c077802b WHIRLPOOL 10bb08242dd9a055f6bdaf3eb1546786b58f180667c6355ea7276114cbac0ffba6c34822add7965fe3b5d41cc92ce8ec45e2d1d56377d8a6aa2755ef4267d101 +AUX python-2.7.6-recvfrom_into_buffer_overflow.patch 563 SHA256 bdf280058fe31b6e9d08a32e4ce16e958e3dddeed515417a03b25e5ec62d41b4 SHA512 21b534e41ce1cd1bf954849f4246ef0ae907ba7335b42ccfc914cc33068db91140dc1fea0f1b8a83818609e7f5a5f5df6623f029c2c86004f2126eb3f2699c06 WHIRLPOOL 2ffe173be651aae7d43ad8ee75600133ea96952431140c7c00e0ca6ad431d3faa230207f93f1191bfd3bcdf7b0c9af61948871b06158e6953106d7f2d0c7e9f5 AUX python-3.2-CVE-2013-2099.patch 2102 SHA256 76a89951e7efcf14d37e30e0104446429ca121c68cbb1753ec362a177c1b5a54 SHA512 03d2a09fe730bf8c94df1eb10f8bac37a31a28dfb45b7d49abe1c3ffe26ca948f8d00eb58319d34102f8a747a038d447d3507b11c051c778c42ae21ac1066c8e WHIRLPOOL 3cd701c606ef1f4f557d1d250af41a860a6a5c4b6d9ff9a9f469ab6974f13e1205d2c4c791e9bd353fd4ff726f6cbf979f9a3927b83b04af5128c1aea7070496 AUX python-3.2-issue16248.patch 738 SHA256 b5e94ead2622f355d733232dcfdac4dab53889aab12980fa1e4496c296191e77 SHA512 6fcf3d4cf05e41758a6d51ad9cc25ce9fcd1d33854f096b599811a07ef6b7f0cc4f178c4db6b15c5c9ee86eb53fcc736fede0dfb4eae81ca429d0fad62d84db9 WHIRLPOOL dd620bdce394a74910f4deed50b8bcd2b5d6b61af1e2e225a7c36fe4f293560fe1237a2111a4a4a334dfd1272fa4b7faf6289b2a018864c4f154c8a8a8b85c5c AUX python-3.3-CVE-2013-2099.patch 2102 SHA256 d5ccc8de43a176d9d16c3a7be58d32dcf3c952147d8866f84dffcd8fa66f6396 SHA512 a8e2c8fd3d3c3924acb856e89b6dc6965c887688e4c7d078c27abacfaf6b33b12484d86942b75643f28e4a14a465e2ec6a30fe53acf2ab036ae667fb7f76d737 WHIRLPOOL c02bd815d5143b6a916a91f40bb7971f1be188e836ab6095a5befd6410545acba0d44b4b0a75a5f7e7d84105018c0ef27887eefdcd883c73e68f872bb4138e35 @@ -43,6 +44,7 @@ EBUILD python-2.6.8-r3.ebuild 11326 SHA256 dda37aee6bf09c08406b7e5e55d284a864a45 EBUILD python-2.6.9.ebuild 11291 SHA256 7c6835d6730113c085ae57f960ea1a85d8087b4554db7bba5450ca57a2ddb568 SHA512 b20d95ebaee99e86294fed7a9acc8fba21fe57e8ab8a29da66ccf44a5d3053cd16944ca217637c3657ceec23e328713fc0c94e7301441ff553ff21dea816902f WHIRLPOOL 632fd305442296dd7cc4450be72a7189723c071c8daaee1afb1247dd9476369f7708858360d37b1d96fd6af070e4d0540c199306ebce6c955bfe8860aa97a8a0 EBUILD python-2.7.5-r3.ebuild 10577 SHA256 c26d18e0fc436e0639ce75e8372b7d05e94bab934ab46ce8e1e0deab7cd2f07d SHA512 37baba1b1c90f6d8355f9eb9af5dfe27187e1d23f9ac83cbc4da5585364cbcd5471ad15eacf92f5b7bd872e6e7d36a1bacb6caf37054cc70c387998dd70e8dce WHIRLPOOL 8df51382e48d72a188c59a43772a7be660713be2f5c568b150a7c23b82f1f1069024c17662ce3f282c4557dd8caf36e93f60900606a0442d1ec8039c3927771b EBUILD python-2.7.5-r4.ebuild 10639 SHA256 8ffedafb7b4c6544a13c9c4187532402002c77b355d0b556b5489a3354a3db3a SHA512 051556f998fded0add60cc576923e7a258333dff47b8ba04aae97447d6c6df04ef0ce01372f66707cba8a4bd7f119f005fc7f3beb6899a434a2760243de1a972 WHIRLPOOL 229db4f43ae9e8d6ed32f277235e635b04537ada07163df6c703d4666a6398ba40601c26506ed7ccaed1fa9ca84b263e55d6d46c37de9e78e05c2ad2059e2752 +EBUILD python-2.7.6-r1.ebuild 10685 SHA256 604d7c56e4dbf48cbb4fde93c21f6966a0a34f529b24e917a7054f401c0f9658 SHA512 73deb6e43b2487961465215b1cc014c9cbb7aa7e124cd7b4b580b5aa9b4383ad9d0cdbe98f8b1df5f0ca70e35f1802eddd4c4b563382fcabadf21ff6fc68f1e4 WHIRLPOOL bff14c5a6435159eb67207ef04ade473b7dbb252906c8845441db64cdc3f7368d26e27d13ae534158e2c5093a0e553c89ceea8ab9c9533a1aad02c75ef72bd89 EBUILD python-2.7.6.ebuild 10572 SHA256 82c4737615f3136b8be3949db34836f19808b4e4d6b851d46c18b7c92f644d0b SHA512 6594f6218acbf265290071ce916e3b2709b963d50d38950ee8f4fcd9c8e78c6dccec5c773dbdfd5486c4f3909051aeb83f461a7dd84c8ac41bbd9d504e7e921e WHIRLPOOL c10fff31e0fbf16721f4b9d5f69198b16aa7933cf315e48587c5ba92e9262fc9930aa7b041094b8004ac340aea229f981cc020fd8cf640162eb5e2d2987f5416 EBUILD python-3.2.5-r3.ebuild 11014 SHA256 bcb890edf84aaaf2188f3e48a3f60ba4b3bb9a69d3e3ca82a8fbacba99d80aa8 SHA512 f960e0b3788c2100825b4541a56bd2ba7c1cdd34b2646b2c7bbdf69c58c2ea2f0f6696c29a1d7e145fb60c808ddb7c347ebdb39462d288501d063b78e79d8e92 WHIRLPOOL 3650606e63ad242f1486f5906e265ca517f48dbb50c08439d509c6a5794c4e2e5dfc6128fbfff794449be516b6757d33a894b45022120936f347d5cedb737882 EBUILD python-3.3.2-r2.ebuild 9633 SHA256 6d1de07e89d299e7a713556703b89aa052fc0f948ce5c0af5029e028d461d932 SHA512 4dd0afedcf225d609bc1d8ec180a7487b51bfdfdeb42d56581bb82861ef70ec52e06057f65cb1efba2a3068cb89ca8704485ae2f5cf1b5c898f890d4a96cc6f0 WHIRLPOOL 30064501c248cdf2f270baf78c8f4380e8feefde3025797d6f897882aa178ace6fff68e94373b23345d9c7e38f6a0619c17b2bfa0d70ade83014e40b4ef88a5f @@ -52,23 +54,23 @@ EBUILD python-3.3.5.ebuild 9448 SHA256 07af60a34f0d8c20ce7ba453636c2df3ad170942d EBUILD python-3.4.0.ebuild 9291 SHA256 3ef842fd9a31a03c94d0c50fd381133f1b49a58ea8fc4a9e558e21d4fc9983a0 SHA512 73479257d7b39c66a3df03a2e4c79bee68617c7682343e30e462af485b569007f193be54a772dbb21975f59a272c8f543bd90223ad6fdd4d814b26ef5f551cc0 WHIRLPOOL 7df11ffdcb4a1a7761cd25b5d344761a2649c7033514d955cd4f02406805cf3c223ff8d5987c85c2d2830bd3e681929028386945503184ece419a7d5ba037a18 EBUILD python-3.4.0_rc1.ebuild 9529 SHA256 190a5063dd2eaf047ba9a0c0960fec77976b51afe9c589acd5f39df9008f7ca7 SHA512 489af787cc26fdca3b70842e99a8e6a9131c4c58b2048960d3f9bb55ea4046e218a3a049be3cb056184e46c98bf341c5d804c8f3c1eaaa60cc91612ad385b766 WHIRLPOOL e711c7080eda69ea115e412c405ee59fd24bc465b07e3e3211c950bfed6cf8dbe186b1603c707378d9fc3064835c7379cee4f3f8be686621615079f29907af51 EBUILD python-3.4.0_rc3.ebuild 9533 SHA256 33bb634167ac3c81319560bbdebf4486b14c5d830073db632a78ac78779f3098 SHA512 f7a7dcb4802144dea1c489de81468b173d444aed4e965db3b2d01a1fed78e3f5aaf7829cb8ad646599e44aa109aa8d2fca341f9019e8523e4d654f268709e48b WHIRLPOOL e598e276df61825fc46f4258b6ec527d6ee46def7a87375b77ca12117071eff2d1ed132ec97b37f55fbbeb566385fa8baf0b079a1dd713a506f4865d2036aec8 -MISC ChangeLog 31972 SHA256 e214c219c0af4b0b5e15627805e85c8c377bf5e1f87c42def3a9e58657174b6a SHA512 f1ca2af8e8cfbdeec6aa24eb2c9dec76ccc370b7502971292751259910616816ed7cb1b3111476fc3f44dc386b14f988882b403c6730d342c4a0b0885388204a WHIRLPOOL 0579572bd1b390d7ae0bfbf1c949b5a1314bebd35ab7879bd419f203810293e5092418b8ca3e3d650c90c8e92e3212ffb12cdb4c8b99f22d978bd31fda8ac2e7 +MISC ChangeLog 32202 SHA256 b25c80e997ffc921695e28ef67c3672dfe5cc54e38631e6d38bfb51186490c9c SHA512 bedb397d0b9b0fdcf483b95168e3eb74bb7ce5d257dbc597a05588a0828ceeb4c91fa2fb489a5df6373ab96a82365fc36cc6ef712d869262767a85e56a0b9891 WHIRLPOOL 4de2b36b615014237023d04916ce4ea3e536d9178143dad6808d0fdf9ee6e59ca326c53b7d53f4135bf84a6b5bb113d5802c966572ebad8ff3a3c177cb5a0691 MISC ChangeLog-2011 100599 SHA256 23129cb47321b2a6b1cb9323f1815d0cd11d6f30c3893908ed51575c270a0cc8 SHA512 4181ba9d965139ba58218da5b960c87b7a611b27606a1ab1ce1b4c3c9255b4e0e2947307cbfffc531f0f8b6b545ee11e083fcb29dc7b2b7ba31c6bb40b8ab128 WHIRLPOOL 4ceebb6a6ed58b906d3a7331795748ac6e4fe2e1401bcccae9024a8e81e2c444aebc5fec610398cfe6002354ad3b10487484598da5091867874727f07e239c56 MISC metadata.xml 661 SHA256 2c6c3407251f7ccd6501dee49494e539a9544f2fbae99a4373eefdf4e83e8908 SHA512 871989a29417ce20d95da950fa385f1a958139de7b1567beb9cda28a1217901243cd9d25235fe3c7b0e43a82176d72286e31e4e97310b26488d2a3252ef3a8a0 WHIRLPOOL b694b1b4270ba15640d04a3b0b26a08575ea4afc9be256717f7f3b1768d75da9f71ceca6afd2f69971906227d5ba42263d2df2fc9387441aa240222d39fd094e -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) -iQIcBAEBCAAGBQJTQWtVAAoJEPGu1DbS6WIAfDUQAJCFsv0ACjyHI4L9NBxENAg5 -+R5kJpFuUSD40OrMIv59VWC5pc09dU5QwJKNeOGq8S8wTJZyeT3DYxTwcrnS/qCX -2qmQ96p707ytWzsbW/zksUZa0tJ7BWvGpOQ9TWDzTO0OGS17TmGKfU2El7hseXDL -yyE/UNsWLnMeOcvKgndq3ZYklagyMfnf1yfromJFI9JXgmBxGd4JXPDzn5AyKuFV -+yncaMcusz2VhEd1kg47wKkeiV12xJqSI47XtHG8n9dYRsnSVew7ZkU38B0ggdCe -a5O6CzQm+6MTeT77RveqnnwTy5FDyksizrUlFSiaVLczixKAVvu1cpvE+XqmDyK0 -Z5I5c3T2+b66hgnE/sXQADOUiaLzOORVx5tXiJxk9j4xAGnR85Zkj/YcwhxRDH5T -ob4etHp4r99LWB21q5n66/ZHAlHtASqBturOQpxJoKtkbIYjQBjPyD8I/gewfN2s -h3YnXJ/elUn5EsEOMo29kS85+wf/wPEZZTXrWkpA8f9T74BhxB1L201lV9B+1zJd -jMigkiDOfZ7UHFIyLGh343H3sQud5WLVWNvRDqg8PTSlTkcBUhKkuQ/ZK5WvefgS -opgnl1oKrBxZdHa0pZAGXlO9G0t66P+6VFvJeU6PtfmUchV8qzyFYiaEX9bsH2y8 -fLs6VSyYe6s2ke421M2e -=4V5J +iQIcBAEBCAAGBQJTWqqLAAoJEHy/RO9cNQiDfmQP+QHeyAeeRZXzxVhf5kOTgMLe +bKPGih5MZQPuM2gWAmZuSEk+UgN2ABebgz3as2QotdBmUVHK47lBu9DSZ3bt1NIQ +VcqUOJWAMASMI1+4c/XCKVIV6uoFu2ec+7YuVtg7pWkg8eUnRz/E3sixsCly9/OJ +ZIaVFddb8ZM6LhYx8a3EbITwJ0WC22K7X9YsOG1y3jxFgSFKtYWpNuAk9GvEFKJT +TnCcpZ105Rnix9WB2Uufid7Pz1YNCubOYrY7VVp/a9cblQ/neUlHZVDjI2fpaQxN +79DxueNiNNHLwVWcGW5zEr9GgH7Ghkt6lM5tGa/z1VfIcqAz/p6/JVEIrqHkMBr6 +QtFKdRHgrHRRwl1/Gd/9udKO+beypLXqki+faI6nfAH+Jb0dvhEWtT/1XL+AL4sn +YTOtZa7YKfOzdDPfbhmtfQnRGc1BVHj6SEYgFW4XELhcAwxwK/w9F5Ye2VnPion5 +54OOZ130sB49DJheekW/dvzwPtNt4kKB+t6VedB6+HQ3OUMBrPpuIZ3BlrRfIL5p +EOiW8VKoWUhMGXjEDS6WR1UZX5mHG7ZSgMHyR3+x3Df2eds8AW/o6zMuDGw4T51+ ++5i0+xxFSDDD5Kl0fYpcJBe77NcAViNdsnMNKsAfPFwkphaxt+wgNTqNgNYkwXa/ +we0Ua83k/sECEn2koxoa +=TjDS -----END PGP SIGNATURE----- diff --git a/dev-lang/python/files/python-2.7.6-recvfrom_into_buffer_overflow.patch b/dev-lang/python/files/python-2.7.6-recvfrom_into_buffer_overflow.patch new file mode 100644 index 000000000000..37e786bd3a5a --- /dev/null +++ b/dev-lang/python/files/python-2.7.6-recvfrom_into_buffer_overflow.patch @@ -0,0 +1,17 @@ +diff -r 40fb60df4755 Modules/socketmodule.c +--- a/Modules/socketmodule.c Sun Jan 12 12:11:47 2014 +0200 ++++ b/Modules/socketmodule.c Mon Jan 13 16:36:35 2014 -0800 +@@ -2744,6 +2744,13 @@ + recvlen = buflen; + } + ++ /* Check if the buffer is large enough */ ++ if (buflen < recvlen) { ++ PyErr_SetString(PyExc_ValueError, ++ "buffer too small for requested bytes"); ++ goto error; ++ } ++ + readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr); + if (readlen < 0) { + /* Return an error */ diff --git a/dev-lang/python/python-2.7.6-r1.ebuild b/dev-lang/python/python-2.7.6-r1.ebuild new file mode 100644 index 000000000000..39c18da61c1e --- /dev/null +++ b/dev-lang/python/python-2.7.6-r1.ebuild @@ -0,0 +1,360 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.6-r1.ebuild,v 1.1 2014/04/25 18:33:36 chutzpah Exp $ + +EAPI="4" +WANT_AUTOMAKE="none" +WANT_LIBTOOL="none" + +inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing + +MY_P="Python-${PV}" +PATCHSET_REVISION="1" + +DESCRIPTION="An interpreted, interactive, object-oriented programming language" +HOMEPAGE="http://www.python.org/" +SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz + mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz + http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz" + +LICENSE="PSF-2" +SLOT="2.7" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="-berkdb build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" + +# Do not add a dependency on dev-lang/python to this ebuild. +# If you need to apply a patch which requires python for bootstrapping, please +# run the bootstrap code on your dev box and include the results in the +# patchset. See bug 447752. + +RDEPEND="app-arch/bzip2 + >=sys-libs/zlib-1.1.3 + virtual/libffi + virtual/libintl + !build? ( + berkdb? ( || ( + sys-libs/db:5.3 + sys-libs/db:5.2 + sys-libs/db:5.1 + sys-libs/db:5.0 + sys-libs/db:4.8 + sys-libs/db:4.7 + sys-libs/db:4.6 + sys-libs/db:4.5 + sys-libs/db:4.4 + sys-libs/db:4.3 + sys-libs/db:4.2 + ) ) + gdbm? ( sys-libs/gdbm[berkdb] ) + ncurses? ( + >=sys-libs/ncurses-5.2 + readline? ( >=sys-libs/readline-4.1 ) + ) + sqlite? ( >=dev-db/sqlite-3.3.8:3 ) + ssl? ( dev-libs/openssl ) + tk? ( + >=dev-lang/tk-8.0 + dev-tcltk/blt + ) + xml? ( >=dev-libs/expat-2.1 ) + ) + !!<sys-apps/portage-2.1.9" +DEPEND="${RDEPEND} + virtual/pkgconfig + >=sys-devel/autoconf-2.65 + !sys-devel/gcc[libffi]" +RDEPEND+=" !build? ( app-misc/mime-types ) + doc? ( dev-python/python-docs:${SLOT} )" +PDEPEND="app-admin/eselect-python + app-admin/python-updater" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + if use berkdb; then + ewarn "'bsddb' module is out-of-date and no longer maintained inside" + ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally" + ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module" + ewarn "is provided by dev-python/bsddb3." + else + if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then + ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]" + ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." + ewarn "You might need to migrate your databases." + fi + fi +} + +src_prepare() { + # Ensure that internal copies of expat, libffi and zlib are not used. + rm -r Modules/expat || die + rm -r Modules/_ctypes/libffi* || die + rm -r Modules/zlib || die + + if tc-is-cross-compiler; then + local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch" + fi + + EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" + + # Fix for cross-compiling. + epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch" + + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + Lib/distutils/command/install.py \ + Lib/distutils/sysconfig.py \ + Lib/site.py \ + Lib/sysconfig.py \ + Lib/test/test_site.py \ + Makefile.pre.in \ + Modules/Setup.dist \ + Modules/getpath.c \ + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" + + epatch_user + + # fix for CVE-2014-1912 (bug #500518) + epatch "${FILESDIR}"/${P}-recvfrom_into_buffer_overflow.patch + + eautoconf + eautoheader +} + +src_configure() { + if use build; then + # Disable extraneous modules with extra dependencies. + export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" + export PYTHON_DISABLE_SSL="1" + else + # dbm module can be linked against berkdb or gdbm. + # Defaults to gdbm when both are enabled, #204343. + local disable + use berkdb || use gdbm || disable+=" dbm" + use berkdb || disable+=" _bsddb" + use gdbm || disable+=" gdbm" + use ncurses || disable+=" _curses _curses_panel" + use readline || disable+=" readline" + use sqlite || disable+=" _sqlite3" + use ssl || export PYTHON_DISABLE_SSL="1" + use tk || disable+=" _tkinter" + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. + export PYTHON_DISABLE_MODULES="${disable}" + + if ! use xml; then + ewarn "You have configured Python without XML support." + ewarn "This is NOT a recommended configuration as you" + ewarn "may face problems parsing any XML documents." + fi + fi + + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" + fi + + if [[ "$(gcc-major-version)" -ge 4 ]]; then + append-flags -fwrapv + fi + + filter-flags -malign-double + + [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC + + # https://bugs.gentoo.org/show_bug.cgi?id=50309 + if is-flagq -O3; then + is-flagq -fstack-protector-all && replace-flags -O3 -O2 + use hardened && replace-flags -O3 -O2 + fi + + if tc-is-cross-compiler; then + # Force some tests that try to poke fs paths. + export ac_cv_file__dev_ptc=no + export ac_cv_file__dev_ptmx=yes + fi + + # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. + tc-export CXX + # The configure script fails to use pkg-config correctly. + # http://bugs.python.org/issue15506 + export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) + + # Set LDFLAGS so we link modules with -lpython2.7 correctly. + # Needed on FreeBSD unless Python 2.7 is already installed. + # Please query BSD team before removing this! + append-ldflags "-L." + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + if use berkdb; then + dbmliborder+="${dbmliborder:+:}bdb" + fi + + BUILD_DIR="${WORKDIR}/${CHOST}" + mkdir -p "${BUILD_DIR}" || die + cd "${BUILD_DIR}" || die + + ECONF_SOURCE="${S}" OPT="" \ + econf \ + --with-fpectl \ + --enable-shared \ + $(use_enable ipv6) \ + $(use_with threads) \ + $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \ + --infodir='${prefix}/share/info' \ + --mandir='${prefix}/share/man' \ + --with-dbmliborder="${dbmliborder}" \ + --with-libc="" \ + --enable-loadable-sqlite-extensions \ + --with-system-expat \ + --with-system-ffi + + if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then + eerror "configure has detected that the sem_open function is broken." + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." + die "Broken sem_open function (bug 496328)" + fi +} + +src_compile() { + # Avoid invoking pgen for cross-compiles. + touch Include/graminit.h Python/graminit.c + + cd "${BUILD_DIR}" || die + emake + + # Work around bug 329499. See also bug 413751 and 457194. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E python + else + pax-mark m python + fi +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + cd "${BUILD_DIR}" || die + + # Skip failing tests. + local skipped_tests="distutils gdb" + + for test in ${skipped_tests}; do + mv "${S}"/Lib/test/test_${test}.py "${T}" + done + + # Rerun failed tests in verbose mode (regrtest -w). + emake test EXTRATESTOPTS="-w" < /dev/tty + local result="$?" + + for test in ${skipped_tests}; do + mv "${T}/test_${test}.py" "${S}"/Lib/test + done + + elog "The following tests have been skipped:" + for test in ${skipped_tests}; do + elog "test_${test}.py" + done + + elog "If you would like to run them, you may:" + elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" + elog "and run the tests separately." + + if [[ "${result}" -ne 0 ]]; then + die "emake test failed" + fi +} + +src_install() { + local libdir=${ED}/usr/$(get_libdir)/python${SLOT} + + cd "${BUILD_DIR}" || die + emake DESTDIR="${D}" altinstall + + sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" + + # Backwards compat with Gentoo divergence. + dosym python${SLOT}-config /usr/bin/python-config-${SLOT} + + # Fix collisions between different slots of Python. + mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}" + mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}" + mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}" + rm -f "${ED}usr/bin/smtpd.py" + + if use build; then + rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test} + else + use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die + use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die + use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} + fi + + use threads || rm -r "${libdir}/multiprocessing" || die + use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die + + dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins -r "${S}"/Tools + fi + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${SLOT}:" \ + -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" + + # for python-exec + python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR + + # if not using a cross-compiler, use the fresh binary + if ! tc-is-cross-compiler; then + local PYTHON=./python + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. + fi + + echo "EPYTHON='${EPYTHON}'" > epython.py + python_domodule epython.py +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then + python_updater_warning="1" + fi +} + +eselect_python_update() { + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then + eselect python update + fi + + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then + eselect python update --python${PV%%.*} + fi +} + +pkg_postinst() { + eselect_python_update + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn "You should switch active version of Python ${PV%%.*} and run" + ewarn "'python-updater [options]' to rebuild Python modules." + fi +} + +pkg_postrm() { + eselect_python_update +} |