Gentoo Archives: gentoo-commits

From: "Ali Polatel (hawking)" <hawking@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/python: ChangeLog python-2.4.4-r10.ebuild python-2.3.6-r5.ebuild python-2.5.2.ebuild
Date: Fri, 18 Apr 2008 14:26:29
Message-Id: E1JmrXm-0006Wo-Ec@stork.gentoo.org
1 hawking 08/04/18 14:26:26
2
3 Modified: ChangeLog
4 Added: python-2.4.4-r10.ebuild python-2.3.6-r5.ebuild
5 python-2.5.2.ebuild
6 Log:
7 Version bumps. Updated patchsets to fix buffer overflow in zlib extension
8 (CVE-2008-1721) bug 217221 and unsafe PyString_FromStringAndSize(). Added
9 patch by Mark Peloquin for distutils to respect CXXFLAGS, bug 145206. Add
10 wininst USE flag to conditionally install MS Windows executables, bug 198021.
11 Use EAPI=1, rename nothreads and nocxx USE flags to threads and cxx.
12 (Portage version: 2.1.5_rc4)
13
14 Revision Changes Path
15 1.308 dev-lang/python/ChangeLog
16
17 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.308&view=markup
18 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.308&content-type=text/plain
19 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?r1=1.307&r2=1.308
20
21 Index: ChangeLog
22 ===================================================================
23 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
24 retrieving revision 1.307
25 retrieving revision 1.308
26 diff -u -r1.307 -r1.308
27 --- ChangeLog 11 Mar 2008 16:01:07 -0000 1.307
28 +++ ChangeLog 18 Apr 2008 14:26:25 -0000 1.308
29 @@ -1,6 +1,19 @@
30 # ChangeLog for dev-lang/python
31 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
32 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.307 2008/03/11 16:01:07 corsair Exp $
33 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.308 2008/04/18 14:26:25 hawking Exp $
34 +
35 +*python-2.5.2 (18 Apr 2008)
36 +*python-2.4.4-r10 (18 Apr 2008)
37 +*python-2.3.6-r5 (18 Apr 2008)
38 +
39 + 18 Apr 2008; Ali Polatel <hawking@g.o> +python-2.3.6-r5.ebuild,
40 + +python-2.4.4-r10.ebuild, +python-2.5.2.ebuild:
41 + Version bumps. Updated patchsets to fix buffer overflow in zlib extension
42 + (CVE-2008-1721) bug 217221 and unsafe PyString_FromStringAndSize(). Added
43 + patch by Mark Peloquin for distutils to respect CXXFLAGS, bug 145206. Add
44 + wininst USE flag to conditionally install MS Windows executables, bug
45 + 198021. Use EAPI=1, rename nothreads and nocxx USE flags to threads and
46 + cxx.
47
48 11 Mar 2008; Markus Rothe <corsair@g.o> python-2.4.4-r9.ebuild:
49 Stable on ppc64; bug #211281
50
51
52
53 1.1 dev-lang/python/python-2.4.4-r10.ebuild
54
55 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.4.4-r10.ebuild?rev=1.1&view=markup
56 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.4.4-r10.ebuild?rev=1.1&content-type=text/plain
57
58 Index: python-2.4.4-r10.ebuild
59 ===================================================================
60 # Copyright 1999-2008 Gentoo Foundation
61 # Distributed under the terms of the GNU General Public License v2
62 # $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 $
63
64 # NOTE about python-portage interactions :
65 # - Do not add a pkg_setup() check for a certain version of portage
66 # in dev-lang/python. It _WILL_ stop people installing from
67 # Gentoo 1.4 images.
68
69 EAPI=1
70
71 inherit autotools eutils flag-o-matic python multilib versionator toolchain-funcs alternatives
72
73 # we need this so that we don't depends on python.eclass
74 PYVER_MAJOR=$(get_major_version)
75 PYVER_MINOR=$(get_version_component_range 2)
76 PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
77
78 MY_P="Python-${PV}"
79 S="${WORKDIR}/${MY_P}"
80 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
81 HOMEPAGE="http://www.python.org/"
82 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
83 mirror://gentoo/python-gentoo-patches-${PV}-r6.tar.bz2"
84
85 LICENSE="PSF-2.2"
86 SLOT="2.4"
87 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
88 IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 doc +cxx +threads examples elibc_uclibc wininst"
89
90 # Can't be compiled against db-4.5 Bug #179377
91 DEPEND=">=sys-libs/zlib-1.1.3
92 !dev-python/cjkcodecs
93 !build? (
94 tk? ( >=dev-lang/tk-8.0 )
95 ncurses? ( >=sys-libs/ncurses-5.2 readline? ( >=sys-libs/readline-4.1 ) )
96 berkdb? ( || ( sys-libs/db:4.4 sys-libs/db:4.3 ) )
97 gdbm? ( sys-libs/gdbm )
98 ssl? ( dev-libs/openssl )
99 doc? ( dev-python/python-docs:2.4 )
100 dev-libs/expat
101 )"
102
103 # NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python
104 # provides the functionality expected from previous pythons.
105
106 # NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need
107 # it to compile python. We just need to ensure that when we install
108 # python, we definitely have fchksum support. - liquidx
109
110 # NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
111 # NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico
112
113 RDEPEND="${DEPEND} build? ( !dev-python/python-fchksum !dev-python/pycrypto )"
114 PDEPEND="${DEPEND} !build? ( dev-python/python-fchksum ) app-admin/python-updater"
115
116 PROVIDE="virtual/python"
117
118 src_unpack() {
119 unpack ${A}
120 cd "${S}"
121
122 if tc-is-cross-compiler ; then
123 [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
124 die "Crosscompiling requires the same host and build versions."
125 epatch "${FILESDIR}"/python-2.4.4-test-cross.patch
126 else
127 rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
128 fi
129
130 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
131 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
132 Lib/distutils/command/install.py \
133 Lib/distutils/sysconfig.py \
134 Lib/site.py \
135 Makefile.pre.in \
136 Modules/Setup.dist \
137 Modules/getpath.c \
138 setup.py || die
139
140 # fix os.utime() on hppa. utimes it not supported but unfortunately
141 # reported as working - gmsoft (22 May 04)
142 # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
143 [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
144
145 if ! use wininst; then
146 # remove microsoft windows executables
147 rm Lib/distutils/command/wininst-*.exe
148 fi
149
150 eautoreconf
151 }
152
153 src_configure() {
154 # disable extraneous modules with extra dependencies
155 if use build; then
156 export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter"
157 export PYTHON_DISABLE_SSL=1
158 else
159 # dbm module can link to berkdb or gdbm -- defaults to gdbm when
160 # both are enabled, see #204343
161 use berkdb || use gdbm \
162 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm"
163 use gdbm \
164 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
165 use berkdb \
166 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} bsddb"
167 use readline \
168 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
169 use tk \
170 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
171 use ncurses \
172 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
173 use ssl \
174 || export PYTHON_DISABLE_SSL=1
175 export PYTHON_DISABLE_MODULES
176 echo $PYTHON_DISABLE_MODULES
177 fi
178 }
179
180 src_compile() {
181 filter-flags -malign-double
182
183 # Seems to no longer be necessary
184 #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
185 [ "${ARCH}" = "alpha" ] && append-flags -fPIC
186
187 # http://bugs.gentoo.org/show_bug.cgi?id=50309
188 if is-flag -O3; then
189 is-flag -fstack-protector-all && replace-flags -O3 -O2
190 use hardened && replace-flags -O3 -O2
191 fi
192
193 export OPT="${CFLAGS}"
194
195 local myconf
196 #if we are creating a new build image, we remove the dependency on g++
197 if use build && ! use bootstrap || ! use cxx ; then
198 myconf="--with-cxx=no"
199 fi
200
201 # super-secret switch. don't use this unless you know what you're
202 # doing. enabling UCS2 support will break your existing python
203 # modules
204 use ucs2 \
205 && myconf="${myconf} --enable-unicode=ucs2" \
206 || myconf="${myconf} --enable-unicode=ucs4"
207
208 use threads \
209 && myconf="${myconf} --with-threads" \
210 || myconf="${myconf} --without-threads"
211
212 src_configure
213
214 if tc-is-cross-compiler ; then
215 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
216 ./configure --with-cxx=no || die "cross-configure failed"
217 emake python Parser/pgen || die "cross-make failed"
218 mv python hostpython
219 mv Parser/pgen Parser/hostpgen
220 make distclean
221 sed -i \
222 -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
223 -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
224 Makefile.pre.in || die
225 fi
226
227 # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
228 tc-export CXX
229 # set LINKCC to prevent python from being linked to libstdc++.so
230 export LINKCC="\$(PURIFY) \$(CC)"
231 econf \
232 --with-fpectl \
233 --enable-shared \
234 `use_enable ipv6` \
235 --infodir='${prefix}'/share/info \
236 --mandir='${prefix}'/share/man \
237 --with-libc='' \
238 ${myconf} || die
239 emake || die "Parallel make failed"
240 }
241
242 src_install() {
243 dodir /usr
244 src_configure
245 make DESTDIR="${D}" altinstall maninstall || die
246
247 # install our own custom python-config
248 exeinto /usr/bin
249 newexe "${FILESDIR}"/python-config-${PYVER}-r1 python-config-${PYVER}
250
251 # Use correct libdir in python-config
252 dosed "s:/usr/lib/:/usr/$(get_libdir)/:" /usr/bin/python-config-${PYVER}
253
254 if use build ; then
255 rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
256 else
257 use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
258 use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
259 use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
260 fi
261
262 # Fix slotted collisions
263 mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
264 mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
265 mv "${D}"/usr/share/man/man1/python.1 \
266 "${D}"/usr/share/man/man1/python${PYVER}.1
267 rm -f "${D}"/usr/bin/smtpd.py
268
269 prep_ml_includes usr/include/python${PYVER}
270
271 # The stuff below this line extends from 2.1, and should be deprecated
272 # in 2.3, or possibly can wait till 2.4
273
274 # seems like the build do not install Makefile.pre.in anymore
275 # it probably shouldn't - use DistUtils, people!
276 insinto /usr/$(get_libdir)/python${PYVER}/config
277 doins "${S}"/Makefile.pre.in
278
279 # While we're working on the config stuff... Let's fix the OPT var
280 # so that it doesn't have any opts listed in it. Prevents the problem
281 # with compiling things with conflicting opts later.
282 dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
283 /usr/$(get_libdir)/python${PYVER}/config/Makefile
284
285 if use examples ; then
286 mkdir -p "${D}"/usr/share/doc/${P}/examples
287 cp -r "${S}"/Tools "${D}"/usr/share/doc/${P}/examples
288 fi
289
290 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
291 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
292 }
293
294 pkg_postrm() {
295 local mansuffix=$(ecompress --suffix)
296 python_makesym
297 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
298 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
299 alternatives_auto_makesym "/usr/bin/python-config" \
300 "python-config-[0-9].[0-9]"
301 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
302 "python[0-9].[0-9].1${mansuffix}"
303
304 python_mod_cleanup /usr/lib/python${PYVER}
305 [[ "$(get_libdir)" == "lib" ]] || \
306 python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
307 }
308
309 pkg_postinst() {
310 local myroot
311 myroot=$(echo $ROOT | sed 's:/$::')
312 local mansuffix=$(ecompress --suffix)
313
314 python_makesym
315 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
316 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
317 alternatives_auto_makesym "/usr/bin/python-config" \
318 "python-config-[0-9].[0-9]"
319 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
320 "python[0-9].[0-9].1${mansuffix}"
321
322 python_mod_optimize
323 python_mod_optimize -x site-packages \
324 -x test ${myroot}/usr/lib/python${PYVER}
325 [[ "$(get_libdir)" == "lib" ]] || \
326 python_mod_optimize -x site-packages \
327 -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
328
329 # workaround possible python-upgrade-breaks-portage situation
330 if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
331 if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
332 einfo "Working around possible python-portage upgrade breakage"
333 mkdir -p ${myroot}/usr/lib/portage/pym
334 cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
335 python_mod_optimize ${myroot}/usr/lib/portage/pym
336 fi
337 fi
338
339 echo
340 ewarn
341 ewarn "If you have just upgraded from an older version of python you"
342 ewarn "will need to run:"
343 ewarn
344 ewarn "/usr/sbin/python-updater"
345 ewarn
346 ewarn "This will automatically rebuild all the python dependent modules"
347 ewarn "to run with python-${PYVER}."
348 ewarn
349 ewarn "Your original Python is still installed and can be accessed via"
350 ewarn "/usr/bin/python2.x."
351 ewarn
352 ebeep 5
353 }
354
355 src_test() {
356 # Tests won't work when cross compiling
357 if tc-is-cross-compiler ; then
358 elog "Disabling tests due to crosscompiling."
359 return
360 fi
361
362 # PYTHON_DONTCOMPILE=1 breaks test_import
363 unset PYTHON_DONTCOMPILE
364
365 #skip all tests that fail during emerge but pass without emerge:
366 #(See bug# 67970)
367 local skip_tests="cookielib distutils global hotshot mimetools minidom mmap posix sax strptime subprocess syntax tcl time urllib urllib2"
368
369 for test in ${skip_tests} ; do
370 mv "${S}"/Lib/test/test_${test}.py "${T}"
371 done
372
373 # rerun failed tests in verbose mode (regrtest -w)
374 EXTRATESTOPTS="-w" make test || die "make test failed"
375
376 for test in ${skip_tests} ; do
377 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
378 done
379
380 elog "Portage skipped the following tests which aren't able to run from emerge:"
381 for test in ${skip_tests} ; do
382 elog "test_${test}.py"
383 done
384
385 elog "If you'd like to run them, you may:"
386 elog "cd /usr/lib/python${PYVER}/test"
387 elog "and run the tests separately."
388 }
389
390
391
392 1.1 dev-lang/python/python-2.3.6-r5.ebuild
393
394 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.3.6-r5.ebuild?rev=1.1&view=markup
395 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.3.6-r5.ebuild?rev=1.1&content-type=text/plain
396
397 Index: python-2.3.6-r5.ebuild
398 ===================================================================
399 # Copyright 1999-2008 Gentoo Foundation
400 # Distributed under the terms of the GNU General Public License v2
401 # $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 $
402
403 # NOTE about python-portage interactions :
404 # - Do not add a pkg_setup() check for a certain version of portage
405 # in dev-lang/python. It _WILL_ stop people installing from
406 # Gentoo 1.4 images.
407
408 EAPI=1
409
410 inherit autotools eutils flag-o-matic python versionator
411
412 PYVER_MAJOR=$(get_major_version)
413 PYVER_MINOR=$(get_version_component_range 2)
414 PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
415
416 S="${WORKDIR}/Python-${PV}"
417 DESCRIPTION="A really great language"
418 HOMEPAGE="http://www.python.org/"
419 SRC_URI="http://www.python.org/ftp/python/${PV%_*}/Python-${PV}.tar.bz2
420 mirror://gentoo/python-gentoo-patches-${PV}-r6.tar.bz2"
421
422 LICENSE="PSF-2.2"
423 SLOT="2.3"
424 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
425 IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 doc +cxx +threads examples elibc_uclibc"
426
427 # INFO: 2.3.5 docs are used for python-2.3.6 as upstream writes in their release
428 # notes.
429 DEPEND=">=sys-libs/zlib-1.1.3
430 !build? (
431 tk? ( >=dev-lang/tk-8.0 )
432 ncurses? ( >=sys-libs/ncurses-5.2 readline? ( >=sys-libs/readline-4.1 ) )
433 berkdb? ( sys-libs/db:3 )
434 gdbm? ( sys-libs/gdbm )
435 ssl? ( dev-libs/openssl )
436 doc? ( dev-python/python-docs:2.3 )
437 dev-libs/expat
438 )"
439
440 # NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python
441 # provides the functionality expected from previous pythons.
442
443 # NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need
444 # it to compile python. We just need to ensure that when we install
445 # python, we definitely have fchksum support. - liquidx
446
447 # NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
448
449 PDEPEND="${DEPEND} dev-python/python-fchksum app-admin/python-updater"
450
451 PROVIDE="virtual/python"
452
453 src_unpack() {
454 unpack ${A}
455 cd "${S}"
456
457 sed -ie 's/OpenBSD\/3.\[01234/OpenBSD\/3.\[012345/' configure || die "OpenBSD sed failed"
458
459 # fix os.utime() on hppa. utimes it not supported but unfortunately
460 # reported as working - gmsoft (22 May 04)
461 [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
462
463 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
464 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
465 Lib/distutils/command/install.py \
466 Lib/distutils/sysconfig.py \
467 Lib/site.py \
468 Makefile.pre.in \
469 Modules/Setup.dist \
470 Modules/getpath.c \
471 setup.py || die
472
473 eautoreconf
474 }
475
476 src_configure() {
477 # disable extraneous modules with extra dependencies
478 if use build; then
479 export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter"
480 export PYTHON_DISABLE_SSL=1
481 else
482 # dbm module can link to berkdb or gdbm -- defaults to gdbm when
483 # both are enabled, see #204343
484 use berkdb || use gdbm \
485 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm"
486 use gdbm \
487 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
488 use berkdb \
489 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} bsddb"
490 use readline \
491 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
492 use tk \
493 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
494 use ncurses \
495 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
496 use ssl \
497 || export PYTHON_DISABLE_SSL=1
498 export PYTHON_DISABLE_MODULES
499 echo $PYTHON_DISABLE_MODULES
500 fi
501 }
502
503 src_compile() {
504 filter-flags -malign-double
505 filter-ldflags -Wl,--as-needed --as-needed
506
507 [ "${ARCH}" = "alpha" ] && append-flags -fPIC
508 [ "${ARCH}" = "amd64" ] && append-flags -fPIC
509
510 # http://bugs.gentoo.org/show_bug.cgi?id=50309
511 if is-flag -O3; then
512 is-flag -fstack-protector-all && replace-flags -O3 -O2
513 use hardened && replace-flags -O3 -O2
514 fi
515
516 export OPT="${CFLAGS}"
517
518 local myconf
519 #if we are creating a new build image, we remove the dependency on g++
520 if use build && ! use bootstrap || ! use cxx ; then
521 myconf="--with-cxx=no"
522 fi
523
524 # super-secret switch. don't use this unless you know what you're
525 # doing. enabling UCS2 support will break your existing python
526 # modules
527 use ucs2 \
528 && myconf="${myconf} --enable-unicode=ucs2" \
529 || myconf="${myconf} --enable-unicode=ucs4"
530
531 use threads \
532 && myconf="${myconf} --with-threads" \
533 && myconf="${myconf} --without-threads"
534
535 src_configure
536
537 econf --with-fpectl \
538 --enable-shared \
539 `use_enable ipv6` \
540 --infodir='${prefix}'/share/info \
541 --mandir='${prefix}'/share/man \
542 --with-libc='' \
543 ${myconf} || die
544 emake || die "Parallel make failed"
545 }
546
547 src_install() {
548 dodir /usr
549 src_configure
550 make DESTDIR="${D}" altinstall || die
551
552 # install our own custom python-config
553 exeinto /usr/bin
554 newexe "${FILESDIR}"/python-config-${PYVER} python-config
555
556 # The stuff below this line extends from 2.1, and should be deprecated
557 # in 2.3, or possibly can wait till 2.4
558
559 # seems like the build do not install Makefile.pre.in anymore
560 # it probably shouldn't - use DistUtils, people!
561 insinto /usr/$(get_libdir)/python${PYVER}/config
562 doins "${S}"/Makefile.pre.in
563
564 # While we're working on the config stuff... Let's fix the OPT var
565 # so that it doesn't have any opts listed in it. Prevents the problem
566 # with compiling things with conflicting opts later.
567 dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' /usr/$(get_libdir)/python${PYVER}/config/Makefile
568
569 if use build ; then
570 rm -rf "${D}"/usr/$(get_libdir)/python2.3/{test,encodings,email,lib-tk,bsddb/test}
571 else
572 use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python2.3/{test,bsddb/test}
573 use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python2.3/bsddb
574 use tk || rm -rf "${D}"/usr/$(get_libdir)/python2.3/lib-tk
575 fi
576
577 if use examples ; then
578 mkdir -p "${D}"/usr/share/doc/${P}/examples
579 cp -r "${S}"/Tools "${D}"/usr/share/doc/${P}/examples
580 fi
581 }
582
583 pkg_postrm() {
584 python_makesym
585 python_mod_cleanup /usr/$(get_libdir)/python2.3
586 }
587
588 pkg_postinst() {
589 local myroot
590 myroot=$(echo $ROOT | sed 's:/$::')
591
592 python_makesym
593 python_mod_optimize
594 python_mod_optimize -x site-packages -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
595
596 # workaround possible python-upgrade-breaks-portage situation
597 if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
598 if [ -f ${myroot}/usr/lib/python2.2/site-packages/portage.py ]; then
599 einfo "Working around possible python-portage upgrade breakage"
600 mkdir -p ${myroot}/usr/lib/portage/pym
601 cp ${myroot}/usr/lib/python2.2/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
602 python_mod_optimize ${myroot}/usr/lib/portage/pym
603 fi
604 fi
605
606 echo
607 ewarn
608 ewarn "If you have just upgraded from an older version of python you"
609 ewarn "will need to run:"
610 ewarn
611 ewarn "/usr/sbin/python-updater"
612 ewarn
613 ewarn "This will automatically rebuild all the python dependent modules"
614 ewarn "to run with python-${PYVER}."
615 ewarn
616 ewarn "Your original Python is still installed and can be accessed via"
617 ewarn "/usr/bin/python2.x."
618 ewarn
619 ebeep 5
620 }
621
622 src_test() {
623 # PYTHON_DONTCOMPILE=1 breaks test_import
624 unset PYTHON_DONTCOMPILE
625
626 #skip all tests that fail during emerge but pass without emerge:
627 #(See bug# 67970)
628 local skip_tests="global mimetools mmap strptime subprocess tcl time urllib urllib2 zipimport"
629
630 for test in ${skip_tests} ; do
631 mv "${S}"/Lib/test/test_${test}.py "${T}"
632 done
633
634 make test || die "make test failed"
635
636 for test in ${skip_tests} ; do
637 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
638 done
639
640 elog "Portage skipped the following tests which aren't able to run from emerge:"
641 for test in ${skip_tests} ; do
642 elog "test_${test}.py"
643 done
644
645 elog "If you'd like to run them, you may:"
646 elog "cd /usr/lib/python${PYVER}/test"
647 elog "and run the tests separately."
648 }
649
650
651
652 1.1 dev-lang/python/python-2.5.2.ebuild
653
654 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.5.2.ebuild?rev=1.1&view=markup
655 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.5.2.ebuild?rev=1.1&content-type=text/plain
656
657 Index: python-2.5.2.ebuild
658 ===================================================================
659 # Copyright 1999-2008 Gentoo Foundation
660 # Distributed under the terms of the GNU General Public License v2
661 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.2.ebuild,v 1.1 2008/04/18 14:26:25 hawking Exp $
662
663 # NOTE about python-portage interactions :
664 # - Do not add a pkg_setup() check for a certain version of portage
665 # in dev-lang/python. It _WILL_ stop people installing from
666 # Gentoo 1.4 images.
667
668 EAPI=1
669
670 inherit eutils autotools flag-o-matic python multilib versionator toolchain-funcs alternatives libtool
671
672 # we need this so that we don't depends on python.eclass
673 PYVER_MAJOR=$(get_major_version)
674 PYVER_MINOR=$(get_version_component_range 2)
675 PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
676
677 MY_P="Python-${PV}"
678 S="${WORKDIR}/${MY_P}"
679
680 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
681 HOMEPAGE="http://www.python.org/"
682 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
683 mirror://gentoo/python-gentoo-patches-${PV}.tar.bz2"
684
685 LICENSE="PSF-2.2"
686 SLOT="2.5"
687 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
688 IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 sqlite doc +threads examples elibc_uclibc wininst"
689
690 # NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs}
691 # do not conflict with the ones in python proper. - liquidx
692
693 DEPEND=">=sys-libs/zlib-1.1.3
694 !build? (
695 sqlite? ( >=dev-db/sqlite-3 )
696 tk? ( >=dev-lang/tk-8.0 )
697 ncurses? ( >=sys-libs/ncurses-5.2
698 readline? ( >=sys-libs/readline-4.1 ) )
699 berkdb? ( >=sys-libs/db-3.1 )
700 gdbm? ( sys-libs/gdbm )
701 ssl? ( dev-libs/openssl )
702 doc? ( dev-python/python-docs:2.5 )
703 dev-libs/expat
704 )"
705
706 # NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python
707 # provides the functionality expected from previous pythons.
708
709 # NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need
710 # it to compile python. We just need to ensure that when we install
711 # python, we definitely have fchksum support. - liquidx
712
713 # NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
714 # NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico
715
716 RDEPEND="${DEPEND} build? ( !dev-python/python-fchksum )"
717 PDEPEND="${DEPEND} !build? ( dev-python/python-fchksum ) app-admin/python-updater"
718 PROVIDE="virtual/python"
719
720 src_unpack() {
721 unpack ${A}
722 cd "${S}"
723
724 if tc-is-cross-compiler ; then
725 [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
726 die "Crosscompiling requires the same host and build versions."
727 epatch "${FILESDIR}"/python-2.4.4-test-cross.patch
728 else
729 rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
730 fi
731
732 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
733 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
734 Lib/distutils/command/install.py \
735 Lib/distutils/sysconfig.py \
736 Lib/site.py \
737 Makefile.pre.in \
738 Modules/Setup.dist \
739 Modules/getpath.c \
740 setup.py || die
741
742 # fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04)
743 # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
744 [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
745
746 if ! use wininst; then
747 # remove microsoft windows executables
748 rm Lib/distutils/command/wininst-*.exe
749 fi
750
751 eautoreconf
752 }
753
754 src_configure() {
755 # disable extraneous modules with extra dependencies
756 if use build; then
757 export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3"
758 export PYTHON_DISABLE_SSL=1
759 else
760 # dbm module can link to berkdb or gdbm -- defaults to gdbm when
761 # both are enabled, see #204343
762 use berkdb || use gdbm \
763 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm"
764 use gdbm \
765 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
766 use berkdb \
767 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} bsddb"
768 use readline \
769 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
770 use tk \
771 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
772 use ncurses \
773 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
774 use sqlite \
775 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _sqlite3"
776 use ssl \
777 || export PYTHON_DISABLE_SSL=1
778 export PYTHON_DISABLE_MODULES
779 echo $PYTHON_DISABLE_MODULES
780 fi
781 }
782
783 src_compile() {
784 filter-flags -malign-double
785
786 # Seems to no longer be necessary
787 #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
788 [ "${ARCH}" = "alpha" ] && append-flags -fPIC
789
790 # http://bugs.gentoo.org/show_bug.cgi?id=50309
791 if is-flag -O3; then
792 is-flag -fstack-protector-all && replace-flags -O3 -O2
793 use hardened && replace-flags -O3 -O2
794 fi
795
796 export OPT="${CFLAGS}"
797
798 local myconf
799
800 # super-secret switch. don't use this unless you know what you're
801 # doing. enabling UCS2 support will break your existing python
802 # modules
803 use ucs2 \
804 && myconf="${myconf} --enable-unicode=ucs2" \
805 || myconf="${myconf} --enable-unicode=ucs4"
806
807 use threads \
808 && myconf="${myconf} --with-threads" \
809 || myconf="${myconf} --without-threads"
810
811 src_configure
812
813 if tc-is-cross-compiler ; then
814 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
815 ./configure || die "cross-configure failed"
816 emake python Parser/pgen || die "cross-make failed"
817 mv python hostpython
818 mv Parser/pgen Parser/hostpgen
819 make distclean
820 sed -i \
821 -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
822 -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
823 Makefile.pre.in || die
824 fi
825
826 # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
827 tc-export CXX
828
829 # set LDFLAGS so we link modules with -lpython2.5 correctly.
830 # Needed on FreeBSD unless python2.5 is already installed.
831 # Please query BSD team before removing this!
832 append-ldflags "-L."
833
834 econf \
835 --with-fpectl \
836 --enable-shared \
837 `use_enable ipv6` \
838 --infodir='${prefix}'/share/info \
839 --mandir='${prefix}'/share/man \
840 --with-libc='' \
841 ${myconf} || die
842 emake || die "Parallel make failed"
843 }
844
845 src_install() {
846 dodir /usr
847 src_configure
848 make DESTDIR="${D}" altinstall maninstall || die
849
850 mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER}
851
852 # Fix slotted collisions
853 mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
854 mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
855 mv "${D}"/usr/share/man/man1/python.1 \
856 "${D}"/usr/share/man/man1/python${PYVER}.1
857 rm -f "${D}"/usr/bin/smtpd.py
858
859 # While we're working on the config stuff... Let's fix the OPT var
860 # so that it doesn't have any opts listed in it. Prevents the problem
861 # with compiling things with conflicting opts later.
862 dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
863 /usr/$(get_libdir)/python${PYVER}/config/Makefile
864
865 if use build ; then
866 rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
867 else
868 use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
869 use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
870 use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
871 fi
872
873 prep_ml_includes usr/include/python${PYVER}
874
875 # The stuff below this line extends from 2.1, and should be deprecated
876 # in 2.3, or possibly can wait till 2.4
877
878 # seems like the build do not install Makefile.pre.in anymore
879 # it probably shouldn't - use DistUtils, people!
880 insinto /usr/$(get_libdir)/python${PYVER}/config
881 doins "${S}"/Makefile.pre.in
882
883 if use examples ; then
884 mkdir -p "${D}"/usr/share/doc/${P}/examples
885 cp -r "${S}"/Tools "${D}"/usr/share/doc/${P}/examples
886 fi
887
888 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
889 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
890 }
891
892 pkg_postrm() {
893 local mansuffix=$(ecompress --suffix)
894 python_makesym
895 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
896 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
897 alternatives_auto_makesym "/usr/bin/python-config" \
898 "python-config-[0-9].[0-9]"
899
900 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
901 "python[0-9].[0-9].1${mansuffix}"
902
903 python_mod_cleanup /usr/lib/python${PYVER}
904 [[ "$(get_libdir)" == "lib" ]] || \
905 python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
906 }
907
908 pkg_postinst() {
909 local myroot
910 myroot=$(echo $ROOT | sed 's:/$::')
911 local mansuffix=$(ecompress --suffix)
912
913 python_makesym
914 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
915 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
916 alternatives_auto_makesym "/usr/bin/python-config" \
917 "python-config-[0-9].[0-9]"
918
919 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
920 "python[0-9].[0-9].1${mansuffix}"
921
922 python_mod_optimize
923 python_mod_optimize -x site-packages \
924 -x test ${myroot}/usr/lib/python${PYVER}
925 [[ "$(get_libdir)" == "lib" ]] || \
926 python_mod_optimize -x site-packages \
927 -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
928
929 # workaround possible python-upgrade-breaks-portage situation
930 if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
931 if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
932 einfo "Working around possible python-portage upgrade breakage"
933 mkdir -p ${myroot}/usr/lib/portage/pym
934 cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
935 python_mod_optimize ${myroot}/usr/lib/portage/pym
936 fi
937 fi
938
939 echo
940 ewarn
941 ewarn "If you have just upgraded from an older version of python you will"
942 ewarn "need to run:"
943 ewarn
944 ewarn "/usr/sbin/python-updater"
945 ewarn
946 ewarn "This will automatically rebuild all the python dependent modules"
947 ewarn "to run with python-${PYVER}."
948 ewarn
949 ewarn "Your original Python is still installed and can be accessed via"
950 ewarn "/usr/bin/python2.x."
951 ewarn
952 ebeep 5
953 }
954
955 src_test() {
956 # Tests won't work when cross compiling
957 if tc-is-cross-compiler ; then
958 elog "Disabling tests due to crosscompiling."
959 return
960 fi
961
962 # PYTHON_DONTCOMPILE=1 breaks test_import
963 unset PYTHON_DONTCOMPILE
964
965 #skip all tests that fail during emerge but pass without emerge:
966 #(See bug# 67970)
967 local skip_tests="distutils global mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
968
969 for test in ${skip_tests} ; do
970 mv "${S}"/Lib/test/test_${test}.py "${T}"
971 done
972
973 # rerun failed tests in verbose mode (regrtest -w)
974 EXTRATESTOPTS="-w" make test || die "make test failed"
975
976 for test in ${skip_tests} ; do
977 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
978 done
979
980 elog "Portage skipped the following tests which aren't able to run from emerge:"
981 for test in ${skip_tests} ; do
982 elog "test_${test}.py"
983 done
984
985 elog "If you'd like to run them, you may:"
986 elog "cd /usr/lib/python${PYVER}/test"
987 elog "and run the tests separately."
988 }
989
990
991
992 --
993 gentoo-commits@l.g.o mailing list