From 4bb3fe187806c51faf3fb16025a59c04230cfb6d Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Mon, 8 Feb 2010 19:58:25 +0000 Subject: [PATCH] - work around bug 562906 by supplying a fixed version of pythondeps.sh - set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the broken test files from killing the build on buildroots where python is installed --- python.spec | 27 ++++++++++++++++++++++++++- pythondeps.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100755 pythondeps.sh diff --git a/python.spec b/python.spec index 058e099..e80241b 100644 --- a/python.spec +++ b/python.spec @@ -24,10 +24,24 @@ %global with_gdb_hooks 1 + +# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py) +# are deliberately invalid, leading to SyntaxError exceptions if they get +# byte-compiled. +# +# These errors are ignored by the normal python build, and aren't normally a +# problem in the buildroots since /usr/bin/python isn't present. +# +# However, for the case where we're rebuilding the python srpm on a machine +# that does have python installed we need to set this to avoid +# brp-python-bytecompile treating these as fatal errors: +# +%global _python_bytecompile_errors_terminate_build 0 + Summary: An interpreted, interactive, object-oriented programming language Name: %{python} Version: 2.6.4 -Release: 14%{?dist} +Release: 15%{?dist} License: Python Group: Development/Languages Provides: python-abi = %{pybasever} @@ -56,6 +70,12 @@ Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 Source1: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz +# Work around bug 562906 until it's fixed in rpm-build by providing a fixed +# version of pythondeps.sh: +Source2: pythondeps.sh +%global __python_requires %{SOURCE2} + + # Modules/Setup.dist is ultimately used by the "makesetup" script to construct # the Makefile and config.c # @@ -832,6 +852,11 @@ rm -fr %{buildroot} %{dynload_dir}/_testcapimodule.so %changelog +* Mon Feb 8 2010 David Malcolm - 2.6.4-15 +- work around bug 562906 by supplying a fixed version of pythondeps.sh +- set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the broken +test files from killing the build on buildroots where python is installed + * Fri Feb 5 2010 David Malcolm - 2.6.4-14 - add gdb hooks for easier debugging diff --git a/pythondeps.sh b/pythondeps.sh new file mode 100755 index 0000000..10a060a --- /dev/null +++ b/pythondeps.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +[ $# -ge 1 ] || { + cat > /dev/null + exit 0 +} + +case $1 in +-P|--provides) + shift + # Match buildroot/payload paths of the form + # /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR + # generating a line of the form + # python(abi) = MAJOR.MINOR + # (Don't match against -config tools e.g. /usr/bin/python2.6-config) + grep "/usr/bin/python.\..$" \ + | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|" + ;; +-R|--requires) + shift + # Match buildroot paths of the form + # /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and + # /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ + # generating (uniqely) lines of the form: + # python(abi) = MAJOR.MINOR + grep "/usr/lib[^/]*/python.\../.*" \ + | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \ + | sort | uniq + ;; +esac + +exit 0