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