Gentoo Archives: gentoo-commits

From: "Mike Gilbert (floppym)" <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/python: python-2.6.9.ebuild ChangeLog
Date: Wed, 25 Dec 2013 02:57:50
Message-Id: 20131225025745.14AAE2004E@flycatcher.gentoo.org
1 floppym 13/12/25 02:57:44
2
3 Modified: ChangeLog
4 Added: python-2.6.9.ebuild
5 Log:
6 Bump for security bug 495224.
7
8 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
9
10 Revision Changes Path
11 1.722 dev-lang/python/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.722&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.722&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?r1=1.721&r2=1.722
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
20 retrieving revision 1.721
21 retrieving revision 1.722
22 diff -u -r1.721 -r1.722
23 --- ChangeLog 15 Dec 2013 08:53:43 -0000 1.721
24 +++ ChangeLog 25 Dec 2013 02:57:44 -0000 1.722
25 @@ -1,6 +1,11 @@
26 # ChangeLog for dev-lang/python
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.721 2013/12/15 08:53:43 ago Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.722 2013/12/25 02:57:44 floppym Exp $
30 +
31 +*python-2.6.9 (25 Dec 2013)
32 +
33 + 25 Dec 2013; Mike Gilbert <floppym@g.o> +python-2.6.9.ebuild:
34 + Bump for security bug 495224.
35
36 15 Dec 2013; Agostino Sarubbo <ago@g.o> python-3.3.2-r2.ebuild:
37 Stable for sparc, wrt bug #474128
38
39
40
41 1.1 dev-lang/python/python-2.6.9.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.6.9.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.6.9.ebuild?rev=1.1&content-type=text/plain
45
46 Index: python-2.6.9.ebuild
47 ===================================================================
48 # Copyright 1999-2013 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.9.ebuild,v 1.1 2013/12/25 02:57:44 floppym Exp $
51
52 EAPI="2"
53 WANT_AUTOMAKE="none"
54 WANT_LIBTOOL="none"
55
56 inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
57
58 MY_P="Python-${PV}"
59 PATCHSET_REVISION="0"
60
61 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
62 HOMEPAGE="http://www.python.org/"
63 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tgz
64 mirror://gentoo/python-gentoo-patches-2.6.8-${PATCHSET_REVISION}.tar.bz2"
65
66 LICENSE="PSF-2"
67 SLOT="2.6"
68 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
69 IUSE="-berkdb build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
70
71 # Do not add a dependency on dev-lang/python to this ebuild.
72 # If you need to apply a patch which requires python for bootstrapping, please
73 # run the bootstrap code on your dev box and include the results in the
74 # patchset. See bug 447752.
75
76 RDEPEND="app-arch/bzip2
77 >=sys-libs/zlib-1.1.3
78 virtual/libffi
79 virtual/libintl
80 !build? (
81 berkdb? ( || (
82 sys-libs/db:4.7
83 sys-libs/db:4.6
84 sys-libs/db:4.5
85 sys-libs/db:4.4
86 sys-libs/db:4.3
87 sys-libs/db:4.2
88 ) )
89 gdbm? ( sys-libs/gdbm[berkdb] )
90 ncurses? (
91 >=sys-libs/ncurses-5.2
92 readline? ( >=sys-libs/readline-4.1 )
93 )
94 sqlite? ( >=dev-db/sqlite-3.3.3:3 )
95 ssl? ( dev-libs/openssl )
96 tk? (
97 >=dev-lang/tk-8.0
98 dev-tcltk/blt
99 )
100 xml? ( >=dev-libs/expat-2.1 )
101 )
102 !!<sys-apps/portage-2.1.9"
103 DEPEND="${RDEPEND}
104 virtual/pkgconfig
105 >=sys-devel/autoconf-2.61
106 !sys-devel/gcc[libffi]"
107 RDEPEND+=" !build? ( app-misc/mime-types )
108 doc? ( dev-python/python-docs:${SLOT} )"
109 PDEPEND="app-admin/eselect-python
110 app-admin/python-updater"
111
112 S="${WORKDIR}/${MY_P}"
113
114 pkg_setup() {
115 if use berkdb; then
116 ewarn "'bsddb' module is out-of-date and no longer maintained inside"
117 ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
118 ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
119 ewarn "is provided by dev-python/bsddb3."
120 else
121 if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
122 ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
123 ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
124 ewarn "You might need to migrate your databases."
125 fi
126 fi
127 }
128
129 src_prepare() {
130 # Ensure that internal copies of expat, libffi and zlib are not used.
131 rm -fr Modules/expat
132 rm -fr Modules/_ctypes/libffi*
133 rm -fr Modules/zlib
134
135 local excluded_patches
136 if ! tc-is-cross-compiler; then
137 excluded_patches="*_all_crosscompile.patch"
138 fi
139
140 EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
141 epatch "${WORKDIR}/2.6.8-${PATCHSET_REVISION}"
142
143 epatch "${FILESDIR}/python-2.5-tcl86.patch"
144
145 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
146 Lib/distutils/command/install.py \
147 Lib/distutils/sysconfig.py \
148 Lib/site.py \
149 Makefile.pre.in \
150 Modules/Setup.dist \
151 Modules/getpath.c \
152 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
153
154 epatch_user
155
156 eautoconf
157 eautoheader
158 }
159
160 src_configure() {
161 if use build; then
162 # Disable extraneous modules with extra dependencies.
163 export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
164 export PYTHON_DISABLE_SSL="1"
165 else
166 # dbm module can be linked against berkdb or gdbm.
167 # Defaults to gdbm when both are enabled, #204343.
168 local disable
169 use berkdb || use gdbm || disable+=" dbm"
170 use berkdb || disable+=" _bsddb"
171 use gdbm || disable+=" gdbm"
172 use ncurses || disable+=" _curses _curses_panel"
173 use readline || disable+=" readline"
174 use sqlite || disable+=" _sqlite3"
175 use ssl || export PYTHON_DISABLE_SSL="1"
176 use tk || disable+=" _tkinter"
177 use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
178 export PYTHON_DISABLE_MODULES="${disable}"
179
180 if ! use xml; then
181 ewarn "You have configured Python without XML support."
182 ewarn "This is NOT a recommended configuration as you"
183 ewarn "may face problems parsing any XML documents."
184 fi
185 fi
186
187 if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
188 einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
189 fi
190
191 if [[ "$(gcc-major-version)" -ge 4 ]]; then
192 append-flags -fwrapv
193 fi
194
195 filter-flags -malign-double
196
197 [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
198
199 # https://bugs.gentoo.org/show_bug.cgi?id=50309
200 if is-flagq -O3; then
201 is-flagq -fstack-protector-all && replace-flags -O3 -O2
202 use hardened && replace-flags -O3 -O2
203 fi
204
205 # Run the configure scripts in parallel.
206 multijob_init
207
208 mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
209
210 if tc-is-cross-compiler; then
211 (
212 multijob_child_init
213 cd "${WORKDIR}"/${CBUILD} >/dev/null
214 OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
215 "${S}"/configure \
216 --{build,host}=${CBUILD} \
217 || die "cross-configure failed"
218 ) &
219 multijob_post_fork
220 fi
221
222 # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
223 tc-export CXX
224 # The configure script fails to use pkg-config correctly.
225 # http://bugs.python.org/issue15506
226 export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
227
228 # Set LDFLAGS so we link modules with -lpython2.6 correctly.
229 # Needed on FreeBSD unless Python 2.6 is already installed.
230 # Please query BSD team before removing this!
231 append-ldflags "-L."
232
233 cd "${WORKDIR}"/${CHOST}
234 ECONF_SOURCE=${S} OPT="" \
235 econf \
236 --with-fpectl \
237 --enable-shared \
238 $(use_enable ipv6) \
239 $(use_with threads) \
240 $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
241 --infodir='${prefix}/share/info' \
242 --mandir='${prefix}/share/man' \
243 --with-libc="" \
244 --with-system-ffi
245
246 if tc-is-cross-compiler; then
247 # Modify the Makefile.pre so we don't regen for the host/ one.
248 # We need to link the host python programs into $PWD and run
249 # them from here because the distutils sysconfig module will
250 # parse Makefile/etc... from argv[0], and we need it to pick
251 # up the target settings, not the host ones.
252 sed -i \
253 -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
254 -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
255 -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
256 Makefile{.pre,} || die "sed failed"
257 fi
258
259 multijob_finish
260 }
261
262 src_compile() {
263 if tc-is-cross-compiler; then
264 cd "${WORKDIR}"/${CBUILD}
265 # Disable as many modules as possible -- but we need a few to install.
266 PYTHON_DISABLE_MODULES=$(
267 sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
268 egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
269 ) \
270 PTHON_DISABLE_SSL="1" \
271 SYSROOT= \
272 emake || die "cross-make failed"
273 # See comment in src_configure about these.
274 ln python ../${CHOST}/hostpython || die
275 ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
276 ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
277 fi
278
279 cd "${WORKDIR}"/${CHOST}
280 default
281
282 # Work around bug 329499. See also bug 413751.
283 pax-mark m python
284 }
285
286 src_test() {
287 # Tests will not work when cross compiling.
288 if tc-is-cross-compiler; then
289 elog "Disabling tests due to crosscompiling."
290 return
291 fi
292
293 cd "${WORKDIR}"/${CHOST}
294
295 # Skip failing tests.
296 local skipped_tests="distutils tcl"
297
298 for test in ${skipped_tests}; do
299 mv "${S}"/Lib/test/test_${test}.py "${T}"
300 done
301
302 # Rerun failed tests in verbose mode (regrtest -w).
303 PYTHONDONTWRITEBYTECODE="" emake test EXTRATESTOPTS="-w" < /dev/tty
304 local result="$?"
305
306 for test in ${skipped_tests}; do
307 mv "${T}/test_${test}.py" "${S}"/Lib/test
308 done
309
310 elog "The following tests have been skipped:"
311 for test in ${skipped_tests}; do
312 elog "test_${test}.py"
313 done
314
315 elog "If you would like to run them, you may:"
316 elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
317 elog "and run the tests separately."
318
319 if [[ "${result}" -ne 0 ]]; then
320 die "emake test failed"
321 fi
322 }
323
324 src_install() {
325 [[ -z "${ED}" ]] && ED="${D%/}${EPREFIX}/"
326
327 local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
328
329 cd "${WORKDIR}"/${CHOST}
330 emake DESTDIR="${D}" altinstall maninstall || die "emake altinstall maninstall failed"
331
332 # Backwards compat with Gentoo divergence.
333 dosym python${SLOT}-config /usr/bin/python-config-${SLOT} || die
334
335 # Fix collisions between different slots of Python.
336 mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
337 mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
338 mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
339 mv "${ED}usr/share/man/man1/python.1" "${ED}usr/share/man/man1/python${SLOT}.1"
340 rm -f "${ED}usr/bin/smtpd.py"
341
342 if use build; then
343 rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test}
344 else
345 use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
346 use berkdb || rm -fr "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*}
347 use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
348 use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk}
349 fi
350
351 use threads || rm -fr "${libdir}/multiprocessing"
352 use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
353
354 dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
355
356 if use examples; then
357 insinto /usr/share/doc/${PF}/examples
358 doins -r "${S}"/Tools || die "doins failed"
359 fi
360
361 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
362 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"
363 sed \
364 -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
365 -e "s:@PYDOC@:pydoc${SLOT}:" \
366 -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
367
368 # for python-exec
369 python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
370
371 # if not using a cross-compiler, use the fresh binary
372 if ! tc-is-cross-compiler; then
373 local PYTHON=./python \
374 LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
375 export LD_LIBRARY_PATH
376 fi
377
378 echo "EPYTHON='${EPYTHON}'" > epython.py
379 python_domodule epython.py
380 }
381
382 pkg_preinst() {
383 if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.6" && ! has_version "${CATEGORY}/${PN}:2.7"; then
384 python_updater_warning="1"
385 fi
386 }
387
388 eselect_python_update() {
389 [[ -z "${EROOT}" || (! -d "${EROOT}" && -d "${ROOT}") ]] && EROOT="${ROOT%/}${EPREFIX}/"
390
391 if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
392 eselect python update
393 fi
394
395 if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
396 eselect python update --python${PV%%.*}
397 fi
398 }
399
400 pkg_postinst() {
401 eselect_python_update
402
403 if [[ "${python_updater_warning}" == "1" ]]; then
404 ewarn "You have just upgraded from an older version of Python."
405 ewarn "You should switch active version of Python ${PV%%.*} and run"
406 ewarn "'python-updater [options]' to rebuild Python modules."
407 fi
408 }
409
410 pkg_postrm() {
411 eselect_python_update
412 }