python-cryptography/python-cryptography.spec
dongyuzhen d48d73ffb9 add SM4 symmetric block cipher and provide openssl apis related to SM for python
(cherry picked from commit d8a06fd99ec55625ffd86899bd6a29bd5271964c)
2022-12-15 09:52:40 +08:00

159 lines
5.0 KiB
RPMSpec

%bcond_with python2
%bcond_without python3
%global srcname cryptography
Name: python-%{srcname}
Version: 3.3.1
Release: 2
Summary: PyCA's cryptography library
License: ASL 2.0 or BSD
URL: https://cryptography.io/en/latest/
Source0: https://pypi.io/packages/source/c/cryptography/cryptography-%{version}.tar.gz
Patch6000: backport-CVE-2020-36242.patch
Patch6001: backport-add-SM4-symmetric-block-cipher-5834.patch
Patch6002: backport-provide-openssl-apis-related-to-SM-for-python.patch
BuildRequires: openssl-devel
BuildRequires: gcc
%if %{with python2}
BuildRequires: python2-devel python2-pytest >= 3.2.1 python2-setuptools
BuildRequires: python2-pretend python2-iso8601 python2-cryptography-vectors = %{version}
BuildRequires: python2-asn1crypto >= 0.21 python2-hypothesis >= 1.11.4 python2-pytz
BuildRequires: python2-idna >= 2.1 python2-six >= 1.4.1 python2-cffi >= 1.7
BuildRequires: python2-enum34 python2-ipaddress
%endif
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-pytest >= 3.2.1
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-pretend
BuildRequires: python%{python3_pkgversion}-iso8601
BuildRequires: python%{python3_pkgversion}-cryptography-vectors = %{version}
BuildRequires: python%{python3_pkgversion}-asn1crypto >= 0.21
BuildRequires: python%{python3_pkgversion}-hypothesis >= 1.11.4
BuildRequires: python%{python3_pkgversion}-pytz
BuildRequires: python%{python3_pkgversion}-idna >= 2.1
BuildRequires: python%{python3_pkgversion}-six >= 1.4.1
BuildRequires: python%{python3_pkgversion}-cffi >= 1.7
%description
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
%if %{with python2}
%package -n python2-cryptography
Summary: PyCA's cryptography library
Requires: openssl-libs python2-idna >= 2.1 python2-asn1crypto >= 0.21
Requires: python2-six >= 1.4.1 python2-cffi >= 1.7 python2-enum34
Requires: python2-ipaddress
%{?python_provide:%python_provide python2-cryptography}
%description -n python2-cryptography
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
%endif
%package -n python%{python3_pkgversion}-cryptography
Summary: PyCA's cryptography library
Requires: openssl-libs
Requires: python%{python3_pkgversion}-idna >= 2.1
Requires: python%{python3_pkgversion}-asn1crypto >= 0.21
Requires: python%{python3_pkgversion}-six >= 1.4.1
Requires: python%{python3_pkgversion}-cffi >= 1.7
%{?python_provide:%python_provide python%{python3_pkgversion}-cryptography}
%description -n python%{python3_pkgversion}-cryptography
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
%package_help
%prep
%autosetup -n cryptography-%{version} -p1
%build
%if %{with python2}
%py2_build
%endif
%py3_build
%install
# Actually other *.c and *.h are appropriate
# see https://github.com/pyca/cryptography/issues/1463
find . -name .keep -print -delete
%if %{with python2}
%py2_install
%endif
%py3_install
%check
%if %{with python2}
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)"
%endif
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)"
%if %{with python2}
%files -n python2-cryptography
%defattr(-,root,root)
%doc AUTHORS.rst
%license LICENSE LICENSE.APACHE LICENSE.BSD
%{python2_sitearch}/cryptography
%{python2_sitearch}/cryptography-%{version}-py*.egg-info
%endif
%files -n python%{python3_pkgversion}-cryptography
%defattr(-,root,root)
%doc AUTHORS.rst
%license LICENSE LICENSE.APACHE LICENSE.BSD
%{python3_sitearch}/*
%files help
%defattr(-,root,root)
%doc README.rst docs
%changelog
* Thu Sep 1 2022 dongyuzhen <dongyuzhen@h-partners.com> - 3.3.1-2
- add SM4 symmetric block cipher and provide openssl apis related to SM for python
* Thu Aug 12 2021 liyanan <liyanan32@huawei.com> - 3.3.1-1
- update to 3.3.1
* Wed Mar 24 2021 shixuantong <shixuantong@huawei.com> - 2.9.2-3
- remove %{py3dir}
* Wed Feb 24 2021 shixuantong <shixuantong@huawei.com> - 2.9.2-2
- fix CVE-2020-36242 and skip hypothesis tests
* Wed Aug 12 2020 Leo Fang <leofang_94@163.com> - 2.9.2-1
- Upgrade to version 2.9.2
* Thu Apr 16 2020 chengquan<chengquan3@huawei.com> -2.9-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:upgrade software to v2.9
* Thu Feb 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.6.1-1
- Update to 2.6.1
* Tue Oct 22 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.3-5
- Package rebuild.
* Sat Oct 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.3-4
- Type: enhancement
- ID: NA
- SUG: NA
- DESC: fix build failed.
* Sat Sep 14 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.3-3
- Package init.