python-cryptography/python-cryptography.spec

155 lines
4.7 KiB
RPMSpec
Raw Normal View History

2020-02-13 16:45:17 +08:00
%bcond_with python2
%bcond_without python3
2020-06-20 14:49:32 +08:00
%bcond_with python3.8
2020-02-13 16:45:17 +08:00
Name: python-cryptography
2020-05-11 16:20:09 +08:00
Version: 2.9
2020-02-13 16:45:17 +08:00
Release: 1
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
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
2019-09-30 11:14:49 -04:00
%description
2020-02-13 16:45:17 +08:00
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
2019-09-30 11:14:49 -04:00
%{?python_provide:%python_provide python2-cryptography}
%description -n python2-cryptography
2020-02-13 16:45:17 +08:00
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
2019-09-30 11:14:49 -04:00
2020-02-13 16:45:17 +08:00
%{?python_provide:%python_provide python%{python3_pkgversion}-cryptography}
2019-09-30 11:14:49 -04:00
2020-02-13 16:45:17 +08:00
%description -n python%{python3_pkgversion}-cryptography
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
2019-09-30 11:14:49 -04:00
%package_help
%prep
%autosetup -n cryptography-%{version} -p1
2020-02-13 16:45:17 +08:00
2019-09-30 11:14:49 -04:00
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
%build
2020-02-13 16:45:17 +08:00
%if %{with python2}
2019-09-30 11:14:49 -04:00
%py2_build
2020-02-13 16:45:17 +08:00
%endif
2019-09-30 11:14:49 -04:00
pushd %{py3dir}
%py3_build
popd
%install
2020-02-13 16:45:17 +08:00
# Actually other *.c and *.h are appropriate
# see https://github.com/pyca/cryptography/issues/1463
2019-09-30 11:14:49 -04:00
find . -name .keep -print -delete
2020-02-13 16:45:17 +08:00
%if %{with python2}
2019-09-30 11:14:49 -04:00
%py2_install
2020-02-13 16:45:17 +08:00
%endif
2019-09-30 11:14:49 -04:00
pushd %{py3dir}
%py3_install
popd
%check
2020-02-13 16:45:17 +08:00
# see https://github.com/pyca/cryptography/issues/4885 for the deselected test
%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
2020-06-20 14:49:32 +08:00
%if %{with python3.8}
2019-09-30 11:14:49 -04:00
pushd %{py3dir}
2020-02-13 16:45:17 +08:00
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)"
2019-09-30 11:14:49 -04:00
popd
2020-06-20 14:49:32 +08:00
%endif
2019-09-30 11:14:49 -04:00
2020-02-13 16:45:17 +08:00
%if %{with python2}
2019-09-30 11:14:49 -04:00
%files -n python2-cryptography
2020-02-13 16:45:17 +08:00
%defattr(-,root,root)
%doc AUTHORS.rst
%license LICENSE LICENSE.APACHE LICENSE.BSD
2019-09-30 11:14:49 -04:00
%{python2_sitearch}/cryptography
%{python2_sitearch}/cryptography-%{version}-py*.egg-info
2020-02-13 16:45:17 +08:00
%endif
2019-09-30 11:14:49 -04:00
2020-02-13 16:45:17 +08:00
%files -n python%{python3_pkgversion}-cryptography
%defattr(-,root,root)
%doc AUTHORS.rst
%license LICENSE LICENSE.APACHE LICENSE.BSD
2019-09-30 11:14:49 -04:00
%{python3_sitearch}/*
%{python3_sitearch}/cryptography-%{version}-py*.egg-info
%files help
2020-02-13 16:45:17 +08:00
%defattr(-,root,root)
%doc README.rst docs
2019-09-30 11:14:49 -04:00
%changelog
2020-05-11 16:20:09 +08:00
* Thu Apr 16 2020 chengquan<chengquan3@huawei.com> -2.9-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:upgrade software to v2.9
2020-02-13 16:45:17 +08:00
* Thu Feb 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.6.1-1
- Update to 2.6.1
2019-11-06 19:48:59 +08:00
* 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.