]> git.pld-linux.org Git - packages/python-Crypto.git/blob - python-Crypto.spec
c92b047c3b8b52949a7d54f2d777f8e819505de8
[packages/python-Crypto.git] / python-Crypto.spec
1
2 # Conditional build:
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
6
7 %define         module  Crypto
8 Summary:        PyCrypto - The Python 2 Cryptography Toolkit
9 Summary(pl.UTF-8):      Kryptograficzny przybornik dla języka Python 2
10 Name:           python-%{module}
11 Version:        2.6.1
12 Release:        4
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/
19 %if %{with python2}
20 BuildRequires:  python
21 BuildRequires:  python-devel >= 2.2
22 BuildRequires:  python-modules
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3
26 BuildRequires:  python3-2to3
27 BuildRequires:  python3-devel
28 BuildRequires:  python3-modules
29 %endif
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  rpmbuild(macros) >= 1.219
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 # Don't want provides for python shared objects
35 %define         _noautoprovfiles        %{py_sitedir}/%{module}/.*/.*.so
36
37 %description
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,
42   Triple-DES, IDEA, RC5
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)
49
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,
55   Triple-DES, IDEA, RC5
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)
62
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
67
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,
73   Triple-DES, IDEA, RC5
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)
80
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,
86   Triple-DES, IDEA, RC5
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)
93
94 %prep
95 %setup -q -n pycrypto-%{version}
96
97 %build
98 %if %{with python2}
99 # CC/CFLAGS is only for arch packages - remove on noarch packages
100 CC="%{__cc}" \
101 CFLAGS="%{rpmcflags}" \
102 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
103 %endif
104
105 %if %{with python3}
106 # CC/CFLAGS is only for arch packages - remove on noarch packages
107 CC="%{__cc}" \
108 CFLAGS="%{rpmcflags}" \
109 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
110 %endif
111
112 %install
113 rm -rf $RPM_BUILD_ROOT
114
115 %if %{with python2}
116 %{__python} setup.py \
117         build --build-base build-2 \
118         install --skip-build \
119         --root=$RPM_BUILD_ROOT \
120         --optimize=2
121
122 %py_postclean
123
124 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/Crypto/SelfTest
125 %endif
126
127 %if %{with python3}
128 %{__python3} setup.py \
129         build --build-base build-3 \
130         install --skip-build \
131         --root=$RPM_BUILD_ROOT \
132         --optimize=2
133
134 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/Crypto/SelfTest
135 %endif
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %if %{with python2}
141 %files
142 %defattr(644,root,root,755)
143 %doc ACKS COPYRIGHT ChangeLog README TODO Doc
144 %dir %{py_sitedir}/%{module}
145 %{py_sitedir}/%{module}/*.py[co]
146 %dir %{py_sitedir}/%{module}/Cipher
147 %dir %{py_sitedir}/%{module}/Hash
148 %dir %{py_sitedir}/%{module}/Protocol
149 %dir %{py_sitedir}/%{module}/PublicKey
150 %dir %{py_sitedir}/%{module}/Random
151 %dir %{py_sitedir}/%{module}/Random/Fortuna
152 %dir %{py_sitedir}/%{module}/Random/OSRNG
153 %dir %{py_sitedir}/%{module}/Signature
154 %dir %{py_sitedir}/%{module}/Util
155 %attr(755,root,root) %{py_sitedir}/%{module}/*/*.so
156 %{py_sitedir}/%{module}/*/*.py[co]
157 %{py_sitedir}/%{module}/*/*/*.py[co]
158 %if "%{py_ver}" > "2.4"
159 %{py_sitedir}/pycrypto-*.egg-info
160 %endif
161 %endif
162
163 %if %{with python3}
164 %files -n python3-%{module}
165 %defattr(644,root,root,755)
166 %doc ACKS COPYRIGHT ChangeLog README TODO Doc
167 %dir %{py3_sitedir}/%{module}
168 %{py3_sitedir}/%{module}/*.py
169 %{py3_sitedir}/%{module}/__pycache__
170 %dir %{py3_sitedir}/%{module}/Cipher
171 %dir %{py3_sitedir}/%{module}/Hash
172 %dir %{py3_sitedir}/%{module}/Protocol
173 %dir %{py3_sitedir}/%{module}/PublicKey
174 %dir %{py3_sitedir}/%{module}/Random
175 %dir %{py3_sitedir}/%{module}/Random/Fortuna
176 %dir %{py3_sitedir}/%{module}/Random/OSRNG
177 %dir %{py3_sitedir}/%{module}/Signature
178 %dir %{py3_sitedir}/%{module}/Util
179 %attr(755,root,root) %{py3_sitedir}/%{module}/*/*.so
180 %{py3_sitedir}/%{module}/*/*.py
181 %{py3_sitedir}/%{module}/*/__pycache__
182 %{py3_sitedir}/%{module}/*/*/*.py
183 %{py3_sitedir}/%{module}/*/*/__pycache__
184 %{py3_sitedir}/pycrypto-*.egg-info
185 %endif
This page took 0.088881 seconds and 2 git commands to generate.