c69fad
%if 0%{?fedora} || 0%{?rhel} > 7
c69fad
# Enable python3 build by default
c69fad
%bcond_without python3
c69fad
%else
c69fad
%bcond_with python3
c69fad
%endif
c69fad
c69fad
%if 0%{?rhel} > 7
c69fad
# Disable python2 build by default
c69fad
%bcond_with python2
c69fad
%else
c69fad
%bcond_without python2
c69fad
%endif
c69fad
c69fad
%{!?python3_pkgversion:%global python3_pkgversion 3}
c69fad
c69fad
%global srcname cryptography
c69fad
c69fad
Name:           python-%{srcname}
c69fad
Version:        2.3
c69fad
Release:        2%{?dist}
c69fad
Summary:        PyCA's cryptography library
c69fad
c69fad
Group:          Development/Libraries
c69fad
License:        ASL 2.0 or BSD
c69fad
URL:            https://cryptography.io/en/latest/
c69fad
Source0:        https://pypi.io/packages/source/c/%{srcname}/%{srcname}-%{version}.tar.gz
c69fad
c69fad
Patch0001:      0001-Fixed-4380-do-not-assume-TLSv1-is-available-in-OpenS.patch
c69fad
c69fad
BuildRequires:  openssl-devel
c69fad
BuildRequires:  gcc
c69fad
c69fad
%if 0%{?with_python2}
c69fad
BuildRequires:  python2-devel
c69fad
BuildRequires:  python2-pytest >= 3.2.1
c69fad
BuildRequires:  python2-setuptools
c69fad
BuildRequires:  python2-pretend
c69fad
BuildRequires:  python2-iso8601
c69fad
BuildRequires:  python2-cryptography-vectors = %{version}
c69fad
BuildRequires:  python2-asn1crypto >= 0.21
c69fad
BuildRequires:  python2-hypothesis >= 1.11.4
c69fad
BuildRequires:  python2-pytz
c69fad
c69fad
BuildRequires:  python2-idna >= 2.1
c69fad
BuildRequires:  python2-six >= 1.4.1
c69fad
BuildRequires:  python2-cffi >= 1.7
c69fad
BuildRequires:  python2-enum34
c69fad
BuildRequires:  python2-ipaddress
c69fad
%endif
c69fad
c69fad
%if 0%{?with_python3}
c69fad
BuildRequires:  python%{python3_pkgversion}-devel
c69fad
BuildRequires:  python%{python3_pkgversion}-pytest >= 3.2.1
c69fad
BuildRequires:  python%{python3_pkgversion}-setuptools
c69fad
BuildRequires:  python%{python3_pkgversion}-pretend
c69fad
BuildRequires:  python%{python3_pkgversion}-iso8601
c69fad
BuildRequires:  python%{python3_pkgversion}-cryptography-vectors = %{version}
c69fad
BuildRequires:  python%{python3_pkgversion}-asn1crypto >= 0.21
c69fad
BuildRequires:  python%{python3_pkgversion}-hypothesis >= 1.11.4
c69fad
BuildRequires:  python%{python3_pkgversion}-pytz
c69fad
c69fad
BuildRequires:  python%{python3_pkgversion}-idna >= 2.1
c69fad
BuildRequires:  python%{python3_pkgversion}-six >= 1.4.1
c69fad
BuildRequires:  python%{python3_pkgversion}-cffi >= 1.7
c69fad
%endif
c69fad
c69fad
%description
c69fad
cryptography is a package designed to expose cryptographic primitives and
c69fad
recipes to Python developers.
c69fad
c69fad
%if 0%{?with_python2}
c69fad
%package -n  python2-%{srcname}
c69fad
Group:          Development/Libraries
c69fad
Summary:        PyCA's cryptography library
c69fad
c69fad
%if 0%{?with_python3}
c69fad
%{?python_provide:%python_provide python2-%{srcname}}
c69fad
%else
c69fad
Provides:       python-%{srcname}
c69fad
%endif
c69fad
c69fad
Requires:       openssl-libs
c69fad
Requires:       python2-idna >= 2.1
c69fad
Requires:       python2-asn1crypto >= 0.21
c69fad
Requires:       python2-six >= 1.4.1
c69fad
Requires:       python2-cffi >= 1.7
c69fad
Requires:       python2-enum34
c69fad
Requires:       python2-ipaddress
c69fad
c69fad
%description -n python2-%{srcname}
c69fad
cryptography is a package designed to expose cryptographic primitives and
c69fad
recipes to Python developers.
c69fad
%endif
c69fad
c69fad
%if 0%{?with_python3}
c69fad
%package -n  python%{python3_pkgversion}-%{srcname}
c69fad
Group:          Development/Libraries
c69fad
Summary:        PyCA's cryptography library
c69fad
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
c69fad
c69fad
Requires:       openssl-libs
c69fad
Requires:       python%{python3_pkgversion}-idna >= 2.1
c69fad
Requires:       python%{python3_pkgversion}-asn1crypto >= 0.21
c69fad
Requires:       python%{python3_pkgversion}-six >= 1.4.1
c69fad
Requires:       python%{python3_pkgversion}-cffi >= 1.7
c69fad
c69fad
%description -n python%{python3_pkgversion}-%{srcname}
c69fad
cryptography is a package designed to expose cryptographic primitives and
c69fad
recipes to Python developers.
c69fad
%endif
c69fad
c69fad
%prep
c69fad
%autosetup -p1 -n %{srcname}-%{version}
c69fad
c69fad
%build
c69fad
%if 0%{?with_python2}
c69fad
%py2_build
c69fad
%endif
c69fad
%if 0%{?with_python3}
c69fad
%py3_build
c69fad
%endif
c69fad
c69fad
%install
c69fad
# Actually other *.c and *.h are appropriate
c69fad
# see https://github.com/pyca/cryptography/issues/1463
c69fad
find . -name .keep -print -delete
c69fad
c69fad
%if 0%{?with_python2}
c69fad
%py2_install
c69fad
%endif
c69fad
%if 0%{?with_python3}
c69fad
%py3_install
c69fad
%endif
c69fad
c69fad
c69fad
%check
c69fad
# workaround for pytest 3.2.0 bug https://github.com/pytest-dev/pytest/issues/2644
c69fad
rm -f tests/hazmat/primitives/test_padding.py
c69fad
%if 0%{?with_python2}
c69fad
%{__python2} setup.py test
c69fad
%endif
c69fad
%if 0%{?with_python3}
c69fad
%{__python3} setup.py test
c69fad
%endif
c69fad
c69fad
%if 0%{?with_python2}
c69fad
%files -n python2-%{srcname}
c69fad
%doc LICENSE LICENSE.APACHE LICENSE.BSD README.rst docs
c69fad
%{python2_sitearch}/%{srcname}
c69fad
%{python2_sitearch}/%{srcname}-%{version}-py*.egg-info
c69fad
%endif
c69fad
c69fad
%if 0%{?with_python3}
c69fad
%files -n python%{python3_pkgversion}-%{srcname}
c69fad
%doc README.rst docs
c69fad
%license LICENSE LICENSE.APACHE LICENSE.BSD
c69fad
%{python3_sitearch}/%{srcname}
c69fad
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
c69fad
%endif
c69fad
c69fad
c69fad
%changelog
c69fad
* Mon Aug 13 2018 Christian Heimes <cheimes@redhat.com> - 2.3-2
c69fad
- Use TLSv1.2 in test as workaround for RHBZ#1615099
c69fad
- Resolves: RHBZ#1611738
c69fad
c69fad
* Wed Jul 18 2018 Christian Heimes <cheimes@redhat.com> - 2.3-1
c69fad
- New upstream release 2.3
c69fad
- Fix AEAD tag truncation bug, CVE-2018-10903, RHBZ#1602755, RHBZ#1602932
c69fad
c69fad
* Tue Jun 19 2018 Christian Heimes <cheimes@redhat.com> - 2.2.1-2
c69fad
- Drop Python 2 subpackages from RHEL 8, fixes RHBZ#1589754
c69fad
- Remove unnecessary copy and shebang mangling
c69fad
c69fad
* Wed Mar 21 2018 Christian Heimes <cheimes@redhat.com> - 2.2.1-1
c69fad
- New upstream release 2.2.1
c69fad
c69fad
* Sun Feb 18 2018 Christian Heimes <cheimes@redhat.com> - 2.1.4-1
c69fad
- New upstream release 2.1.4
c69fad
c69fad
* Sun Feb 18 2018 Christian Heimes <cheimes@redhat.com> - 2.1.3-4
c69fad
- Build requires gcc
c69fad
c69fad
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.1.3-3
c69fad
- Update Python 2 dependency declarations to new packaging standards
c69fad
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
c69fad
c69fad
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-2
c69fad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c69fad
c69fad
* Thu Nov 23 2017 Haïkel Guémar <hguemar@fedoraproject.org> - 2.1.3-1
c69fad
- Upstream 2.1.3
c69fad
c69fad
* Tue Oct 24 2017 Christian Heimes <cheimes@redhat.com> - 2.1-2
c69fad
- Change Requires to openssl-libs
c69fad
c69fad
* Thu Oct 12 2017 Christian Heimes <cheimes@redhat.com> - 2.1-1
c69fad
- New upstream release 2.1
c69fad
c69fad
* Wed Sep 27 2017 Troy Dawson <tdawson@redhat.com> - 2.0.2-3
c69fad
- Cleanup spec file conditionals
c69fad
c69fad
* Thu Aug 03 2017 Christian Heimes <cheimes@redhat.com> - 2.0.2-2
c69fad
- Add workaround for pytest bug
c69fad
c69fad
* Thu Aug 03 2017 Christian Heimes <cheimes@redhat.com> - 2.0.2-1
c69fad
- New upstream release 2.0.2
c69fad
- Modernize spec
c69fad
c69fad
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-3
c69fad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
c69fad
c69fad
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-2
c69fad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c69fad
c69fad
* Tue Jun 27 2017 Christian Heimes <cheimes@redhat.com> - 1.9-1
c69fad
- Upstream release 1.9
c69fad
c69fad
* Wed Feb 15 2017 Christian Heimes <cheimes@redhat.com> - 1.7.2-1
c69fad
- Update to latest upstream
c69fad
c69fad
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-2
c69fad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
c69fad
c69fad
* Thu Jan 05 2017 Matěj Cepl <mcepl@redhat.com> - 1.7.1-1
c69fad
- Update to the latest upstream.
c69fad
- Add a patch from https://github.com/pyca/cryptography/pull/3328
c69fad
c69fad
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.5.3-5
c69fad
- Enable tests
c69fad
c69fad
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.5.3-4
c69fad
- Rebuild for Python 3.6
c69fad
- Disable python3 tests for now
c69fad
c69fad
* Thu Nov 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.5.3-3
c69fad
- Revert previous change
c69fad
c69fad
* Thu Nov 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.5.3-2
c69fad
- Disable tests on releases earlier than 24
c69fad
c69fad
* Mon Nov 07 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.5.3-1
c69fad
- Update to v1.5.3
c69fad
- Update source URL
c69fad
- Add BR for pytz
c69fad
c69fad
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-4
c69fad
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c69fad
c69fad
* Tue May 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-3
c69fad
- Remove versioned setuptools dependency
c69fad
c69fad
* Tue May 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-2
c69fad
- Make it easier to build on EL7
c69fad
c69fad
* Tue May 03 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-1
c69fad
- Update to v1.3.1
c69fad
c69fad
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-3
c69fad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c69fad
c69fad
* Mon Jan 11 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-2
c69fad
- Move python-cryptograph => python2-cryptography
c69fad
c69fad
* Sat Jan 09 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-1
c69fad
- Update to v1.2.1
c69fad
c69fad
* Wed Nov 11 2015 Robert Kuska <rkuska@redhat.com> - 1.1-1
c69fad
- Update to v1.1
c69fad
c69fad
* Wed Nov 04 2015 Robert Kuska <rkuska@redhat.com> - 1.0.2-2
c69fad
- Rebuilt for Python3.5 rebuild
c69fad
c69fad
* Wed Sep 30 2015 Matěj Cepl <mcepl@redhat.com> - 1.0.2-1
c69fad
- New upstream release (fix #1267548)
c69fad
c69fad
* Wed Aug 12 2015 Nathaniel McCallum <npmccallum@redhat.com> - 1.0-1
c69fad
- New upstream release
c69fad
c69fad
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
c69fad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c69fad
c69fad
* Thu May 14 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.9-1
c69fad
- New upstream release
c69fad
- Run tests on RHEL
c69fad
- New deps: python-idna, python-ipaddress
c69fad
c69fad
* Fri Apr 17 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.8.2-1
c69fad
- New upstream release
c69fad
- Add python3-pyasn1 Requires (#1211073)
c69fad
c69fad
* Tue Apr 14 2015 Matej Cepl <mcepl@redhat.com> - 0.8-2
c69fad
- Add python-pyasn1 Requires (#1211073)
c69fad
c69fad
* Fri Mar 13 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.8-1
c69fad
- New upstream release
c69fad
- Remove upstreamed patch
c69fad
c69fad
* Wed Mar 04 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.7.2-2
c69fad
- Add python3-cryptography-vectors build requires
c69fad
- Add python-enum34 requires
c69fad
c69fad
* Tue Feb 03 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.7.2-1
c69fad
- New upstream release. BSD is now an optional license.
c69fad
- Fix test running on python3
c69fad
- Add upstream patch to fix test paths
c69fad
c69fad
* Fri Nov 07 2014 Matej Cepl <mcepl@redhat.com> - 0.6.1-2
c69fad
- Fix requires, for reasons why other development files were not
c69fad
  eliminated see https://github.com/pyca/cryptography/issues/1463.
c69fad
c69fad
* Wed Nov 05 2014 Matej Cepl <mcepl@redhat.com> - 0.6.1-1
c69fad
- New upstream release.
c69fad
c69fad
* Sun Jun 29 2014 Terry Chia <terrycwk1994@gmail.com> 0.4-1
c69fad
- initial version