1 |
pinkbyte 14/07/29 07:53:03 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: python-3.2.5-r6.ebuild |
5 |
Removed: python-3.2.5-r5.ebuild |
6 |
Log: |
7 |
Revision bump: backport patch for CVE-2014-1912, bug #500518. Drop old revision. Acked by Python team |
8 |
|
9 |
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 0x1F357D42) |
10 |
|
11 |
Revision Changes Path |
12 |
1.766 dev-lang/python/ChangeLog |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.766&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.766&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?r1=1.765&r2=1.766 |
17 |
|
18 |
Index: ChangeLog |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v |
21 |
retrieving revision 1.765 |
22 |
retrieving revision 1.766 |
23 |
diff -u -r1.765 -r1.766 |
24 |
--- ChangeLog 29 Jul 2014 07:19:13 -0000 1.765 |
25 |
+++ ChangeLog 29 Jul 2014 07:53:03 -0000 1.766 |
26 |
@@ -1,6 +1,13 @@ |
27 |
# ChangeLog for dev-lang/python |
28 |
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 |
29 |
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.765 2014/07/29 07:19:13 pinkbyte Exp $ |
30 |
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.766 2014/07/29 07:53:03 pinkbyte Exp $ |
31 |
+ |
32 |
+*python-3.2.5-r6 (29 Jul 2014) |
33 |
+ |
34 |
+ 29 Jul 2014; Sergey Popov <pinkbyte@g.o> -python-3.2.5-r5.ebuild, |
35 |
+ +python-3.2.5-r6.ebuild, +files/python-3.2-CVE-2014-1912.patch: |
36 |
+ Revision bump: backport patch for CVE-2014-1912, bug #500518. Drop old |
37 |
+ revision. Acked by Python team |
38 |
|
39 |
*python-3.3.5-r1 (29 Jul 2014) |
40 |
*python-3.2.5-r5 (29 Jul 2014) |
41 |
|
42 |
|
43 |
|
44 |
1.1 dev-lang/python/python-3.2.5-r6.ebuild |
45 |
|
46 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.2.5-r6.ebuild?rev=1.1&view=markup |
47 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.2.5-r6.ebuild?rev=1.1&content-type=text/plain |
48 |
|
49 |
Index: python-3.2.5-r6.ebuild |
50 |
=================================================================== |
51 |
# Copyright 1999-2014 Gentoo Foundation |
52 |
# Distributed under the terms of the GNU General Public License v2 |
53 |
# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.2.5-r6.ebuild,v 1.1 2014/07/29 07:53:03 pinkbyte Exp $ |
54 |
|
55 |
EAPI="4" |
56 |
WANT_AUTOMAKE="none" |
57 |
WANT_LIBTOOL="none" |
58 |
|
59 |
inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing |
60 |
|
61 |
MY_P="Python-${PV}" |
62 |
PATCHSET_REVISION="1" |
63 |
|
64 |
DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
65 |
HOMEPAGE="http://www.python.org/" |
66 |
SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
67 |
http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz" |
68 |
|
69 |
LICENSE="PSF-2" |
70 |
SLOT="3.2" |
71 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" |
72 |
IUSE="build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" |
73 |
|
74 |
# Do not add a dependency on dev-lang/python to this ebuild. |
75 |
# If you need to apply a patch which requires python for bootstrapping, please |
76 |
# run the bootstrap code on your dev box and include the results in the |
77 |
# patchset. See bug 447752. |
78 |
|
79 |
RDEPEND="app-arch/bzip2 |
80 |
>=sys-libs/zlib-1.1.3 |
81 |
virtual/libffi |
82 |
virtual/libintl |
83 |
!build? ( |
84 |
gdbm? ( sys-libs/gdbm[berkdb] ) |
85 |
ncurses? ( |
86 |
>=sys-libs/ncurses-5.2 |
87 |
readline? ( >=sys-libs/readline-4.1 ) |
88 |
) |
89 |
sqlite? ( >=dev-db/sqlite-3.3.8:3 ) |
90 |
ssl? ( dev-libs/openssl ) |
91 |
tk? ( |
92 |
>=dev-lang/tk-8.0 |
93 |
dev-tcltk/blt |
94 |
dev-tcltk/tix |
95 |
) |
96 |
xml? ( >=dev-libs/expat-2.1 ) |
97 |
)" |
98 |
DEPEND="${RDEPEND} |
99 |
virtual/pkgconfig |
100 |
>=sys-devel/autoconf-2.65 |
101 |
!sys-devel/gcc[libffi]" |
102 |
RDEPEND+=" !build? ( app-misc/mime-types ) |
103 |
doc? ( dev-python/python-docs:${SLOT} )" |
104 |
PDEPEND="app-admin/eselect-python |
105 |
app-admin/python-updater" |
106 |
|
107 |
S="${WORKDIR}/${MY_P}" |
108 |
|
109 |
pkg_setup() { |
110 |
if [[ "${PV}" =~ ^3\.2(\.[1234])?(_pre)? ]]; then |
111 |
rm -f "${EROOT}usr/$(get_libdir)/llibpython3.so" |
112 |
else |
113 |
die "Deprecated code not deleted" |
114 |
fi |
115 |
} |
116 |
|
117 |
src_prepare() { |
118 |
# Ensure that internal copies of expat, libffi and zlib are not used. |
119 |
rm -r Modules/expat |
120 |
rm -r Modules/_ctypes/libffi* |
121 |
rm -r Modules/zlib |
122 |
|
123 |
local excluded_patches |
124 |
if ! tc-is-cross-compiler; then |
125 |
excluded_patches="*_all_crosscompile.patch" |
126 |
fi |
127 |
|
128 |
EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ |
129 |
epatch "${WORKDIR}/patches" |
130 |
|
131 |
epatch "${FILESDIR}/python-3.2-CVE-2013-2099.patch" |
132 |
epatch "${FILESDIR}/CVE-2013-4238_py33.patch" |
133 |
epatch "${FILESDIR}/python-3.2-issue16248.patch" |
134 |
|
135 |
sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
136 |
Lib/distutils/command/install.py \ |
137 |
Lib/distutils/sysconfig.py \ |
138 |
Lib/site.py \ |
139 |
Lib/sysconfig.py \ |
140 |
Lib/test/test_site.py \ |
141 |
Makefile.pre.in \ |
142 |
Modules/Setup.dist \ |
143 |
Modules/getpath.c \ |
144 |
setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
145 |
|
146 |
# Disable ABI flags. |
147 |
sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed" |
148 |
|
149 |
# bug #514686 |
150 |
epatch "${FILESDIR}/${PN}-3.2-CVE-2014-4616.patch" |
151 |
# bug #500518 |
152 |
epatch "${FILESDIR}/${PN}-3.2-CVE-2014-1912.patch" |
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="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" |
164 |
export PYTHON_DISABLE_SSL="1" |
165 |
else |
166 |
local disable |
167 |
use gdbm || disable+=" gdbm" |
168 |
use ncurses || disable+=" _curses _curses_panel" |
169 |
use readline || disable+=" readline" |
170 |
use sqlite || disable+=" _sqlite3" |
171 |
use ssl || export PYTHON_DISABLE_SSL="1" |
172 |
use tk || disable+=" _tkinter" |
173 |
use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
174 |
export PYTHON_DISABLE_MODULES="${disable}" |
175 |
|
176 |
if ! use xml; then |
177 |
ewarn "You have configured Python without XML support." |
178 |
ewarn "This is NOT a recommended configuration as you" |
179 |
ewarn "may face problems parsing any XML documents." |
180 |
fi |
181 |
fi |
182 |
|
183 |
if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
184 |
einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
185 |
fi |
186 |
|
187 |
if [[ "$(gcc-major-version)" -ge 4 ]]; then |
188 |
append-flags -fwrapv |
189 |
fi |
190 |
|
191 |
filter-flags -malign-double |
192 |
|
193 |
[[ "${ARCH}" == "alpha" ]] && append-flags -fPIC |
194 |
|
195 |
# https://bugs.gentoo.org/show_bug.cgi?id=50309 |
196 |
if is-flagq -O3; then |
197 |
is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
198 |
use hardened && replace-flags -O3 -O2 |
199 |
fi |
200 |
|
201 |
# Run the configure scripts in parallel. |
202 |
multijob_init |
203 |
|
204 |
mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}} |
205 |
|
206 |
if tc-is-cross-compiler; then |
207 |
( |
208 |
multijob_child_init |
209 |
cd "${WORKDIR}"/${CBUILD} >/dev/null |
210 |
OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \ |
211 |
"${S}"/configure \ |
212 |
--{build,host}=${CBUILD} \ |
213 |
|| die "cross-configure failed" |
214 |
) & |
215 |
multijob_post_fork |
216 |
|
217 |
# The configure script assumes it's buggy when cross-compiling. |
218 |
export ac_cv_buggy_getaddrinfo=no |
219 |
export ac_cv_have_long_long_format=yes |
220 |
fi |
221 |
|
222 |
# Export CXX so it ends up in /usr/lib/python3.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 -lpython3.2 correctly. |
229 |
# Needed on FreeBSD unless Python 3.2 is already installed. |
230 |
# Please query BSD team before removing this! |
231 |
append-ldflags "-L." |
232 |
|
233 |
local dbmliborder |
234 |
if use gdbm; then |
235 |
dbmliborder+="${dbmliborder:+:}gdbm" |
236 |
fi |
237 |
|
238 |
cd "${WORKDIR}"/${CHOST} |
239 |
ECONF_SOURCE=${S} OPT="" \ |
240 |
econf \ |
241 |
--with-fpectl \ |
242 |
--enable-shared \ |
243 |
$(use_enable ipv6) \ |
244 |
$(use_with threads) \ |
245 |
$(use_with wide-unicode) \ |
246 |
--infodir='${prefix}/share/info' \ |
247 |
--mandir='${prefix}/share/man' \ |
248 |
--with-computed-gotos \ |
249 |
--with-dbmliborder="${dbmliborder}" \ |
250 |
--with-libc="" \ |
251 |
--enable-loadable-sqlite-extensions \ |
252 |
--with-system-expat \ |
253 |
--with-system-ffi |
254 |
|
255 |
if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
256 |
eerror "configure has detected that the sem_open function is broken." |
257 |
eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
258 |
die "Broken sem_open function (bug 496328)" |
259 |
fi |
260 |
|
261 |
if tc-is-cross-compiler; then |
262 |
# Modify the Makefile.pre so we don't regen for the host/ one. |
263 |
# We need to link the host python programs into $PWD and run |
264 |
# them from here because the distutils sysconfig module will |
265 |
# parse Makefile/etc... from argv[0], and we need it to pick |
266 |
# up the target settings, not the host ones. |
267 |
sed -i \ |
268 |
-e '1iHOSTPYTHONPATH = ./hostpythonpath:' \ |
269 |
-e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \ |
270 |
-e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \ |
271 |
Makefile{.pre,} || die "sed failed" |
272 |
fi |
273 |
|
274 |
multijob_finish |
275 |
} |
276 |
|
277 |
src_compile() { |
278 |
if tc-is-cross-compiler; then |
279 |
cd "${WORKDIR}"/${CBUILD} |
280 |
# Disable as many modules as possible -- but we need a few to install. |
281 |
PYTHON_DISABLE_MODULES=$( |
282 |
sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \ |
283 |
egrep -v '(unicodedata|time|cStringIO|_struct|binascii)' |
284 |
) \ |
285 |
PTHON_DISABLE_SSL="1" \ |
286 |
SYSROOT= \ |
287 |
emake |
288 |
# See comment in src_configure about these. |
289 |
ln python ../${CHOST}/hostpython || die |
290 |
ln Parser/pgen ../${CHOST}/Parser/hostpgen || die |
291 |
ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die |
292 |
fi |
293 |
|
294 |
cd "${WORKDIR}"/${CHOST} |
295 |
emake CPPFLAGS="" CFLAGS="" LDFLAGS="" |
296 |
|
297 |
# Work around bug 329499. See also bug 413751 and 457194. |
298 |
if has_version dev-libs/libffi[pax_kernel]; then |
299 |
pax-mark E python |
300 |
else |
301 |
pax-mark m python |
302 |
fi |
303 |
} |
304 |
|
305 |
src_test() { |
306 |
# Tests will not work when cross compiling. |
307 |
if tc-is-cross-compiler; then |
308 |
elog "Disabling tests due to crosscompiling." |
309 |
return |
310 |
fi |
311 |
|
312 |
cd "${WORKDIR}"/${CHOST} |
313 |
|
314 |
# Skip failing tests. |
315 |
local skipped_tests="gdb" |
316 |
|
317 |
for test in ${skipped_tests}; do |
318 |
mv "${S}"/Lib/test/test_${test}.py "${T}" |
319 |
done |
320 |
|
321 |
# Rerun failed tests in verbose mode (regrtest -w). |
322 |
PYTHONDONTWRITEBYTECODE="" emake test EXTRATESTOPTS="-w" CPPFLAGS="" CFLAGS="" LDFLAGS="" < /dev/tty |
323 |
local result="$?" |
324 |
|
325 |
for test in ${skipped_tests}; do |
326 |
mv "${T}/test_${test}.py" "${S}"/Lib/test |
327 |
done |
328 |
|
329 |
elog "The following tests have been skipped:" |
330 |
for test in ${skipped_tests}; do |
331 |
elog "test_${test}.py" |
332 |
done |
333 |
|
334 |
elog "If you would like to run them, you may:" |
335 |
elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" |
336 |
elog "and run the tests separately." |
337 |
|
338 |
if [[ "${result}" -ne 0 ]]; then |
339 |
die "emake test failed" |
340 |
fi |
341 |
} |
342 |
|
343 |
src_install() { |
344 |
local libdir=${ED}/usr/$(get_libdir)/python${SLOT} |
345 |
|
346 |
cd "${WORKDIR}"/${CHOST} |
347 |
emake DESTDIR="${D}" altinstall |
348 |
|
349 |
sed \ |
350 |
-e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
351 |
-e "s/\(PY_LDFLAGS=\).*/\1/" \ |
352 |
-i "${libdir}/config-${SLOT}/Makefile" || die "sed failed" |
353 |
|
354 |
# Backwards compat with Gentoo divergence. |
355 |
dosym python${SLOT}-config /usr/bin/python-config-${SLOT} |
356 |
|
357 |
# Fix collisions between different slots of Python. |
358 |
rm "${ED}usr/$(get_libdir)/libpython3.so" || die |
359 |
|
360 |
if use build; then |
361 |
rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,sqlite3,test,tkinter} |
362 |
else |
363 |
use elibc_uclibc && rm -fr "${libdir}/test" |
364 |
use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*} |
365 |
use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,tkinter,test/test_tk*} |
366 |
fi |
367 |
|
368 |
use threads || rm -fr "${libdir}/multiprocessing" |
369 |
use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe |
370 |
|
371 |
dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
372 |
|
373 |
if use examples; then |
374 |
insinto /usr/share/doc/${PF}/examples |
375 |
find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr |
376 |
doins -r "${S}"/Tools |
377 |
fi |
378 |
insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
379 |
local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
380 |
emake --no-print-directory -s -f - 2>/dev/null) |
381 |
newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
382 |
|
383 |
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} |
384 |
newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} |
385 |
sed \ |
386 |
-e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ |
387 |
-e "s:@PYDOC@:pydoc${SLOT}:" \ |
388 |
-i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" |
389 |
|
390 |
# for python-exec |
391 |
python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR |
392 |
|
393 |
# if not using a cross-compiler, use the fresh binary |
394 |
if ! tc-is-cross-compiler; then |
395 |
local PYTHON=./python \ |
396 |
LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
397 |
export LD_LIBRARY_PATH |
398 |
fi |
399 |
|
400 |
echo "EPYTHON='${EPYTHON}'" > epython.py |
401 |
python_domodule epython.py |
402 |
} |
403 |
|
404 |
pkg_preinst() { |
405 |
if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then |
406 |
python_updater_warning="1" |
407 |
fi |
408 |
} |
409 |
|
410 |
eselect_python_update() { |
411 |
if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
412 |
eselect python update |
413 |
fi |
414 |
|
415 |
if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
416 |
eselect python update --python${PV%%.*} |
417 |
fi |
418 |
} |
419 |
|
420 |
pkg_postinst() { |
421 |
eselect_python_update |
422 |
|
423 |
if [[ "${python_updater_warning}" == "1" ]]; then |
424 |
ewarn "You have just upgraded from an older version of Python." |
425 |
ewarn "You should switch active version of Python ${PV%%.*} and run" |
426 |
ewarn "'python-updater [options]' to rebuild Python modules." |
427 |
fi |
428 |
} |
429 |
|
430 |
pkg_postrm() { |
431 |
eselect_python_update |
432 |
} |