73f0b32
%if 0%{?fedora} || 0%{?rhel} > 7
73f0b32
# Enable python3 build by default
73f0b32
%bcond_without python3
5eac1cd
%else
73f0b32
%bcond_with python3
73f0b32
%endif
73f0b32
73f0b32
%if 0%{?fedora} > 31 || 0%{?rhel} > 7
73f0b32
# Disable python2 build by default
73f0b32
%bcond_with python2
73f0b32
%else
73f0b32
%bcond_without python2
5eac1cd
%endif
5eac1cd
0e50205
%{!?python3_pkgversion:%global python3_pkgversion 3}
0e50205
f23f1ef
%global srcname cryptography
f23f1ef
f23f1ef
Name:           python-%{srcname}
080edf5
Version:        2.6.1
73f0b32
Release:        3%{?dist}
5eac1cd
Summary:        PyCA's cryptography library
5eac1cd
2b9cc15
License:        ASL 2.0 or BSD
5eac1cd
URL:            https://cryptography.io/en/latest/
f23f1ef
Source0:        https://pypi.io/packages/source/c/%{srcname}/%{srcname}-%{version}.tar.gz
5eac1cd
5eac1cd
BuildRequires:  openssl-devel
985a0ec
BuildRequires:  gcc
27ec704
73f0b32
%if 0%{?with_python2}
f23f1ef
BuildRequires:  python2-devel
8a8b99c
BuildRequires:  python2-pytest >= 3.2.1
f23f1ef
BuildRequires:  python2-setuptools
229133e
BuildRequires:  python2-pretend
f23f1ef
BuildRequires:  python2-iso8601
f23f1ef
BuildRequires:  python2-cryptography-vectors = %{version}
Christian Heimes aababb3
BuildRequires:  python2-asn1crypto >= 0.21
f23f1ef
BuildRequires:  python2-hypothesis >= 1.11.4
229133e
BuildRequires:  python2-pytz
777ef8f
f23f1ef
BuildRequires:  python2-idna >= 2.1
f23f1ef
BuildRequires:  python2-six >= 1.4.1
f23f1ef
BuildRequires:  python2-cffi >= 1.7
229133e
BuildRequires:  python2-enum34
229133e
BuildRequires:  python2-ipaddress
73f0b32
%endif
27ec704
5eac1cd
%if 0%{?with_python3}
f23f1ef
BuildRequires:  python%{python3_pkgversion}-devel
8a8b99c
BuildRequires:  python%{python3_pkgversion}-pytest >= 3.2.1
f23f1ef
BuildRequires:  python%{python3_pkgversion}-setuptools
f23f1ef
BuildRequires:  python%{python3_pkgversion}-pretend
f23f1ef
BuildRequires:  python%{python3_pkgversion}-iso8601
f23f1ef
BuildRequires:  python%{python3_pkgversion}-cryptography-vectors = %{version}
f23f1ef
BuildRequires:  python%{python3_pkgversion}-asn1crypto >= 0.21
f23f1ef
BuildRequires:  python%{python3_pkgversion}-hypothesis >= 1.11.4
f23f1ef
BuildRequires:  python%{python3_pkgversion}-pytz
f23f1ef
f23f1ef
BuildRequires:  python%{python3_pkgversion}-idna >= 2.1
f23f1ef
BuildRequires:  python%{python3_pkgversion}-six >= 1.4.1
f23f1ef
BuildRequires:  python%{python3_pkgversion}-cffi >= 1.7
5eac1cd
%endif
5eac1cd
5eac1cd
%description
5eac1cd
cryptography is a package designed to expose cryptographic primitives and
5eac1cd
recipes to Python developers.
5eac1cd
73f0b32
%if 0%{?with_python2}
f23f1ef
%package -n  python2-%{srcname}
777ef8f
Summary:        PyCA's cryptography library
b27a5f5
9e52198
%if 0%{?with_python3}
f23f1ef
%{?python_provide:%python_provide python2-%{srcname}}
b27a5f5
%else
f23f1ef
Provides:       python-%{srcname}
b27a5f5
%endif
777ef8f
Colin Walters bd2b6c6
Requires:       openssl-libs
f23f1ef
Requires:       python2-idna >= 2.1
Christian Heimes aababb3
Requires:       python2-asn1crypto >= 0.21
f23f1ef
Requires:       python2-six >= 1.4.1
f23f1ef
Requires:       python2-cffi >= 1.7
229133e
Requires:       python2-enum34
229133e
Requires:       python2-ipaddress
777ef8f
f23f1ef
%description -n python2-%{srcname}
777ef8f
cryptography is a package designed to expose cryptographic primitives and
777ef8f
recipes to Python developers.
73f0b32
%endif
777ef8f
5eac1cd
%if 0%{?with_python3}
f23f1ef
%package -n  python%{python3_pkgversion}-%{srcname}
5eac1cd
Summary:        PyCA's cryptography library
f23f1ef
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
5eac1cd
Colin Walters bd2b6c6
Requires:       openssl-libs
f23f1ef
Requires:       python%{python3_pkgversion}-idna >= 2.1
f23f1ef
Requires:       python%{python3_pkgversion}-asn1crypto >= 0.21
f23f1ef
Requires:       python%{python3_pkgversion}-six >= 1.4.1
f23f1ef
Requires:       python%{python3_pkgversion}-cffi >= 1.7
5eac1cd
f23f1ef
%description -n python%{python3_pkgversion}-%{srcname}
5eac1cd
cryptography is a package designed to expose cryptographic primitives and
5eac1cd
recipes to Python developers.
5eac1cd
%endif
5eac1cd
5eac1cd
%prep
f23f1ef
%autosetup -p1 -n %{srcname}-%{version}
5eac1cd
5eac1cd
%build
73f0b32
%if 0%{?with_python2}
9e52198
%py2_build
73f0b32
%endif
73f0b32
%if 0%{?with_python3}
f23f1ef
%py3_build
73f0b32
%endif
5eac1cd
5eac1cd
%install
5eac1cd
# Actually other *.c and *.h are appropriate
5eac1cd
# see https://github.com/pyca/cryptography/issues/1463
5eac1cd
find . -name .keep -print -delete
5eac1cd
73f0b32
%if 0%{?with_python2}
9e52198
%py2_install
73f0b32
%endif
73f0b32
%if 0%{?with_python3}
f23f1ef
%py3_install
73f0b32
%endif
5eac1cd
5eac1cd
%check
73f0b32
%if 0%{?with_python2}
73f0b32
# see https://github.com/pyca/cryptography/issues/4885 and
73f0b32
# see https://bugzilla.redhat.com/show_bug.cgi?id=1761194 for deselected tests
73f0b32
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)"
73f0b32
%endif
5eac1cd
5eac1cd
%if 0%{?with_python3}
73f0b32
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)"
5eac1cd
%endif
5eac1cd
5eac1cd
73f0b32
%if 0%{?with_python2}
f23f1ef
%files -n python2-%{srcname}
2b9cc15
%doc LICENSE LICENSE.APACHE LICENSE.BSD README.rst docs
0e50205
%{python2_sitearch}/%{srcname}
0e50205
%{python2_sitearch}/%{srcname}-%{version}-py*.egg-info
73f0b32
%endif
5eac1cd
5eac1cd
5eac1cd
%if 0%{?with_python3}
f23f1ef
%files -n python%{python3_pkgversion}-%{srcname}
f23f1ef
%doc README.rst docs
f23f1ef
%license LICENSE LICENSE.APACHE LICENSE.BSD
73f0b32
%{python3_sitearch}/%{srcname}
f23f1ef
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
5eac1cd
%endif
5eac1cd
5eac1cd
5eac1cd
%changelog
73f0b32
* Sun Oct 13 2019 Christian Heimes <cheimes@redhat.com> - 2.6.1-3
73f0b32
- Skip unit tests that fail with OpenSSL 1.1.1.d
73f0b32
- Resolves: rhbz#1761194
73f0b32
- Fix and simplify Python 3 packaging
73f0b32
7395bb8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-2
7395bb8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
7395bb8
080edf5
* Thu Feb 28 2019 Christian Heimes <cheimes@redhat.com> - 2.6.1-1
080edf5
- New upstream release 2.6.1, resolves RHBZ#1683691
080edf5
437c09b
* Wed Feb 13 2019 Alfredo Moralejo <amoralej@redhat.com> - 2.5-1
437c09b
- Updated to 2.5.
437c09b
3b94213
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3-3
3b94213
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
3b94213
f0e48c2
* Mon Aug 13 2018 Christian Heimes <cheimes@redhat.com> - 2.3-2
f0e48c2
- Use TLSv1.2 in test as workaround for RHBZ#1615143
f0e48c2
aa22128
* Wed Jul 18 2018 Christian Heimes <cheimes@redhat.com> - 2.3-1
aa22128
- New upstream release 2.3
aa22128
- Fix AEAD tag truncation bug, RHBZ#1602752
aa22128
ee5c33e
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-3
ee5c33e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
ee5c33e
8390e45
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.1-2
8390e45
- Rebuilt for Python 3.7
8390e45
0bfc451
* Wed Mar 21 2018 Christian Heimes <cheimes@redhat.com> - 2.2.1-1
0bfc451
- New upstream release 2.2.1
0bfc451
e6b5d11
* Sun Feb 18 2018 Christian Heimes <cheimes@redhat.com> - 2.1.4-1
e6b5d11
- New upstream release 2.1.4
e6b5d11
985a0ec
* Sun Feb 18 2018 Christian Heimes <cheimes@redhat.com> - 2.1.3-4
985a0ec
- Build requires gcc
985a0ec
229133e
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.1.3-3
229133e
- Update Python 2 dependency declarations to new packaging standards
229133e
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
229133e
7739c4a
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-2
7739c4a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
7739c4a
7a283fd
* Thu Nov 23 2017 Haïkel Guémar <hguemar@fedoraproject.org> - 2.1.3-1
7a283fd
- Upstream 2.1.3
7a283fd
c34f49f
* Tue Oct 24 2017 Christian Heimes <cheimes@redhat.com> - 2.1-2
c34f49f
- Change Requires to openssl-libs
c34f49f
8a8b99c
* Thu Oct 12 2017 Christian Heimes <cheimes@redhat.com> - 2.1-1
8a8b99c
- New upstream release 2.1
8a8b99c
9e52198
* Wed Sep 27 2017 Troy Dawson <tdawson@redhat.com> - 2.0.2-3
9e52198
- Cleanup spec file conditionals
9e52198
0e50205
* Thu Aug 03 2017 Christian Heimes <cheimes@redhat.com> - 2.0.2-2
0e50205
- Add workaround for pytest bug
0e50205
f23f1ef
* Thu Aug 03 2017 Christian Heimes <cheimes@redhat.com> - 2.0.2-1
f23f1ef
- New upstream release 2.0.2
f23f1ef
- Modernize spec
f23f1ef
6cd5fe4
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-3
6cd5fe4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
6cd5fe4
7e9d542
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-2
7e9d542
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
7e9d542
Christian Heimes aababb3
* Tue Jun 27 2017 Christian Heimes <cheimes@redhat.com> - 1.9-1
Christian Heimes aababb3
- Upstream release 1.9
Christian Heimes aababb3
Christian Heimes e0298e2
* Wed Feb 15 2017 Christian Heimes <cheimes@redhat.com> - 1.7.2-1
Christian Heimes e0298e2
- Update to latest upstream
Christian Heimes e0298e2
d09ea6c
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-2
d09ea6c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d09ea6c
e2fe49e
* Thu Jan 05 2017 Matěj Cepl <mcepl@redhat.com> - 1.7.1-1
e2fe49e
- Update to the latest upstream.
0e7bbf7
- Add a patch from https://github.com/pyca/cryptography/pull/3328
e2fe49e
176faf4
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.5.3-5
176faf4
- Enable tests
176faf4
8e84bae
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.5.3-4
8e84bae
- Rebuild for Python 3.6
8e84bae
- Disable python3 tests for now
8e84bae
176e84e
* Thu Nov 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.5.3-3
176e84e
- Revert previous change
176e84e
1269475
* Thu Nov 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.5.3-2
1269475
- Disable tests on releases earlier than 24
1269475
9aa544e
* Mon Nov 07 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.5.3-1
9aa544e
- Update to v1.5.3
9aa544e
- Update source URL
6344bc6
- Add BR for pytz
9aa544e
2f793c4
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-4
2f793c4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
2f793c4
2115dff
* Tue May 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-3
2115dff
- Remove versioned setuptools dependency
2115dff
b27a5f5
* Tue May 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-2
b27a5f5
- Make it easier to build on EL7
b27a5f5
5effb8e
* Tue May 03 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-1
5effb8e
- Update to v1.3.1
5effb8e
2d6faa0
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-3
2d6faa0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2d6faa0
777ef8f
* Mon Jan 11 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-2
777ef8f
- Move python-cryptograph => python2-cryptography
777ef8f
7d1e28f
* Sat Jan 09 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-1
7d1e28f
- Update to v1.2.1
7d1e28f
Robert Kuska 8f91816
* Wed Nov 11 2015 Robert Kuska <rkuska@redhat.com> - 1.1-1
Robert Kuska 8f91816
- Update to v1.1
Robert Kuska 8f91816
Robert Kuska 1326ad4
* Wed Nov 04 2015 Robert Kuska <rkuska@redhat.com> - 1.0.2-2
Robert Kuska 1326ad4
- Rebuilt for Python3.5 rebuild
Robert Kuska 1326ad4
4743d35
* Wed Sep 30 2015 Matěj Cepl <mcepl@redhat.com> - 1.0.2-1
4743d35
- New upstream release (fix #1267548)
4743d35
03a59bd
* Wed Aug 12 2015 Nathaniel McCallum <npmccallum@redhat.com> - 1.0-1
03a59bd
- New upstream release
03a59bd
a4d5017
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
a4d5017
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a4d5017
3911660
* Thu May 14 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.9-1
3911660
- New upstream release
363ee21
- Run tests on RHEL
d8084b7
- New deps: python-idna, python-ipaddress
3911660
bc8535c
* Fri Apr 17 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.8.2-1
bc8535c
- New upstream release
bc8535c
- Add python3-pyasn1 Requires (#1211073)
bc8535c
86fc324
* Tue Apr 14 2015 Matej Cepl <mcepl@redhat.com> - 0.8-2
86fc324
- Add python-pyasn1 Requires (#1211073)
86fc324
bc8535c
* Fri Mar 13 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.8-1
0773ac1
- New upstream release
0773ac1
- Remove upstreamed patch
0773ac1
27ec704
* Wed Mar 04 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.7.2-2
27ec704
- Add python3-cryptography-vectors build requires
27ec704
- Add python-enum34 requires
27ec704
2b9cc15
* Tue Feb 03 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.7.2-1
2b9cc15
- New upstream release. BSD is now an optional license.
d3a0b1e
- Fix test running on python3
d3a0b1e
- Add upstream patch to fix test paths
2b9cc15
5eac1cd
* Fri Nov 07 2014 Matej Cepl <mcepl@redhat.com> - 0.6.1-2
5eac1cd
- Fix requires, for reasons why other development files were not
5eac1cd
  eliminated see https://github.com/pyca/cryptography/issues/1463.
5eac1cd
5eac1cd
* Wed Nov 05 2014 Matej Cepl <mcepl@redhat.com> - 0.6.1-1
5eac1cd
- New upstream release.
5eac1cd
5eac1cd
* Sun Jun 29 2014 Terry Chia <terrycwk1994@gmail.com> 0.4-1
5eac1cd
- initial version