2014-02-24 14:01:28 +00:00
|
|
|
#
|
2024-09-28 19:46:03 +00:00
|
|
|
# spec file for package python-cryptography
|
2014-02-24 14:01:28 +00:00
|
|
|
#
|
2025-01-29 08:34:20 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
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.
|
|
|
|
|
2018-12-06 11:48:48 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-02-24 14:01:28 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2021-11-29 11:07:36 +00:00
|
|
|
%global rustflags '-Clink-arg=-Wl,-z,relro,-z,now'
|
2022-02-16 19:00:35 +00: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 06:18:33 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2022-02-16 19:00:35 +00:00
|
|
|
Name: python-cryptography%{psuffix}
|
2024-10-22 13:26:27 +00:00
|
|
|
# ALWAYS KEEP IN SYNC WITH python-cryptography-vectors!
|
2025-01-29 08:34:20 +00:00
|
|
|
Version: 44.0.0
|
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
|
2018-03-27 12:55:23 +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
|
2024-01-29 14:19:13 +00:00
|
|
|
# use `osc service manualrun` to regenerate
|
2022-05-24 06:59:20 +00:00
|
|
|
Source2: vendor.tar.zst
|
2022-02-16 19:00:35 +00:00
|
|
|
Source4: python-cryptography.keyring
|
2023-07-11 05:55:34 +00: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 00:59:08 +00:00
|
|
|
BuildRequires: %{python_module cffi >= 1.12}
|
2017-03-30 14:12:18 +00:00
|
|
|
BuildRequires: %{python_module devel}
|
2022-12-08 11:47:57 +00:00
|
|
|
BuildRequires: %{python_module exceptiongroup}
|
2024-07-26 10:51:57 +00:00
|
|
|
BuildRequires: %{python_module maturin}
|
2024-01-29 14:19:13 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
BuildRequires: %{python_module setuptools-rust >= 1.7.0}
|
2021-10-13 00:59:08 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2024-01-29 14:19:13 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2023-06-19 20:44:25 +00:00
|
|
|
BuildRequires: cargo >= 1.56.0
|
2024-08-12 22:30:46 +00:00
|
|
|
BuildRequires: cargo-packaging
|
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
|
2023-06-19 20:44:25 +00:00
|
|
|
BuildRequires: rust >= 1.56.0
|
2022-05-24 06:59:20 +00:00
|
|
|
BuildRequires: zstd
|
2017-11-02 15:19:19 +00:00
|
|
|
BuildRequires: pkgconfig(libffi)
|
2021-10-13 00:59:08 +00:00
|
|
|
# python-base is not enough, we need the _ssl module
|
|
|
|
Requires: python
|
2024-07-31 21:48:34 +00:00
|
|
|
Requires: python-bcrypt
|
2024-11-08 15:01:32 +00:00
|
|
|
Requires: python-cffi = %(rpm -q --whatprovides python-cffi --qf "%%{version}")
|
2022-02-16 19:00:35 +00:00
|
|
|
%if %{with test}
|
2024-07-31 21:48:34 +00:00
|
|
|
BuildRequires: %{python_module bcrypt}
|
2024-01-29 14:19:13 +00:00
|
|
|
BuildRequires: %{python_module certifi}
|
2022-02-16 19:00:35 +00:00
|
|
|
BuildRequires: %{python_module cryptography >= %{version}}
|
2021-10-13 00:59:08 +00:00
|
|
|
BuildRequires: %{python_module cryptography-vectors = %{version}}
|
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}
|
|
|
|
BuildRequires: %{python_module pretend}
|
2021-10-13 00:59:08 +00:00
|
|
|
BuildRequires: %{python_module pytest > 6.0}
|
2024-07-31 21:48:34 +00:00
|
|
|
BuildRequires: %{python_module pytest-benchmark}
|
2021-10-04 21:39:33 +00:00
|
|
|
BuildRequires: %{python_module pytest-subtests}
|
2021-10-13 00:59:08 +00:00
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
|
|
|
BuildRequires: %{python_module pytz}
|
2022-02-16 19:00:35 +00:00
|
|
|
%endif
|
2017-03-30 14:12:18 +00:00
|
|
|
%python_subpackages
|
2014-02-24 14:01:28 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
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 11:07:36 +00:00
|
|
|
%autosetup -a2 -p1 -n cryptography-%{version}
|
2015-09-17 14:30:34 +00:00
|
|
|
|
2014-02-24 14:01:28 +00:00
|
|
|
%build
|
2024-08-12 20:36:26 +00:00
|
|
|
export CARGO_NET_OFFLINE=true
|
|
|
|
export CARGO_PROFILE_RELEASE_DEBUG=true
|
2024-08-12 20:37:07 +00:00
|
|
|
export CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO=off
|
2024-09-16 11:21:15 +00:00
|
|
|
# https://pyo3.rs/main/building-and-distribution#configuring-the-python-version
|
|
|
|
%python_expand export PYO3_PYTHON="%{_bindir}/$python"
|
2023-06-20 17:14:00 +00:00
|
|
|
%global _lto_cflags %{nil}
|
2021-11-29 11:07:36 +00:00
|
|
|
export RUSTFLAGS=%{rustflags}
|
2017-03-30 14:12:18 +00:00
|
|
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
2024-01-29 14:19:13 +00:00
|
|
|
%pyproject_wheel
|
2014-02-24 14:01:28 +00:00
|
|
|
|
|
|
|
%install
|
2022-02-16 19:56:54 +00:00
|
|
|
%if !%{with test}
|
2021-11-29 11:07:36 +00:00
|
|
|
export RUSTFLAGS=%{rustflags}
|
2019-05-29 15:01:07 +00:00
|
|
|
# Actually other *.c and *.h are appropriate
|
|
|
|
# see https://github.com/pyca/cryptography/issues/1463
|
|
|
|
find . -name .keep -print -delete
|
|
|
|
|
2024-01-29 14:19:13 +00:00
|
|
|
%pyproject_install
|
2018-12-06 11:48:48 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
2022-02-16 19:00:35 +00:00
|
|
|
%endif
|
2014-02-24 14:01:28 +00:00
|
|
|
|
2022-02-16 19:00:35 +00:00
|
|
|
%if %{with test}
|
2014-04-01 08:25:31 +00:00
|
|
|
%check
|
2023-01-05 21:13:05 +00:00
|
|
|
# won't work for cryptography
|
2024-02-04 18:53:53 +00:00
|
|
|
# fails with OverflowError on 32bit platform
|
2024-02-04 19:12:18 +00:00
|
|
|
%ifarch %ix86 %arm ppc
|
2024-02-04 18:53:53 +00:00
|
|
|
rm -v tests/hazmat/primitives/test_aead.py
|
2024-02-22 18:03:16 +00: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 18:53:53 +00:00
|
|
|
%endif
|
2023-01-05 21:13:05 +00:00
|
|
|
%pytest_arch -n auto --ignore-glob=vendor/*
|
2022-02-16 19:00:35 +00:00
|
|
|
%endif
|
2014-02-24 14:01:28 +00:00
|
|
|
|
2022-02-16 19:00:35 +00:00
|
|
|
%if !%{with test}
|
2017-03-30 14:12:18 +00:00
|
|
|
%files %{python_files}
|
2018-03-26 07:50:13 +00:00
|
|
|
%license LICENSE LICENSE.APACHE LICENSE.BSD
|
2021-10-04 21:39:33 +00:00
|
|
|
%doc CONTRIBUTING.rst CHANGELOG.rst README.rst
|
2021-10-13 00:59:08 +00:00
|
|
|
%{python_sitearch}/cryptography
|
2025-01-29 08:54:07 +00:00
|
|
|
%{python_sitearch}/rust
|
2024-01-29 14:19:13 +00:00
|
|
|
%{python_sitearch}/cryptography-%{version}.dist-info
|
2022-02-16 19:00:35 +00:00
|
|
|
%endif
|
2014-02-24 14:01:28 +00:00
|
|
|
|
|
|
|
%changelog
|