5ede8f
%if 0%{?fedora} > 20
5ede8f
%global with_python3 1
5ede8f
%else
5ede8f
%{!?__python2: %global __python2 /usr/bin/python2}
5ede8f
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
5ede8f
%endif
5ede8f
5ede8f
Name:           python-cryptography
4c47a8
Version:        1.7.2
788fbf
Release:        1%{?dist}.1
5ede8f
Summary:        PyCA's cryptography library
5ede8f
5ede8f
Group:          Development/Libraries
5ede8f
License:        ASL 2.0 or BSD
5ede8f
URL:            https://cryptography.io/en/latest/
4c47a8
Source0:        https://files.pythonhosted.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz
788fbf
Patch0:         0001-Drop-minimal-setuptools-and-pytest-version-fron-setu.patch
788fbf
Patch1:         0002-Disable-unsupported-tests.patch
788fbf
Patch2:         0003-Refactor-binding-initialization-to-allow-specified-e.patch
788fbf
Patch3:         0004-Enlarge-_oid2txt-buffer-to-handle-larger-OIDs-3612.patch
4c47a8
788fbf
# This package needs four brew build overrides for RHEL in order to provide
4c47a8
# build and test dependencies:
4c47a8
#     python-pretend
4c47a8
#     python-hypothesis
4c47a8
#     python-iso8601
4c47a8
#     python-cryptography-vectors
788fbf
# brew tag-build rhel-7.5-temp-override python-pretend-1.0.8-2.el7 python-hypothesis-3.1.3-1.el7 python-iso8601-0.1.11-2.el7 python-cryptography-vectors-1.7.2-1.el7
5ede8f
5ede8f
BuildRequires:  openssl-devel
5ede8f
9c4fe6
BuildRequires:  python-devel
9c4fe6
BuildRequires:  pytest
5ede8f
BuildRequires:  python-setuptools
5ede8f
BuildRequires:  python-pretend
9c4fe6
BuildRequires:  python-iso8601
9c4fe6
BuildRequires:  python-cryptography-vectors = %{version}
9c4fe6
BuildRequires:  python-pyasn1-modules >= 0.1.8
9c4fe6
BuildRequires:  python-hypothesis
4c47a8
BuildRequires:  pytz
9c4fe6
9c4fe6
BuildRequires:  python-idna >= 2.0
9c4fe6
BuildRequires:  python-pyasn1 >= 0.1.8
9c4fe6
BuildRequires:  python-six >= 1.4.1
9c4fe6
BuildRequires:  python-cffi >= 1.4.1
9c4fe6
BuildRequires:  python-enum34
9c4fe6
BuildRequires:  python-ipaddress
5ede8f
5ede8f
%if 0%{?with_python3}
5ede8f
BuildRequires:  python3-devel
9c4fe6
BuildRequires:  python3-pytest
5ede8f
BuildRequires:  python3-setuptools
5ede8f
BuildRequires:  python3-pretend
9c4fe6
BuildRequires:  python3-iso8601
9c4fe6
BuildRequires:  python3-cryptography-vectors = %{version}
9c4fe6
BuildRequires:  python3-pyasn1-modules >= 0.1.8
9c4fe6
BuildRequires:  python3-hypothesis
4c47a8
BuildRequires:  python3-pytz
9c4fe6
9c4fe6
BuildRequires:  python3-idna >= 2.0
9c4fe6
BuildRequires:  python3-pyasn1 >= 0.1.8
9c4fe6
BuildRequires:  python3-six >= 1.4.1
9c4fe6
BuildRequires:  python3-cffi >= 1.4.1
9c4fe6
%endif
9c4fe6
9c4fe6
%description
9c4fe6
cryptography is a package designed to expose cryptographic primitives and
9c4fe6
recipes to Python developers.
9c4fe6
9c4fe6
%package -n  python2-cryptography
9c4fe6
Group:          Development/Libraries
9c4fe6
Summary:        PyCA's cryptography library
9c4fe6
Obsoletes:      python-cryptography <= %{version}-%{release}
9c4fe6
9c4fe6
%if 0%{?fedora}
9c4fe6
%{?python_provide:%python_provide python2-cryptography}
9c4fe6
%else
4c47a8
Provides:       python-cryptography = %{version}-%{release}
5ede8f
%endif
5ede8f
5ede8f
Requires:       openssl
9c4fe6
Requires:       python-idna >= 2.0
9c4fe6
Requires:       python-pyasn1 >= 0.1.8
9c4fe6
Requires:       python-six >= 1.4.1
9c4fe6
Requires:       python-cffi >= 1.4.1
5ede8f
Requires:       python-enum34
9c4fe6
Requires:       python-ipaddress
5ede8f
9c4fe6
%description -n python2-cryptography
5ede8f
cryptography is a package designed to expose cryptographic primitives and
5ede8f
recipes to Python developers.
5ede8f
5ede8f
%if 0%{?with_python3}
5ede8f
%package -n  python3-cryptography
5ede8f
Group:          Development/Libraries
5ede8f
Summary:        PyCA's cryptography library
9c4fe6
%{?python_provide:%python_provide python3-cryptography}
5ede8f
5ede8f
Requires:       openssl
9c4fe6
Requires:       python3-idna >= 2.0
9c4fe6
Requires:       python3-pyasn1 >= 0.1.8
9c4fe6
Requires:       python3-six >= 1.4.1
9c4fe6
Requires:       python3-cffi >= 1.4.1
5ede8f
5ede8f
%description -n python3-cryptography
5ede8f
cryptography is a package designed to expose cryptographic primitives and
5ede8f
recipes to Python developers.
5ede8f
%endif
5ede8f
5ede8f
%prep
9c4fe6
%autosetup -p1 -n cryptography-%{version}
5ede8f
5ede8f
%if 0%{?with_python3}
5ede8f
rm -rf %{py3dir}
5ede8f
cp -a . %{py3dir}
5ede8f
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
5ede8f
%endif
5ede8f
5ede8f
%build
5ede8f
%{__python2} setup.py build
5ede8f
5ede8f
%if 0%{?with_python3}
5ede8f
pushd %{py3dir}
5ede8f
%{__python3} setup.py build
5ede8f
popd
5ede8f
%endif
5ede8f
5ede8f
5ede8f
%install
5ede8f
# Actually other *.c and *.h are appropriate
5ede8f
# see https://github.com/pyca/cryptography/issues/1463
5ede8f
find . -name .keep -print -delete
5ede8f
5ede8f
%{__python2} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot}
5ede8f
5ede8f
%if 0%{?with_python3}
5ede8f
pushd %{py3dir}
5ede8f
%{__python3} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot}
5ede8f
popd
5ede8f
%endif
5ede8f
5ede8f
5ede8f
%check
5ede8f
%{__python} setup.py test
5ede8f
5ede8f
%if 0%{?with_python3}
5ede8f
pushd %{py3dir}
5ede8f
%{__python3} setup.py test
5ede8f
popd
5ede8f
%endif
5ede8f
5ede8f
9c4fe6
%files -n python2-cryptography
5ede8f
%doc LICENSE LICENSE.APACHE LICENSE.BSD README.rst docs
5ede8f
%{python_sitearch}/*
5ede8f
5ede8f
5ede8f
%if 0%{?with_python3}
5ede8f
%files -n python3-cryptography
5ede8f
%doc LICENSE LICENSE.APACHE LICENSE.BSD README.rst docs
5ede8f
%{python3_sitearch}/*
5ede8f
%endif
5ede8f
5ede8f
5ede8f
%changelog
788fbf
* Mon Aug 14 2017 Christian Heimes <cheimes@redhat.com> - 1.7.2-1.1
788fbf
- Ignore errors on OpenSSL's error stack when initializing, fixes RHBZ#1485896
788fbf
- Fix parsing of long OIDs, fixes RHBZ#1485898
788fbf
4c47a8
* Tue Feb 14 2017 Christian Heimes <cheimes@redhat.com> - 1.7.2-1
4c47a8
- Update to 1.7.2
4c47a8
- Disable pytest.deprecated_call() tests
4c47a8
- Remove versioned pytest
4c47a8
- Add build requirements pytz
4c47a8
9c4fe6
* Tue May 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-3
9c4fe6
- Remove versioned setuptools dependency
9c4fe6
9c4fe6
* Tue May 10 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-2
9c4fe6
- Make it easier to build on EL7
9c4fe6
9c4fe6
* Tue May 03 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.3.1-1
9c4fe6
- Update to v1.3.1
9c4fe6
9c4fe6
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-3
9c4fe6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9c4fe6
9c4fe6
* Mon Jan 11 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-2
9c4fe6
- Move python-cryptograph => python2-cryptography
9c4fe6
9c4fe6
* Sat Jan 09 2016 Nathaniel McCallum <npmccallum@redhat.com> - 1.2.1-1
9c4fe6
- Update to v1.2.1
9c4fe6
9c4fe6
* Wed Nov 11 2015 Robert Kuska <rkuska@redhat.com> - 1.1-1
9c4fe6
- Update to v1.1
9c4fe6
9c4fe6
* Wed Nov 04 2015 Robert Kuska <rkuska@redhat.com> - 1.0.2-2
9c4fe6
- Rebuilt for Python3.5 rebuild
9c4fe6
9c4fe6
* Wed Sep 30 2015 Matěj Cepl <mcepl@redhat.com> - 1.0.2-1
9c4fe6
- New upstream release (fix #1267548)
9c4fe6
9c4fe6
* Wed Aug 12 2015 Nathaniel McCallum <npmccallum@redhat.com> - 1.0-1
9c4fe6
- New upstream release
9c4fe6
9c4fe6
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
9c4fe6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
9c4fe6
9c4fe6
* Thu May 14 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.9-1
9c4fe6
- New upstream release
9c4fe6
- Run tests on RHEL
9c4fe6
- New deps: python-idna, python-ipaddress
9c4fe6
5ede8f
* Fri Apr 17 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.8.2-1
5ede8f
- New upstream release
5ede8f
- Add python3-pyasn1 Requires (#1211073)
5ede8f
5ede8f
* Tue Apr 14 2015 Matej Cepl <mcepl@redhat.com> - 0.8-2
5ede8f
- Add python-pyasn1 Requires (#1211073)
5ede8f
5ede8f
* Fri Mar 13 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.8-1
5ede8f
- New upstream release
5ede8f
- Remove upstreamed patch
5ede8f
5ede8f
* Wed Mar 04 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.7.2-2
5ede8f
- Add python3-cryptography-vectors build requires
5ede8f
- Add python-enum34 requires
5ede8f
5ede8f
* Tue Feb 03 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.7.2-1
5ede8f
- New upstream release. BSD is now an optional license.
5ede8f
- Fix test running on python3
5ede8f
- Add upstream patch to fix test paths
5ede8f
5ede8f
* Fri Nov 07 2014 Matej Cepl <mcepl@redhat.com> - 0.6.1-2
5ede8f
- Fix requires, for reasons why other development files were not
5ede8f
  eliminated see https://github.com/pyca/cryptography/issues/1463.
5ede8f
5ede8f
* Wed Nov 05 2014 Matej Cepl <mcepl@redhat.com> - 0.6.1-1
5ede8f
- New upstream release.
5ede8f
5ede8f
* Sun Jun 29 2014 Terry Chia <terrycwk1994@gmail.com> 0.4-1
5ede8f
- initial version