special conditionals only for rhel8

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
Lokesh Mandvekar 2022-03-09 13:57:57 -05:00
parent 686d06f96c
commit 9b3a95f0ea

View File

@ -25,18 +25,14 @@ BuildRequires: python%{python3_pkgversion}-devel
%if 0%{?fedora} %if 0%{?fedora}
BuildRequires: pyproject-rpm-macros BuildRequires: pyproject-rpm-macros
%else %else
%if %{?rhel} <= 8
BuildRequires: python%{python3_pkgversion}-pytoml
BuildRequires: python%{python3_pkgversion}-pyxdg BuildRequires: python%{python3_pkgversion}-pyxdg
BuildRequires: python%{python3_pkgversion}-requests BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-setuptools
Requires: python%{python3_pkgversion}-pytoml
Requires: python%{python3_pkgversion}-pyxdg Requires: python%{python3_pkgversion}-pyxdg
Requires: python%{python3_pkgversion}-requests Requires: python%{python3_pkgversion}-requests
%if %{?rhel} >= 9
BuildRequires: python%{python3_pkgversion}-toml
Requires: python%{python3_pkgversion}-toml
%else
BuildRequires: python%{python3_pkgversion}-pytoml
Requires: python%{python3_pkgversion}-pytoml
%endif
%endif %endif
Provides: %{pypi_name}-py = %{version}-%{release} Provides: %{pypi_name}-py = %{version}-%{release}
Summary: %{summary} Summary: %{summary}
@ -48,19 +44,27 @@ Summary: %{summary}
%prep %prep
%autosetup -Sgit_am -n %{pypi_name}-%{built_tag_strip} %autosetup -Sgit_am -n %{pypi_name}-%{built_tag_strip}
%if ! 0%{?rhel} <= 8
%generate_buildrequires %generate_buildrequires
%pyproject_buildrequires %{?with_tests:-t} %pyproject_buildrequires %{?with_tests:-t}
%endif
%build %build
export PBR_VERSION="0.0.0" export PBR_VERSION="0.0.0"
%if 0%{?rhel} <= 8
%py3_build
%else
%pyproject_wheel %pyproject_wheel
%endif
%install %install
export PBR_VERSION="0.0.0" export PBR_VERSION="0.0.0"
%if 0{?hrel} <= 8
%py3_install
%else
%pyproject_install %pyproject_install
%pyproject_save_files %{pypi_name} %pyproject_save_files %{pypi_name}
%endif
%check
%files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files} %files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files}
%license LICENSE %license LICENSE