forked from containers/podman-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-podman.spec.rpkg
More file actions
109 lines (87 loc) · 3.09 KB
/
python-podman.spec.rpkg
File metadata and controls
109 lines (87 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# 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
%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: {{{ git_dir_version }}}
# 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. We assume GPLv2+ here.
License: ASL 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_dir_vcs }}}
# 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: {{{ git_dir_pack }}}
%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}-toml
Requires: python%{python3_pkgversion}-pyxdg
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-toml
%else
BuildRequires: pyproject-rpm-macros
%endif
%if 0%{?fedora} <= 35 && ! 0%{?rhel}
BuildRequires: python%{python3_pkgversion}-tomli
Requires: python%{python3_pkgversion}-tomli
%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
{{{ git_dir_setup_macro }}}
%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
# 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
{{{ git_dir_changelog }}}