diff --git a/0001-Don-t-fail-on-older-python-versions-because-of-hashe.patch b/0001-Don-t-fail-on-older-python-versions-because-of-hashe.patch new file mode 100644 index 0000000..d50bd54 --- /dev/null +++ b/0001-Don-t-fail-on-older-python-versions-because-of-hashe.patch @@ -0,0 +1,26 @@ +From f6f6666438af884da7b4b1d76a258639f949406f Mon Sep 17 00:00:00 2001 +From: Jeffrey C. Ollie +Date: Thu, 2 Dec 2010 13:05:50 -0600 +Subject: [PATCH] Don't fail on older python versions because of hashes. + +--- + dns/hash.py | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +diff --git a/dns/hash.py b/dns/hash.py +index 7bd5ae5..8582a9c 100644 +--- a/dns/hash.py ++++ b/dns/hash.py +@@ -37,9 +37,6 @@ def _setup(): + if sys.hexversion >= 0x02050200: + _hashes['SHA384'] = hashlib.sha384 + _hashes['SHA512'] = hashlib.sha512 +- else: +- _hashes['SHA384'] = _need_later_python('SHA384') +- _hashes['SHA512'] = _need_later_python('SHA512') + + if sys.hexversion < 0x02050000: + # hashlib doesn't conform to PEP 247: API for +-- +1.7.3.2 + diff --git a/python-dns.spec b/python-dns.spec index 7ec3456..e6fac2b 100644 --- a/python-dns.spec +++ b/python-dns.spec @@ -20,6 +20,9 @@ License: MIT URL: http://www.dnspython.org/ Source0: http://www.dnspython.org/kits/%{version}/dnspython-%{version}.tar.gz Source1: http://www.dnspython.org/kits/%{version}/dnspython-%{version}.tar.gz.asc +%if 0%{?rhel} == 5 +Patch0: 0001-Don-t-fail-on-older-python-versions-because-of-hashe.patch +%endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -76,6 +79,10 @@ cp -a . %{py26dir} find %{py26dir} -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python26}|' %endif +%if 0%{?rhel} == 5 +%patch0 -p1 +%endif + %build CFLAGS="%{optflags}" %{__python} -c 'import setuptools; execfile("setup.py")' build