1 | %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} |
---|
2 | %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} |
---|
3 | |
---|
4 | Summary: Cryptography library for Python |
---|
5 | Summary(ja): Python 用 Cryptography ライブラリ |
---|
6 | Name: python-crypto |
---|
7 | Version: 2.6.1 |
---|
8 | Release: 2%{?_dist_release} |
---|
9 | License: Public Domain and Python |
---|
10 | Group: Development/Libraries |
---|
11 | URL: http://www.dlitz.net/software/pycrypto/ |
---|
12 | Source: http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-%{version}.tar.gz |
---|
13 | |
---|
14 | Patch0: python-crypto-2.4-optflags.patch |
---|
15 | Patch1: python-crypto-2.4-fix-pubkey-size-divisions.patch |
---|
16 | Patch2: pycrypto-2.6.1-CVE-2013-7459.patch |
---|
17 | Patch4: python-crypto-2.6.1-link.patch |
---|
18 | Patch5: pycrypto-2.6.1-CVE-2018-6594.patch |
---|
19 | |
---|
20 | BuildRequires: python >= 2.2 |
---|
21 | BuildRequires: python-devel >= 2.2 |
---|
22 | BuildRequires: python-rpm-macros |
---|
23 | BuildRequires: python3 |
---|
24 | BuildRequires: python3-devel |
---|
25 | BuildRequires: python3-rpm-macros |
---|
26 | BuildRequires: libxcrypt-devel |
---|
27 | BuildRequires: gmp-devel >= 5 |
---|
28 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
29 | |
---|
30 | Vendor: Project Vine |
---|
31 | Distribution: Vine Linux |
---|
32 | |
---|
33 | %description |
---|
34 | Python-crypto is a collection of both secure hash functions |
---|
35 | (such as MD5 and SHA), and various encryption algorithms |
---|
36 | (AES, DES, IDEA, RSA, ElGamal, etc.). |
---|
37 | |
---|
38 | |
---|
39 | %package -n python3-crypto |
---|
40 | Summary: Cryptography library for Python 3 |
---|
41 | %{?python_provide:%python_provide python3-crypto} |
---|
42 | |
---|
43 | %description -n python3-crypto |
---|
44 | PyCrypto is a collection of both secure hash functions (such as MD5 and |
---|
45 | SHA), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.). |
---|
46 | |
---|
47 | This is the Python 3 build of the package. |
---|
48 | |
---|
49 | %prep |
---|
50 | %setup -n pycrypto-%{version} -q |
---|
51 | |
---|
52 | # Use distribution compiler flags rather than upstream's |
---|
53 | %patch0 -p1 |
---|
54 | |
---|
55 | # Fix divisions within benchmarking suite: |
---|
56 | %patch1 -p1 |
---|
57 | |
---|
58 | # AES.new with invalid parameter crashes python |
---|
59 | # https://github.com/dlitz/pycrypto/issues/176 |
---|
60 | # CVE-2013-7459 |
---|
61 | %patch2 -p1 |
---|
62 | |
---|
63 | # log() not available in libgmp, need libm too |
---|
64 | %patch4 |
---|
65 | |
---|
66 | # When creating ElGamal keys, the generator wasn't a square residue: ElGamal |
---|
67 | # encryption done with those keys cannot be secure under the DDH assumption |
---|
68 | # https://bugzilla.redhat.com/show_bug.cgi?id=1542313 (CVE-2018-6594) |
---|
69 | # https://github.com/TElgamal/attack-on-pycrypto-elgamal |
---|
70 | # https://github.com/Legrandin/pycryptodome/issues/90 |
---|
71 | # https://github.com/dlitz/pycrypto/issues/253 |
---|
72 | # Patch based on this commit from cryptodome: |
---|
73 | # https://github.com/Legrandin/pycryptodome/commit/99c27a3b |
---|
74 | # Converted to pull request for pycrypto: |
---|
75 | # https://github.com/dlitz/pycrypto/pull/256 |
---|
76 | %patch5 |
---|
77 | |
---|
78 | # Remove spurious shellbangs |
---|
79 | %{__sed} -i -e '\|^#!/usr/local/bin/python| d' lib/Crypto/Util/RFC1751.py |
---|
80 | |
---|
81 | %build |
---|
82 | %global optflags %{optflags} -fno-strict-aliasing |
---|
83 | %py_build |
---|
84 | %py3_build |
---|
85 | |
---|
86 | %install |
---|
87 | %{__rm} -rf %{buildroot} |
---|
88 | %py_install |
---|
89 | %py3_install |
---|
90 | |
---|
91 | # Remove group write permissions on shared objects |
---|
92 | find %{buildroot}%{python_sitearch} -name '*.so' -exec chmod -c g-w {} \; |
---|
93 | find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod -c g-w {} \; |
---|
94 | |
---|
95 | %check |
---|
96 | %{__python} setup.py test |
---|
97 | %{__python3} setup.py test |
---|
98 | |
---|
99 | %clean |
---|
100 | rm -rf $RPM_BUILD_ROOT |
---|
101 | |
---|
102 | |
---|
103 | %files |
---|
104 | %defattr(-,root,root,-) |
---|
105 | %license COPYRIGHT LEGAL/ |
---|
106 | %doc README TODO ACKS ChangeLog Doc/ |
---|
107 | %{python_sitearch}/Crypto/ |
---|
108 | %{python_sitearch}/pycrypto-%{version}-py2.*.egg-info |
---|
109 | |
---|
110 | %files -n python3-crypto |
---|
111 | %defattr(-,root,root,-) |
---|
112 | %license COPYRIGHT LEGAL/ |
---|
113 | %doc README TODO ACKS ChangeLog Doc/ |
---|
114 | %{python3_sitearch}/Crypto/ |
---|
115 | %{python3_sitearch}/pycrypto-%{version}-py3.*.egg-info |
---|
116 | |
---|
117 | %changelog |
---|
118 | * Tue May 14 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6.1-2 |
---|
119 | - dropped all patches. |
---|
120 | - import patched from rawhide. |
---|
121 | - added BR:libxcrypt-devel. |
---|
122 | - added python3 support. |
---|
123 | |
---|
124 | * Sun Dec 15 2013 NAKAMURA Kenta <kenta@vinelinux.org> 2.6.1-1 |
---|
125 | - new upstream release |
---|
126 | - drop Patch3: doc.patch |
---|
127 | |
---|
128 | * Sat May 26 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.6-1 |
---|
129 | - new upstream release |
---|
130 | |
---|
131 | * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.5-2 |
---|
132 | - rebuild with python-2.7.2 |
---|
133 | |
---|
134 | * Mon Jan 16 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.5-1 |
---|
135 | - new upstream release |
---|
136 | - added patches(1,2,3) from Debian |
---|
137 | |
---|
138 | * Sun Nov 13 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.4.1-1 |
---|
139 | - new upstream release |
---|
140 | - dropt patch1 |
---|
141 | |
---|
142 | * Sun Oct 3 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.3-2 |
---|
143 | - rebuilt with rpm-4.8.1 for pkg-config |
---|
144 | |
---|
145 | * Sat Aug 28 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.3-1 |
---|
146 | - new upstream release |
---|
147 | - changed %%files |
---|
148 | |
---|
149 | * Sun Aug 22 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.2-2 |
---|
150 | - fix %files (change directory from %{python_sitelib} to %{python_sitearch}) |
---|
151 | |
---|
152 | * Sun Aug 22 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.2-1 |
---|
153 | - new upstream release |
---|
154 | |
---|
155 | * Wed Jul 7 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.1.0-1 |
---|
156 | - new upstream release |
---|
157 | - changed URL and SOURCE to new upstream |
---|
158 | - dropt patch0,2 |
---|
159 | - replaced patch1 from Debian newer |
---|
160 | - added pacth3 from Debian |
---|
161 | - changed document files dir in %%files |
---|
162 | |
---|
163 | * Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 2.0.1-3 |
---|
164 | - rebuild with python-2.6 |
---|
165 | |
---|
166 | * Fri Oct 23 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.0.1-2 |
---|
167 | - added Patch0,1,2 from Debian to fix some problem |
---|
168 | |
---|
169 | * Wed Jul 29 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.0.1-1 |
---|
170 | - initial build for VineSeed |
---|
171 | |
---|
172 | * Mon Jun 04 2007 David Woodhouse <dwmw2@infradead.org> - 2.0.1-7.1 |
---|
173 | - Fix libdir handling so it works on more arches than x86_64 |
---|
174 | |
---|
175 | * Wed Apr 18 2007 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-7 |
---|
176 | - Fix typo |
---|
177 | |
---|
178 | * Wed Apr 18 2007 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-6 |
---|
179 | - Remove dist |
---|
180 | - rebuild, because the older version was much bigger, as it was build when |
---|
181 | distutils was doing static links of libpython |
---|
182 | |
---|
183 | * Sat Dec 09 2006 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-5 |
---|
184 | - Rebuild for python 2.5 |
---|
185 | |
---|
186 | * Thu Sep 07 2006 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-4 |
---|
187 | - Don't ghost pyo files (#205408) |
---|
188 | |
---|
189 | * Tue Aug 29 2006 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-3 |
---|
190 | - Rebuild for Fedora Extras 6 |
---|
191 | |
---|
192 | * Mon Feb 13 2006 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-2 |
---|
193 | - Rebuild for Fedora Extras 5 |
---|
194 | |
---|
195 | * Wed Aug 17 2005 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0.1-1 |
---|
196 | - Update to 2.0.1 |
---|
197 | - Use Dist |
---|
198 | - Drop python-crypto-64bit-unclean.patch, similar patch was applied |
---|
199 | upstream |
---|
200 | |
---|
201 | * Thu May 05 2005 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0-4 |
---|
202 | - add python-crypto-64bit-unclean.patch (#156173) |
---|
203 | |
---|
204 | * Mon Mar 21 2005 Seth Vidal <skvidal at phy.duke.edu> - 0:2.0-3 |
---|
205 | - iterate release for build on python 2.4 based systems |
---|
206 | |
---|
207 | * Sat Dec 18 2004 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0-2 |
---|
208 | - Fix build on x86_64: use python_sitearch for files and patch source |
---|
209 | to find gmp |
---|
210 | |
---|
211 | * Thu Aug 26 2004 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0-0.fdr.1 |
---|
212 | - Update to 2.00 |
---|
213 | |
---|
214 | * Fri Aug 13 2004 Ville Skytta <ville.skytta at iki.fi> - 0:1.9-0.fdr.6.a6 |
---|
215 | - Don't use get_python_version(), it's available in Python >= 2.3 only. |
---|
216 | |
---|
217 | * Thu Aug 12 2004 Thorsten Leemhuis <fedora at leemhuis dot info> 0:1.9-0.fdr.5.a6 |
---|
218 | - Own dir python_sitearch/Crypto/ |
---|
219 | |
---|
220 | * Wed Aug 11 2004 Thorsten Leemhuis <fedora at leemhuis dot info> 0:1.9-0.fdr.4.a6 |
---|
221 | - Match python spec template more |
---|
222 | |
---|
223 | * Sat Jul 17 2004 Thorsten Leemhuis <fedora at leemhuis dot info> 0:1.9-0.fdr.3.a6 |
---|
224 | - Own _libdir/python/site-packages/Crypto/ |
---|
225 | |
---|
226 | * Wed Mar 24 2004 Panu Matilainen <pmatilai@welho.com> 0.3.2-0.fdr.2.a6 |
---|
227 | - generate .pyo files during install |
---|
228 | - require exact version of python used to build the package |
---|
229 | - include more docs + demos |
---|
230 | - fix dependency on /usr/local/bin/python |
---|
231 | - use fedora.us style buildroot |
---|
232 | - buildrequires gmp-devel |
---|
233 | - use description from README |
---|
234 | |
---|
235 | * Sun Jan 11 2004 Ryan Boder <icanoop@bitwiser.org> 0.3.2-0.fdr.1.a6 |
---|
236 | - Initial build. |
---|
237 | |
---|