summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Polatel <hawking@gentoo.org>2007-10-24 21:39:43 +0000
committerAli Polatel <hawking@gentoo.org>2007-10-24 21:39:43 +0000
commit1536483af06857eaee2d1a0e7b2ba136046931d0 (patch)
tree29b8f85c54f771fb75bb7acf254bfd2c4cf124d4 /dev-lang/python
parentMove alsa-headers to DEPEND (diff)
downloadhistorical-1536483af06857eaee2d1a0e7b2ba136046931d0.tar.gz
historical-1536483af06857eaee2d1a0e7b2ba136046931d0.tar.bz2
historical-1536483af06857eaee2d1a0e7b2ba136046931d0.zip
revbump(s). fix imageop integer overflows (CVE-2007-4965), bug 192876
Package-Manager: portage-2.1.3.16
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/ChangeLog10
-rw-r--r--dev-lang/python/Manifest32
-rw-r--r--dev-lang/python/files/digest-python-2.3.6-r36
-rw-r--r--dev-lang/python/files/digest-python-2.4.4-r66
-rw-r--r--dev-lang/python/files/digest-python-2.5.1-r36
-rw-r--r--dev-lang/python/python-2.3.6-r3.ebuild244
-rw-r--r--dev-lang/python/python-2.4.4-r6.ebuild314
-rw-r--r--dev-lang/python/python-2.5.1-r3.ebuild317
8 files changed, 930 insertions, 5 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog
index 61a443c80dbd..eb8f3c8b241f 100644
--- a/dev-lang/python/ChangeLog
+++ b/dev-lang/python/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-lang/python
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.280 2007/09/26 01:16:45 kumba Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.281 2007/10/24 21:39:42 hawking Exp $
+
+*python-2.5.1-r3 (24 Oct 2007)
+*python-2.4.4-r6 (24 Oct 2007)
+*python-2.3.6-r3 (24 Oct 2007)
+
+ 24 Oct 2007; Ali Polatel <hawking@gentoo.org> +python-2.3.6-r3.ebuild,
+ +python-2.4.4-r6.ebuild, +python-2.5.1-r3.ebuild:
+ revbump(s). fix imageop integer overflows (CVE-2007-4965), bug 192876
26 Sep 2007; Joshua Kinard <kumba@gentoo.org> python-2.4.4-r5.ebuild:
Stable on mips, per #188029.
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index fa5dbdf3c86d..8cc4b6622b45 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -50,7 +50,10 @@ DIST python-gentoo-patches-2.3.5-r1.tar.bz2 9239 RMD160 0afe928728c2cb5c306bff26
DIST python-gentoo-patches-2.3.5.tar.bz2 8489 RMD160 aa2860d06e0aa387c91419ed1a2bb33de14fd393 SHA1 32349bd5e0f6c3859414b4a03643dd89538792f9 SHA256 f144c5488a55599a0d0614f7c687e43106f8b6da51738296aadcec374d567237
DIST python-gentoo-patches-2.3.6-r1.tar.bz2 8483 RMD160 20a7e020f4cecb849af1d611eb3b159440915de1 SHA1 bf8c2f4512aacf70f78dd1d04e6f5a19cd73cec3 SHA256 995c356c6e5481299b9cedd56a510cfed59dffe50f8932192ae8343a1ad1e416
DIST python-gentoo-patches-2.3.6-r3.tar.bz2 8950 RMD160 a9bd4dfadf711ade1a314ace63b34bbbf0044064 SHA1 c8d11f3a05a7d92f81457303ea1ba72cc60af790 SHA256 7510efa951ccf2bf79052ec2a7ac9ac70c85143b199aeef811d0bae36b40bd0b
+DIST python-gentoo-patches-2.3.6-r4.tar.bz2 10161 RMD160 6f8ea9c86ac8fe3f126bec15e99ee469b5db7e49 SHA1 929eb400264368a8d8f182d3df4a9234da0135d9 SHA256 2a24063c235f3449bf38816c6f272671e22674a14dc9c7840305ad5be143df20
DIST python-gentoo-patches-2.4.4-r3.tar.bz2 8348 RMD160 e9b59a7cd1469668d43a41d396d7a275bef78270 SHA1 16373b922895d1c14ccfa9d6b39079f2d5a2bcb6 SHA256 1c81397312136625fc220db660f701d4eccbde75e74bb40a0d77015b4d5d4f9f
+DIST python-gentoo-patches-2.4.4-r4.tar.bz2 9569 RMD160 2e618e2bf8d0d9d1e722f60b6b781af8906b1750 SHA1 f2253df5b52350fdfbd06054597814d705c088c5 SHA256 a5e9783a4ad57c60f91e3f943f4ff60dcb9b2eb64aa9226598bff9658473781e
+DIST python-gentoo-patches-2.5.1-r1.tar.bz2 6699 RMD160 2a1e1719aec03b1dbec75d406175501b78c9ea3d SHA1 6d245f22637731f0093301d07d07504edcdf0ab7 SHA256 7f6ace09af93a7c0ba14a14fcf30ac164d066aef28ad40f12faee253c559f1cc
DIST python-gentoo-patches-2.5.1.tar.bz2 5430 RMD160 7cdfb51c00a49ebb9027228691e10b8c4c3f574f SHA1 435bb50e342555fc6fac79d72a22a88b592a3627 SHA256 065f31d46c3b57d99b1c3236bbaf445ca142fda33c9ef13e7e2e39be3d027499
EBUILD python-2.3.5-r2.ebuild 8023 RMD160 ca015db4546a4e2743af21f53cf8766dd12185e8 SHA1 0699f6f2b6d8f525caf6c1082fd355c646f97405 SHA256 80286202f710f1b2f608d8b7c814687abe2dae1b816ee2dd4b908a25706c5277
MD5 4396d20fd265f5612ba42e12f8e839d0 python-2.3.5-r2.ebuild 8023
@@ -64,6 +67,10 @@ EBUILD python-2.3.6-r2.ebuild 7584 RMD160 066bef0984f486b891d1d774ac2770135438bd
MD5 edd99bad27daaa5dc5d3769a0ea1143e python-2.3.6-r2.ebuild 7584
RMD160 066bef0984f486b891d1d774ac2770135438bd90 python-2.3.6-r2.ebuild 7584
SHA256 312891ee198401da31736607c79da093007a12852c7d002219e928c7740cc034 python-2.3.6-r2.ebuild 7584
+EBUILD python-2.3.6-r3.ebuild 7581 RMD160 692f54635f713fcfcc4f91183d2e867f8645afa8 SHA1 9a040e9276142a3c35e24560b59e6d746bdc4cce SHA256 72dfbd58661c8071d38a3675daa2779d41e2b4eeb818b67e1ae01745b2289d7f
+MD5 c20747e4f16a4dcdd19eae4516b63134 python-2.3.6-r3.ebuild 7581
+RMD160 692f54635f713fcfcc4f91183d2e867f8645afa8 python-2.3.6-r3.ebuild 7581
+SHA256 72dfbd58661c8071d38a3675daa2779d41e2b4eeb818b67e1ae01745b2289d7f python-2.3.6-r3.ebuild 7581
EBUILD python-2.3.6.ebuild 8125 RMD160 212d3a44bc94906be6447938205ae57a70848aee SHA1 ccb349dd679c33afaff0a97fe9f19b8a9a612f40 SHA256 728c51a9f3a082b4b93b8a4d93d57272ba2460dc43276cd773909061836d3d1e
MD5 edb743fdcd33d9424d55cb93179cf041 python-2.3.6.ebuild 8125
RMD160 212d3a44bc94906be6447938205ae57a70848aee python-2.3.6.ebuild 8125
@@ -76,14 +83,22 @@ EBUILD python-2.4.4-r5.ebuild 10335 RMD160 e660e26d62e0a7a97030b9c9af032afd631f1
MD5 4f2e85f9301a03229fdeecafdfc8e801 python-2.4.4-r5.ebuild 10335
RMD160 e660e26d62e0a7a97030b9c9af032afd631f1fd9 python-2.4.4-r5.ebuild 10335
SHA256 7a433006ffc4907293ece7e6a24f65c5544378a2abf19ece9dada735fd5105c8 python-2.4.4-r5.ebuild 10335
+EBUILD python-2.4.4-r6.ebuild 10345 RMD160 6a5d686ae0820521df248d05d1782b89a3689193 SHA1 96b29a4058fa947fa890efd7c7eb088785a45f08 SHA256 0dfc6d217156788c9dd7f3a218418f766191a6c94e010d0e46f4d11bc37d19b1
+MD5 bd41178854e687a6c9039afe15bb3272 python-2.4.4-r6.ebuild 10345
+RMD160 6a5d686ae0820521df248d05d1782b89a3689193 python-2.4.4-r6.ebuild 10345
+SHA256 0dfc6d217156788c9dd7f3a218418f766191a6c94e010d0e46f4d11bc37d19b1 python-2.4.4-r6.ebuild 10345
EBUILD python-2.5.1-r2.ebuild 10333 RMD160 79588711454352ae17e6e1c042989aada2654c63 SHA1 63c8a3002741f7569b451c19275bafe35e3604c4 SHA256 b3f66cab06550579bcee7da97fc06a3d7a45be9765b7806884f364762fd8eb62
MD5 cd11c5ccf1671de5cd14d3c2e2777a52 python-2.5.1-r2.ebuild 10333
RMD160 79588711454352ae17e6e1c042989aada2654c63 python-2.5.1-r2.ebuild 10333
SHA256 b3f66cab06550579bcee7da97fc06a3d7a45be9765b7806884f364762fd8eb62 python-2.5.1-r2.ebuild 10333
-MISC ChangeLog 48347 RMD160 89a62fbfd20e638dd8a3c7a5cfece84d3ec50315 SHA1 13263e406fc10c2d8b81a511edc497f6fc8c1a8a SHA256 45b81ac6b8239fb3264f23a2eee50f2d08d17d475d5dca9a64b4bee0290f6be4
-MD5 876b3821174a082058b88287c977c85d ChangeLog 48347
-RMD160 89a62fbfd20e638dd8a3c7a5cfece84d3ec50315 ChangeLog 48347
-SHA256 45b81ac6b8239fb3264f23a2eee50f2d08d17d475d5dca9a64b4bee0290f6be4 ChangeLog 48347
+EBUILD python-2.5.1-r3.ebuild 10402 RMD160 a33b0b8a32866f45d742981a73428478c4bd3a3d SHA1 5b5569e61f9604b324b93a0dfa532da6df9c1d64 SHA256 deb694d0fd62e65f4bb2acc6a1cbedff3a763fed00c008f69e6b286f1f82bf98
+MD5 e3b6150537d361a719d85c7431bc8d48 python-2.5.1-r3.ebuild 10402
+RMD160 a33b0b8a32866f45d742981a73428478c4bd3a3d python-2.5.1-r3.ebuild 10402
+SHA256 deb694d0fd62e65f4bb2acc6a1cbedff3a763fed00c008f69e6b286f1f82bf98 python-2.5.1-r3.ebuild 10402
+MISC ChangeLog 48641 RMD160 675193f4b49ee2f12703364c2407b0ec2468619d SHA1 7ff1d4846b3ee00bf9e0bcb9ebe66dd1a348baae SHA256 cd0829e8e4318aa14b518241672d133f06cf2fb1c3e2e6f78d0ed37436c27a52
+MD5 7df87a6448844a432bd948abb17ea458 ChangeLog 48641
+RMD160 675193f4b49ee2f12703364c2407b0ec2468619d ChangeLog 48641
+SHA256 cd0829e8e4318aa14b518241672d133f06cf2fb1c3e2e6f78d0ed37436c27a52 ChangeLog 48641
MISC metadata.xml 159 RMD160 900a8c55d7a7d2f6312594769aaf941bf9e99c7f SHA1 c8e604d56dae898258b5254d78cfeac0b981e288 SHA256 9f01104d3484792496faff4805eed0ecea2352a897151f3397d49a13800037b4
MD5 71c4638c9c88af75b58e5f5cb54fe008 metadata.xml 159
RMD160 900a8c55d7a7d2f6312594769aaf941bf9e99c7f metadata.xml 159
@@ -100,12 +115,21 @@ SHA256 fb247577f15f0d6a5efaac65011bae615a036e937635746c791f67c622c0c0b3 files/di
MD5 e1c304a277e5e53152689629eb612b0a files/digest-python-2.3.6-r2 533
RMD160 cd8dda9da91f67cb2839756d7b810ec8de9bebc4 files/digest-python-2.3.6-r2 533
SHA256 5134e788f892a5ee3c08664574a427b3289cbb02e5afc896e46e0be52f7bda83 files/digest-python-2.3.6-r2 533
+MD5 61779c80a45ad3adf487c9a3bf96731e files/digest-python-2.3.6-r3 536
+RMD160 27f14329a2c85e3ded2897ffb5db2d6f064bb07b files/digest-python-2.3.6-r3 536
+SHA256 4ec91ddd5c1cc078e557bb58b90408e4ca7cf44ecbc3ad8def4dfbd658d294ba files/digest-python-2.3.6-r3 536
MD5 bee33863e49d046cbe199a9e5d8f7dba files/digest-python-2.4.4-r4 533
RMD160 bb38a0bcdb4e3a9849883271a58461cb3cdeaf3c files/digest-python-2.4.4-r4 533
SHA256 7adcb37e259cb269f5000934c41ed8a355157bb5a70fbe26f8899dae8a4892a4 files/digest-python-2.4.4-r4 533
MD5 bee33863e49d046cbe199a9e5d8f7dba files/digest-python-2.4.4-r5 533
RMD160 bb38a0bcdb4e3a9849883271a58461cb3cdeaf3c files/digest-python-2.4.4-r5 533
SHA256 7adcb37e259cb269f5000934c41ed8a355157bb5a70fbe26f8899dae8a4892a4 files/digest-python-2.4.4-r5 533
+MD5 9c32faf4d8eda5bbf2036949de404d7d files/digest-python-2.4.4-r6 533
+RMD160 a8f69f27fca74ad7e50b3245235907632a428a82 files/digest-python-2.4.4-r6 533
+SHA256 f0e646a4a0ee31e5f6eb48ab27c64968d352556a1269ba33e8926dd4889cc7d4 files/digest-python-2.4.4-r6 533
MD5 324d60a42f00557119aa50958d0ee6fd files/digest-python-2.5.1-r2 524
RMD160 d49c6128cbed41384a15cacfd1c728a1b2bc9f8d files/digest-python-2.5.1-r2 524
SHA256 a45e1cf55eda4d760225944ed0f598d594b573174479651cfa8a78ca9ca4db3c files/digest-python-2.5.1-r2 524
+MD5 384720314c3ff4cb356c0a272f6c8f18 files/digest-python-2.5.1-r3 533
+RMD160 1f1eea3fa32a4155b9e35caa094249a22b4aa8b7 files/digest-python-2.5.1-r3 533
+SHA256 2f01d5ac273992d54d93a791cb947fb5f0136bd5da0e9685f8276488ac89cd50 files/digest-python-2.5.1-r3 533
diff --git a/dev-lang/python/files/digest-python-2.3.6-r3 b/dev-lang/python/files/digest-python-2.3.6-r3
new file mode 100644
index 000000000000..46a4f0dc091f
--- /dev/null
+++ b/dev-lang/python/files/digest-python-2.3.6-r3
@@ -0,0 +1,6 @@
+MD5 1bd475e69e20481c6301853eef7018f1 Python-2.3.6.tar.bz2 7350182
+RMD160 db7a2ebff31e86bc99d45062fc77e4194399cc8d Python-2.3.6.tar.bz2 7350182
+SHA256 120b6babcc29dfd0ba31ad1b1db587fbceee9705a569727c80d18292ba675da4 Python-2.3.6.tar.bz2 7350182
+MD5 880d1834aa24d6c95fef95d959b01626 python-gentoo-patches-2.3.6-r4.tar.bz2 10161
+RMD160 6f8ea9c86ac8fe3f126bec15e99ee469b5db7e49 python-gentoo-patches-2.3.6-r4.tar.bz2 10161
+SHA256 2a24063c235f3449bf38816c6f272671e22674a14dc9c7840305ad5be143df20 python-gentoo-patches-2.3.6-r4.tar.bz2 10161
diff --git a/dev-lang/python/files/digest-python-2.4.4-r6 b/dev-lang/python/files/digest-python-2.4.4-r6
new file mode 100644
index 000000000000..5bebb58f1df6
--- /dev/null
+++ b/dev-lang/python/files/digest-python-2.4.4-r6
@@ -0,0 +1,6 @@
+MD5 0ba90c79175c017101100ebf5978e906 Python-2.4.4.tar.bz2 8158073
+RMD160 4c7b5b70178fe69881b62201ef0bab55037d8708 Python-2.4.4.tar.bz2 8158073
+SHA256 325fdc7351a08bd8d811e7fb53c41bff11764648ab1a671abd910afec946b38a Python-2.4.4.tar.bz2 8158073
+MD5 9e4d4c8f01c0921eaa67267bbadf0f5f python-gentoo-patches-2.4.4-r4.tar.bz2 9569
+RMD160 2e618e2bf8d0d9d1e722f60b6b781af8906b1750 python-gentoo-patches-2.4.4-r4.tar.bz2 9569
+SHA256 a5e9783a4ad57c60f91e3f943f4ff60dcb9b2eb64aa9226598bff9658473781e python-gentoo-patches-2.4.4-r4.tar.bz2 9569
diff --git a/dev-lang/python/files/digest-python-2.5.1-r3 b/dev-lang/python/files/digest-python-2.5.1-r3
new file mode 100644
index 000000000000..fc56dc7f0eff
--- /dev/null
+++ b/dev-lang/python/files/digest-python-2.5.1-r3
@@ -0,0 +1,6 @@
+MD5 70084ffa561660f07de466c2c8c4842d Python-2.5.1.tar.bz2 9383651
+RMD160 af0e8ed93bbc07015c338ae19bbee8811da21c1c Python-2.5.1.tar.bz2 9383651
+SHA256 d0b5d4dce02c56d2eb0728db3ebd63afc3dae906d158be6532ae4480d311e167 Python-2.5.1.tar.bz2 9383651
+MD5 d91dd374f743ca8c850560e4a89a60f8 python-gentoo-patches-2.5.1-r1.tar.bz2 6699
+RMD160 2a1e1719aec03b1dbec75d406175501b78c9ea3d python-gentoo-patches-2.5.1-r1.tar.bz2 6699
+SHA256 7f6ace09af93a7c0ba14a14fcf30ac164d066aef28ad40f12faee253c559f1cc python-gentoo-patches-2.5.1-r1.tar.bz2 6699
diff --git a/dev-lang/python/python-2.3.6-r3.ebuild b/dev-lang/python/python-2.3.6-r3.ebuild
new file mode 100644
index 000000000000..aeb9f1f73d88
--- /dev/null
+++ b/dev-lang/python/python-2.3.6-r3.ebuild
@@ -0,0 +1,244 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.6-r3.ebuild,v 1.1 2007/10/24 21:39:42 hawking Exp $
+
+# NOTE about python-portage interactions :
+# - Do not add a pkg_setup() check for a certain version of portage
+# in dev-lang/python. It _WILL_ stop people installing from
+# Gentoo 1.4 images.
+
+inherit autotools eutils flag-o-matic python versionator
+
+PYVER_MAJOR=$(get_major_version)
+PYVER_MINOR=$(get_version_component_range 2)
+PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
+
+S="${WORKDIR}/Python-${PV}"
+DESCRIPTION="A really great language"
+HOMEPAGE="http://www.python.org/"
+SRC_URI="http://www.python.org/ftp/python/${PV%_*}/Python-${PV}.tar.bz2
+ mirror://gentoo/python-gentoo-patches-${PV}-r4.tar.bz2"
+
+LICENSE="PSF-2.2"
+SLOT="2.3"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 doc nocxx nothreads examples"
+
+# INFO: 2.3.5 docs are used for python-2.3.6 as upstream writes in their release
+# notes.
+DEPEND=">=sys-libs/zlib-1.1.3
+ !build? (
+ tk? ( >=dev-lang/tk-8.0 )
+ ncurses? ( >=sys-libs/ncurses-5.2 readline? ( >=sys-libs/readline-4.1 ) )
+ berkdb? ( >=sys-libs/db-3.1 )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ doc? ( =dev-python/python-docs-2.3.5* )
+ dev-libs/expat
+ )"
+
+# NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python
+# provides the functionality expected from previous pythons.
+
+# NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need
+# it to compile python. We just need to ensure that when we install
+# python, we definitely have fchksum support. - liquidx
+
+# NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
+
+PDEPEND="${DEPEND} dev-python/python-fchksum app-admin/python-updater"
+
+PROVIDE="virtual/python"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ sed -ie 's/OpenBSD\/3.\[01234/OpenBSD\/3.\[012345/' configure || die "OpenBSD sed failed"
+
+ # fix os.utime() on hppa. utimes it not supported but unfortunately
+ # reported as working - gmsoft (22 May 04)
+ [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i ${S}/configure
+
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+ Lib/distutils/command/install.py \
+ Lib/distutils/sysconfig.py \
+ Lib/site.py \
+ Makefile.pre.in \
+ Modules/Setup.dist \
+ Modules/getpath.c \
+ setup.py || die
+
+ eautoreconf
+}
+
+src_configure() {
+ # disable extraneous modules with extra dependencies
+ if use build; then
+ export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter"
+ export PYTHON_DISABLE_SSL=1
+ else
+ use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
+ use berkdb \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm bsddb"
+ use readline \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
+ use tk \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
+ use ncurses \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
+ use ssl \
+ || export PYTHON_DISABLE_SSL=1
+ export PYTHON_DISABLE_MODULES
+ echo $PYTHON_DISABLE_MODULES
+ fi
+}
+
+src_compile() {
+ filter-flags -malign-double
+ filter-ldflags -Wl,--as-needed --as-needed
+
+ [ "${ARCH}" = "alpha" ] && append-flags -fPIC
+ [ "${ARCH}" = "amd64" ] && append-flags -fPIC
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flag -O3; then
+ is-flag -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
+
+ export OPT="${CFLAGS}"
+
+ local myconf
+ #if we are creating a new build image, we remove the dependency on g++
+ if use build && ! use bootstrap || use nocxx ; then
+ myconf="--with-cxx=no"
+ fi
+
+ # super-secret switch. don't use this unless you know what you're
+ # doing. enabling UCS2 support will break your existing python
+ # modules
+ use ucs2 \
+ && myconf="${myconf} --enable-unicode=ucs2" \
+ || myconf="${myconf} --enable-unicode=ucs4"
+
+ use nothreads \
+ && myconf="${myconf} --without-threads" \
+ || myconf="${myconf} --with-threads"
+
+ src_configure
+
+ econf --with-fpectl \
+ --enable-shared \
+ `use_enable ipv6` \
+ --infodir='${prefix}'/share/info \
+ --mandir='${prefix}'/share/man \
+ --with-libc='' \
+ ${myconf} || die
+ emake || die "Parallel make failed"
+}
+
+src_install() {
+ dodir /usr
+ src_configure
+ make DESTDIR="${D}" altinstall || die
+
+ # install our own custom python-config
+ exeinto /usr/bin
+ newexe ${FILESDIR}/python-config-${PYVER} python-config
+
+ # The stuff below this line extends from 2.1, and should be deprecated
+ # in 2.3, or possibly can wait till 2.4
+
+ # seems like the build do not install Makefile.pre.in anymore
+ # it probably shouldn't - use DistUtils, people!
+ insinto /usr/$(get_libdir)/python${PYVER}/config
+ doins ${S}/Makefile.pre.in
+
+ # While we're working on the config stuff... Let's fix the OPT var
+ # so that it doesn't have any opts listed in it. Prevents the problem
+ # with compiling things with conflicting opts later.
+ dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' /usr/$(get_libdir)/python${PYVER}/config/Makefile
+
+ if use build ; then
+ rm -rf ${D}/usr/$(get_libdir)/python2.3/{test,encodings,email,lib-tk,bsddb/test}
+ else
+ use elibc_uclibc && rm -rf ${D}/usr/$(get_libdir)/python2.3/{test,bsddb/test}
+ use berkdb || rm -rf ${D}/usr/$(get_libdir)/python2.3/bsddb
+ use tk || rm -rf ${D}/usr/$(get_libdir)/python2.3/lib-tk
+ fi
+
+ if use examples ; then
+ mkdir -p ${D}/usr/share/doc/${P}/examples
+ cp -r ${S}/Tools ${D}/usr/share/doc/${P}/examples
+ fi
+}
+
+pkg_postrm() {
+ python_makesym
+ python_mod_cleanup /usr/$(get_libdir)/python2.3
+}
+
+pkg_postinst() {
+ local myroot
+ myroot=$(echo $ROOT | sed 's:/$::')
+
+ python_makesym
+ python_mod_optimize
+ python_mod_optimize -x site-packages -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
+
+ # workaround possible python-upgrade-breaks-portage situation
+ if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
+ if [ -f ${myroot}/usr/lib/python2.2/site-packages/portage.py ]; then
+ einfo "Working around possible python-portage upgrade breakage"
+ mkdir -p ${myroot}/usr/lib/portage/pym
+ cp ${myroot}/usr/lib/python2.2/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
+ python_mod_optimize ${myroot}/usr/lib/portage/pym
+ fi
+ fi
+
+ echo
+ ewarn
+ ewarn "If you have just upgraded from an older version of python you"
+ ewarn "will need to run:"
+ ewarn
+ ewarn "/usr/sbin/python-updater"
+ ewarn
+ ewarn "This will automatically rebuild all the python dependent modules"
+ ewarn "to run with python-${PYVER}."
+ ewarn
+ ewarn "Your original Python is still installed and can be accessed via"
+ ewarn "/usr/bin/python2.x."
+ ewarn
+ ebeep 5
+}
+
+src_test() {
+ # PYTHON_DONTCOMPILE=1 breaks test_import
+ unset PYTHON_DONTCOMPILE
+
+ #skip all tests that fail during emerge but pass without emerge:
+ #(See bug# 67970)
+ local skip_tests="global mimetools mmap strptime subprocess tcl time urllib urllib2 zipimport"
+
+ for test in ${skip_tests} ; do
+ mv ${S}/Lib/test/test_${test}.py ${T}
+ done
+
+ make test || die "make test failed"
+
+ for test in ${skip_tests} ; do
+ mv ${T}/test_${test}.py ${S}/Lib/test/test_${test}.py
+ done
+
+ elog "Portage skipped the following tests which aren't able to run from emerge:"
+ for test in ${skip_tests} ; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you'd like to run them, you may:"
+ elog "cd /usr/lib/python${PYVER}/test"
+ elog "and run the tests separately."
+}
diff --git a/dev-lang/python/python-2.4.4-r6.ebuild b/dev-lang/python/python-2.4.4-r6.ebuild
new file mode 100644
index 000000000000..9a0ae8881f5d
--- /dev/null
+++ b/dev-lang/python/python-2.4.4-r6.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.4.4-r6.ebuild,v 1.1 2007/10/24 21:39:42 hawking Exp $
+
+# NOTE about python-portage interactions :
+# - Do not add a pkg_setup() check for a certain version of portage
+# in dev-lang/python. It _WILL_ stop people installing from
+# Gentoo 1.4 images.
+
+inherit autotools eutils flag-o-matic python multilib versionator toolchain-funcs alternatives
+
+# we need this so that we don't depends on python.eclass
+PYVER_MAJOR=$(get_major_version)
+PYVER_MINOR=$(get_version_component_range 2)
+PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
+
+MY_P="Python-${PV}"
+S="${WORKDIR}/${MY_P}"
+DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
+HOMEPAGE="http://www.python.org/"
+SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~kloeri/python-gentoo-patches-${PV}-r4.tar.bz2"
+
+LICENSE="PSF-2.2"
+SLOT="2.4"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 doc nocxx nothreads examples"
+
+DEPEND=">=sys-libs/zlib-1.1.3
+ !dev-python/cjkcodecs
+ !build? (
+ tk? ( >=dev-lang/tk-8.0 )
+ ncurses? ( >=sys-libs/ncurses-5.2 readline? ( >=sys-libs/readline-4.1 ) )
+ berkdb? ( >=sys-libs/db-3.1 )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ doc? ( =dev-python/python-docs-${PV}* )
+ dev-libs/expat
+ )"
+
+# NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python
+# provides the functionality expected from previous pythons.
+
+# NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need
+# it to compile python. We just need to ensure that when we install
+# python, we definitely have fchksum support. - liquidx
+
+# NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
+# NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico
+
+RDEPEND="${DEPEND} build? ( !dev-python/python-fchksum !dev-python/pycrypto )"
+PDEPEND="${DEPEND} !build? ( dev-python/python-fchksum ) app-admin/python-updater"
+
+PROVIDE="virtual/python"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ if tc-is-cross-compiler ; then
+ [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
+ die "Crosscompiling requires the same host and build versions."
+ epatch ${FILESDIR}/python-2.4.4-test-cross.patch
+ else
+ rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
+ fi
+
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+ Lib/distutils/command/install.py \
+ Lib/distutils/sysconfig.py \
+ Lib/site.py \
+ Makefile.pre.in \
+ Modules/Setup.dist \
+ Modules/getpath.c \
+ setup.py || die
+
+ # fix os.utime() on hppa. utimes it not supported but unfortunately
+ # reported as working - gmsoft (22 May 04)
+ # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
+ [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i ${S}/configure
+
+ eautoreconf
+}
+
+src_configure() {
+ # disable extraneous modules with extra dependencies
+ if use build; then
+ export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter"
+ export PYTHON_DISABLE_SSL=1
+ else
+ use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
+ use berkdb \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm bsddb"
+ use readline \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
+ use tk \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
+ use ncurses \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
+ use ssl \
+ || export PYTHON_DISABLE_SSL=1
+ export PYTHON_DISABLE_MODULES
+ echo $PYTHON_DISABLE_MODULES
+ fi
+}
+
+src_compile() {
+ filter-flags -malign-double
+
+ # Seems to no longer be necessary
+ #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
+ [ "${ARCH}" = "alpha" ] && append-flags -fPIC
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flag -O3; then
+ is-flag -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
+
+ export OPT="${CFLAGS}"
+
+ local myconf
+ #if we are creating a new build image, we remove the dependency on g++
+ if use build && ! use bootstrap || use nocxx ; then
+ myconf="--with-cxx=no"
+ fi
+
+ # super-secret switch. don't use this unless you know what you're
+ # doing. enabling UCS2 support will break your existing python
+ # modules
+ use ucs2 \
+ && myconf="${myconf} --enable-unicode=ucs2" \
+ || myconf="${myconf} --enable-unicode=ucs4"
+
+ use nothreads \
+ && myconf="${myconf} --without-threads" \
+ || myconf="${myconf} --with-threads"
+
+ src_configure
+
+ if tc-is-cross-compiler ; then
+ OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
+ ./configure --with-cxx=no || die "cross-configure failed"
+ emake python Parser/pgen || die "cross-make failed"
+ mv python hostpython
+ mv Parser/pgen Parser/hostpgen
+ make distclean
+ sed -i \
+ -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
+ -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
+ Makefile.pre.in || die
+ fi
+
+ # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
+ tc-export CXX
+ # set LINKCC to prevent python from being linked to libstdc++.so
+ export LINKCC="\$(PURIFY) \$(CC)"
+ econf \
+ --with-fpectl \
+ --enable-shared \
+ `use_enable ipv6` \
+ --infodir='${prefix}'/share/info \
+ --mandir='${prefix}'/share/man \
+ --with-libc='' \
+ ${myconf} || die
+ emake || die "Parallel make failed"
+}
+
+src_install() {
+ dodir /usr
+ src_configure
+ make DESTDIR="${D}" altinstall maninstall || die
+
+ # install our own custom python-config
+ exeinto /usr/bin
+ newexe ${FILESDIR}/python-config-${PYVER}-r1 python-config-${PYVER}
+
+ # Use correct libdir in python-config
+ dosed "s:/usr/lib/:/usr/$(get_libdir)/:" /usr/bin/python-config-${PYVER}
+
+ if use build ; then
+ rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
+ else
+ use elibc_uclibc && rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
+ use berkdb || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/bsddb
+ use tk || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/lib-tk
+ fi
+
+ # Fix slotted collisions
+ mv ${D}/usr/bin/pydoc ${D}/usr/bin/pydoc${PYVER}
+ mv ${D}/usr/bin/idle ${D}/usr/bin/idle${PYVER}
+ mv ${D}/usr/share/man/man1/python.1 \
+ ${D}/usr/share/man/man1/python${PYVER}.1
+ rm -f ${D}/usr/bin/smtpd.py
+
+ prep_ml_includes usr/include/python${PYVER}
+
+ # The stuff below this line extends from 2.1, and should be deprecated
+ # in 2.3, or possibly can wait till 2.4
+
+ # seems like the build do not install Makefile.pre.in anymore
+ # it probably shouldn't - use DistUtils, people!
+ insinto /usr/$(get_libdir)/python${PYVER}/config
+ doins ${S}/Makefile.pre.in
+
+ # While we're working on the config stuff... Let's fix the OPT var
+ # so that it doesn't have any opts listed in it. Prevents the problem
+ # with compiling things with conflicting opts later.
+ dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
+ /usr/$(get_libdir)/python${PYVER}/config/Makefile
+
+ if use examples ; then
+ mkdir -p ${D}/usr/share/doc/${P}/examples
+ cp -r ${S}/Tools ${D}/usr/share/doc/${P}/examples
+ fi
+}
+
+pkg_postrm() {
+ local mansuffix=$(ecompress --suffix)
+ python_makesym
+ alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/python-config" \
+ "python-config-[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
+ "python[0-9].[0-9].1${mansuffix}"
+
+ python_mod_cleanup /usr/lib/python${PYVER}
+ [[ "$(get_libdir)" == "lib" ]] || \
+ python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
+}
+
+pkg_postinst() {
+ local myroot
+ myroot=$(echo $ROOT | sed 's:/$::')
+ local mansuffix=$(ecompress --suffix)
+
+ python_makesym
+ alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/python-config" \
+ "python-config-[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
+ "python[0-9].[0-9].1${mansuffix}"
+
+ python_mod_optimize
+ python_mod_optimize -x site-packages \
+ -x test ${myroot}/usr/lib/python${PYVER}
+ [[ "$(get_libdir)" == "lib" ]] || \
+ python_mod_optimize -x site-packages \
+ -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
+
+ # workaround possible python-upgrade-breaks-portage situation
+ if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
+ if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
+ einfo "Working around possible python-portage upgrade breakage"
+ mkdir -p ${myroot}/usr/lib/portage/pym
+ cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
+ python_mod_optimize ${myroot}/usr/lib/portage/pym
+ fi
+ fi
+
+ echo
+ ewarn
+ ewarn "If you have just upgraded from an older version of python you"
+ ewarn "will need to run:"
+ ewarn
+ ewarn "/usr/sbin/python-updater"
+ ewarn
+ ewarn "This will automatically rebuild all the python dependent modules"
+ ewarn "to run with python-${PYVER}."
+ ewarn
+ ewarn "Your original Python is still installed and can be accessed via"
+ ewarn "/usr/bin/python2.x."
+ ewarn
+ ebeep 5
+}
+
+src_test() {
+ # Tests won't work when cross compiling
+ if tc-is-cross-compiler ; then
+ elog "Disabling tests due to crosscompiling."
+ return
+ fi
+
+ # PYTHON_DONTCOMPILE=1 breaks test_import
+ unset PYTHON_DONTCOMPILE
+
+ #skip all tests that fail during emerge but pass without emerge:
+ #(See bug# 67970)
+ local skip_tests="cookielib distutils global hotshot mimetools minidom mmap posix sax strptime subprocess syntax tcl time urllib urllib2"
+
+ for test in ${skip_tests} ; do
+ mv ${S}/Lib/test/test_${test}.py ${T}
+ done
+
+ # rerun failed tests in verbose mode (regrtest -w)
+ EXTRATESTOPTS="-w" make test || die "make test failed"
+
+ for test in ${skip_tests} ; do
+ mv ${T}/test_${test}.py ${S}/Lib/test/test_${test}.py
+ done
+
+ elog "Portage skipped the following tests which aren't able to run from emerge:"
+ for test in ${skip_tests} ; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you'd like to run them, you may:"
+ elog "cd /usr/lib/python${PYVER}/test"
+ elog "and run the tests separately."
+}
diff --git a/dev-lang/python/python-2.5.1-r3.ebuild b/dev-lang/python/python-2.5.1-r3.ebuild
new file mode 100644
index 000000000000..534af9259fd2
--- /dev/null
+++ b/dev-lang/python/python-2.5.1-r3.ebuild
@@ -0,0 +1,317 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.1-r3.ebuild,v 1.1 2007/10/24 21:39:42 hawking Exp $
+
+# NOTE about python-portage interactions :
+# - Do not add a pkg_setup() check for a certain version of portage
+# in dev-lang/python. It _WILL_ stop people installing from
+# Gentoo 1.4 images.
+
+inherit eutils autotools flag-o-matic python multilib versionator toolchain-funcs alternatives libtool
+
+# we need this so that we don't depends on python.eclass
+PYVER_MAJOR=$(get_major_version)
+PYVER_MINOR=$(get_version_component_range 2)
+PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
+
+MY_P="Python-${PV}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
+HOMEPAGE="http://www.python.org/"
+SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
+ mirror://gentoo/python-gentoo-patches-${PV}-r1.tar.bz2"
+
+LICENSE="PSF-2.2"
+SLOT="2.5"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 sqlite doc nothreads examples"
+
+# NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs}
+# do not conflict with the ones in python proper. - liquidx
+
+DEPEND=">=sys-libs/zlib-1.1.3
+ !build? (
+ sqlite? ( >=dev-db/sqlite-3 )
+ tk? ( >=dev-lang/tk-8.0 )
+ ncurses? ( >=sys-libs/ncurses-5.2
+ readline? ( >=sys-libs/readline-4.1 ) )
+ berkdb? ( >=sys-libs/db-3.1 )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ doc? ( =dev-python/python-docs-${PV}* )
+ dev-libs/expat
+ )"
+
+# NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python
+# provides the functionality expected from previous pythons.
+
+# NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need
+# it to compile python. We just need to ensure that when we install
+# python, we definitely have fchksum support. - liquidx
+
+# NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
+# NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico
+
+RDEPEND="${DEPEND} build? ( !dev-python/python-fchksum )"
+PDEPEND="${DEPEND} !build? ( dev-python/python-fchksum ) app-admin/python-updater"
+PROVIDE="virtual/python"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ #epatch "${FILESDIR}/python-2.5.CVE-2007-4965-int-overflow.patch"
+ if tc-is-cross-compiler ; then
+ [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
+ die "Crosscompiling requires the same host and build versions."
+ epatch ${FILESDIR}/python-2.4.4-test-cross.patch
+ else
+ rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
+ fi
+
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+ Lib/distutils/command/install.py \
+ Lib/distutils/sysconfig.py \
+ Lib/site.py \
+ Makefile.pre.in \
+ Modules/Setup.dist \
+ Modules/getpath.c \
+ setup.py || die
+
+ # fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04)
+ # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
+ [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i ${S}/configure
+
+ eautoreconf
+}
+
+src_configure() {
+ # disable extraneous modules with extra dependencies
+ if use build; then
+ export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3"
+ export PYTHON_DISABLE_SSL=1
+ else
+ use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
+ use berkdb \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm bsddb"
+ use readline \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
+ use tk \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
+ use ncurses \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
+ use sqlite \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _sqlite3"
+ use ssl \
+ || export PYTHON_DISABLE_SSL=1
+ export PYTHON_DISABLE_MODULES
+ echo $PYTHON_DISABLE_MODULES
+ fi
+}
+
+src_compile() {
+ filter-flags -malign-double
+
+ # Seems to no longer be necessary
+ #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
+ [ "${ARCH}" = "alpha" ] && append-flags -fPIC
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flag -O3; then
+ is-flag -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
+
+ export OPT="${CFLAGS}"
+
+ local myconf
+
+ # super-secret switch. don't use this unless you know what you're
+ # doing. enabling UCS2 support will break your existing python
+ # modules
+ use ucs2 \
+ && myconf="${myconf} --enable-unicode=ucs2" \
+ || myconf="${myconf} --enable-unicode=ucs4"
+
+ use nothreads \
+ && myconf="${myconf} --without-threads" \
+ || myconf="${myconf} --with-threads"
+
+ src_configure
+
+ if tc-is-cross-compiler ; then
+ OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
+ ./configure || die "cross-configure failed"
+ emake python Parser/pgen || die "cross-make failed"
+ mv python hostpython
+ mv Parser/pgen Parser/hostpgen
+ make distclean
+ sed -i \
+ -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
+ -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
+ Makefile.pre.in || die
+ fi
+
+ # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
+ tc-export CXX
+
+ # set LDFLAGS so we link modules with -lpython2.5 correctly.
+ # Needed on FreeBSD unless python2.5 is already installed.
+ # Please query BSD team before removing this!
+ append-ldflags "-L."
+
+ econf \
+ --with-fpectl \
+ --enable-shared \
+ `use_enable ipv6` \
+ --infodir='${prefix}'/share/info \
+ --mandir='${prefix}'/share/man \
+ --with-libc='' \
+ ${myconf} || die
+ emake || die "Parallel make failed"
+}
+
+src_install() {
+ dodir /usr
+ src_configure
+ make DESTDIR="${D}" altinstall maninstall || die
+
+ mv ${D}/usr/bin/python${PYVER}-config ${D}/usr/bin/python-config-${PYVER}
+
+ # Fix slotted collisions
+ mv ${D}/usr/bin/pydoc ${D}/usr/bin/pydoc${PYVER}
+ mv ${D}/usr/bin/idle ${D}/usr/bin/idle${PYVER}
+ mv ${D}/usr/share/man/man1/python.1 \
+ ${D}/usr/share/man/man1/python${PYVER}.1
+ rm -f ${D}/usr/bin/smtpd.py
+
+ # While we're working on the config stuff... Let's fix the OPT var
+ # so that it doesn't have any opts listed in it. Prevents the problem
+ # with compiling things with conflicting opts later.
+ dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
+ /usr/$(get_libdir)/python${PYVER}/config/Makefile
+
+ if use build ; then
+ rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
+ else
+ use elibc_uclibc && rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
+ use berkdb || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/bsddb
+ use tk || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/lib-tk
+ fi
+
+ prep_ml_includes usr/include/python${PYVER}
+
+ # The stuff below this line extends from 2.1, and should be deprecated
+ # in 2.3, or possibly can wait till 2.4
+
+ # seems like the build do not install Makefile.pre.in anymore
+ # it probably shouldn't - use DistUtils, people!
+ insinto /usr/$(get_libdir)/python${PYVER}/config
+ doins ${S}/Makefile.pre.in
+
+ if use examples ; then
+ mkdir -p ${D}/usr/share/doc/${P}/examples
+ cp -r ${S}/Tools ${D}/usr/share/doc/${P}/examples
+ fi
+}
+
+pkg_postrm() {
+ local mansuffix=$(ecompress --suffix)
+ python_makesym
+ alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/python-config" \
+ "python-config-[0-9].[0-9]"
+
+ alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
+ "python[0-9].[0-9].1${mansuffix}"
+
+ python_mod_cleanup /usr/lib/python${PYVER}
+ [[ "$(get_libdir)" == "lib" ]] || \
+ python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
+}
+
+pkg_postinst() {
+ local myroot
+ myroot=$(echo $ROOT | sed 's:/$::')
+ local mansuffix=$(ecompress --suffix)
+
+ python_makesym
+ alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/python-config" \
+ "python-config-[0-9].[0-9]"
+
+ alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
+ "python[0-9].[0-9].1${mansuffix}"
+
+ python_mod_optimize
+ python_mod_optimize -x site-packages \
+ -x test ${myroot}/usr/lib/python${PYVER}
+ [[ "$(get_libdir)" == "lib" ]] || \
+ python_mod_optimize -x site-packages \
+ -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
+
+ # workaround possible python-upgrade-breaks-portage situation
+ if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
+ if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
+ einfo "Working around possible python-portage upgrade breakage"
+ mkdir -p ${myroot}/usr/lib/portage/pym
+ cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
+ python_mod_optimize ${myroot}/usr/lib/portage/pym
+ fi
+ fi
+
+ echo
+ ewarn
+ ewarn "If you have just upgraded from an older version of python you will"
+ ewarn "need to run:"
+ ewarn
+ ewarn "/usr/sbin/python-updater"
+ ewarn
+ ewarn "This will automatically rebuild all the python dependent modules"
+ ewarn "to run with python-${PYVER}."
+ ewarn
+ ewarn "Your original Python is still installed and can be accessed via"
+ ewarn "/usr/bin/python2.x."
+ ewarn
+ ebeep 5
+}
+
+src_test() {
+ # Tests won't work when cross compiling
+ if tc-is-cross-compiler ; then
+ elog "Disabling tests due to crosscompiling."
+ return
+ fi
+
+ # PYTHON_DONTCOMPILE=1 breaks test_import
+ unset PYTHON_DONTCOMPILE
+
+ #skip all tests that fail during emerge but pass without emerge:
+ #(See bug# 67970)
+ local skip_tests="distutils global mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
+
+ for test in ${skip_tests} ; do
+ mv ${S}/Lib/test/test_${test}.py ${T}
+ done
+
+ # rerun failed tests in verbose mode (regrtest -w)
+ EXTRATESTOPTS="-w" make test || die "make test failed"
+
+ for test in ${skip_tests} ; do
+ mv ${T}/test_${test}.py ${S}/Lib/test/test_${test}.py
+ done
+
+ elog "Portage skipped the following tests which aren't able to run from emerge:"
+ for test in ${skip_tests} ; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you'd like to run them, you may:"
+ elog "cd /usr/lib/python${PYVER}/test"
+ elog "and run the tests separately."
+}