Blame SPECS/python3.11-cryptography.spec

6656ee
%global __python3 /usr/bin/python3.11
6656ee
%global python3_pkgversion 3.11
6656ee
6656ee
# RHEL: Tests disabled due to missing deps
6656ee
%bcond_with tests
6656ee
6656ee
%global srcname cryptography
6656ee
6656ee
Name:           python%{python3_pkgversion}-%{srcname}
6656ee
Version:        37.0.2
6656ee
Release:        3%{?dist}
6656ee
Summary:        PyCA's cryptography library
6656ee
6656ee
# We bundle various crates with cryptography which is dual licensed
6656ee
# under the ASL 2.0 and BSD-3-Clause, as well as the Python license
6656ee
# for the OS random engine derived by CPython.
6656ee
6656ee
# Inflector: BSD
6656ee
# aliasable: MIT
6656ee
# asn1: BSD
6656ee
# asn1_derive: BSD
6656ee
# autocfg: MIT or ASL 2.0
6656ee
# base64: MIT or ASL 2.0
6656ee
# cfg-if: MIT or ASL 2.0
6656ee
# chrono: MIT or ASL 2.0
6656ee
# indoc: MIT or ASL 2.0
6656ee
# indoc-impl: MIT or ASL 2.0
6656ee
# instant: BSD
6656ee
# lazy_static: MIT or ASL 2.0
6656ee
# libc: MIT or ASL 2.0
6656ee
# lock_api: MIT or ASL 2.0
6656ee
# num-integer: MIT or ASL 2.0
6656ee
# num-traits: MIT or ASL 2.0
6656ee
# once_cell: MIT or ASL 2.0
6656ee
# ouroboros: MIT or ASL 2.0
6656ee
# ouroboros_macro: MIT or ASL 2.0
6656ee
# parking_lot: MIT or ASL 2.0
6656ee
# parking_lot_core: MIT or ASL 2.0
6656ee
# paste: MIT or ASL 2.0
6656ee
# paste-impl: MIT or ASL 2.0
6656ee
# pem: MIT
6656ee
# proc-macro-error: MIT or ASL 2.0
6656ee
# proc-macro-error-attr: MIT or ASL 2.0
6656ee
# proc-macro-hack: MIT or ASL 2.0
6656ee
# proc-macro2: MIT or ASL 2.0
6656ee
# pyo3: ASL 2.0
6656ee
# pyo3-build-config: ASL 2.0
6656ee
# pyo3-macros: ASL 2.0
6656ee
# pyo3-macros-backend: ASL 2.0
6656ee
# quote: MIT or ASL 2.0
6656ee
# scopeguard: MIT or ASL 2.0
6656ee
# smallvec: MIT or ASL 2.0
6656ee
# stable_deref_trait: MIT or ASL 2.0
6656ee
# syn: MIT or ASL 2.0
6656ee
# unicode-xid: MIT or ASL 2.0
6656ee
# unindent: MIT or ASL 2.0
6656ee
# version_check: MIT or ASL 2.0
6656ee
6656ee
License:        (ASL 2.0 or BSD) and Python and BSD and MIT and (MIT or ASL 2.0) and ASL 2.0
6656ee
URL:            https://cryptography.io/en/latest/
6656ee
Source0:        https://github.com/pyca/cryptography/archive/%{version}/%{srcname}-%{version}.tar.gz
6656ee
                # created by ./vendor_rust.py helper script
6656ee
Source1:        cryptography-%{version}-vendor.tar.bz2
6656ee
Source2:        conftest-skipper.py
6656ee
6656ee
ExclusiveArch:  %{rust_arches}
6656ee
6656ee
BuildRequires:  openssl-devel
6656ee
BuildRequires:  gcc
6656ee
BuildRequires:  gnupg2
6656ee
%if 0%{?fedora}
6656ee
BuildRequires:  rust-packaging
6656ee
%else
6656ee
BuildRequires:  rust-toolset
6656ee
%endif
6656ee
6656ee
BuildRequires:  python%{python3_pkgversion}-cffi >= 1.7
6656ee
BuildRequires:  python%{python3_pkgversion}-devel
6656ee
BuildRequires:  python%{python3_pkgversion}-rpm-macros
6656ee
BuildRequires:  python%{python3_pkgversion}-setuptools
6656ee
BuildRequires:  python%{python3_pkgversion}-setuptools-rust >= 0.11.3
6656ee
# Cargo.toml requires asn1 0.6, but package FTBFS with 0.6.1
6656ee
#BuildRequires:  rust-asn1-devel >= 0.6.4
6656ee
6656ee
%if %{with tests}
6656ee
%if 0%{?fedora}
6656ee
BuildRequires:  python%{python3_pkgversion}-hypothesis >= 1.11.4
6656ee
BuildRequires:  python%{python3_pkgversion}-iso8601
6656ee
BuildRequires:  python%{python3_pkgversion}-pretend
6656ee
BuildRequires:  python%{python3_pkgversion}-pytest-xdist
6656ee
%endif
6656ee
BuildRequires:  python%{python3_pkgversion}-pytest >= 6.0
6656ee
BuildRequires:  python%{python3_pkgversion}-pytest-benchmark
6656ee
BuildRequires:  python%{python3_pkgversion}-pytest-subtests >= 0.3.2
6656ee
BuildRequires:  python%{python3_pkgversion}-pytz
6656ee
%endif
6656ee
6656ee
Requires:       openssl-libs
6656ee
Requires:       python%{python3_pkgversion}-cffi >= 1.7
6656ee
6656ee
# Provides for the bundled crates
6656ee
6656ee
Provides: bundled(crate(Inflector)) = 0.11.4
6656ee
Provides: bundled(crate(aliasable)) = 0.1.3
6656ee
Provides: bundled(crate(asn1)) = 0.8.7
6656ee
Provides: bundled(crate(asn1_derive)) = 0.8.7
6656ee
Provides: bundled(crate(autocfg)) = 1.1.0
6656ee
Provides: bundled(crate(base64)) = 0.13.0
6656ee
Provides: bundled(crate(cfg-if)) = 1.0.0
6656ee
Provides: bundled(crate(chrono)) = 0.4.19
6656ee
Provides: bundled(crate(indoc)) = 0.3.6
6656ee
Provides: bundled(crate(indoc-impl)) = 0.3.6
6656ee
Provides: bundled(crate(instant)) = 0.1.12
6656ee
Provides: bundled(crate(lazy_static)) = 1.4.0
6656ee
Provides: bundled(crate(libc)) = 0.2.124
6656ee
Provides: bundled(crate(lock_api)) = 0.4.7
6656ee
Provides: bundled(crate(num-integer)) = 0.1.44
6656ee
Provides: bundled(crate(num-traits)) = 0.2.14
6656ee
Provides: bundled(crate(once_cell)) = 1.10.0
6656ee
Provides: bundled(crate(ouroboros)) = 0.15.0
6656ee
Provides: bundled(crate(ouroboros_macro)) = 0.15.0
6656ee
Provides: bundled(crate(parking_lot)) = 0.11.2
6656ee
Provides: bundled(crate(parking_lot_core)) = 0.8.5
6656ee
Provides: bundled(crate(paste)) = 0.1.18
6656ee
Provides: bundled(crate(paste-impl)) = 0.1.18
6656ee
Provides: bundled(crate(pem)) = 1.0.2
6656ee
Provides: bundled(crate(proc-macro-error)) = 1.0.4
6656ee
Provides: bundled(crate(proc-macro-error-attr)) = 1.0.4
6656ee
Provides: bundled(crate(proc-macro-hack)) = 0.5.19
6656ee
Provides: bundled(crate(proc-macro2)) = 1.0.37
6656ee
Provides: bundled(crate(pyo3)) = 0.15.2
6656ee
Provides: bundled(crate(pyo3-build-config)) = 0.15.2
6656ee
Provides: bundled(crate(pyo3-macros)) = 0.15.2
6656ee
Provides: bundled(crate(pyo3-macros-backend)) = 0.15.2
6656ee
Provides: bundled(crate(quote)) = 1.0.18
6656ee
Provides: bundled(crate(scopeguard)) = 1.1.0
6656ee
Provides: bundled(crate(smallvec)) = 1.8.0
6656ee
Provides: bundled(crate(stable_deref_trait)) = 1.2.0
6656ee
Provides: bundled(crate(syn)) = 1.0.91
6656ee
Provides: bundled(crate(unicode-xid)) = 0.2.2
6656ee
Provides: bundled(crate(unindent)) = 0.1.8
6656ee
Provides: bundled(crate(version_check)) = 0.9.4
6656ee
6656ee
# Cryptography crate
6656ee
Provides: crate(cryptography-rust) = 0.1.0
6656ee
6656ee
%description
6656ee
cryptography is a package designed to expose cryptographic primitives and
6656ee
recipes to Python developers.
6656ee
6656ee
%prep
6656ee
%autosetup -p1 -n %{srcname}-%{version}
6656ee
6656ee
6656ee
%if 0%{?fedora}
6656ee
# Fedora: use cargo macros to make use of RPMified crates
6656ee
%cargo_prep
6656ee
cd src/rust
6656ee
rm -f Cargo.lock
6656ee
%cargo_generate_buildrequires
6656ee
cd ../..
6656ee
%else
6656ee
# RHEL: use vendored Rust crates
6656ee
%cargo_prep -V 1
6656ee
%endif
6656ee
6656ee
%build
6656ee
export RUSTFLAGS="%__global_rustflags"
6656ee
%py3_build
6656ee
6656ee
%install
6656ee
# Actually other *.c and *.h are appropriate
6656ee
# see https://github.com/pyca/cryptography/issues/1463
6656ee
find . -name .keep -print -delete
6656ee
%py3_install
6656ee
6656ee
%check
6656ee
%if %{with tests}
6656ee
%if 0%{?rhel}
6656ee
# skip hypothesis tests on RHEL
6656ee
rm -rf tests/hypothesis
6656ee
# append skipper to skip iso8601 and pretend tests
6656ee
cat < %{SOURCE2} >> tests/conftest.py
6656ee
%endif
6656ee
6656ee
%if 0%{?eln}
6656ee
# enable SHA-1 signatures for RSA tests
6656ee
# also see https://github.com/pyca/cryptography/pull/6931 and rhbz#2060343
6656ee
export OPENSSL_ENABLE_SHA1_SIGNATURES=yes
6656ee
%endif
6656ee
6656ee
# see https://github.com/pyca/cryptography/issues/4885 and
6656ee
# see https://bugzilla.redhat.com/show_bug.cgi?id=1761194 for deselected tests
6656ee
# see rhbz#2042413 for memleak. It's unstable under Python 3.11 and makes
6656ee
# not much sense for downstream testing.
6656ee
PYTHONPATH=${PWD}/vectors:%{buildroot}%{python3_sitearch} \
6656ee
    %{__python3} -m pytest \
6656ee
    -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve or test_openssl_memleak)"
6656ee
%endif
6656ee
6656ee
%files -n python%{python3_pkgversion}-%{srcname}
6656ee
%doc README.rst docs
6656ee
%license LICENSE LICENSE.APACHE LICENSE.BSD
6656ee
%{python3_sitearch}/%{srcname}
6656ee
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
6656ee
6656ee
%changelog
6656ee
* Tue Feb 14 2023 Charalampos Stratakis <cstratak@redhat.com> - 37.0.2-3
6656ee
- Rebuild for gating
6656ee
6656ee
* Mon Feb 13 2023 Charalampos Stratakis <cstratak@redhat.com> - 37.0.2-2
6656ee
- Add explicit dependency on python3.11-rpm-macros
6656ee
6656ee
* Thu Dec 01 2022 Charalampos Stratakis <cstratak@redhat.com> - 37.0.2-1
6656ee
- Initial package
6656ee
- Fedora contributions by:
6656ee
      Alfredo Moralejo <amoralej@redhat.com>
6656ee
      Charalampos Stratakis <cstratak@redhat.com>
6656ee
      Christian Heimes <christian@python.org>
6656ee
      Colin Walters <walters@verbum.org>
6656ee
      Dennis Gilmore <dennis@ausil.us>
6656ee
      Fabio Valentini <decathorpe@gmail.com>
6656ee
      Felix Schwarz <felix.schwarz@oss.schwarz.eu>
6656ee
      Haikel Guemar <hguemar@fedoraproject.org>
6656ee
      Igor Gnatenko <ignatenkobrain@fedoraproject.org>
6656ee
      Iryna Shcherbina <shcherbina.iryna@gmail.com>
6656ee
      Lumir Balhar <lbalhar@redhat.com>
6656ee
      Matěj Cepl <mcepl@cepl.eu>
6656ee
      Miro Hrončok <miro@hroncok.cz>
6656ee
      Nathaniel McCallum <npmccallum@redhat.com>
6656ee
      Randy Barlow <randy@electronsweatshop.com>
6656ee
      Robert Kuska <rkuska@redhat.com>
6656ee
      Sahana Prasad <sahana@redhat.com>
6656ee
      Stephen Gallagher <sgallagh@redhat.com>
6656ee
      Troy Dawson <tdawson@redhat.com>