remove debbuild macros to comply with Fedora guidelines

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
Lokesh Mandvekar 2022-10-05 14:21:46 -04:00
parent 46fa295bfc
commit f54b225c43

View File

@ -1,41 +1,29 @@
%if "%{_vendor}" == "debbuild"
%global python3_pkgversion 3
%endif
%global pypi_name podman
%global desc %{pypi_name} is a library of bindings to use the RESTful API for Podman.
%global pypi_dist 4
%global built_tag_strip 4.2.0
%global built_tag v4.2.0
%global built_tag_strip %(b=%{built_tag}; echo ${b:1})
%global gen_version %(b=%{built_tag_strip}; echo ${b/-/"~"})
Name: python-%{pypi_name}
Epoch: 3
Version: 4.2.0
%if "%{_vendor}" == "debbuild"
Packager: Podman Debbuild Maintainers <https://github.com/orgs/containers/teams/podman-debbuild-maintainers>
License: ASL-2.0
Release: 0%{?dist}
%else
Version: %{gen_version}
License: ASL 2.0
Release: %autorelease
%endif
Summary: RESTful API for Podman
URL: https://github.com/containers/%{pypi_name}-py
Source0: %{url}/releases/download/v%{built_tag_strip}/%{pypi_name}-%{version}.tar.gz
# Tarball fetched from upstream
Source0: %{url}/releases/download/%{built_tag}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
%desc
%package -n python%{python3_pkgversion}-%{pypi_name}
%if "%{_vendor}" == "debbuild"
BuildRequires: git
BuildRequires: python%{python3_pkgversion}-dev
%else
BuildRequires: git-core
BuildRequires: python%{python3_pkgversion}-devel
%endif
%if ("%{_vendor}" == "debbuild") || (! 0%{?fedora} && 0%{?rhel} <= 8)
%if ! 0%{?fedora} && 0%{?rhel} <= 8
BuildRequires: python%{python3_pkgversion}-pytoml
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-setuptools
@ -44,21 +32,14 @@ Requires: python%{python3_pkgversion}-requests
%else
BuildRequires: pyproject-rpm-macros
%endif
%if "%{_vendor}" == "debbuild"
BuildRequires: python%{python3_pkgversion}-xdg
Requires: python%{python3_pkgversion}-xdg
%else
%if 0%{?centos} <= 8
BuildRequires: python%{python3_pkgversion}-pyxdg
Requires: python%{python3_pkgversion}-pyxdg
%endif
%if 0%{?fedora} >= 35
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-toml
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-toml
%endif
%endif
Provides: %{pypi_name}-py = %{version}-%{release}
Provides: python%{python3_pkgversion}dist(%{pypi_name}) = %{pypi_dist}
Provides: python%{python3_version}dist(%{pypi_name}) = %{pypi_dist}
@ -80,28 +61,20 @@ Summary: %{summary}
%build
export PBR_VERSION="0.0.0"
%if "%{_vendor}" == "debbuild"
python3 setup.py sdist bdist
%else
%if 0%{?rhel} <= 8
%py3_build
%else
%pyproject_wheel
%endif
%endif
%install
export PBR_VERSION="0.0.0"
%if "%{_vendor}" == "debbuild"
python3 setup.py install --root %{buildroot}
%else
%if 0%{?rhel} <= 8
%py3_install
%else
%pyproject_install
%pyproject_save_files %{pypi_name}
%endif
%endif
%if 0%{?rhel} <= 8
%files -n python3-podman
@ -116,6 +89,4 @@ python3 setup.py install --root %{buildroot}
%endif
%changelog
%if "%{_vendor}" != "debbuild"
%autochangelog
%endif