python-crypto-vl.spec 7.5 KB

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