diff --git a/pycrypto-2.3-lib64.patch b/pycrypto-2.3-lib64.patch deleted file mode 100644 index 6f35541..0000000 --- a/pycrypto-2.3-lib64.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- pycrypto-2.3/setup.py 2010-08-27 09:25:59.462963720 +0100 -+++ pycrypto-2.3/setup.py 2010-08-27 10:12:04.590901603 +0100 -@@ -136,7 +136,7 @@ - self.compiler.include_dirs.insert(0, "src/inc-msvc/") - - # Detect libgmp and don't build _fastmath if it is missing. -- lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib'] -+ lib_dirs = self.compiler.library_dirs + ['/lib64', '/usr/lib64'] - if not (self.compiler.find_library_file(lib_dirs, 'gmp')): - print >>sys.stderr, "warning: GMP library not found; Not building Crypto.PublicKey._fastmath." - self.__remove_extensions(["Crypto.PublicKey._fastmath"]) diff --git a/python-crypto-2.2-optflags.patch b/python-crypto-2.2-optflags.patch deleted file mode 100644 index a4f7a11..0000000 --- a/python-crypto-2.2-optflags.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- pycrypto-2.2/setup.py.orig 2010-08-02 22:15:23.000000000 +0100 -+++ pycrypto-2.2/setup.py 2010-08-03 09:23:48.012339680 +0100 -@@ -127,27 +127,6 @@ - # Make assert() statements always work - self.__remove_compiler_option("-DNDEBUG") - -- # Choose our own optimization options -- for opt in ["-O", "-O0", "-O1", "-O2", "-O3", "-Os"]: -- self.__remove_compiler_option(opt) -- if self.debug: -- # Basic optimization is still needed when debugging to compile -- # the libtomcrypt code. -- self.__add_compiler_option("-O") -- else: -- # Speed up execution by tweaking compiler options. This -- # especially helps the DES modules. -- self.__add_compiler_option("-O3") -- self.__add_compiler_option("-fomit-frame-pointer") -- # Don't include debug symbols unless debugging -- self.__remove_compiler_option("-g") -- # Don't include profiling information (incompatible with -fomit-frame-pointer) -- self.__remove_compiler_option("-pg") -- if USE_GCOV: -- self.__add_compiler_option("-fprofile-arcs") -- self.__add_compiler_option("-ftest-coverage") -- self.compiler.libraries += ['gcov'] -- - # Call the superclass's build_extensions method - build_ext.build_extensions(self) - diff --git a/python-crypto-2.4-optflags.patch b/python-crypto-2.4-optflags.patch new file mode 100644 index 0000000..c0f57ce --- /dev/null +++ b/python-crypto-2.4-optflags.patch @@ -0,0 +1,31 @@ +--- pycrypto/setup.py ++++ pycrypto/setup.py +@@ -165,28 +165,6 @@ + # Make assert() statements always work + self.__remove_compiler_option("-DNDEBUG") + +- # Choose our own optimization options +- for opt in ["-O", "-O0", "-O1", "-O2", "-O3", "-Os"]: +- self.__remove_compiler_option(opt) +- if self.debug: +- # Basic optimization is still needed when debugging to compile +- # the libtomcrypt code. +- self.__add_compiler_option("-O") +- else: +- # Speed up execution by tweaking compiler options. This +- # especially helps the DES modules. +- self.__add_compiler_option("-O3") +- self.__add_compiler_option("-fomit-frame-pointer") +- # Don't include debug symbols unless debugging +- self.__remove_compiler_option("-g") +- # Don't include profiling information (incompatible with +- # -fomit-frame-pointer) +- self.__remove_compiler_option("-pg") +- if USE_GCOV: +- self.__add_compiler_option("-fprofile-arcs") +- self.__add_compiler_option("-ftest-coverage") +- self.compiler.libraries += ['gcov'] +- + # Call the superclass's build_extensions method + build_ext.build_extensions(self) + diff --git a/python-crypto.spec b/python-crypto.spec index 01ed8a5..e766bcc 100644 --- a/python-crypto.spec +++ b/python-crypto.spec @@ -3,15 +3,14 @@ Summary: Cryptography library for Python Name: python-crypto -Version: 2.3 -Release: 5%{?dist}.1 +Version: 2.4 +Release: 1%{?dist} # Mostly Public Domain apart from parts of HMAC.py and setup.py, which are Python License: Public Domain and Python Group: Development/Libraries URL: http://www.pycrypto.org/ Source0: http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-%{version}.tar.gz -Patch0: python-crypto-2.2-optflags.patch -Patch1: pycrypto-2.3-lib64.patch +Patch0: python-crypto-2.4-optflags.patch Provides: pycrypto = %{version}-%{release} BuildRequires: python2-devel >= 2.2, gmp-devel >= 4.1 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot-%(id -nu) @@ -30,17 +29,6 @@ SHA), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.). # Use distribution compiler flags rather than upstream's %patch0 -p1 -# Look in the right place for libgmp -%if "%{_lib}" == "lib64" -%patch1 -p1 -%endif - -# Remove spurious shellbangs -sed -i -e '\|^#!/usr/local/bin/python| d' lib/Crypto/Util/RFC1751.py - -# Fix permissions for debuginfo -chmod -c -x src/_fastmath.c - %build CFLAGS="%{optflags} -fno-strict-aliasing" %{__python} setup.py build @@ -70,11 +58,37 @@ rm -rf %{buildroot} %files -f egg-info %defattr(-,root,root,-) %doc README TODO ACKS ChangeLog LEGAL/ COPYRIGHT Doc/ +%doc python-3-changes.txt %{python_sitearch}/Crypto/ %changelog +* Mon Oct 24 2011 Paul Howarth - 2.4-1 +- Update to 2.4 + - Python 3 support! PyCrypto now supports every version of Python from 2.1 + through to 3.2 + - Timing-attack countermeasures in _fastmath: when built against libgmp + version 5 or later, we use mpz_powm_sec instead of mpz_powm, which should + prevent the timing attack described by Geremy Condra at PyCon 2011 + - New hash modules (for Python ≥ 2.5 only): SHA224, SHA384 and SHA512 + - Configuration using GNU autoconf, which should help fix a bunch of build + issues + - Support using MPIR as an alternative to GMP + - Improve the test command in setup.py, by allowing tests to be performed on + a single sub-package or module only + - Fix double-decref of "counter" when Cipher object initialization fails + - Apply patches from Debian's python-crypto 2.3-3 package: + - fix-RSA-generate-exception.patch + - epydoc-exclude-introspect.patch + - no-usr-local.patch + - Fix launchpad bug #702835: "Import key code is not compatible with GMP + library" + - More tests, better documentation, various bugfixes +- Update patch for imposing our own compiler optimization flags +- Drop lib64 patch, no longer needed +- No longer need to fix up permissions and remove shellbangs + * Wed Oct 12 2011 Peter Schiffer - 2.3-5.1 -- rebuild with new gmp +- Rebuild with new gmp * Wed May 11 2011 Paul Howarth - 2.3-5 - Upstream rolled new tarball with top-level directory restored @@ -87,7 +101,7 @@ rm -rf %{buildroot} - Rebuilt for gcc bug 634757 * Fri Sep 24 2010 David Malcolm - 2.3-2 -- add "-fno-strict-aliasing" to compilation flags +- Add "-fno-strict-aliasing" to compilation flags * Fri Aug 27 2010 Paul Howarth - 2.3-1 - Update to 2.3 diff --git a/sources b/sources index f6b6758..4e43420 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2b811cfbfc342d83ee614097effb8101 pycrypto-2.3.tar.gz +274fa44c30a320d56460a93fdd95e702 pycrypto-2.4.tar.gz