| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | #
 | 
					
						
							|  |  |  | # spec file for package python-cryptography
 | 
					
						
							|  |  |  | #
 | 
					
						
							| 
									
										
										
										
											2018-01-16 10:27:31 +00:00
										 |  |  | # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00: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 14:12:18 +00:00
										 |  |  | %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 | 
					
						
							| 
									
										
										
										
											2018-01-18 13:31:34 +00:00
										 |  |  | %bcond_without python2
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | Name:           python-cryptography
 | 
					
						
							| 
									
										
										
										
											2017-12-08 20:57:03 +00:00
										 |  |  | Version:        2.1.4
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | Release:        0
 | 
					
						
							|  |  |  | Summary:        Python library which exposes cryptographic recipes and primitives
 | 
					
						
							| 
									
										
										
										
											2017-11-02 15:19:19 +00:00
										 |  |  | License:        Apache-2.0 OR BSD-3-Clause
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | Group:          Development/Languages/Python
 | 
					
						
							| 
									
										
										
										
											2014-12-29 18:15:46 +00:00
										 |  |  | Url:            https://cryptography.io/en/latest/
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00: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 14:01:28 +00:00
										 |  |  | Source2:        %{name}.keyring
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00: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 14:30:34 +00:00
										 |  |  | # PATCH-FIX-SLE disable-uneven-sizes-tests.patch bnc#944204
 | 
					
						
							|  |  |  | Patch1:         disable-uneven-sizes-tests.patch
 | 
					
						
							| 
									
										
										
										
											2017-09-07 14:49:40 +00:00
										 |  |  | Patch2:         skip_openssl_memleak_test.patch
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | BuildRequires:  %{python_module asn1crypto >= 0.21.0}
 | 
					
						
							| 
									
										
										
										
											2017-09-29 10:42:10 +00:00
										 |  |  | BuildRequires:  %{python_module cffi >= 1.7}
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | 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}
 | 
					
						
							| 
									
										
										
										
											2017-11-02 15:19:19 +00:00
										 |  |  | BuildRequires:  fdupes
 | 
					
						
							|  |  |  | BuildRequires:  libopenssl-devel
 | 
					
						
							|  |  |  | BuildRequires:  pkgconfig
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | BuildRequires:  python-rpm-macros
 | 
					
						
							| 
									
										
										
										
											2017-11-02 15:19:19 +00:00
										 |  |  | BuildRequires:  pkgconfig(libffi)
 | 
					
						
							|  |  |  | Requires:       python-asn1crypto >= 0.21.0
 | 
					
						
							|  |  |  | Requires:       python-idna >= 2.1
 | 
					
						
							|  |  |  | Requires:       python-packaging
 | 
					
						
							|  |  |  | Requires:       python-pyasn1 >= 0.1.8
 | 
					
						
							|  |  |  | Requires:       python-setuptools >= 11.3
 | 
					
						
							|  |  |  | Requires:       python-six >= 1.4.1
 | 
					
						
							|  |  |  | %requires_eq    python-cffi
 | 
					
						
							| 
									
										
										
										
											2018-01-18 13:31:34 +00:00
										 |  |  | %if %{with python2}
 | 
					
						
							| 
									
										
										
										
											2017-11-10 19:27:10 +00:00
										 |  |  | BuildRequires:  python2-enum34
 | 
					
						
							|  |  |  | BuildRequires:  python2-ipaddress
 | 
					
						
							|  |  |  | %endif
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | # SECTION Test requirements
 | 
					
						
							| 
									
										
										
										
											2018-03-02 21:42:20 +00:00
										 |  |  | BuildRequires:  %{python_module hypothesis >= 1.11.4}
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | BuildRequires:  %{python_module iso8601}
 | 
					
						
							| 
									
										
										
										
											2017-05-02 13:10:17 +00:00
										 |  |  | BuildRequires:  %{python_module packaging}
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | BuildRequires:  %{python_module pretend}
 | 
					
						
							|  |  |  | BuildRequires:  %{python_module pyasn1 >= 0.1.8}
 | 
					
						
							| 
									
										
										
										
											2018-03-02 21:42:20 +00:00
										 |  |  | BuildRequires:  %{python_module pytest > 3.3.0}
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | BuildRequires:  %{python_module virtualenv}
 | 
					
						
							|  |  |  | # /SECTION
 | 
					
						
							| 
									
										
										
										
											2018-01-16 10:27:31 +00:00
										 |  |  | # python-base is not enough, we need the _ssl module
 | 
					
						
							| 
									
										
										
										
											2018-01-27 10:42:10 +00:00
										 |  |  | %ifpython2
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | Requires:       python-enum34
 | 
					
						
							|  |  |  | Requires:       python-ipaddress
 | 
					
						
							| 
									
										
										
										
											2018-02-08 10:56:56 +00:00
										 |  |  | Requires:       python2
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | %endif
 | 
					
						
							| 
									
										
										
										
											2018-02-03 13:02:25 +00:00
										 |  |  | %ifpython3
 | 
					
						
							|  |  |  | Requires:       python3
 | 
					
						
							|  |  |  | %endif
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | %python_subpackages
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00: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 08:39:17 +00:00
										 |  |  | # prepare vectors module
 | 
					
						
							| 
									
										
										
										
											2014-12-29 18:15:46 +00:00
										 |  |  | tar xvzf %{SOURCE3}
 | 
					
						
							| 
									
										
										
										
											2014-05-28 08:39:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-17 14:30:34 +00:00
										 |  |  | %patch1 -p1
 | 
					
						
							| 
									
										
										
										
											2017-09-07 14:49:40 +00:00
										 |  |  | %patch2 -p1
 | 
					
						
							| 
									
										
										
										
											2015-09-17 14:30:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | %build
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | export CFLAGS="%{optflags} -fno-strict-aliasing"
 | 
					
						
							|  |  |  | %python_build
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | %install
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | %python_install
 | 
					
						
							|  |  |  | %fdupes %{buildroot}%{_prefix}
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-01 08:25:31 +00:00
										 |  |  | %check
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | %{python_expand # this is going to be fun
 | 
					
						
							| 
									
										
										
										
											2014-12-29 18:15:46 +00:00
										 |  |  | # create virtualenv
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | $python %{_bindir}/virtualenv --system-site-packages TESTROOT-%{$python_bin_suffix}
 | 
					
						
							|  |  |  | . TESTROOT-%{$python_bin_suffix}/bin/activate
 | 
					
						
							| 
									
										
										
										
											2014-12-29 18:15:46 +00:00
										 |  |  | # install package in virtualenv
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | $python setup.py install
 | 
					
						
							| 
									
										
										
										
											2014-12-29 18:15:46 +00:00
										 |  |  | # install cryptography vectors
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | (cd cryptography_vectors-%{version} && $python setup.py install)
 | 
					
						
							| 
									
										
										
										
											2014-12-29 18:15:46 +00:00
										 |  |  | # run tests with virtualenv'd python
 | 
					
						
							|  |  |  | # (specify "tests" directory, otherwise py.test discovers tests in virtualenv'd setuptools)
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | $python -m pytest tests
 | 
					
						
							| 
									
										
										
										
											2014-12-29 18:15:46 +00:00
										 |  |  | # finish
 | 
					
						
							|  |  |  | deactivate
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | }
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | %files %{python_files}
 | 
					
						
							| 
									
										
										
										
											2016-03-13 21:20:08 +00:00
										 |  |  | %doc LICENSE LICENSE.APACHE LICENSE.BSD
 | 
					
						
							|  |  |  | %doc AUTHORS.rst CONTRIBUTING.rst CHANGELOG.rst README.rst
 | 
					
						
							| 
									
										
										
										
											2017-03-30 14:12:18 +00:00
										 |  |  | %{python_sitearch}/*
 | 
					
						
							| 
									
										
										
										
											2014-02-24 14:01:28 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | %changelog
 |