%bcond_with python2

Name:           python-cryptography-vectors
Version:        3.3.1
Release:        1
License:        ASL 2.0 or BSD
Summary:        This module is a test vectors for the cryptography package
URL:            https://pypi.python.org/pypi/cryptography-vectors
Source0:        https://pypi.io/packages/source/c/cryptography-vectors/cryptography_vectors-%{version}.tar.gz
BuildArch:      noarch

%description
This package is a test vectors for the python-cryptography.

%if %{with python2}
%package     -n python2-cryptography-vectors
Summary:        This module is a test vectors for the cryptography package
BuildRequires:  python2-devel python2-setuptools
%{?python_provide:%python_provide python2-cryptography-vectors}

%description -n python2-cryptography-vectors
This package is a test vectors for the python-cryptography.
%endif

%package     -n python3-cryptography-vectors
Summary:        This module is a test vectors for the cryptography package
BuildRequires:  python3-devel python3-setuptools
%{?python_provide:%python_provide python3-cryptography-vectors}

%description -n python3-cryptography-vectors
This package is a test vectors for the python-cryptography.

%prep
%autosetup -n cryptography_vectors-%{version}
rm -vrf cryptography_vectors.egg-info

%build
%if %{with python2}
%py2_build
%endif

%py3_build

%check
%if %{with python2}
%{__python2} setup.py test
%endif

%{__python3} setup.py test

%install
%if %{with python2}
%py2_install
%endif

%py3_install

%if %{with python2}
%files -n python2-cryptography-vectors
%defattr(-,root,root)
%license LICENSE LICENSE.APACHE LICENSE.BSD
%{python2_sitelib}/cryptography_vectors/
%{python2_sitelib}/cryptography_vectors-%{version}-py*.egg-info
%endif

%files -n python3-cryptography-vectors
%defattr(-,root,root)
%license LICENSE LICENSE.APACHE LICENSE.BSD
%{python3_sitelib}/cryptography_vectors/
%{python3_sitelib}/cryptography_vectors-%{version}-py*.egg-info

%changelog
* Thu Aug 12 2021 liyanan <liyanan32@huawei.com> - 3.3.1-1
- update to 3.3.1

* Wed Aug 12 2020 Leo Fang <leoafng_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

* Fri Feb 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.6.1-1
- Update to 2.6.1

* Mon Nov 25 2019 Ling Yang <lingyang2@huawei.com> - 2.3-2
- Package init
