From cfa7c5c5666f5b6de077a76a489fe39193709b4b Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 30 Jun 2023 08:42:22 -0400 Subject: [PATCH] [CI:BUILD] RPM: Cleanup Remove unnecessary dependencies and conditionals Dist-git ref for dependency update: https://src.fedoraproject.org/rpms/python-podman/pull-request/2 From: Yaakov Selkowitz Signed-off-by: Lokesh Mandvekar --- rpm/python-podman.spec | 49 ++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/rpm/python-podman.spec b/rpm/python-podman.spec index 672fa606..be7630c3 100644 --- a/rpm/python-podman.spec +++ b/rpm/python-podman.spec @@ -1,21 +1,7 @@ -# copr_username is only set on copr environments, not on others like koji -# This is used to set custom epoch value for builds on coprs owned by -# rhcontainerbot. -%if "%{?copr_username}" != "rhcontainerbot" -%bcond_with copr -%else -%bcond_without copr -%endif - -# RHEL 8 envs can't use autochangelog yet, -# has slightly different python deps -# and also doesn't support generate_buildrequires. -%if !0%{?fedora} && 0%{?rhel} <= 8 -%bcond_without changelog -%bcond_without rhel8_py -%else -%bcond_with changelog -%bcond_with rhel8_py +# RHEL 8 envs has slightly different python deps +# and also doesn't support dynamic (build)requires. +%if %{defined rhel} && 0%{?rhel} == 8 +%define rhel8_py 1 %endif %global pypi_name podman @@ -24,7 +10,7 @@ %global pypi_dist 4 Name: python-%{pypi_name} -%if %{with copr} +%if %{defined copr_username} Epoch: 102 %else Epoch: 3 @@ -50,19 +36,16 @@ BuildArch: noarch %package -n python%{python3_pkgversion}-%{pypi_name} BuildRequires: git-core BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-requests -%if %{with rhel8_py} -BuildRequires: python%{python3_pkgversion}-devel +%if %{defined rhel8_py} BuildRequires: python%{python3_pkgversion}-rpm-macros BuildRequires: python%{python3_pkgversion}-pytoml +BuildRequires: python%{python3_pkgversion}-requests Requires: python%{python3_pkgversion}-pytoml +Requires: python%{python3_pkgversion}-requests %else BuildRequires: pyproject-rpm-macros -BuildRequires: python%{python3_pkgversion}-toml -Requires: python%{python3_pkgversion}-toml %endif -Requires: python%{python3_pkgversion}-requests -Provides: %{pypi_name}-py = %{version}-%{release} +Provides: %{pypi_name}-py = %{epoch}:%{version}-%{release} Provides: python%{python3_pkgversion}dist(%{pypi_name}) = %{pypi_dist} Provides: python%{python3_version}dist(%{pypi_name}) = %{pypi_dist} Obsoletes: python%{python3_pkgversion}-%{pypi_name}-api <= 0.0.0-1 @@ -76,14 +59,14 @@ Summary: %{summary} %prep %autosetup -Sgit -n %{pypi_name}-py-%{version} -%if %{without rhel8_py} +%if !%{defined rhel8_py} %generate_buildrequires %pyproject_buildrequires %{?with_tests:-t} %endif %build export PBR_VERSION="0.0.0" -%if %{with rhel8_py} +%if %{defined rhel8_py} %py3_build %else %pyproject_wheel @@ -91,14 +74,14 @@ export PBR_VERSION="0.0.0" %install export PBR_VERSION="0.0.0" -%if %{with rhel8_py} +%if %{defined rhel8_py} %py3_install %else %pyproject_install %pyproject_save_files %{pypi_name} %endif -%if %{with rhel8_py} +%if %{defined rhel8_py} %files -n python%{python3_pkgversion}-%{pypi_name} %dir %{python3_sitelib}/%{pypi_name}-*-py%{python3_version}.egg-info %{python3_sitelib}/%{pypi_name}-*-py%{python3_version}.egg-info/* @@ -111,9 +94,9 @@ export PBR_VERSION="0.0.0" %doc README.md %changelog -%if %{with changelog} +%if %{defined autochangelog} +%autochangelog +%else * Mon May 01 2023 RH Container Bot - Placeholder changelog for envs that are not autochangelog-ready -%else -%autochangelog %endif