python-cryptography/python-cryptography.spec

122 lines
3.2 KiB
RPMSpec
Raw Normal View History

2014-11-21 05:21:59 +00:00
%if 0%{?fedora} > 12
%global with_python3 1
%else
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
Name: python-cryptography
2015-03-04 15:51:07 +00:00
Version: 0.7.2
Release: 1%{?dist}
2014-11-21 05:21:59 +00:00
Summary: PyCA's cryptography library
Group: Development/Libraries
2015-03-04 15:51:07 +00:00
License: ASL 2.0 or BSD
2014-11-21 05:21:59 +00:00
URL: https://cryptography.io/en/latest/
Source0: https://pypi.python.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz
2015-03-04 17:16:31 +00:00
Patch0: python-cryptography-0.7.2-testspath.patch
2014-11-21 05:21:59 +00:00
BuildRequires: openssl-devel
BuildRequires: python2-devel python-setuptools python-cffi >= 0.8 python-six
# For check
2015-03-04 15:51:07 +00:00
BuildRequires: python-cryptography-vectors = %{version}, pytest, python-pyasn1
2015-03-04 16:10:56 +00:00
BuildRequires: python-iso8601, python-pretend, python-enum34
2014-11-21 05:21:59 +00:00
%if 0%{?with_python3}
BuildRequires: python3-devel python3-setuptools python3-cffi >= 0.8 python3-six
BuildRequires: python3-pytest, python3-pyasn1, python3-iso8601, python3-pretend
%endif
Requires: openssl
Requires: python-cffi >= 0.8
Requires: python-six >= 1.6.1
%description
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
%if 0%{?with_python3}
%package -n python3-cryptography
Group: Development/Libraries
Summary: PyCA's cryptography library
Requires: openssl
Requires: python3-cffi >= 0.8
Requires: python3-six >= 1.6.1
%description -n python3-cryptography
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
%endif
%prep
%setup -q -n cryptography-%{version}
2015-03-04 17:16:31 +00:00
%patch0 -p1
2014-11-21 05:21:59 +00:00
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
%endif
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
# Actually other *.c and *.h are appropriate
# see https://github.com/pyca/cryptography/issues/1463
find . -name .keep -print -delete
%{__python2} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot}
popd
%endif
%check
%{__python} setup.py test
%if 0%{?with_python3}
pushd %{py3dir}
2015-03-04 17:16:31 +00:00
%{__python3} setup.py test
2014-11-21 05:21:59 +00:00
popd
%endif
%files
2015-03-04 15:51:07 +00:00
%doc LICENSE LICENSE.APACHE LICENSE.BSD README.rst docs
2014-11-21 05:21:59 +00:00
%{python_sitearch}/*
%if 0%{?with_python3}
%files -n python3-cryptography
2015-03-04 15:51:07 +00:00
%doc LICENSE LICENSE.APACHE LICENSE.BSD README.rst docs
2014-11-21 05:21:59 +00:00
%{python3_sitearch}/*
%endif
%changelog
2015-03-04 15:51:07 +00:00
* Tue Feb 03 2015 Nathaniel McCallum <npmccallum@redhat.com> - 0.7.2-1
- New upstream release. BSD is now an optional license.
2015-03-04 17:16:31 +00:00
- Fix test running on python3
- Add upstream patch to fix test paths
2015-03-04 15:51:07 +00:00
2014-11-21 05:21:59 +00:00
* Fri Nov 07 2014 Matej Cepl <mcepl@redhat.com> - 0.6.1-2
- Fix requires, for reasons why other development files were not
eliminated see https://github.com/pyca/cryptography/issues/1463.
* Wed Nov 05 2014 Matej Cepl <mcepl@redhat.com> - 0.6.1-1
- New upstream release.
* Sun Jun 29 2014 Terry Chia <terrycwk1994@gmail.com> 0.4-1
- initial version