-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from lsm5/packit-cleanup
[CI:BUILD] RPM: Cleanup
- Loading branch information
Showing
1 changed file
with
16 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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,29 +59,29 @@ 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 | ||
%endif | ||
|
||
%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 <[email protected]> | ||
- Placeholder changelog for envs that are not autochangelog-ready | ||
%else | ||
%autochangelog | ||
%endif |