2014-02-24 15:01:28 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-cryptography
|
|
|
|
#
|
2017-03-16 15:49:25 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2014-02-24 15:01:28 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2017-03-30 16:12:18 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2014-02-24 15:01:28 +01:00
|
|
|
Name: python-cryptography
|
2017-07-19 19:53:23 +02:00
|
|
|
Version: 2.0
|
2014-02-24 15:01:28 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Python library which exposes cryptographic recipes and primitives
|
2016-03-13 22:20:08 +01:00
|
|
|
License: Apache-2.0 or BSD-3-Clause
|
2014-02-24 15:01:28 +01:00
|
|
|
Group: Development/Languages/Python
|
2014-12-29 19:15:46 +01:00
|
|
|
Url: https://cryptography.io/en/latest/
|
2017-03-30 16:12:18 +02:00
|
|
|
Source0: https://files.pythonhosted.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz
|
|
|
|
Source1: https://files.pythonhosted.org/packages/source/c/cryptography/cryptography-%{version}.tar.gz.asc
|
2014-02-24 15:01:28 +01:00
|
|
|
Source2: %{name}.keyring
|
2017-03-30 16:12:18 +02:00
|
|
|
Source3: https://files.pythonhosted.org/packages/source/c/cryptography_vectors/cryptography_vectors-%{version}.tar.gz
|
|
|
|
Source4: https://files.pythonhosted.org/packages/source/c/cryptography_vectors/cryptography_vectors-%{version}.tar.gz.asc
|
2015-09-17 16:30:34 +02:00
|
|
|
# PATCH-FIX-SLE disable-uneven-sizes-tests.patch bnc#944204
|
|
|
|
Patch1: disable-uneven-sizes-tests.patch
|
2017-03-30 16:12:18 +02:00
|
|
|
BuildRequires: %{python_module asn1crypto >= 0.21.0}
|
|
|
|
BuildRequires: %{python_module cffi >= 1.4.1}
|
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
BuildRequires: %{python_module idna >= 2.1}
|
|
|
|
BuildRequires: %{python_module pyasn1-modules}
|
|
|
|
BuildRequires: %{python_module pytz}
|
|
|
|
BuildRequires: %{python_module setuptools >= 11.3}
|
|
|
|
BuildRequires: %{python_module six >= 1.4.1}
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
BuildRequires: python2-enum34
|
|
|
|
BuildRequires: python2-ipaddress
|
|
|
|
# SECTION Test requirements
|
|
|
|
BuildRequires: %{python_module hypothesis}
|
|
|
|
BuildRequires: %{python_module iso8601}
|
2017-05-02 15:10:17 +02:00
|
|
|
BuildRequires: %{python_module packaging}
|
2017-03-30 16:12:18 +02:00
|
|
|
BuildRequires: %{python_module pretend}
|
|
|
|
BuildRequires: %{python_module pyasn1 >= 0.1.8}
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: %{python_module virtualenv}
|
|
|
|
# /SECTION
|
|
|
|
BuildRequires: fdupes
|
2014-04-01 10:25:31 +02:00
|
|
|
BuildRequires: libopenssl-devel
|
2017-03-30 16:12:18 +02:00
|
|
|
BuildRequires: pkgconfig
|
2014-12-29 19:15:46 +01:00
|
|
|
BuildRequires: pkgconfig(libffi)
|
2017-03-16 15:49:25 +01:00
|
|
|
Requires: python-asn1crypto >= 0.21.0
|
|
|
|
Requires: python-idna >= 2.1
|
2017-05-02 15:10:17 +02:00
|
|
|
Requires: python-packaging
|
2015-08-24 10:43:13 +02:00
|
|
|
Requires: python-pyasn1 >= 0.1.8
|
2016-07-18 07:46:45 +02:00
|
|
|
Requires: python-setuptools >= 11.3
|
2016-09-27 11:43:50 +02:00
|
|
|
Requires: python-six >= 1.4.1
|
2017-03-30 16:12:18 +02:00
|
|
|
%requires_eq python-cffi
|
2014-12-29 19:15:46 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2017-03-30 16:12:18 +02:00
|
|
|
%ifpython2
|
|
|
|
Requires: python-enum34
|
|
|
|
Requires: python-ipaddress
|
|
|
|
%endif
|
|
|
|
%python_subpackages
|
2014-02-24 15:01:28 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
cryptography is a package designed to expose cryptographic
|
|
|
|
recipes and primitives to Python developers. Our goal is
|
|
|
|
for it to be your "cryptographic standard library". It
|
|
|
|
supports Python 2.6-2.7, Python 3.2+, and PyPy.
|
|
|
|
|
|
|
|
cryptography includes both high level recipes, and low
|
|
|
|
level interfaces to common cryptographic algorithms such as
|
|
|
|
symmetric ciphers, message digests and key derivation
|
|
|
|
functions.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n cryptography-%{version}
|
|
|
|
|
2014-05-28 10:39:17 +02:00
|
|
|
# prepare vectors module
|
2014-12-29 19:15:46 +01:00
|
|
|
tar xvzf %{SOURCE3}
|
2014-05-28 10:39:17 +02:00
|
|
|
|
2015-09-17 16:30:34 +02:00
|
|
|
%patch1 -p1
|
|
|
|
|
2014-02-24 15:01:28 +01:00
|
|
|
%build
|
2017-03-30 16:12:18 +02:00
|
|
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
|
|
|
%python_build
|
2014-02-24 15:01:28 +01:00
|
|
|
|
|
|
|
%install
|
2017-03-30 16:12:18 +02:00
|
|
|
%python_install
|
|
|
|
%fdupes %{buildroot}%{_prefix}
|
2014-02-24 15:01:28 +01:00
|
|
|
|
2014-04-01 10:25:31 +02:00
|
|
|
%check
|
2015-12-09 11:20:38 +01:00
|
|
|
%if 0%{?suse_version} >= 1210
|
2017-03-30 16:12:18 +02:00
|
|
|
%{python_expand # this is going to be fun
|
2014-12-29 19:15:46 +01:00
|
|
|
# create virtualenv
|
2017-03-30 16:12:18 +02:00
|
|
|
$python %{_bindir}/virtualenv --system-site-packages TESTROOT-%{$python_bin_suffix}
|
|
|
|
. TESTROOT-%{$python_bin_suffix}/bin/activate
|
2014-12-29 19:15:46 +01:00
|
|
|
# install package in virtualenv
|
2017-03-30 16:12:18 +02:00
|
|
|
$python setup.py install
|
2014-12-29 19:15:46 +01:00
|
|
|
# install cryptography vectors
|
2017-03-30 16:12:18 +02:00
|
|
|
(cd cryptography_vectors-%{version} && $python setup.py install)
|
2014-12-29 19:15:46 +01:00
|
|
|
# run tests with virtualenv'd python
|
|
|
|
# (specify "tests" directory, otherwise py.test discovers tests in virtualenv'd setuptools)
|
2017-03-30 16:12:18 +02:00
|
|
|
$python -m pytest tests
|
2014-12-29 19:15:46 +01:00
|
|
|
# finish
|
|
|
|
deactivate
|
2017-03-30 16:12:18 +02:00
|
|
|
}
|
2015-12-09 11:20:38 +01:00
|
|
|
%endif
|
2014-02-24 15:01:28 +01:00
|
|
|
|
2017-03-30 16:12:18 +02:00
|
|
|
%files %{python_files}
|
2014-02-24 15:01:28 +01:00
|
|
|
%defattr(-,root,root,-)
|
2016-03-13 22:20:08 +01:00
|
|
|
%doc LICENSE LICENSE.APACHE LICENSE.BSD
|
|
|
|
%doc AUTHORS.rst CONTRIBUTING.rst CHANGELOG.rst README.rst
|
2017-03-30 16:12:18 +02:00
|
|
|
%{python_sitearch}/*
|
2014-02-24 15:01:28 +01:00
|
|
|
|
|
|
|
%changelog
|