2023-07-24 15:00:10 +00:00
|
|
|
# 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
|
|
|
|
|
2021-06-09 16:04:46 +00:00
|
|
|
%global pypi_name podman
|
|
|
|
%global desc %{pypi_name} is a library of bindings to use the RESTful API for Podman.
|
|
|
|
|
2022-09-09 13:15:58 +00:00
|
|
|
%global pypi_dist 4
|
2021-08-12 12:46:22 +00:00
|
|
|
|
2021-06-09 16:04:46 +00:00
|
|
|
Name: python-%{pypi_name}
|
2023-07-24 15:00:10 +00:00
|
|
|
%if %{defined copr_username}
|
|
|
|
Epoch: 102
|
|
|
|
%else
|
2021-06-09 16:04:46 +00:00
|
|
|
Epoch: 3
|
2023-07-24 15:00:10 +00:00
|
|
|
%endif
|
|
|
|
# DO NOT TOUCH the Version string!
|
|
|
|
# The TRUE source of this specfile is:
|
|
|
|
# https://github.com/containers/podman/blob/main/rpm/python-podman.spec
|
|
|
|
# If that's what you're reading, Version must be 0, and will be updated by Packit for
|
|
|
|
# copr and koji builds.
|
|
|
|
# If you're reading this on dist-git, the version is automatically filled in by Packit.
|
2024-11-26 14:06:09 +00:00
|
|
|
Version: 5.3.0
|
2023-03-06 12:28:03 +00:00
|
|
|
License: Apache-2.0
|
2022-01-27 19:09:29 +00:00
|
|
|
Release: %autorelease
|
2021-06-09 16:04:46 +00:00
|
|
|
Summary: RESTful API for Podman
|
|
|
|
URL: https://github.com/containers/%{pypi_name}-py
|
2022-10-05 18:21:46 +00:00
|
|
|
# Tarball fetched from upstream
|
2023-07-24 15:00:10 +00:00
|
|
|
Source0: %{url}/archive/v%{version}.tar.gz
|
2021-06-09 16:04:46 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
2022-08-29 22:41:36 +00:00
|
|
|
%description
|
2021-06-09 16:04:46 +00:00
|
|
|
%desc
|
|
|
|
|
|
|
|
%package -n python%{python3_pkgversion}-%{pypi_name}
|
|
|
|
BuildRequires: git-core
|
2022-03-09 18:36:36 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}-devel
|
2023-07-24 15:00:10 +00:00
|
|
|
%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
|
2022-03-09 19:14:51 +00:00
|
|
|
BuildRequires: pyproject-rpm-macros
|
2023-07-24 15:00:10 +00:00
|
|
|
%endif
|
|
|
|
Provides: %{pypi_name}-py = %{epoch}:%{version}-%{release}
|
2022-09-09 13:15:58 +00:00
|
|
|
Provides: python%{python3_pkgversion}dist(%{pypi_name}) = %{pypi_dist}
|
|
|
|
Provides: python%{python3_version}dist(%{pypi_name}) = %{pypi_dist}
|
2022-09-15 12:39:34 +00:00
|
|
|
Obsoletes: python%{python3_pkgversion}-%{pypi_name}-api <= 0.0.0-1
|
2022-09-15 12:47:44 +00:00
|
|
|
Provides: python%{python3_pkgversion}-%{pypi_name}-api = %{epoch}:%{version}-%{release}
|
2021-06-09 16:04:46 +00:00
|
|
|
Summary: %{summary}
|
|
|
|
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
|
|
|
|
|
|
|
|
%description -n python%{python3_pkgversion}-%{pypi_name}
|
|
|
|
%desc
|
|
|
|
|
|
|
|
%prep
|
2023-07-24 15:00:10 +00:00
|
|
|
%autosetup -Sgit -n %{pypi_name}-py-%{version}
|
2021-06-09 16:04:46 +00:00
|
|
|
|
2023-07-24 15:00:10 +00:00
|
|
|
%if !%{defined rhel8_py}
|
2021-06-09 16:04:46 +00:00
|
|
|
%generate_buildrequires
|
|
|
|
%pyproject_buildrequires %{?with_tests:-t}
|
2023-07-24 15:00:10 +00:00
|
|
|
%endif
|
2021-06-09 16:04:46 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
export PBR_VERSION="0.0.0"
|
2023-07-24 15:00:10 +00:00
|
|
|
%if %{defined rhel8_py}
|
|
|
|
%py3_build
|
|
|
|
%else
|
2021-06-09 16:04:46 +00:00
|
|
|
%pyproject_wheel
|
2023-07-24 15:00:10 +00:00
|
|
|
%endif
|
2021-06-09 16:04:46 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
export PBR_VERSION="0.0.0"
|
2023-07-24 15:00:10 +00:00
|
|
|
%if %{defined rhel8_py}
|
|
|
|
%py3_install
|
|
|
|
%else
|
2021-06-09 16:04:46 +00:00
|
|
|
%pyproject_install
|
|
|
|
%pyproject_save_files %{pypi_name}
|
2023-07-24 15:00:10 +00:00
|
|
|
%endif
|
2021-06-09 16:04:46 +00:00
|
|
|
|
2024-01-03 13:44:05 +00:00
|
|
|
%if !%{defined rhel8_py}
|
|
|
|
%check
|
|
|
|
%pyproject_check_import -e podman.api.typing_extensions
|
|
|
|
%endif
|
|
|
|
|
2023-07-24 15:00:10 +00:00
|
|
|
%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/*
|
|
|
|
%dir %{python3_sitelib}/%{pypi_name}
|
|
|
|
%{python3_sitelib}/%{pypi_name}/*
|
|
|
|
%else
|
2024-01-03 13:44:05 +00:00
|
|
|
%pyproject_extras_subpkg -n python%{python3_pkgversion}-%{pypi_name} progress_bar
|
2021-06-09 16:04:46 +00:00
|
|
|
%files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files}
|
2023-07-24 15:00:10 +00:00
|
|
|
%endif
|
2021-06-09 16:04:46 +00:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
|
|
|
|
%changelog
|
2023-07-24 15:00:10 +00:00
|
|
|
%if %{defined autochangelog}
|
2022-01-27 19:09:29 +00:00
|
|
|
%autochangelog
|
2023-07-24 15:00:10 +00:00
|
|
|
%else
|
|
|
|
* Mon May 01 2023 RH Container Bot <rhcontainerbot@fedoraproject.org>
|
|
|
|
- Placeholder changelog for envs that are not autochangelog-ready
|
|
|
|
%endif
|