summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Polatel <hawking@gentoo.org>2008-04-18 14:26:25 +0000
committerAli Polatel <hawking@gentoo.org>2008-04-18 14:26:25 +0000
commit48546446cebf75237a6e5d26b5b8d14411e5091c (patch)
tree5bb1a0e57cdb22864a1b10c85b991b339f524a75 /dev-lang
parentTEXTRELs are back and filter-flags isn't needed anymore according to bug #200... (diff)
downloadhistorical-48546446cebf75237a6e5d26b5b8d14411e5091c.tar.gz
historical-48546446cebf75237a6e5d26b5b8d14411e5091c.tar.bz2
historical-48546446cebf75237a6e5d26b5b8d14411e5091c.zip
Version bumps. Updated patchsets to fix buffer overflow in zlib extension
(CVE-2008-1721) bug 217221 and unsafe PyString_FromStringAndSize(). Added patch by Mark Peloquin for distutils to respect CXXFLAGS, bug 145206. Add wininst USE flag to conditionally install MS Windows executables, bug 198021. Use EAPI=1, rename nothreads and nocxx USE flags to threads and cxx. Package-Manager: portage-2.1.5_rc4
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/python/ChangeLog15
-rw-r--r--dev-lang/python/Manifest19
-rw-r--r--dev-lang/python/python-2.3.6-r5.ebuild250
-rw-r--r--dev-lang/python/python-2.4.4-r10.ebuild329
-rw-r--r--dev-lang/python/python-2.5.2.ebuild330
5 files changed, 941 insertions, 2 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog
index 629ebc7f216d..9dc4e5083025 100644
--- a/dev-lang/python/ChangeLog
+++ b/dev-lang/python/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for dev-lang/python
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.307 2008/03/11 16:01:07 corsair Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.308 2008/04/18 14:26:25 hawking Exp $
+
+*python-2.5.2 (18 Apr 2008)
+*python-2.4.4-r10 (18 Apr 2008)
+*python-2.3.6-r5 (18 Apr 2008)
+
+ 18 Apr 2008; Ali Polatel <hawking@gentoo.org> +python-2.3.6-r5.ebuild,
+ +python-2.4.4-r10.ebuild, +python-2.5.2.ebuild:
+ Version bumps. Updated patchsets to fix buffer overflow in zlib extension
+ (CVE-2008-1721) bug 217221 and unsafe PyString_FromStringAndSize(). Added
+ patch by Mark Peloquin for distutils to respect CXXFLAGS, bug 145206. Add
+ wininst USE flag to conditionally install MS Windows executables, bug
+ 198021. Use EAPI=1, rename nothreads and nocxx USE flags to threads and
+ cxx.
11 Mar 2008; Markus Rothe <corsair@gentoo.org> python-2.4.4-r9.ebuild:
Stable on ppc64; bug #211281
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 0c877ae69901..682ee828e5ef 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,3 +1,6 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
AUX depreorder-topsort.py 1958 RMD160 4192ad9ed14064a9da42ce1faedcf28996094da3 SHA1 2c900abeb6cfcc4327f0e9418b5abd7761ce5879 SHA256 7406f639d17b8acab6a1db7e398e74379b44950d4821bc36901abd3455d63b3d
AUX depreorder.py 2235 RMD160 a6da5f336bdf8c370861c7922a5fa79ce4ab89cb SHA1 3b8590d7fbece2367088c646a792a9618d786dec SHA256 93920120e596f34e4222e8686e6283b03cdd517f89f2dba3eda90d79fa016aba
AUX pydoc.conf 234 RMD160 33e7decd0ca9a9c4a9f94ef9773f7e9c1668b9fb SHA1 fcfc1a47952dd424f4a1187ef8a6ae9ff8d460c8 SHA256 ded00287fe0ab41e02e3dd52b1818aeea669fc3d94d179cda677c064f47b1098
@@ -15,25 +18,31 @@ DIST Python-2.3.5.tar.bz2 7230000 RMD160 2b1fa90393f517fe02d546c037996754f65f8c8
DIST Python-2.3.6.tar.bz2 7350182 RMD160 db7a2ebff31e86bc99d45062fc77e4194399cc8d SHA1 11ae8960fb4a5a57be0f57bdc86d901fedc92f66 SHA256 120b6babcc29dfd0ba31ad1b1db587fbceee9705a569727c80d18292ba675da4
DIST Python-2.4.4.tar.bz2 8158073 RMD160 4c7b5b70178fe69881b62201ef0bab55037d8708 SHA1 9e0971f93df8acbd947378d0d16a32fcc8897ba2 SHA256 325fdc7351a08bd8d811e7fb53c41bff11764648ab1a671abd910afec946b38a
DIST Python-2.5.1.tar.bz2 9383651 RMD160 af0e8ed93bbc07015c338ae19bbee8811da21c1c SHA1 993a66bd2dabb0c4f33ca98372576315ef113df6 SHA256 d0b5d4dce02c56d2eb0728db3ebd63afc3dae906d158be6532ae4480d311e167
+DIST Python-2.5.2.tar.bz2 9807597 RMD160 b23b02739833e6730799c5866e2b77aae884b63f SHA1 4755d212f50af704c20224a6966e23acc5aea60f SHA256 f2f80e2a62a039e9a1ffa0fdf58707b2d12b3ff33c56472b46bb6d53f45e083e
DIST python-gentoo-patches-2.3.5-r1.tar.bz2 9239 RMD160 0afe928728c2cb5c306bff261e2fbe485a554c71 SHA1 1bfc2b79fe69bed59705b5c734fe8c4af264bf7e SHA256 35e1139aa91f0ac026017928df71b21da68d8470278852e700f0b32d6c638dbf
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 61b9f9b7f16e0d17db1a135dc3a0e9c12ceb6534 SHA1 714159683adb86e0b8cb9c16073e9bdfc399ea60 SHA256 96a235e7e23b4b2767b001738fbf66f31f16ebf5e106c18aa636857e62f1585c
DIST python-gentoo-patches-2.3.6-r5.tar.bz2 11499 RMD160 18fca1caff4d0deac088bf9972a0aa8444ba2591 SHA1 0d0c6cdf2ffb0f378491578f28eb3d22bbc9fa64 SHA256 ca95763a170224e8de34471905330e0aaeb86fc9022b8ee8913313bd775dab17
+DIST python-gentoo-patches-2.3.6-r6.tar.bz2 12189 RMD160 f96d5ef5e10504d4c49b61d80eb420a32a1bf0cd SHA1 a36178ea41534f11c8296436cffeed3fbdad4976 SHA256 9819c20571b04f62656042b2ec27548e40dc0bf848983fc791a207be4f46bace
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.4.4-r5.tar.bz2 10105 RMD160 2489fc0fb709f862fc56d9dc17c2ba03ebd426da SHA1 0e5391fc434fbaa759964c263c2d32af81af0100 SHA256 147b74697c73788f192fea7b8034a99367a2ffc0c5cf6536a5fe5e76b8624a99
+DIST python-gentoo-patches-2.4.4-r6.tar.bz2 11830 RMD160 ee14e2b8beea7d383cf7531ae487830c41e88802 SHA1 c3efbe6687c1704dad82411448374ec7ec31759d SHA256 b475055703efebbfcf99df08d372a4d2155639c0d900dd1a0f420045705362ef
DIST python-gentoo-patches-2.5.1-r1.tar.bz2 6701 RMD160 7c2ad1de35a1ff73b703ef8ffe4d42b4151082ab SHA1 444b5580ad334a507603363ecac2f8a61b9b48e8 SHA256 e721bdb30cee9cd0bebfab604821d94111dc6a00276b486b39016aa8984c7c78
DIST python-gentoo-patches-2.5.1-r2.tar.bz2 7277 RMD160 c919653b71c3a46d4d41b02afe6c2caa634c975d SHA1 f430f021f5cf9ba81e3f22d4e9344f2d757fb6b8 SHA256 3946c52dae8321ac06d12b7da26b4d5cf34e972b00c28289ead51fc8af8313d1
DIST python-gentoo-patches-2.5.1-r3.tar.bz2 9597 RMD160 02f26d19e6bab99c41ef2a293f081e90bb653e5a SHA1 8d1a6fe57d61f96c9ae737ab61bb2cc23e330431 SHA256 ce3d085f3948169b28b00b9a5dfa7719bcac9cc2974a50110db9843ce1cbd360
DIST python-gentoo-patches-2.5.1.tar.bz2 5430 RMD160 7cdfb51c00a49ebb9027228691e10b8c4c3f574f SHA1 435bb50e342555fc6fac79d72a22a88b592a3627 SHA256 065f31d46c3b57d99b1c3236bbaf445ca142fda33c9ef13e7e2e39be3d027499
+DIST python-gentoo-patches-2.5.2.tar.bz2 11182 RMD160 0278302a5c260f4c90e87577ce3d49a41947bbe6 SHA1 a24be6cfd7daa12a7f02a079d0e5223564dc9f10 SHA256 304c86d3494efb1c91dbe1c86240c9b98bfe9e1d28fc3bd41d8e61c4c740f2b0
EBUILD python-2.3.5-r2.ebuild 8034 RMD160 b805698e84278ee285bf32a6e5a7da5f92a851c6 SHA1 121aa7cff6ddbbc1dcce1cda420bf6463cdadbe6 SHA256 048e89c2c9f22909f5a4660f532c0faefa919725d6f20a8a8d0f1fdda17643e6
EBUILD python-2.3.5-r3.ebuild 8090 RMD160 474dc660351fc0ae3e3d435701fbbf91752da6d8 SHA1 233d3200d1ac110b47be305bcc3c131989d39f10 SHA256 37adb2dfff70552834c211e1c1cdfa8e2f052356c0a445b4a8b101a3c25c44d9
EBUILD python-2.3.6-r2.ebuild 7595 RMD160 09764fe1d81a33a72ab4663b4229cf5018e1344e SHA1 89803c1e2a4126fd78ecb43c1cda7889156e8b09 SHA256 4b4773ab4324e66905ac21632cebdac9e41da14dc58617b2e7eb782849dcc739
EBUILD python-2.3.6-r3.ebuild 7589 RMD160 abae838531d061431a0b1514572a66ee40e05a0d SHA1 e6efd4253478467bff31a78540f54bfea48b5497 SHA256 071766d47f37a0fddae939d51fe9f897d9852eb0ef734842f1c9bf5c278c3bb8
EBUILD python-2.3.6-r4.ebuild 7806 RMD160 c32fb2947a0fe4b09525ef55511278f4555c0225 SHA1 5c2b824716418392e81a84fbb768050e7bba4d39 SHA256 46006fc51e4c3b157a772d9fbaea3d1aba61123ea9be812c735c3a923f09569a
+EBUILD python-2.3.6-r5.ebuild 7812 RMD160 ccc88d82db7480bf4a719939af8db769ae5a288c SHA1 303e76ac22a8f747573637775c807432ce4d7b37 SHA256 ed62b24b3de47047360ed645d108b843cfe43642f2e01b432d09bca068e9754a
EBUILD python-2.3.6.ebuild 8136 RMD160 bd837f52252064bcc7735ac3ec709bdd24612e5e SHA1 2003e5c73d20097ea832e393296fd653937dff77 SHA256 c8ce9d36c468b7563f818e7bbd647fe7aab4690b92ed70137a68a05645b765e1
+EBUILD python-2.4.4-r10.ebuild 10863 RMD160 d907addade90520f71f3ae35fb48803a62b18d61 SHA1 d34bb9e8dbdc00de3e1150c26d2b63a2b19934fe SHA256 3e1c3abb50ed99a50217f552648329d41511258891403a73ef659f640f8d84dc
EBUILD python-2.4.4-r4.ebuild 10305 RMD160 2331d5fbb91da4bac0e10198d8f289120dfe6b06 SHA1 3d561b593be46dd8ff97b4aae315dfafb019c4c2 SHA256 e57f7511635851cada83d0361d4086ed713a2fbb3588b11596c2d8b4a793b748
EBUILD python-2.4.4-r5.ebuild 10332 RMD160 b0a00a167b1385aa4b9472e6fa8245aee01a5ea2 SHA1 78e4b6a8c15096ecb2937afdf33ddeb39752b167 SHA256 3793991c00fbc7f240570c9478b1bf7cbfa4a86a69ab2cda35af18d63ec888e4
EBUILD python-2.4.4-r6.ebuild 10379 RMD160 23414e397b35039af912849f6a366c16ed092390 SHA1 b1ba0c7cf6d9e2533865b9ee610b324bafbe2aed SHA256 027565f6f2fbf90d38fdc5dc240ebae8e7cba8f44d8307df8c05c0f1b4f70d36
@@ -44,5 +53,13 @@ EBUILD python-2.5.1-r2.ebuild 10346 RMD160 e04f22c557c3fcb8e79955d39dda26a25e03f
EBUILD python-2.5.1-r3.ebuild 10348 RMD160 b312c9bbd10510721543d51cb9281dc2033845e7 SHA1 569b85a020bade1e35b849802aeeada337c63eee SHA256 6d281ff6cc64c1ccc861be3b6fae6be94c300a23827d7d4e30d91b71fc23dd11
EBUILD python-2.5.1-r4.ebuild 10476 RMD160 1d74c53b21eb8242659bcf9d528e35401c303ed3 SHA1 a85d737e73d0bd177f69d6871c6d31d276584bc0 SHA256 dedc062353e2c359a3024410f1f86643f405a66bb27da626149bafdd1742c06a
EBUILD python-2.5.1-r5.ebuild 10761 RMD160 3f1c21c341b40e6142e5f7958a57982c8f889e94 SHA1 f1d1b1db5131db9182a4719d8d26c40a0318a758 SHA256 d20e2107016a0680d21632bb886f46b5b4868d8032fe25d3ff99dfbbfc36e8ab
-MISC ChangeLog 52533 RMD160 290980dbebb038f91ed4e727656cdb00a6a0299b SHA1 93371ce6a791c170a029c040b24a70ad5bcb0f2d SHA256 a91d1593654d42272d7e1cb8c5f95b457391c970b12b1626d2a110cc7d205b87
+EBUILD python-2.5.2.ebuild 10793 RMD160 cebb108ad0154f6c6d685e2b541e0a8ac1981ac1 SHA1 0a5ee65558965de709d09bda379ca093ca05afd6 SHA256 592f2f50e6499d437694ff906cd260209bed42df3efe6b551fddc8aa9969ef51
+MISC ChangeLog 53130 RMD160 a4de2932edb7432fea683574cc4e61be64813632 SHA1 4cc278f6a6d5abd415d40a5d94c2a7544e18e754 SHA256 732f3720fdb04004f09e1bf9166f14696f5b1b5832d60e29a8777f3ac6b10f2d
MISC metadata.xml 159 RMD160 900a8c55d7a7d2f6312594769aaf941bf9e99c7f SHA1 c8e604d56dae898258b5254d78cfeac0b981e288 SHA256 9f01104d3484792496faff4805eed0ecea2352a897151f3397d49a13800037b4
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.9 (GNU/Linux)
+
+iEYEARECAAYFAkgIr5cACgkQQU4yORhF8iCOMwCeIabzWyyF2Z3UdmELmAPp5c8l
+4yYAn0mr+5reQVArGRM3IEbVt7GHKyNH
+=G63z
+-----END PGP SIGNATURE-----
diff --git a/dev-lang/python/python-2.3.6-r5.ebuild b/dev-lang/python/python-2.3.6-r5.ebuild
new file mode 100644
index 000000000000..0ace3b89891e
--- /dev/null
+++ b/dev-lang/python/python-2.3.6-r5.ebuild
@@ -0,0 +1,250 @@
+# Copyright 1999-2008 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-r5.ebuild,v 1.1 2008/04/18 14:26:25 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.
+
+EAPI=1
+
+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}-r6.tar.bz2"
+
+LICENSE="PSF-2.2"
+SLOT="2.3"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 doc +cxx +threads examples elibc_uclibc"
+
+# 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 )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ doc? ( dev-python/python-docs:2.3 )
+ 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
+ # dbm module can link to berkdb or gdbm -- defaults to gdbm when
+ # both are enabled, see #204343
+ use berkdb || use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm"
+ use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
+ use berkdb \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} 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 cxx ; 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 threads \
+ && myconf="${myconf} --with-threads" \
+ && myconf="${myconf} --without-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-r10.ebuild b/dev-lang/python/python-2.4.4-r10.ebuild
new file mode 100644
index 000000000000..322011d462fb
--- /dev/null
+++ b/dev-lang/python/python-2.4.4-r10.ebuild
@@ -0,0 +1,329 @@
+# Copyright 1999-2008 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-r10.ebuild,v 1.1 2008/04/18 14:26:25 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.
+
+EAPI=1
+
+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
+ mirror://gentoo/python-gentoo-patches-${PV}-r6.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 +cxx +threads examples elibc_uclibc wininst"
+
+# Can't be compiled against db-4.5 Bug #179377
+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:4.4 sys-libs/db:4.3 ) )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ doc? ( dev-python/python-docs:2.4 )
+ 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
+
+ if ! use wininst; then
+ # remove microsoft windows executables
+ rm Lib/distutils/command/wininst-*.exe
+ fi
+
+ 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
+ # dbm module can link to berkdb or gdbm -- defaults to gdbm when
+ # both are enabled, see #204343
+ use berkdb || use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm"
+ use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
+ use berkdb \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} 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 cxx ; 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 threads \
+ && myconf="${myconf} --with-threads" \
+ || myconf="${myconf} --without-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
+
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
+}
+
+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.2.ebuild b/dev-lang/python/python-2.5.2.ebuild
new file mode 100644
index 000000000000..ad511cf92c93
--- /dev/null
+++ b/dev-lang/python/python-2.5.2.ebuild
@@ -0,0 +1,330 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.2.ebuild,v 1.1 2008/04/18 14:26:25 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.
+
+EAPI=1
+
+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}.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 +threads examples elibc_uclibc wininst"
+
+# 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:2.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
+# 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}"
+
+ 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
+
+ if ! use wininst; then
+ # remove microsoft windows executables
+ rm Lib/distutils/command/wininst-*.exe
+ fi
+
+ 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
+ # dbm module can link to berkdb or gdbm -- defaults to gdbm when
+ # both are enabled, see #204343
+ use berkdb || use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm"
+ use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
+ use berkdb \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} 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 threads \
+ && myconf="${myconf} --with-threads" \
+ || myconf="${myconf} --without-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
+
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
+}
+
+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."
+}