# For automatic rebuilds in COPR # The following tag is to get correct syntax highlighting for this file in vim text editor # vim: syntax=spec %global debug_package %{nil} %if ! 0%{?fedora} && 0%{?rhel} <= 8 %global old_rhel 1 %else %global old_rhel 0 %endif %if %{undefined rhel} %bcond_without tests %else %bcond_with tests %endif %global pypi_name podman %global desc %{pypi_name} is a library of bindings to use the RESTful API for Podman. # git_dir_name returns repository name derived from remote Git repository URL Name: python-podman Epoch: 101 # git_dir_version returns version based on commit and tag history of the Git project Version: 0.0.git.409.ce006ff7 # This can be useful later for adding downstream patches Release: 1%{?dist} # Basic description of the package Summary: Manage Pods, Containers and Container Images License: Apache-2.0 # Home page of the project. Can also point to the public Git repository page. URL: https://github.com/containers/podman-py # Detailed information about the source Git repository and the source commit # for the created rpm package VCS: git+https://github.com/containers/podman-py#ce006ff7103d3475198967d3fb87369ed4ec3a54: # git_dir_pack macro places the repository content (the source files) into a tarball # and returns its filename. The tarball will be used to build the rpm. Source: podman-py-ce006ff7.tar.gz %description %desc %package -n python%{python3_pkgversion}-%{pypi_name} BuildRequires: git-core BuildRequires: python%{python3_pkgversion}-devel %if %{?old_rhel} BuildRequires: python%{python3_pkgversion}-pyxdg BuildRequires: python%{python3_pkgversion}-requests BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-pytoml Requires: python%{python3_pkgversion}-pyxdg Requires: python%{python3_pkgversion}-requests Requires: python%{python3_pkgversion}-pytoml %else BuildRequires: pyproject-rpm-macros %endif Provides: %{pypi_name}-py = %{version}-%{release} Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} %description -n python%{python3_pkgversion}-%{pypi_name} %desc # The following four sections already describe the rpm build process itself. # prep will extract the tarball defined as Source above and descend into it. %prep %setup -T -b 0 -q -n podman-py %if %{defined el8} # RHEL 8 does not have tomli. Use pytoml instead. sed -i 's|tomli.*|pytoml|' setup.cfg # Ensure patch was properly applied. (! grep 'tomli' setup.cfg) %endif %if %{defined el9} # RHEL 9 does not have tomli. Use toml instead. sed -i 's|tomli.*|toml|' setup.cfg # Ensure patch was properly applied. (! grep 'tomli' setup.cfg) %endif # Remove lint and integration test dependencies sed -i -E '/black|coverage|pylint|fixtures/d' test-requirements.txt %if ! %{?old_rhel} %generate_buildrequires %pyproject_buildrequires %{?with_tests:-t} %endif # This will invoke `make` command in the directory with the extracted sources. %build %if %{?old_rhel} %py3_build %else %pyproject_wheel %endif %install %if %{?old_rhel} %py3_install %else %pyproject_install %endif %check %if %{with tests} %tox -- -- podman/tests/unit %endif # This lists all the files that are included in the rpm package and that # are going to be installed into target system where the rpm is installed. %files -n python3-podman %license LICENSE %doc README.md %{python3_sitelib}/podman/* %{python3_sitelib}/podman-*/* # Finally, changes from the latest release of your application are generated from # your project's Git history. It will be empty until you make first annotated Git tag. %changelog