diff --git a/python-urllib3.spec b/python-urllib3.spec index 2da657e..1f3b207 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -1,12 +1,8 @@ # When bootstrapping Python, we cannot test this yet # RHEL does not include the test dependencies and the dependencies for extras -%if 0%{?rhel} -%bcond_with tests -%bcond_with extras -%else -%bcond_without tests -%bcond_without extras -%endif +%bcond tests %{undefined rhel} +%bcond extras %[%{undefined rhel} || %{defined eln}] +%bcond extradeps %{undefined rhel} Name: python-urllib3 Version: 2.2.3 @@ -110,7 +106,7 @@ Requires: ca-certificates BuildRequires: %{py3_dist idna} Requires: %{py3_dist idna} -%if %{with extras} +%if %{with extradeps} # There has historically been a manual hard dependency on python3-pysocks; # since bringing it in is the sole function of python3-urllib3+socks, # we recommend it, so it is installed by default. @@ -152,7 +148,7 @@ sed -i "s/^RECENT_DATE = datetime.date(.*)/RECENT_DATE = datetime.date($recent_d export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' # Generate BR’s from packaged extras even when tests are disabled, to ensure # the extras metapackages are installable if the build succeeds. -%pyproject_buildrequires %{?with_extras:-x brotli,zstd,socks,h2} +%pyproject_buildrequires %{?with_extradeps:-x brotli,zstd,socks,h2} %build @@ -173,7 +169,7 @@ export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' # urllib3.contrib.ntlmpool is deprecated and requires ntlm # urllib3.contrib.securetransport is macOS only # urllib3.contrib.pyopenssl requires pyOpenSSL -%{pyproject_check_import %{!?with_extras:-e urllib3.contrib.socks -e urllib3.http2*} +%{pyproject_check_import %{!?with_extradeps:-e urllib3.contrib.socks -e urllib3.http2*} -e urllib3.contrib.emscripten* -e urllib3.contrib.ntlmpool -e urllib3.contrib.securetransport