diff --git a/python-cryptography.spec b/python-cryptography.spec index 722047a..98c9280 100644 --- a/python-cryptography.spec +++ b/python-cryptography.spec @@ -4,6 +4,12 @@ %global srcname cryptography +%if 0%{?rhel} >= 10 +%bcond openssl_engine 0 +%else +%bcond openssl_engine 1 +%endif + Name: python-%{srcname} Version: 42.0.8 Release: %autorelease @@ -24,7 +30,9 @@ Patch1: skip-overflow-tests-32bit.patch ExclusiveArch: %{rust_arches} BuildRequires: openssl-devel +%if %{with openssl_engine} && 0%{fedora} >= 41 BuildRequires: openssl-devel-engine +%endif BuildRequires: gcc BuildRequires: gnupg2 %if 0%{?fedora} @@ -98,6 +106,11 @@ cd ../.. %build export RUSTFLAGS="%build_rustflags" export OPENSSL_NO_VENDOR=1 + +%if !%{with openssl_engine} +export CFLAGS="${CFLAGS} -DOPENSSL_NO_ENGINE=1" +%endif + # Temporary work-around for using pyo3 0.20 with Python 3.13 on ELN; This can # be dropped when a cryptography release bumps to pyo3 >= 0.22 %if 0%{?rhel}