[python-crypto] Unbundle libtomcrypt (#1087557)

Paul Howarth pghmcfc at fedoraproject.org
Fri May 16 10:33:10 UTC 2014


commit 88a061a79f0b21da0eda96785f1051aae855ae5c
Author: Paul Howarth <paul at city-fan.org>
Date:   Tue Apr 15 14:20:55 2014 +0100

    Unbundle libtomcrypt (#1087557)
    
    - Unbundle libtomcrypt (#1087557)
    - Drop %defattr, redundant since rpm 4.4

 pycrypto-2.6.1-unbundle-libtomcrypt.patch |   30 +++++++++++++++++++++++++++++
 python-crypto.spec                        |   17 +++++++++++----
 2 files changed, 42 insertions(+), 5 deletions(-)
---
diff --git a/pycrypto-2.6.1-unbundle-libtomcrypt.patch b/pycrypto-2.6.1-unbundle-libtomcrypt.patch
new file mode 100644
index 0000000..00c7676
--- /dev/null
+++ b/pycrypto-2.6.1-unbundle-libtomcrypt.patch
@@ -0,0 +1,30 @@
+--- setup.py
++++ setup.py
+@@ -390,10 +390,12 @@ kw = {'name':"pycrypto",
+                       include_dirs=['src/'],
+                       sources=["src/CAST.c"]),
+             Extension("Crypto.Cipher._DES",
+-                      include_dirs=['src/', 'src/libtom/'],
++                      include_dirs=['src/'],
++                      libraries=['tomcrypt'],
+                       sources=["src/DES.c"]),
+             Extension("Crypto.Cipher._DES3",
+-                      include_dirs=['src/', 'src/libtom/'],
++                      include_dirs=['src/'],
++                      libraries=['tomcrypt'],
+                       sources=["src/DES3.c"]),
+ 
+             # Stream ciphers
+--- src/DES.c
++++ src/DES.c
+@@ -28,8 +28,8 @@
+  * assert-like LTC_ARGCHK macro fails. */
+ #define ARGTYPE 4
+ 
+-/* Include the actial DES implementation */
+-#include "libtom/tomcrypt_des.c"
++/* Access the actual DES implementation */
++#include "tomcrypt.h"
+ 
+ #undef DES  /* this is needed because tomcrypt_custom.h defines DES to an empty string */
+ 
diff --git a/python-crypto.spec b/python-crypto.spec
index 04de787..55d56ef 100644
--- a/python-crypto.spec
+++ b/python-crypto.spec
@@ -7,7 +7,7 @@
 Summary:	Cryptography library for Python
 Name:		python-crypto
 Version:	2.6.1
-Release:	2%{?dist}
+Release:	3%{?dist}
 # Mostly Public Domain apart from parts of HMAC.py and setup.py, which are Python
 License:	Public Domain and Python
 Group:		Development/Libraries
@@ -15,8 +15,9 @@ URL:		http://www.pycrypto.org/
 Source0:	http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-%{version}.tar.gz
 Patch0:		python-crypto-2.4-optflags.patch
 Patch1:		python-crypto-2.4-fix-pubkey-size-divisions.patch
+Patch2:		pycrypto-2.6.1-unbundle-libtomcrypt.patch
 Provides:	pycrypto = %{version}-%{release}
-BuildRequires:	python2-devel >= 2.2, gmp-devel >= 4.1
+BuildRequires:	python2-devel >= 2.2, gmp-devel >= 4.1, libtomcrypt-devel >= 1.16
 %if %{with_python3}
 BuildRequires:	python-tools
 BuildRequires:	python3-devel
@@ -55,6 +56,10 @@ This is the Python 3 build of the package.
 # Fix divisions within benchmarking suite:
 %patch1 -p1
 
+# Unbundle libtomcrypt (#1087557)
+rm -rf src/libtom
+%patch2
+
 # Prepare python3 build (setup.py doesn't run 2to3 on pct-speedtest.py)
 %if %{with_python3}
 cp -a . %{py3dir}
@@ -110,19 +115,21 @@ cd -
 rm -rf %{buildroot}
 
 %files -f egg-info
-%defattr(-,root,root,-)
 %doc README TODO ACKS ChangeLog LEGAL/ COPYRIGHT Doc/
 %{python_sitearch}/Crypto/
 
 %if %{with_python3}
 %files -n python3-crypto
-%defattr(-,root,root,-)
 %doc README TODO ACKS ChangeLog LEGAL/ COPYRIGHT Doc/
 %{python3_sitearch}/Crypto/
 %{python3_sitearch}/pycrypto-*py3.*.egg-info
 %endif
 
 %changelog
+* Wed May 14 2014 Paul Howarth <paul at city-fan.org> - 2.6.1-3
+- Unbundle libtomcrypt (#1087557)
+- Drop %%defattr, redundant since rpm 4.4
+
 * Wed May 14 2014 Bohuslav Kabrda <bkabrda at redhat.com> - 2.6.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
 
@@ -352,7 +359,7 @@ rm -rf %{buildroot}
 * Wed Aug 17 2005 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0.1-1
 - Update to 2.0.1
 - Use Dist
-- Drop python-crypto-64bit-unclean.patch, similar patch was applied 
+- Drop python-crypto-64bit-unclean.patch, similar patch was applied
   upstream
 
 * Thu May 05 2005 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0-4


More information about the scm-commits mailing list