3 %bcond_without tests # do not perform "make test"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: PyCrypto - The Python 2 Cryptography Toolkit
9 Summary(pl.UTF-8): Kryptograficzny przybornik dla języka Python 2
10 Name: python-%{module}
13 # Mostly Public Domain apart from parts of HMAC.py and setup.py, which are Python
14 License: Public Domain and Python
15 Group: Development/Languages/Python
16 Source0: http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-%{version}.tar.gz
17 # Source0-md5: 55a61a054aa66812daf5161a0d5d7eda
19 URL: http://www.dlitz.net/software/pycrypto/
20 BuildRequires: gmp-devel
22 BuildRequires: python >= 2.2
23 BuildRequires: python-devel >= 2.2
24 BuildRequires: python-modules >= 2.2
27 BuildRequires: python3 >= 1:3.2
28 BuildRequires: python3-2to3 >= 1:3.2
29 BuildRequires: python3-devel >= 1:3.2
30 BuildRequires: python3-modules >= 1:3.2
32 BuildRequires: rpm-pythonprov
33 BuildRequires: rpmbuild(macros) >= 1.714
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 # Don't want provides for python shared objects
37 %define _noautoprovfiles %{py_sitedir}/%{module}/.*/.*.so
40 The Toolkit is a collection of cryptographic algorithms and protocols,
41 implemented for use from Python 2. Among the contents of the package:
42 - hash functions: MD2, MD4, RIPEMD
43 - block encryption algorithms: AES, ARC2, Blowfish, CAST, DES,
45 - stream encryption algorithms: ARC4, simple XOR
46 - public-key algorithms: RSA, DSA, ElGamal, qNEW
47 - protocols: All-or-nothing transforms, chaffing/winnowing
48 - miscellaneous: RFC1751 module for converting 128-key keys into a set
49 of English words, primality testing
50 - some demo programs (currently all quite old and outdated)
52 %description -l pl.UTF-8
53 Ten przybornik jest zbiorem kryptograficznych algorytmów i protokołów
54 zaimplementowanych dla języka Python 2. Pakiet zawiera między innymi:
55 - funkcje haszujące: MD2, MD4, RIPEMD
56 - blokowe algorytmy szyfrujące: AES,ARC2, Blowfish, CAST, DES,
58 - strumieniowe algorytmu szyfrujące: ARC4, zwykły XOR
59 - algorytmy z kluczem publicznym: RSA, DSA,ElGamal, qNEW
60 - protokoły: przekształcenia wszystko-albo-nic, chaffing/winnowing
61 - inne: RFC1751 moduł do konwersji kluczy 128 bitowych w zbiory słów
62 angielskich, test liczb pierwszych
63 - programy demonstracyjne (aktualnie odrobinę stare i nieaktualne)
65 %package -n python3-%{module}
66 Summary: PyCrypto - The Python 3 Cryptography Toolkit
67 Summary(pl.UTF-8): Kryptograficzny przybornik dla języka Python 3
68 Group: Development/Languages/Python
70 %description -n python3-%{module}
71 The Toolkit is a collection of cryptographic algorithms and protocols,
72 implemented for use from Python 3. Among the contents of the package:
73 - hash functions: MD2, MD4, RIPEMD
74 - block encryption algorithms: AES, ARC2, Blowfish, CAST, DES,
76 - stream encryption algorithms: ARC4, simple XOR
77 - public-key algorithms: RSA, DSA, ElGamal, qNEW
78 - protocols: All-or-nothing transforms, chaffing/winnowing
79 - miscellaneous: RFC1751 module for converting 128-key keys into a set
80 of English words, primality testing
81 - some demo programs (currently all quite old and outdated)
83 %description -n python3-%{module} -l pl.UTF-8
84 Ten przybornik jest zbiorem kryptograficznych algorytmów i protokołów
85 zaimplementowanych dla języka Python 3. Pakiet zawiera między innymi:
86 - funkcje haszujące: MD2, MD4, RIPEMD
87 - blokowe algorytmy szyfrujące: AES,ARC2, Blowfish, CAST, DES,
89 - strumieniowe algorytmu szyfrujące: ARC4, zwykły XOR
90 - algorytmy z kluczem publicznym: RSA, DSA,ElGamal, qNEW
91 - protokoły: przekształcenia wszystko-albo-nic, chaffing/winnowing
92 - inne: RFC1751 moduł do konwersji kluczy 128 bitowych w zbiory słów
93 angielskich, test liczb pierwszych
94 - programy demonstracyjne (aktualnie odrobinę stare i nieaktualne)
97 %setup -q -n pycrypto-%{version}
102 %py_build %{?with_tests:test}
106 %py3_build %{?with_tests:test}
110 rm -rf $RPM_BUILD_ROOT
117 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/Crypto/SelfTest
123 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/Crypto/SelfTest
127 rm -rf $RPM_BUILD_ROOT
131 %defattr(644,root,root,755)
132 %doc ACKS COPYRIGHT ChangeLog README TODO Doc
133 %dir %{py_sitedir}/%{module}
134 %{py_sitedir}/%{module}/*.py[co]
135 %dir %{py_sitedir}/%{module}/Cipher
136 %dir %{py_sitedir}/%{module}/Hash
137 %dir %{py_sitedir}/%{module}/Protocol
138 %dir %{py_sitedir}/%{module}/PublicKey
139 %dir %{py_sitedir}/%{module}/Random
140 %dir %{py_sitedir}/%{module}/Random/Fortuna
141 %dir %{py_sitedir}/%{module}/Random/OSRNG
142 %dir %{py_sitedir}/%{module}/Signature
143 %dir %{py_sitedir}/%{module}/Util
144 %attr(755,root,root) %{py_sitedir}/%{module}/*/*.so
145 %{py_sitedir}/%{module}/*/*.py[co]
146 %{py_sitedir}/%{module}/*/*/*.py[co]
147 %if "%{py_ver}" > "2.4"
148 %{py_sitedir}/pycrypto-*.egg-info
153 %files -n python3-%{module}
154 %defattr(644,root,root,755)
155 %doc ACKS COPYRIGHT ChangeLog README TODO Doc
156 %dir %{py3_sitedir}/%{module}
157 %{py3_sitedir}/%{module}/*.py
158 %{py3_sitedir}/%{module}/__pycache__
159 %dir %{py3_sitedir}/%{module}/Cipher
160 %dir %{py3_sitedir}/%{module}/Hash
161 %dir %{py3_sitedir}/%{module}/Protocol
162 %dir %{py3_sitedir}/%{module}/PublicKey
163 %dir %{py3_sitedir}/%{module}/Random
164 %dir %{py3_sitedir}/%{module}/Random/Fortuna
165 %dir %{py3_sitedir}/%{module}/Random/OSRNG
166 %dir %{py3_sitedir}/%{module}/Signature
167 %dir %{py3_sitedir}/%{module}/Util
168 %attr(755,root,root) %{py3_sitedir}/%{module}/*/*.so
169 %{py3_sitedir}/%{module}/*/*.py
170 %{py3_sitedir}/%{module}/*/__pycache__
171 %{py3_sitedir}/%{module}/*/*/*.py
172 %{py3_sitedir}/%{module}/*/*/__pycache__
173 %{py3_sitedir}/pycrypto-*.egg-info