- 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
This commit is contained in:
dmalcolm 2010-02-08 19:58:25 +00:00
parent b25d6022fc
commit 4bb3fe1878
2 changed files with 58 additions and 1 deletions

View File

@ -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 <dmalcolm@redhat.com> - 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 <dmalcolm@redhat.com> - 2.6.4-14
- add gdb hooks for easier debugging

32
pythondeps.sh Executable file
View File

@ -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