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
18 URL: http://www.dlitz.net/software/pycrypto/
21 BuildRequires: python-devel >= 2.2
22 BuildRequires: python-modules
25 BuildRequires: python3
26 BuildRequires: python3-2to3
27 BuildRequires: python3-devel
28 BuildRequires: python3-modules
30 BuildRequires: rpm-pythonprov
31 BuildRequires: rpmbuild(macros) >= 1.710
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 # Don't want provides for python shared objects
35 %define _noautoprovfiles %{py_sitedir}/%{module}/.*/.*.so
38 The Toolkit is a collection of cryptographic algorithms and protocols,
39 implemented for use from Python 2. Among the contents of the package:
40 - hash functions: MD2, MD4, RIPEMD
41 - block encryption algorithms: AES, ARC2, Blowfish, CAST, DES,
43 - stream encryption algorithms: ARC4, simple XOR
44 - public-key algorithms: RSA, DSA, ElGamal, qNEW
45 - protocols: All-or-nothing transforms, chaffing/winnowing
46 - miscellaneous: RFC1751 module for converting 128-key keys into a set
47 of English words, primality testing
48 - some demo programs (currently all quite old and outdated)
50 %description -l pl.UTF-8
51 Ten przybornik jest zbiorem kryptograficznych algorytmów i protokołów
52 zaimplementowanych dla języka Python 2. Pakiet zawiera między innymi:
53 - funkcje haszujące: MD2, MD4, RIPEMD
54 - blokowe algorytmy szyfrujące: AES,ARC2, Blowfish, CAST, DES,
56 - strumieniowe algorytmu szyfrujące: ARC4, zwykły XOR
57 - algorytmy z kluczem publicznym: RSA, DSA,ElGamal, qNEW
58 - protokoły: przekształcenia wszystko-albo-nic, chaffing/winnowing
59 - inne: RFC1751 moduł do konwersji kluczy 128 bitowych w zbiory słów
60 angielskich, test liczb pierwszych
61 - programy demonstracyjne (aktualnie odrobinę stare i nieaktualne)
63 %package -n python3-%{module}
64 Summary: PyCrypto - The Python 3 Cryptography Toolkit
65 Summary(pl.UTF-8): Kryptograficzny przybornik dla języka Python 3
66 Group: Development/Languages/Python
68 %description -n python3-%{module}
69 The Toolkit is a collection of cryptographic algorithms and protocols,
70 implemented for use from Python 3. Among the contents of the package:
71 - hash functions: MD2, MD4, RIPEMD
72 - block encryption algorithms: AES, ARC2, Blowfish, CAST, DES,
74 - stream encryption algorithms: ARC4, simple XOR
75 - public-key algorithms: RSA, DSA, ElGamal, qNEW
76 - protocols: All-or-nothing transforms, chaffing/winnowing
77 - miscellaneous: RFC1751 module for converting 128-key keys into a set
78 of English words, primality testing
79 - some demo programs (currently all quite old and outdated)
81 %description -n python3-%{module} -l pl.UTF-8
82 Ten przybornik jest zbiorem kryptograficznych algorytmów i protokołów
83 zaimplementowanych dla języka Python 3. Pakiet zawiera między innymi:
84 - funkcje haszujące: MD2, MD4, RIPEMD
85 - blokowe algorytmy szyfrujące: AES,ARC2, Blowfish, CAST, DES,
87 - strumieniowe algorytmu szyfrujące: ARC4, zwykły XOR
88 - algorytmy z kluczem publicznym: RSA, DSA,ElGamal, qNEW
89 - protokoły: przekształcenia wszystko-albo-nic, chaffing/winnowing
90 - inne: RFC1751 moduł do konwersji kluczy 128 bitowych w zbiory słów
91 angielskich, test liczb pierwszych
92 - programy demonstracyjne (aktualnie odrobinę stare i nieaktualne)
95 %setup -q -n pycrypto-%{version}
99 %py_build %{?with_tests:test}
103 %py3_build %{?with_tests:test}
107 rm -rf $RPM_BUILD_ROOT
114 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/Crypto/SelfTest
120 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/Crypto/SelfTest
124 rm -rf $RPM_BUILD_ROOT
128 %defattr(644,root,root,755)
129 %doc ACKS COPYRIGHT ChangeLog README TODO Doc
130 %dir %{py_sitedir}/%{module}
131 %{py_sitedir}/%{module}/*.py[co]
132 %dir %{py_sitedir}/%{module}/Cipher
133 %dir %{py_sitedir}/%{module}/Hash
134 %dir %{py_sitedir}/%{module}/Protocol
135 %dir %{py_sitedir}/%{module}/PublicKey
136 %dir %{py_sitedir}/%{module}/Random
137 %dir %{py_sitedir}/%{module}/Random/Fortuna
138 %dir %{py_sitedir}/%{module}/Random/OSRNG
139 %dir %{py_sitedir}/%{module}/Signature
140 %dir %{py_sitedir}/%{module}/Util
141 %attr(755,root,root) %{py_sitedir}/%{module}/*/*.so
142 %{py_sitedir}/%{module}/*/*.py[co]
143 %{py_sitedir}/%{module}/*/*/*.py[co]
144 %if "%{py_ver}" > "2.4"
145 %{py_sitedir}/pycrypto-*.egg-info
150 %files -n python3-%{module}
151 %defattr(644,root,root,755)
152 %doc ACKS COPYRIGHT ChangeLog README TODO Doc
153 %dir %{py3_sitedir}/%{module}
154 %{py3_sitedir}/%{module}/*.py
155 %{py3_sitedir}/%{module}/__pycache__
156 %dir %{py3_sitedir}/%{module}/Cipher
157 %dir %{py3_sitedir}/%{module}/Hash
158 %dir %{py3_sitedir}/%{module}/Protocol
159 %dir %{py3_sitedir}/%{module}/PublicKey
160 %dir %{py3_sitedir}/%{module}/Random
161 %dir %{py3_sitedir}/%{module}/Random/Fortuna
162 %dir %{py3_sitedir}/%{module}/Random/OSRNG
163 %dir %{py3_sitedir}/%{module}/Signature
164 %dir %{py3_sitedir}/%{module}/Util
165 %attr(755,root,root) %{py3_sitedir}/%{module}/*/*.so
166 %{py3_sitedir}/%{module}/*/*.py
167 %{py3_sitedir}/%{module}/*/__pycache__
168 %{py3_sitedir}/%{module}/*/*/*.py
169 %{py3_sitedir}/%{module}/*/*/__pycache__
170 %{py3_sitedir}/pycrypto-*.egg-info