Blame SPECS/python-crypto.spec

205252
%global pythonver %(%{__python} -c "import sys; print sys.version[:3]" 2>/dev/null || echo 0.0)
205252
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" 2>/dev/null)}
205252
205252
# Python3 introduced in Fedora 13
205252
%global with_python3 %([ 0%{?fedora} -gt 12 ] && echo 1 || echo 0)
205252
205252
Summary:	Cryptography library for Python
205252
Name:		python-crypto
205252
Version:	2.6.1
205252
Release:	1%{?dist}
205252
# Mostly Public Domain apart from parts of HMAC.py and setup.py, which are Python
205252
License:	Public Domain and Python
205252
Group:		Development/Libraries
205252
URL:		http://www.pycrypto.org/
205252
Source0:	http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-%{version}.tar.gz
205252
Patch0:		python-crypto-2.4-optflags.patch
205252
Patch1:		python-crypto-2.4-fix-pubkey-size-divisions.patch
205252
Provides:	pycrypto = %{version}-%{release}
205252
BuildRequires:	python2-devel >= 2.2, gmp-devel >= 4.1
205252
%if %{with_python3}
205252
BuildRequires:	python-tools
205252
BuildRequires:	python3-devel
205252
%endif
205252
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot-%(id -nu)
205252
205252
# Don't want provides for python shared objects
205252
%{?filter_provides_in: %filter_provides_in %{python_sitearch}/Crypto/.*\.so}
205252
%if %{with_python3}
205252
%{?filter_provides_in: %filter_provides_in %{python3_sitearch}/Crypto/.*\.so}
205252
%endif
205252
%{?filter_setup}
205252
205252
%description
205252
PyCrypto is a collection of both secure hash functions (such as MD5 and
205252
SHA), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.).
205252
205252
%if %{with_python3}
205252
%package -n python3-crypto
205252
Summary:	Cryptography library for Python 3
205252
Group:		Development/Libraries
205252
205252
%description -n python3-crypto
205252
PyCrypto is a collection of both secure hash functions (such as MD5 and
205252
SHA), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.).
205252
205252
This is the Python 3 build of the package.
205252
%endif
205252
205252
%prep
205252
%setup -n pycrypto-%{version} -q
205252
205252
# Use distribution compiler flags rather than upstream's
205252
%patch0 -p1
205252
205252
# Fix divisions within benchmarking suite:
205252
%patch1 -p1
205252
205252
# Prepare python3 build (setup.py doesn't run 2to3 on pct-speedtest.py)
205252
%if %{with_python3}
205252
cp -a . %{py3dir}
205252
2to3 -wn %{py3dir}/pct-speedtest.py
205252
%endif
205252
205252
%build
205252
CFLAGS="%{optflags} -fno-strict-aliasing" %{__python} setup.py build
205252
205252
%if %{with_python3}
205252
cd %{py3dir}
205252
CFLAGS="%{optflags} -fno-strict-aliasing" %{__python3} setup.py build
205252
cd -
205252
%endif
205252
205252
%install
205252
rm -rf %{buildroot}
205252
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
205252
205252
# Remove group write permissions on shared objects
205252
find %{buildroot}%{python_sitearch} -name '*.so' -exec chmod -c g-w {} \;
205252
205252
# Build for python3 too
205252
%if %{with_python3}
205252
cd %{py3dir}
205252
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
205252
cd -
205252
find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod -c g-w {} \;
205252
%endif
205252
205252
# See if there's any egg-info
205252
if [ -f %{buildroot}%{python_sitearch}/pycrypto-%{version}-py%{pythonver}.egg-info ]; then
205252
	echo %{python_sitearch}/pycrypto-%{version}-py%{pythonver}.egg-info
205252
fi > egg-info
205252
205252
%check
205252
%{__python} setup.py test
205252
205252
# Benchmark uses os.urandom(), which is available from python 2.4
205252
%if %(%{__python} -c "import sys; print sys.hexversion >= 0x02040000 and 1 or 0" 2>/dev/null || echo 0)
205252
PYTHONPATH=%{buildroot}%{python_sitearch} %{__python} pct-speedtest.py
205252
%endif
205252
205252
# Test the python3 build too
205252
%if %{with_python3}
205252
cd %{py3dir}
205252
%{__python3} setup.py test
205252
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} pct-speedtest.py
205252
cd -
205252
%endif
205252
205252
%clean
205252
rm -rf %{buildroot}
205252
205252
%files -f egg-info
205252
%defattr(-,root,root,-)
205252
%doc README TODO ACKS ChangeLog LEGAL/ COPYRIGHT Doc/
205252
%{python_sitearch}/Crypto/
205252
205252
%if %{with_python3}
205252
%files -n python3-crypto
205252
%defattr(-,root,root,-)
205252
%doc README TODO ACKS ChangeLog LEGAL/ COPYRIGHT Doc/
205252
%{python3_sitearch}/Crypto/
205252
%{python3_sitearch}/pycrypto-*py3.*.egg-info
205252
%endif
205252
205252
%changelog
205252
* Fri Oct 18 2013 Paul Howarth <paul@city-fan.org> - 2.6.1-1
205252
- Update to 2.6.1
205252
  - Fix PRNG not correctly reseeded in some situations (CVE-2013-1445)
205252
205252
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-6
205252
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
205252
205252
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-5
205252
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
205252
205252
* Fri Aug 03 2012 David Malcolm <dmalcolm@redhat.com> - 2.6-4
205252
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
205252
205252
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 2.6-3
205252
- remove rhel logic from with_python3 conditional
205252
205252
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-2
205252
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
205252
205252
* Thu May 24 2012 Paul Howarth <paul@city-fan.org> - 2.6-1
205252
- Update to 2.6
205252
  - Fix insecure ElGamal key generation (launchpad bug #985164, CVE-2012-2417)
205252
  - Huge documentation cleanup
205252
  - Added more tests, including test vectors from NIST 800-38A
205252
  - Remove broken MODE_PGP, which never actually worked properly
205252
  - A new mode, MODE_OPENPGP, has been added for people wishing to write
205252
    OpenPGP implementations (see also launchpad bug #996814)
205252
  - Fix: getPrime with invalid input causes Python to abort with fatal error
205252
    (launchpad bug #988431)
205252
  - Fix: Segfaults within error-handling paths (launchpad bug #934294)
205252
  - Fix: Block ciphers allow empty string as IV (launchpad bug #997464)
205252
  - Fix DevURandomRNG to work with Python3's new I/O stack
205252
  - Remove automagic dependencies on libgmp and libmpir; let the caller
205252
    disable them using args
205252
  - Many other minor bug fixes and improvements
205252
- Drop upstream patches
205252
205252
* Sat Feb 18 2012 Paul Howarth <paul@city-fan.org> - 2.5-2
205252
- Add upstream fixes for issues found by Dave Malcolm's experimental static
205252
  analysis tool (#790584)
205252
205252
* Mon Jan 16 2012 Paul Howarth <paul@city-fan.org> - 2.5-1
205252
- Update to 2.5
205252
  - Added PKCS#1 encryption schemes (v1.5 and OAEP); we now have a decent,
205252
    easy-to-use non-textbook RSA implementation
205252
  - Added PKCS#1 signature schemes (v1.5 and PSS); v1.5 required some
205252
    extensive changes to Hash modules to contain the algorithm-specific ASN.1
205252
    OID, and to that end we now always have a (thin) Python module to hide the
205252
    one in pure C
205252
  - Added 2 standard Key Derivation Functions (PBKDF1 and PBKDF2)
205252
  - Added export/import of RSA keys in OpenSSH and PKCS#8 formats
205252
  - Added password-protected export/import of RSA keys (one old method for
205252
    PKCS#8 PEM only)
205252
  - Added ability to generate RSA key pairs with configurable public
205252
    exponent e
205252
  - Added ability to construct an RSA key pair even if only the private
205252
    exponent d is known, and not p and q
205252
  - Added SHA-2 C source code (fully from Lorenz Quack)
205252
  - Unit tests for all the above
205252
  - Updates to documentation (both inline and in Doc/pycrypt.rst)
205252
  - Minor bug fixes (setup.py and tests)
205252
- Upstream no longer ships python-3-changes.txt
205252
205252
* Sat Jan  7 2012 Paul Howarth <paul@city-fan.org> - 2.4.1-2
205252
- Rebuild with gcc 4.7
205252
205252
* Mon Nov  7 2011 Paul Howarth <paul@city-fan.org> - 2.4.1-1
205252
- Update to 2.4.1
205252
  - Fix "error: Setup script exited with error: src/config.h: No such file or
205252
    directory" when installing via easy_install
205252
205252
* Wed Oct 26 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.4-2.1
205252
- Rebuild with new gmp without compat lib
205252
205252
* Tue Oct 25 2011 Paul Howarth <paul@city-fan.org> - 2.4-2
205252
- Add python3-crypto subpackage (based on patch from Dave Malcolm - #748529)
205252
205252
* Mon Oct 24 2011 Paul Howarth <paul@city-fan.org> - 2.4-1
205252
- Update to 2.4
205252
  - Python 3 support! PyCrypto now supports every version of Python from 2.1
205252
    through to 3.2
205252
  - Timing-attack countermeasures in _fastmath: when built against libgmp
205252
    version 5 or later, we use mpz_powm_sec instead of mpz_powm, which should
205252
    prevent the timing attack described by Geremy Condra at PyCon 2011
205252
  - New hash modules (for Python ≥ 2.5 only): SHA224, SHA384 and SHA512
205252
  - Configuration using GNU autoconf, which should help fix a bunch of build
205252
    issues
205252
  - Support using MPIR as an alternative to GMP
205252
  - Improve the test command in setup.py, by allowing tests to be performed on
205252
    a single sub-package or module only
205252
  - Fix double-decref of "counter" when Cipher object initialization fails
205252
  - Apply patches from Debian's python-crypto 2.3-3 package:
205252
    - fix-RSA-generate-exception.patch
205252
    - epydoc-exclude-introspect.patch
205252
    - no-usr-local.patch
205252
  - Fix launchpad bug #702835: "Import key code is not compatible with GMP
205252
    library"
205252
  - More tests, better documentation, various bugfixes
205252
- Update patch for imposing our own compiler optimization flags
205252
- Drop lib64 patch, no longer needed
205252
- No longer need to fix up permissions and remove shellbangs
205252
205252
* Wed Oct 12 2011 Peter Schiffer <pschiffe@redhat.com> - 2.3-5.1
205252
- Rebuild with new gmp
205252
205252
* Wed May 11 2011 Paul Howarth <paul@city-fan.org> - 2.3-5
205252
- Upstream rolled new tarball with top-level directory restored
205252
- Nobody else likes macros for commands
205252
205252
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3-4
205252
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
205252
205252
* Wed Sep 29 2010 jkeating - 2.3-3
205252
- Rebuilt for gcc bug 634757
205252
205252
* Fri Sep 24 2010 David Malcolm <dmalcolm@redhat.com> - 2.3-2
205252
- Add "-fno-strict-aliasing" to compilation flags
205252
205252
* Fri Aug 27 2010 Paul Howarth <paul@city-fan.org> - 2.3-1
205252
- Update to 2.3
205252
  - Fix NameError when attempting to use deprecated getRandomNumber() function
205252
  - _slowmath: Compute RSA u parameter when it's not given to RSA.construct;
205252
    this makes _slowmath behave the same as _fastmath in this regard
205252
  - Make RSA.generate raise a more user-friendly exception message when the
205252
    user tries to generate a bogus-length key
205252
- Add -c option to %%setup because upstream tarball has dropped the top-level
205252
  directory
205252
- Run benchmark as part of %%check if we have python 2.4 or later
205252
- BR: python2-devel rather than just python-devel
205252
- Add patch to make sure we can find libgmp in 64-bit multilib environments
205252
205252
* Tue Aug  3 2010 Paul Howarth <paul@city-fan.org> - 2.2-1
205252
- Update to 2.2
205252
  - Deprecated Crypto.Util.number.getRandomNumber()
205252
  - It's been replaced by getRandomNBitInteger and getRandomInteger
205252
  - Better isPrime() and getPrime() implementations
205252
  - getStrongPrime() implementation for generating RSA primes
205252
  - Support for importing and exporting RSA keys in DER and PEM format
205252
  - Fix PyCrypto when floor division (python -Qnew) is enabled
205252
  - When building using gcc, use -std=c99 for compilation
205252
- Update optflags patch
205252
205252
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.1.0-2
205252
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
205252
205252
* Tue Feb 16 2010 Paul Howarth <paul@city-fan.org> - 2.1.0-1
205252
- Update to 2.1.0 (see ChangeLog for details)
205252
- Remove patches (no longer needed)
205252
- Use new upstream URLs
205252
- Upstream has replaced LICENSE with LEGAL/ and COPYRIGHT
205252
- Clarify that license is mostly Public Domain, partly Python
205252
- Add %%check section and run the test suite in it
205252
- Remove upstream's fiddling with compiler optimization flags so we get
205252
  usable debuginfo
205252
- Filter out unwanted provides for python shared objects
205252
- Tidy up egg-info handling
205252
- Simplify %%files list
205252
- Pacify rpmlint as much as is reasonable
205252
- Add dist tag
205252
205252
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-19
205252
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
205252
205252
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-18
205252
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
205252
205252
* Fri Feb 13 2009 Stewart Adam <s.adam at diffingo.com> - 2.0.1-17
205252
- Use patches in upstream git to fix #484473
205252
205252
* Fri Feb 13 2009 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.0.1-16.1
205252
- add patch to fix #485298 / CVE-2009-0544
205252
205252
* Sat Feb 7 2009 Stewart Adam <s.adam at diffingo.com> - 2.0.1-15.1
205252
- Oops, actually apply the patch
205252
- Modify patch so modules remain compatible with PEP 247
205252
205252
* Sat Feb 7 2009 Stewart Adam <s.adam at diffingo.com> - 2.0.1-15
205252
- Add patch to hashlib instead of deprecated md5 and sha modules (#484473)
205252
205252
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.0.1-14.1
205252
- Rebuild for Python 2.6
205252
205252
* Sun May 04 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.0.1-13
205252
- provide pycrypto
205252
205252
* Sat Feb 09 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.0.1-12
205252
- rebuilt
205252
205252
* Fri Jan 04 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.0.1-11
205252
- egg-info file in python_sitearch and not in python_sitelib
205252
205252
* Fri Jan 04 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.0.1-10
205252
- ship egg-file
205252
205252
* Tue Aug 21 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.0.1-9
205252
- Remove the old and outdated python-abi hack
205252
205252
* Fri Aug 03 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info>
205252
- Update License field due to the "Licensing guidelines changes"
205252
205252
* Mon Jun 04 2007 David Woodhouse <dwmw2@infradead.org> - 2.0.1-8
205252
- Fix libdir handling so it works on more arches than x86_64
205252
205252
* Wed Apr 18 2007 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-7
205252
- Fix typo
205252
205252
* Wed Apr 18 2007 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-6
205252
- Remove dist
205252
- rebuild, because the older version was much bigger, as it was build when
205252
  distutils was doing static links of libpython
205252
205252
* Sat Dec 09 2006 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-5
205252
- Rebuild for python 2.5
205252
205252
* Thu Sep 07 2006 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-4
205252
- Don't ghost pyo files (#205408)
205252
205252
* Tue Aug 29 2006 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-3
205252
- Rebuild for Fedora Extras 6
205252
205252
* Mon Feb 13 2006 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.0.1-2
205252
- Rebuild for Fedora Extras 5
205252
205252
* Wed Aug 17 2005 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0.1-1
205252
- Update to 2.0.1
205252
- Use Dist
205252
- Drop python-crypto-64bit-unclean.patch, similar patch was applied 
205252
  upstream
205252
205252
* Thu May 05 2005 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0-4
205252
- add python-crypto-64bit-unclean.patch (#156173)
205252
205252
* Mon Mar 21 2005 Seth Vidal <skvidal at phy.duke.edu> - 0:2.0-3
205252
- iterate release for build on python 2.4 based systems
205252
205252
* Sat Dec 18 2004 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0-2
205252
- Fix build on x86_64: use python_sitearch for files and patch source
205252
  to find gmp
205252
205252
* Thu Aug 26 2004 Thorsten Leemhuis <fedora at leemhuis dot info> - 0:2.0-0.fdr.1
205252
- Update to 2.00
205252
205252
* Fri Aug 13 2004 Ville Skytta <ville.skytta at iki.fi> - 0:1.9-0.fdr.6.a6
205252
- Don't use get_python_version(), it's available in Python >= 2.3 only.
205252
205252
* Thu Aug 12 2004 Thorsten Leemhuis <fedora at leemhuis dot info> 0:1.9-0.fdr.5.a6
205252
- Own dir python_sitearch/Crypto/
205252
205252
* Wed Aug 11 2004 Thorsten Leemhuis <fedora at leemhuis dot info> 0:1.9-0.fdr.4.a6
205252
- Match python spec template more
205252
205252
* Sat Jul 17 2004 Thorsten Leemhuis <fedora at leemhuis dot info> 0:1.9-0.fdr.3.a6
205252
- Own _libdir/python/site-packages/Crypto/
205252
205252
* Wed Mar 24 2004 Panu Matilainen <pmatilai@welho.com> 0.3.2-0.fdr.2.a6
205252
- generate .pyo files during install
205252
- require exact version of python used to build the package
205252
- include more docs + demos
205252
- fix dependency on /usr/local/bin/python
205252
- use fedora.us style buildroot
205252
- buildrequires gmp-devel
205252
- use description from README
205252
205252
* Sun Jan 11 2004 Ryan Boder <icanoop@bitwiser.org>  0.3.2-0.fdr.1.a6
205252
- Initial build.
205252