Convert all code to Python 3 before the ability to use 2to3 goes away

f38
Paul Howarth 3 years ago
parent 56ccdc2d5f
commit f386e9cd05

File diff suppressed because it is too large Load Diff

@ -7,7 +7,7 @@
Summary: Cryptography library for Python
Name: python-crypto
Version: 2.6.1
Release: 37%{?dist}
Release: 38%{?dist}
# Mostly Public Domain apart from parts of HMAC.py and setup.py, which are Python
License: Public Domain and Python
URL: http://www.pycrypto.org/
@ -22,13 +22,13 @@ Patch6: pycrypto-2.6.1-use-os-random.patch
Patch7: pycrypto-2.6.1-drop-py2.1-support.patch
Patch8: python-crypto-2.6.1-python3.10.patch
Patch9: python-crypto-2.6.1-python3.11.patch
Patch10: python-crypto-2.6.1-python3only.patch
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: gcc
BuildRequires: gmp-devel >= 4.1
BuildRequires: libtomcrypt-devel >= 1.16
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: %{_bindir}/2to3
%description
PyCrypto is a collection of both secure hash functions (such as MD5 and
@ -94,9 +94,8 @@ rm -rf src/libtom
# https://bugzilla.redhat.com/show_bug.cgi?id=2021808
%patch9
# setup.py doesn't run 2to3 on pct-speedtest.py
cp pct-speedtest.py pct-speedtest3.py
2to3 -wn pct-speedtest3.py
# Convert all code to Python 3 before the ability to use 2to3 goes away
%patch10
%build
%global optflags %{optflags} -fno-strict-aliasing
@ -112,7 +111,7 @@ find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod -c g-w {} \;
%{__python3} setup.py test
# Benchmark
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} pct-speedtest3.py
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} pct-speedtest.py
%files -n python%{python3_pkgversion}-crypto
%license COPYRIGHT LEGAL/
@ -121,6 +120,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} pct-speedtest3.py
%{python3_sitearch}/pycrypto-%{version}-py3.*.egg-info
%changelog
* Thu Nov 11 2021 Paul Howarth <paul@city-fan.org> - 2.6.1-38
- Convert all code to Python 3 before the ability to use 2to3 goes away
* Wed Nov 10 2021 Paul Howarth <paul@city-fan.org> - 2.6.1-37
- Fix Python 3.11 compatibility (#2021808)

Loading…
Cancel
Save