2014-02-24 15:01:28 +01:00
|
|
|
#
|
2024-01-29 15:19:13 +01:00
|
|
|
# spec file for package python-cryptography
|
2014-02-24 15:01:28 +01:00
|
|
|
#
|
2024-01-29 15:19:13 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
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.
|
|
|
|
|
2018-12-06 12:48:48 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-02-24 15:01:28 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2021-11-29 12:07:36 +01:00
|
|
|
%global rustflags '-Clink-arg=-Wl,-z,relro,-z,now'
|
2022-02-16 20:00:35 +01:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2023-04-22 08:18:33 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2022-02-16 20:00:35 +01:00
|
|
|
Name: python-cryptography%{psuffix}
|
2024-06-08 14:04:45 +02:00
|
|
|
Version: 42.0.8
|
2014-02-24 15:01:28 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Python library which exposes cryptographic recipes and primitives
|
2017-11-02 16:19:19 +01:00
|
|
|
License: Apache-2.0 OR BSD-3-Clause
|
2014-02-24 15:01:28 +01:00
|
|
|
Group: Development/Languages/Python
|
2018-03-27 14:55:23 +02: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
|
2024-01-29 15:19:13 +01:00
|
|
|
# use `osc service manualrun` to regenerate
|
2022-05-24 08:59:20 +02:00
|
|
|
Source2: vendor.tar.zst
|
2022-02-16 20:00:35 +01:00
|
|
|
Source4: python-cryptography.keyring
|
2023-07-11 07:55:34 +02:00
|
|
|
# PATCH-FEATURE-OPENSUSE no-pytest_benchmark.patch mcepl@suse.com
|
|
|
|
# We don't need no benchmarking and coverage measurement
|
|
|
|
Patch4: no-pytest_benchmark.patch
|
2021-10-13 02:59:08 +02:00
|
|
|
BuildRequires: %{python_module cffi >= 1.12}
|
2017-03-30 16:12:18 +02:00
|
|
|
BuildRequires: %{python_module devel}
|
2022-12-08 12:47:57 +01:00
|
|
|
BuildRequires: %{python_module exceptiongroup}
|
2024-01-29 15:19:13 +01:00
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
BuildRequires: %{python_module setuptools-rust >= 1.7.0}
|
2021-10-13 02:59:08 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2024-01-29 15:19:13 +01:00
|
|
|
BuildRequires: %{python_module wheel}
|
2023-06-19 22:44:25 +02:00
|
|
|
BuildRequires: cargo >= 1.56.0
|
2017-11-02 16:19:19 +01:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: libopenssl-devel
|
|
|
|
BuildRequires: pkgconfig
|
2017-03-30 16:12:18 +02:00
|
|
|
BuildRequires: python-rpm-macros
|
2023-06-19 22:44:25 +02:00
|
|
|
BuildRequires: rust >= 1.56.0
|
2022-05-24 08:59:20 +02:00
|
|
|
BuildRequires: zstd
|
2017-11-02 16:19:19 +01:00
|
|
|
BuildRequires: pkgconfig(libffi)
|
2021-10-13 02:59:08 +02:00
|
|
|
# python-base is not enough, we need the _ssl module
|
|
|
|
Requires: python
|
2022-02-16 20:00:35 +01:00
|
|
|
%requires_eq python-cffi
|
|
|
|
%if %{with test}
|
2024-01-29 15:19:13 +01:00
|
|
|
BuildRequires: %{python_module certifi}
|
2022-02-16 20:00:35 +01:00
|
|
|
BuildRequires: %{python_module cryptography >= %{version}}
|
2021-10-13 02:59:08 +02:00
|
|
|
BuildRequires: %{python_module cryptography-vectors = %{version}}
|
2018-03-02 22:42:20 +01:00
|
|
|
BuildRequires: %{python_module hypothesis >= 1.11.4}
|
2017-03-30 16:12:18 +02:00
|
|
|
BuildRequires: %{python_module iso8601}
|
|
|
|
BuildRequires: %{python_module pretend}
|
2021-10-13 02:59:08 +02:00
|
|
|
BuildRequires: %{python_module pytest > 6.0}
|
2021-10-04 23:39:33 +02:00
|
|
|
BuildRequires: %{python_module pytest-subtests}
|
2021-10-13 02:59:08 +02:00
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
|
|
|
BuildRequires: %{python_module pytz}
|
2022-02-16 20:00:35 +01:00
|
|
|
%endif
|
2017-03-30 16:12:18 +02:00
|
|
|
%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
|
2018-06-12 10:00:09 +02:00
|
|
|
supports Python 2.7, Python 3.4+, and PyPy-5.3+.
|
2014-02-24 15:01:28 +01:00
|
|
|
|
|
|
|
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
|
2021-11-29 12:07:36 +01:00
|
|
|
%autosetup -a2 -p1 -n cryptography-%{version}
|
2022-05-24 08:59:20 +02:00
|
|
|
rm -v src/rust/Cargo.lock
|
2015-09-17 16:30:34 +02:00
|
|
|
|
2014-02-24 15:01:28 +01:00
|
|
|
%build
|
2023-06-20 19:14:00 +02:00
|
|
|
# https://github.com/pyca/cryptography/issues/9023
|
|
|
|
%global _lto_cflags %{nil}
|
2021-11-29 12:07:36 +01:00
|
|
|
export RUSTFLAGS=%{rustflags}
|
2017-03-30 16:12:18 +02:00
|
|
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
2024-01-29 15:19:13 +01:00
|
|
|
%pyproject_wheel
|
2014-02-24 15:01:28 +01:00
|
|
|
|
|
|
|
%install
|
2022-02-16 20:56:54 +01:00
|
|
|
%if !%{with test}
|
2021-11-29 12:07:36 +01:00
|
|
|
export RUSTFLAGS=%{rustflags}
|
2019-05-29 17:01:07 +02:00
|
|
|
# Actually other *.c and *.h are appropriate
|
|
|
|
# see https://github.com/pyca/cryptography/issues/1463
|
|
|
|
find . -name .keep -print -delete
|
|
|
|
|
2024-01-29 15:19:13 +01:00
|
|
|
%pyproject_install
|
2018-12-06 12:48:48 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
2022-02-16 20:00:35 +01:00
|
|
|
%endif
|
2014-02-24 15:01:28 +01:00
|
|
|
|
2022-02-16 20:00:35 +01:00
|
|
|
%if %{with test}
|
2014-04-01 10:25:31 +02:00
|
|
|
%check
|
2023-01-05 22:13:05 +01:00
|
|
|
# won't work for cryptography
|
2024-02-04 19:53:53 +01:00
|
|
|
# fails with OverflowError on 32bit platform
|
2024-02-04 20:12:18 +01:00
|
|
|
%ifarch %ix86 %arm ppc
|
2024-02-04 19:53:53 +01:00
|
|
|
rm -v tests/hazmat/primitives/test_aead.py
|
2024-02-22 19:03:16 +01:00
|
|
|
# imports test_aead so we need to remove also these
|
|
|
|
rm -v tests/wycheproof/test_aes.py
|
|
|
|
rm -v tests/wycheproof/test_chacha20poly1305.py
|
2024-02-04 19:53:53 +01:00
|
|
|
%endif
|
2023-01-05 22:13:05 +01:00
|
|
|
%pytest_arch -n auto --ignore-glob=vendor/*
|
2022-02-16 20:00:35 +01:00
|
|
|
%endif
|
2014-02-24 15:01:28 +01:00
|
|
|
|
2022-02-16 20:00:35 +01:00
|
|
|
%if !%{with test}
|
2017-03-30 16:12:18 +02:00
|
|
|
%files %{python_files}
|
2018-03-26 09:50:13 +02:00
|
|
|
%license LICENSE LICENSE.APACHE LICENSE.BSD
|
2021-10-04 23:39:33 +02:00
|
|
|
%doc CONTRIBUTING.rst CHANGELOG.rst README.rst
|
2021-10-13 02:59:08 +02:00
|
|
|
%{python_sitearch}/cryptography
|
2024-01-29 15:19:13 +01:00
|
|
|
%{python_sitearch}/cryptography-%{version}.dist-info
|
2022-02-16 20:00:35 +01:00
|
|
|
%endif
|
2014-02-24 15:01:28 +01:00
|
|
|
|
|
|
|
%changelog
|