af44da
# Enable python3
af44da
%bcond_without python3
af44da
af44da
# Disable python2
af44da
%bcond_with python2
af44da
af44da
# RHEL8: Tests disabled due to missing deps
af44da
%bcond_with tests
af44da
af44da
%global srcname cryptography
af44da
af44da
Name:           python-%{srcname}
af44da
Version:        3.3.1
af44da
Release:        2%{?dist}
af44da
Summary:        PyCA's cryptography library
af44da
af44da
License:        ASL 2.0 or BSD
af44da
URL:            https://cryptography.io/en/latest/
af44da
Source0:        %{pypi_source}
af44da
Source1:        %{pypi_source}.asc
af44da
# key ids of upstream authors are published in the AUTHORS file:
af44da
#    https://github.com/pyca/cryptography/blob/master/AUTHORS.rst
af44da
# gpg2 --recv-keys "05FD 9FA1 6CF7 5735 0D91 A560 235A E5F1 29F9 ED98"
af44da
# gpg2 --export --export-options export-minimal "05FD 9FA1 6CF7 5735 0D91 A560 235A E5F1 29F9 ED98" > gpgkey-05FD_9FA1_6CF7_5735_0D91_A560_235A_E5F1_29F9_ED98.gpg
af44da
Source2:        gpgkey-05FD_9FA1_6CF7_5735_0D91_A560_235A_E5F1_29F9_ED98.gpg
af44da
af44da
# Exclude i686 arch. Due to a modularity issue it's being added to the
af44da
# x86_64 compose of CRB, but we don't want to ship it at all.
af44da
# See: https://projects.engineering.redhat.com/browse/RCM-72605
af44da
ExcludeArch: i686
af44da
af44da
BuildRequires:  openssl-devel
af44da
BuildRequires:  gcc
af44da
BuildRequires:  gnupg2
af44da
af44da
%if 0%{?with_python2}
af44da
BuildRequires:  python2-cffi >= 1.7
af44da
BuildRequires:  python2-cryptography-vectors = %{version}
af44da
BuildRequires:  python2-devel
af44da
BuildRequires:  python2-enum34
af44da
BuildRequires:  python2-idna >= 2.1
af44da
BuildRequires:  python2-ipaddress
af44da
BuildRequires:  python2-setuptools
af44da
BuildRequires:  python2-six >= 1.4.1
af44da
af44da
%if %{with tests}
af44da
BuildRequires:  python2-hypothesis >= 1.11.4
af44da
BuildRequires:  python2-iso8601
af44da
BuildRequires:  python2-pretend
af44da
BuildRequires:  python2-pytest >= 3.2.1
af44da
BuildRequires:  python2-pytz
af44da
%endif
af44da
%endif
af44da
af44da
%if 0%{?with_python3}
af44da
BuildRequires:  python%{python3_pkgversion}-cffi >= 1.7
af44da
BuildRequires:  python%{python3_pkgversion}-devel
af44da
BuildRequires:  python%{python3_pkgversion}-rpm-macros
af44da
BuildRequires:  python%{python3_pkgversion}-idna >= 2.1
af44da
BuildRequires:  python%{python3_pkgversion}-setuptools
af44da
BuildRequires:  python%{python3_pkgversion}-six >= 1.4.1
af44da
af44da
%if %{with tests}
af44da
BuildRequires:  python%{python3_pkgversion}-cryptography-vectors = %{version}
af44da
BuildRequires:  python%{python3_pkgversion}-hypothesis >= 1.11.4
af44da
BuildRequires:  python%{python3_pkgversion}-iso8601
af44da
BuildRequires:  python%{python3_pkgversion}-pretend
af44da
BuildRequires:  python%{python3_pkgversion}-pytest >= 3.2.1
af44da
BuildRequires:  python%{python3_pkgversion}-pytz
af44da
%endif
af44da
%endif
af44da
af44da
%description
af44da
cryptography is a package designed to expose cryptographic primitives and
af44da
recipes to Python developers.
af44da
af44da
%if 0%{?with_python2}
af44da
%package -n  python2-%{srcname}
af44da
Summary:        PyCA's cryptography library
af44da
af44da
%if 0%{?with_python3}
af44da
%{?python_provide:%python_provide python2-%{srcname}}
af44da
%else
af44da
Provides:       python-%{srcname}
af44da
%endif
af44da
af44da
Requires:       openssl-libs
af44da
Requires:       python2-idna >= 2.1
af44da
Requires:       python2-six >= 1.4.1
af44da
Requires:       python2-cffi >= 1.7
af44da
Requires:       python2-enum34
af44da
Requires:       python2-ipaddress
af44da
af44da
%description -n python2-%{srcname}
af44da
cryptography is a package designed to expose cryptographic primitives and
af44da
recipes to Python developers.
af44da
%endif
af44da
af44da
%if 0%{?with_python3}
af44da
%package -n  python%{python3_pkgversion}-%{srcname}
af44da
Summary:        PyCA's cryptography library
af44da
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
af44da
af44da
Requires:       openssl-libs
af44da
Requires:       python%{python3_pkgversion}-idna >= 2.1
af44da
Requires:       python%{python3_pkgversion}-six >= 1.4.1
af44da
Requires:       python%{python3_pkgversion}-cffi >= 1.7
af44da
af44da
%description -n python%{python3_pkgversion}-%{srcname}
af44da
cryptography is a package designed to expose cryptographic primitives and
af44da
recipes to Python developers.
af44da
%endif
af44da
af44da
%prep
af44da
# RHEL8: GPGverify macro is not present in RHEL
af44da
# %%{gpgverify} --keyring='%%{SOURCE2}' --signature='%%{SOURCE1}' --data='%%{SOURCE0}'
af44da
%autosetup -p1 -n %{srcname}-%{version}
af44da
af44da
%build
af44da
%if 0%{?with_python2}
af44da
%py2_build
af44da
%endif
af44da
%if 0%{?with_python3}
af44da
%py3_build
af44da
%endif
af44da
af44da
%install
af44da
# Actually other *.c and *.h are appropriate
af44da
# see https://github.com/pyca/cryptography/issues/1463
af44da
find . -name .keep -print -delete
af44da
af44da
%if 0%{?with_python2}
af44da
%py2_install
af44da
%endif
af44da
%if 0%{?with_python3}
af44da
%py3_install
af44da
%endif
af44da
af44da
%check
af44da
%if %{with tests}
af44da
%if 0%{?with_python2}
af44da
# see https://github.com/pyca/cryptography/issues/4885 and
af44da
# see https://bugzilla.redhat.com/show_bug.cgi?id=1761194 for deselected tests
af44da
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)"
af44da
%endif
af44da
af44da
%if 0%{?with_python3}
af44da
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)"
af44da
%endif
af44da
%endif
af44da
af44da
af44da
%if 0%{?with_python2}
af44da
%files -n python2-%{srcname}
af44da
%doc LICENSE LICENSE.APACHE LICENSE.BSD README.rst docs
af44da
%{python2_sitearch}/%{srcname}
af44da
%{python2_sitearch}/%{srcname}-%{version}-py*.egg-info
af44da
%endif
af44da
af44da
af44da
%if 0%{?with_python3}
af44da
%files -n python%{python3_pkgversion}-%{srcname}
af44da
%doc README.rst docs
af44da
%license LICENSE LICENSE.APACHE LICENSE.BSD
af44da
%{python3_sitearch}/%{srcname}
af44da
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
af44da
%endif
af44da
af44da
af44da
%changelog
af44da
* Mon Jan 18 2021 Tomas Orsava <torsava@redhat.com> - 3.3.1-2
af44da
- Convert from Fedora to the python39 module in RHEL8
af44da
- Resolves: rhbz#1877430
af44da
af44da
* Thu Dec 10 2020 Christian Heimes <cheimes@redhat.com> - 3.3.1-1
af44da
- Update to 3.3.1 (#1905756)
af44da
af44da
* Wed Oct 28 2020 Christian Heimes <cheimes@redhat.com> - 3.2.1-1
af44da
- Update to 3.2.1 (#1892153)
af44da
af44da
* Mon Oct 26 2020 Christian Heimes <cheimes@redhat.com> - 3.2-1
af44da
- Update to 3.2 (#1891378)
af44da
af44da
* Mon Sep 07 2020 Christian Heimes <cheimes@redhat.com> - 3.1-1
af44da
- Update to 3.1 (#1872978)
af44da
af44da
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0-2
af44da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
af44da
af44da
* Tue Jul 21 2020 Christian Heimes <cheimes@redhat.com> - 3.0-1
af44da
- Update to 3.0 (#185897)
af44da
af44da
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 2.9-3
af44da
- Rebuilt for Python 3.9
af44da
af44da
* Tue May 12 2020 Felix Schwarz <fschwarz@fedoraproject.org> - 2.9-2
af44da
- add source file verification
af44da
af44da
* Fri Apr 03 2020 Christian Heimes <cheimes@redhat.com> - 2.9-1
af44da
- Update to 2.9 (#1820348)
af44da
af44da
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.8-3
af44da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
af44da
af44da
* Mon Jan 13 2020 Christian Heimes <cheimes@redhat.com> - 2.8-2
af44da
- cryptography 2.8+ no longer depends on python-asn1crypto
af44da
af44da
* Thu Oct 17 2019 Christian Heimes <cheimes@redhat.com> - 2.8-1
af44da
- Update to 2.8
af44da
- Resolves: rhbz#1762779
af44da
af44da
* Sun Oct 13 2019 Christian Heimes <cheimes@redhat.com> - 2.7-3
af44da
- Skip unit tests that fail with OpenSSL 1.1.1.d
af44da
- Resolves: rhbz#1761194
af44da
- Fix and simplify Python 3 packaging
af44da
af44da
* Sat Oct 12 2019 Christian Heimes <cheimes@redhat.com> - 2.7-2
af44da
- Drop Python 2 package
af44da
- Resolves: rhbz#1761081
af44da
af44da
* Tue Sep 03 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.7-1
af44da
- Update to 2.7 (#1715680).
af44da
af44da
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 2.6.1-3
af44da
- Rebuilt for Python 3.8
af44da
af44da
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-2
af44da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
af44da
af44da
* Thu Feb 28 2019 Christian Heimes <cheimes@redhat.com> - 2.6.1-1
af44da
- New upstream release 2.6.1, resolves RHBZ#1683691
af44da
af44da
* Wed Feb 13 2019 Alfredo Moralejo <amoralej@redhat.com> - 2.5-1
af44da
- Updated to 2.5.
af44da
af44da
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3-3
af44da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
af44da
af44da
* Mon Aug 13 2018 Christian Heimes <cheimes@redhat.com> - 2.3-2
af44da
- Use TLSv1.2 in test as workaround for RHBZ#1615143
af44da
af44da
* Wed Jul 18 2018 Christian Heimes <cheimes@redhat.com> - 2.3-1
af44da
- New upstream release 2.3
af44da
- Fix AEAD tag truncation bug, RHBZ#1602752
af44da
af44da
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-3
af44da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
af44da
af44da
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.1-2
af44da
- Rebuilt for Python 3.7
af44da
af44da
* Wed Mar 21 2018 Christian Heimes <cheimes@redhat.com> - 2.2.1-1
af44da
- New upstream release 2.2.1
af44da
af44da
* Sun Feb 18 2018 Christian Heimes <cheimes@redhat.com> - 2.1.4-1
af44da
- New upstream release 2.1.4
af44da
af44da
* Sun Feb 18 2018 Christian Heimes <cheimes@redhat.com> - 2.1.3-4
af44da
- Build requires gcc
af44da
af44da
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.1.3-3
af44da
- Update Python 2 dependency declarations to new packaging standards
af44da
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
af44da
af44da
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-2
af44da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild