From 88084de2b80817953ddcdc5e611f76d704ed161c Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Fri, 17 Nov 2023 17:58:32 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20generate=20build=20requires=20o?= =?UTF-8?q?n=20EL=20<=3D=209?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nils Philippsen --- python-rpmautospec-core.spec | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/python-rpmautospec-core.spec b/python-rpmautospec-core.spec index 57c55ba..197c7e2 100644 --- a/python-rpmautospec-core.spec +++ b/python-rpmautospec-core.spec @@ -1,15 +1,11 @@ %if ! 0%{?rhel} || 0%{?rhel} >= 10 %bcond_without testcoverage -%bcond_with setup_py +%bcond_without pyproject_build +%bcond_without genbrs %else %bcond_with testcoverage -%bcond_without setup_py -%endif - -%if ! 0%{?rhel} || 0%{?rhel} >= 9 -%bcond_with compatbuild -%else -%bcond_without compatbuild +%bcond_with pyproject_build +%bcond_with genbrs %endif %if 0%{undefined pyproject_files} @@ -36,15 +32,11 @@ BuildRequires: python3dist(pytest-cov) %endif BuildRequires: sed -%if %{without compatbuild} +%if %{with genbrs} %generate_buildrequires -%if %{without setup.py} %{pyproject_buildrequires} %else -( %{pyproject_buildrequires} ) | grep -v poetry -echo 'python3dist(setuptools)' -%endif -%else +BuildRequires: python3dist(pip) BuildRequires: python3dist(setuptools) %endif @@ -56,7 +48,7 @@ uses rpmautospec features.} %package -n python3-%{canonicalname} Summary: %{summary} -%if %{with compatbuild} +%if %{without pyproject_build} %py_provides python3-%{canonicalname} %endif @@ -72,7 +64,7 @@ addopts = PYTESTINI %endif -%if %{with setup_py} +%if %{without pyproject_build} cat << SETUPPY > setup.py from setuptools import setup @@ -81,14 +73,14 @@ SETUPPY %endif %build -%if %{without compatbuild} +%if %{with pyproject_build} %pyproject_wheel %else %py3_build %endif %install -%if %{without compatbuild} +%if %{with pyproject_build} %pyproject_install %pyproject_save_files %{srcname} # Work around poetry not listing license files as such in package metadata. @@ -103,7 +95,7 @@ echo '%{python3_sitelib}/%{srcname}*' > %{pyproject_files} %files -n python3-%{canonicalname} -f %{pyproject_files} %doc README.md -%if %{with compatbuild} +%if %{without pyproject_build} %license LICENSE %endif