blob: 73c60e945b65b6dac953c68641494d0c8d8928b7 (
plain)
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
Name: rpkg
Version: 1.66
Release: 1
Summary: Python library for interacting with rpm+git
License: GPLv2+ and LGPLv2
URL: https://pagure.io/rpkg
BuildArch: noarch
Source0: https://pagure.io/releases/rpkg/%{name}-%{version}.tar.gz
# Disable python2 build by default
%global with_python2 0
# Enable python3 build by default
%global with_python3 1
# Fix for bug 1579367
# Due to https://pagure.io/koji/issue/912, python[23]-koji package does not
# have egginfo.
# rpm-py-installer is required as a proxy to install RPM python binding
# library, so rpm is the actual requirement that must be present in the
# requires.txt. But, rpkg has to work in all active Fedora and EPEL releases,
# and there is only old rpm-python package in EL6 and 7, so just simply to
# remove rpm-py-installer for now.
Patch0: remove-koji-and-rpm-py-installer-from-requires.patch
Patch1: 0001-Do-not-use-pytest-related-dependencies-temporarily.patch
Patch2: 0002-Remove-pytest-coverage-execution.patch
%if 0%{?with_python2}
Patch3: 0003-Remove-Environment-Markers-syntax.patch
%endif
Patch4: 0004-Process-source-URLs-with-fragment-in-pre-push-hook.patch
Patch5: 0005-container-build-update-signing-intent-help-for-OSBS-.patch
Patch6: 0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch
%description
Python library for interacting with rpm+git
%if 0%{?with_python2}
%package -n python2-%{name}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{name}}
BuildRequires: python2-devel
# We br these things for man page generation due to imports
BuildRequires: rpmlint
BuildRequires: rpmdevtools
BuildRequires: python2-koji >= 1.21
BuildRequires: python2-CCColUtils
BuildRequires: PyYAML
BuildRequires: GitPython
BuildRequires: python-pycurl
BuildRequires: python-requests
BuildRequires: python-requests-kerberos
BuildRequires: python-six >= 1.9.0
BuildRequires: python2-argcomplete
BuildRequires: python2-mock
BuildRequires: python2-nose
BuildRequires: python2-setuptools
Requires: mock
Requires: redhat-rpm-config
Requires: rpm-build
Requires: rpmlint
Requires: rpmdevtools
Requires: python2-argcomplete
Requires: python2-cccolutils
Requires: python2-koji >= 1.21
Requires: PyYAML
Requires: GitPython >= 0.2.0
Requires: python-pycurl
Requires: python-requests
Requires: python-requests-kerberos
Requires: python-six >= 1.9.0
Requires: rpm-python
Requires: %{name}-common = %{version}-%{release}
Conflicts: fedpkg < 1.26
# Backward compatibility with capability pyrpkg
Provides: pyrpkg = %{version}-%{release}
# All old versions before 1.49-1 should not be used anymore
Obsoletes: pyrpkg < 1.49-2
%description -n python2-%{name}
A python library for managing RPM package sources in a git repository.
%endif
# end of python2 section
%if 0%{?with_python3}
%package -n python3-%{name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{name}}
# Obsolete python2-rpkg (remove after Fedora29)
%if 0%{?with_python2} == 0
Obsoletes: python2-rpkg < %{version}-%{release}
%endif
BuildRequires: python3-devel
BuildRequires: python3-GitPython
BuildRequires: python3-koji >= 1.24
%if 0%{?rhel}
BuildRequires: python3-gobject-base
BuildRequires: libmodulemd
BuildRequires: python3-requests-kerberos
%else
BuildRequires: python3-libmodulemd
%endif
BuildRequires: python3-argcomplete
BuildRequires: python3-cccolutils
BuildRequires: python3-openidc-client
BuildRequires: python3-pycurl
BuildRequires: python3-six >= 1.9.0
BuildRequires: python3-requests
BuildRequires: python3-setuptools
BuildRequires: python3-pytest
BuildRequires: python3-PyYAML
BuildRequires: rpmlint
BuildRequires: rpmdevtools
Requires: mock
Requires: redhat-rpm-config
Requires: rpm-build
Requires: rpmlint
Requires: rpmdevtools
Requires: python3-argcomplete
Requires: python3-GitPython >= 0.2.0
Requires: python3-cccolutils
Requires: python3-koji >= 1.24
%if 0%{?rhel}
Requires: python3-gobject-base
Requires: libmodulemd
Requires: python3-requests-kerberos
%else
Requires: python3-libmodulemd
Requires: python3-rpmautospec
%endif
Requires: python3-rpm
Requires: python3-pycurl
Requires: python3-six >= 1.9.0
Requires: python3-PyYAML
Requires: %{name}-common = %{version}-%{release}
Conflicts: fedpkg < 1.26
%description -n python3-%{name}
A python library for managing RPM package sources in a git repository.
%endif
# end of python3 section
%package common
Summary: Common files for %{name}
# Files were moved from python2-rpkg in that version
Conflicts: python2-rpkg < 1.52-2
Conflicts: pyrpkg < 1.52-2
%description common
Common files for python2-%{name} and python3-%{name}.
%prep
%autosetup -p1
# Removes section from setup.py that is relevant only for pip and
# is not compatible with in RHEL-6 tools
sed -i -n '/extras_require/,/}/!p' setup.py
%build
%if 0%{?with_python2}
%{__python2} setup.py build
%endif
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python2}
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%endif
%if 0%{?with_python3}
%py3_install
%endif
# Create configuration directory to holding downstream clients config files
# that are built on top of rpkg
%{__install} -d $RPM_BUILD_ROOT%{_sysconfdir}/rpkg
example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
%{__install} -d $example_cli_dir
# Install example CLI to rpkg own data directory
%{__install} -d ${example_cli_dir}%{_bindir}
%{__install} -d ${example_cli_dir}%{_sysconfdir}/bash_completion.d
%{__install} -d ${example_cli_dir}%{_sysconfdir}/rpkg
%{__install} -p -m 0644 bin/rpkg ${example_cli_dir}%{_bindir}
%{__install} -p -m 0644 etc/bash_completion.d/rpkg.bash ${example_cli_dir}%{_sysconfdir}/bash_completion.d
%{__install} -p -m 0644 etc/rpkg/rpkg.conf ${example_cli_dir}%{_sysconfdir}/rpkg
%check
%if 0%{?with_python2}
%{__python2} -m nose tests
%endif
%if 0%{?with_python3}
%pytest
%endif
%if 0%{?with_python2}
%files -n python2-%{name}
%doc README.rst CHANGELOG.rst
%if 0%{?rhel} && 0%{?rhel} < 7
%doc COPYING COPYING-koji LGPL
%else
%license COPYING COPYING-koji LGPL
%endif
# For noarch packages: sitelib
%{python2_sitelib}/pyrpkg
%{python2_sitelib}/%{name}-%{version}-py*.egg-info
%endif
%if 0%{?with_python3}
%files -n python3-%{name}
%doc README.rst CHANGELOG.rst
%license COPYING COPYING-koji LGPL
%{python3_sitelib}/pyrpkg
%{python3_sitelib}/%{name}-%{version}-py*.egg-info
%endif
%files common
%{_datadir}/%{name}
%{_sysconfdir}/rpkg
%changelog
* Fri Mar 24 2023 lichaoran <pkwarcraft@hotmail.com> - 1.66-1
- Initial package
|