-
Notifications
You must be signed in to change notification settings - Fork 24
/
ovirt-imageio.spec.in
342 lines (267 loc) · 10.3 KB
/
ovirt-imageio.spec.in
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: @RELEASE@%{?dist}
Summary: oVirt imageio
License: GPLv2+
Url: https://github.com/oVirt/%{name}
Source0: https://github.com/oVirt/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
%global ovirtimg_user ovirtimg
%global srcname ovirt_imageio
%global logdir %{_localstatedir}/log/%{name}
%global admin_confdir %{_sysconfdir}/%{name}
%global vendor_confdir %{_prefix}/lib/%{name}
# We need to have Python 3.11 support of imageio client for oVirt Ansible
# Collection running with ansible-core-2.14, which uses non-standard Python 3.11
# on EL8 platform
%if "%{?rhel}" == "9" || "%{?rhel}" == "8"
%global with_python311 1
%global python3_name python3.11
%undefine __brp_mangle_shebangs
%else
%global with_python311 0
%endif
%description
Transfer disk images on oVirt system.
%prep
%setup -q
%build
%define python3_pkgversion 3
%define __python3 /usr/bin/python3
%py3_build
%if %{with_python311}
%define python3_pkgversion 3.11
%define __python3 /usr/bin/python3.11
%py3_build "--executable=%{quote:/usr/bin/python3 -s}"
%endif
%define python3_pkgversion 3
%define __python3 /usr/bin/python3
%install
%define python3_pkgversion 3
%define __python3 /usr/bin/python3
%py3_install
%if %{with_python311}
%define python3_pkgversion 3.11
%define __python3 /usr/bin/python3.11
%py3_install
%endif
%define python3_pkgversion 3
%define __python3 /usr/bin/python3
install -D -m 0755 --directory %{buildroot}%{logdir}
# Create a dummy log file to make rpm happy during build
touch %{buildroot}%{logdir}/daemon.log
install -D -m 0755 --directory %{buildroot}%{vendor_confdir}/conf.d
install -D -m 0755 --directory %{buildroot}%{admin_confdir}/conf.d
install -D -m 0644 data/README %{buildroot}%{admin_confdir}
install -D -m 0644 data/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
%clean
rm -rf $RPM_BUILD_ROOT
%package common
Summary: oVirt imageio common resources
# NOTE: keep in sync with docs/development.md
BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3
%description common
Common resources used by oVirt imageio server and client
%files common
%license LICENSES/GPL-2.0-or-later.txt
%{python3_sitearch}/%{srcname}
%{python3_sitearch}/%{srcname}-*.egg-info
%exclude %{python3_sitearch}/%{srcname}/client
%exclude %{python3_sitearch}/%{srcname}/admin
%package client
Summary: oVirt imageio client library
Requires: %{name}-common = %{version}-%{release}
%if 0%{?rhel}
# RHEL 8.4 version. Some features require qemu-nbd 5.2.0 and are disabled when
# using older qemu-nbd.
Requires: qemu-img >= 15:4.2.0
Requires: python3-ovirt-engine-sdk4
%else
# Fedora.
Requires: qemu-img
%endif
%description client
Python client library for accessing imageio server on oVirt hosts.
%files client
%{python3_sitearch}/%{srcname}/client
%{_bindir}/ovirt-img
%package daemon
Summary: oVirt imageio daemon
# NOTE: keep in sync with docs/development.md
BuildRequires: systemd
Requires: python3-systemd
Requires: %{name}-common = %{version}-%{release}
%description daemon
Daemon providing image transfer service on oVirt hosts.
%files daemon
%{python3_sitearch}/%{srcname}/admin
%{_bindir}/%{name}
%{_bindir}/%{name}ctl
%{_unitdir}/%{name}.service
%dir %{admin_confdir}
%dir %{admin_confdir}/conf.d
%dir %{vendor_confdir}
%dir %{vendor_confdir}/conf.d
%{admin_confdir}/README
# The log directory should belong to the daemon so it can create log files.
# http://rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-ATTR-DIRECTIVE
%dir %attr(755, %{ovirtimg_user}, %{ovirtimg_user}) %{logdir}
# The log files belongs to the package, so they will be removed with the package.
# http://rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-GHOST-DIRECTIVE
%ghost %attr(644, %{ovirtimg_user}, %{ovirtimg_user}) %{logdir}/daemon.log*
# For more information about the systemd macros, see:
# https://fedoraproject.org/wiki/Packaging:Scriptlets#New_Packages
# For info on ordering of the scriplets, see:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering
%pre daemon
# Create a user and group if needed
if ! /usr/bin/getent passwd %{ovirtimg_user} >/dev/null; then
/usr/sbin/useradd --system \
--user-group \
--shell /sbin/nologin \
--home-dir /run/%{name} \
--comment "oVirt imageio" \
%{ovirtimg_user}
fi
%post daemon
# After installation, synchronize service state with preset files.
%systemd_post %{name}.service
%preun daemon
# Before uninstalling, stop and disable the service.
%systemd_preun %{name}.service
%postun daemon
# After upgrading, restart the service.
%systemd_postun_with_restart %{name}.service
%posttrans daemon
# At the end of the transaction, stop stale ovirt-imageio-daemon service.
# Needed only when upgrading from ovirt-imageio-daemon < 2.
if systemctl is-active ovirt-imageio-daemon.service >/dev/null; then
echo "Stopping ovirt-imageio-daemon.service";
systemctl stop ovirt-imageio-daemon.service
fi
%if %{with_python311}
%package -n %{python3_name}-%{name}-common
Summary: oVirt imageio common resources
BuildRequires: gcc
BuildRequires: %{python3_name}-devel
BuildRequires: %{python3_name}-setuptools
Requires: %{python3_name}
%description -n %{python3_name}-%{name}-common
Common resources used by oVirt imageio server and client
%if %{with_python311}
%define python3_pkgversion 3.11
%define __python3 /usr/bin/python3.11
%files -n %{python3_name}-%{name}-common
%license LICENSES/GPL-2.0-or-later.txt
%{python3_sitearch}/%{srcname}
%{python3_sitearch}/%{srcname}-*.egg-info
%exclude %{python3_sitearch}/%{srcname}/client
%exclude %{python3_sitearch}/%{srcname}/admin
%endif
%package -n %{python3_name}-%{name}-client
Summary: oVirt imageio client library
Requires: %{python3_name}-%{name}-common = %{version}-%{release}
%if 0%{?rhel}
# RHEL 8.4 version. Some features require qemu-nbd 5.2.0 and are disabled when
# using older qemu-nbd.
Requires: qemu-img >= 15:4.2.0
Requires: %{python3_name}-ovirt-engine-sdk4
%else
# Fedora.
Requires: qemu-img
%endif
%description -n %{python3_name}-%{name}-client
Python client library for accessing imageio server on oVirt hosts.
%if %{with_python311}
%define python3_pkgversion 3.11
%define __python3 /usr/bin/python3.11
%files -n %{python3_name}-%{name}-client
%{python3_sitearch}/%{srcname}/client
%endif
%endif
%changelog
* Wed Mar 29 2023 Albert Esteve <aesteve@redhat.com> 2.5.0-1
- Add Python 3.11 subpackage to be usable in ansible-core 2.14 for el8
- Fix ovirt-imageioctl without arguments
* Thu Mar 2 2023 Albert Esteve <aesteve@redhat.com> 2.4.8-1
- Add Python 3.11 subpackage to be usable in ansible-core 2.14
- Fix ovirt-img --insecure connection
* Fri Nov 25 2022 Albert Esteve <aesteve@redhat.com> 2.4.7-1
- Handle disk status errors while waiting for disk creation #117
- Add option for custom disk alias for uploaded disk #121
- Add --insecure argument to ovirt-img #153
- ovirt-img: Machine readable progress #154
- Support downloading block devices via ovirt-imageio container #168
* Wed Aug 3 2022 Albert Esteve <aesteve@redhat.com> 2.4.6-1
- ovirt-img command line tool #72
- Speed up upload to new disk #76
* Tue Jun 14 2022 Nir Soffer <nsoffer@redhat.com> 2.4.5-1
- http: Revert the default timeout to 60 seconds #71
* Sun Apr 3 2022 Nir Soffer <nsoffer@redhat.com> 2.4.3-1
- Build client and common for python 3.8 BZ2071365
* Sun Mar 27 2022 Nir Soffer <nsoffer@redhat.com> 2.4.2-1
- http: Increase listen backlog to 40 BZ2066113
- setup: Fix bug tracker url #45
- Update RELEASE.md #46
* Sun Mar 13 2022 Nir Soffer <nsoffer@redhat.com> 2.4.1-1
- Select cache and aio automatically #42
- Add profiling support #36
- Fail fast with invalid config directory #33
- Don't track ranges for read-write ticket #32
- Inefficient measuring of transferred size #29
- Replace ticket id with transfer id in logs #26
- "Backend was closed" error during backup image transfer #23
- Disable allocation depth for raw format #21
- Make client socket timeout configurable #14
* Wed Oct 6 2021 Nir Soffer <nsoffer@redhat.com> 2.3.0-1
- Downloading images much slower than uploading #BZ1990656
- Downloading prellocated disk created preallocated image #BZ2010067
* Sun Jun 20 2021 Nir Soffer <nsoffer@redhat.com> 2.2.0-1
- Report zero status in dirty extents response #BZ1971185
- Use "qemu:allocation-depth" meta context to report holes #BZ1971182
* Wed Oct 21 2020 Nir Soffer <nsoffer@redhat.com> 2.1.1-1
- Add client.extents() function
- Add Fedora 33 CI
* Wed Oct 14 2020 Nir Soffer <nsoffer@redhat.com> 2.1.0-1
- Support upload and download snapshots #BZ1847090
- Remove python2 leftovers #BZ1862719
- Faster checkusms using zero hashing
- Report checksum configuration in client.checksum()
- Improve logging for easier debugging
- Improve client online help
- Silence output from qemu-img create
- Configurable buffer size per backend
* Wed Aug 5 2020 Nir Soffer <nsoffer@redhat.com> 2.0.10-1
- Support 3rd party certificates #BZ1862107
- Imageio low level API #BZ1855047
- Compute image checksums #BZ1787906
- Support transfer cancellation #BZ1524184
- Imporve error reporting in io.copy() #BZ1854550
- Create configuration directories
* Wed Jul 1 2020 Nir Soffer <nsoffer@redhat.com> 2.0.9-1
- Fix ipv6 regression in 2.0.8-1 #BZ1851707
- Fix preallocation on NFS 4.2 and GlusterFS #BZ1851256
- Support upload disk from ova #BZ1849981
- Report holes in zero extents
* Mon Jun 15 2020 Nir Soffer <nsoffer@redhat.com> 2.0.8-1
- Improve performance using multiple connections #BZ1591439
- Support ipv6 #BZ1805267
- Fix Cross-Site scripting vulnerabilities #BZ1757066
* Thu Jun 4 2020 Nir Soffer <nsoffer@redhat.com> 2.0.7-0
- Support showing parsed configuration #BZ1835719
- Improve performance when using small requests #BZ1836858
- Use proxy_url if transfer_url is not accessible #BZ1839400
* Wed May 13 2020 Nir Soffer <nsoffer@redhat.com> 2.0.6-0
- Introduce ovirt-imageio-client package
- Support drop-in confiugration #BZ1826679, #BZ1738729, #BZ1761960
- Make private modules private #BZ1818170
- Log detailed transfer stats #BZ1740489
- Support platform trusted CA
* Mon Apr 20 2020 Nir Soffer <nsoffer@redhat.com> 2.0.5-0
- Support closing connections for web clients
* Fri Apr 17 2020 Nir Soffer <nsoffer@redhat.com> 2.0.4-0
- Support starting as root