1 # Architectures that we run the test suite on.
3 # As the test suite takes a very long time to run and is somewhat
4 # unreliable on !x86 architectures, only run it on x86-64.
6 %global test_arches x86_64
9 # x86-64: "/lib64/libc.so.6: CPU ISA level is lower than required"
11 %global test_arches NONE
14 # Verify tarball signature with GPGv2.
15 %global verify_tarball_signature 1
17 # If there are patches which touch autotools files, set this to 1.
18 %global patches_touch_autotools 1
20 # The source directory.
21 %global source_directory 1.45-development
23 # Filter perl provides.
24 %{?perl_default_filter}
26 Summary: Tools to access and modify virtual machine disk images
32 # Build only for architectures that have a kernel
33 ExclusiveArch: %{kernel_arches}
36 URL: http://libguestfs.org/
37 Source0: http://download.libguestfs.org/guestfs-tools/%{source_directory}/%{name}-%{version}.tar.gz
38 %if 0%{verify_tarball_signature}
39 Source1: http://download.libguestfs.org/guestfs-tools/%{source_directory}/%{name}-%{version}.tar.gz.sig
42 # Keyring used to verify tarball signature.
43 %if 0%{verify_tarball_signature}
44 Source2: libguestfs.keyring
47 # Upstream patches to fix various build issues discovered while
48 # packaging this for Fedora.
49 Patch1: 0001-po-docs-podfiles-Fix-bogus-directories-in-this-file.patch
50 Patch2: 0002-po-docs-Don-t-try-to-install-.3-and-.5-files-which-d.patch
51 Patch3: 0003-build-Remove-dependency-on-gobject-introspection.patch
52 Patch4: 0004-build-Remove-dependency-on-perl-Sys-Virt.patch
53 Patch5: 0005-builder-Get-rid-of-etc-xdg-and-XDG_CONFIG_DIRS-nonse.patch
54 Patch6: 0006-builder-Use-correct-ounit2-module.patch
55 Patch7: 0007-Update-common-submodule-to-latest.patch
57 %if 0%{patches_touch_autotools}
58 BuildRequires: autoconf, automake, libtool, gettext-devel
61 # Basic build requirements.
62 BuildRequires: gcc, gcc-c++
64 BuildRequires: libguestfs-devel >= 1.44.0
65 BuildRequires: libguestfs-xfs
66 BuildRequires: perl(Pod::Simple)
67 BuildRequires: perl(Pod::Man)
68 BuildRequires: perl(Module::Build)
69 BuildRequires: perl(Test::More)
70 BuildRequires: /usr/bin/pod2text
72 BuildRequires: pcre2-devel
73 BuildRequires: libxml2-devel
74 BuildRequires: jansson-devel
75 BuildRequires: libvirt-devel
76 BuildRequires: libxcrypt-devel
77 BuildRequires: ncurses-devel
78 BuildRequires: ocaml-libguestfs-devel
79 BuildRequires: ocaml-findlib-devel
80 BuildRequires: ocaml-gettext-devel
82 BuildRequires: ocaml-ounit-devel
86 BuildRequires: xz-devel
92 BuildRequires: perl(Expect)
94 BuildRequires: bash-completion
95 BuildRequires: /usr/bin/qemu-img
96 BuildRequires: perl(Locale::TextDomain)
97 BuildRequires: perl(Sys::Guestfs)
98 BuildRequires: perl(Win::Hivex)
99 BuildRequires: perl(Win::Hivex::Regedit)
101 %if 0%{verify_tarball_signature}
102 BuildRequires: gnupg2
108 Requires: /usr/bin/qemu-img
111 # For virt-builder-repository:
114 # For virt-inspector, since Fedora and RHEL >= 7 use XFS:
115 Recommends: libguestfs-xfs
117 # For virt-edit and virt-customize:
120 # This replaces the libguestfs-tools-c package.
121 Provides: libguestfs-tools-c = 1:%{version}-%{release}
122 Obsoletes: libguestfs-tools-c <= 1:1.45.2-1
126 guestfs-tools is a set of tools that can be used to make batch
127 configuration changes to guests, get disk used/free statistics
128 (virt-df), perform backups and guest clones, change
129 registry/UUID/hostname info, build guests from scratch (virt-builder)
132 Virt-alignment-scan scans virtual machines looking for partition
135 Virt-builder is a command line tool for rapidly making disk images
136 of popular free operating systems.
138 Virt-cat is a command line tool to display the contents of a file in a
141 Virt-customize is a command line tool for customizing virtual machine
144 Virt-df is a command line tool to display free space on virtual
145 machine filesystems. Unlike other tools, it doesn’t just display the
146 amount of space allocated to a virtual machine, but can look inside
147 the virtual machine to see how much space is really being used. It is
148 like the df(1) command, but for virtual machines, except that it also
149 works for Windows virtual machines.
151 Virt-diff shows the differences between virtual machines.
153 Virt-edit is a command line tool to edit the contents of a file in a
156 Virt-filesystems is a command line tool to display the filesystems,
157 partitions, block devices, LVs, VGs and PVs found in a disk image
158 or virtual machine. It replaces the deprecated programs
159 virt-list-filesystems and virt-list-partitions with a much more
162 Virt-format is a command line tool to erase and make blank disks.
164 Virt-get-kernel extracts a kernel/initrd from a disk image.
166 Virt-inspector examines a virtual machine and tries to determine the
167 version of the OS, the kernel version, what drivers are installed,
168 whether the virtual machine is fully virtualized (FV) or
169 para-virtualized (PV), what applications are installed and more.
171 Virt-log is a command line tool to display the log files from a
174 Virt-ls is a command line tool to list out files in a virtual machine.
176 Virt-make-fs is a command line tool to build a filesystem out of
177 a collection of files or a tarball.
179 Virt-resize can resize existing virtual machine disk images.
181 Virt-sparsify makes virtual machine disk images sparse (thin-provisioned).
183 Virt-sysprep lets you reset or unconfigure virtual machines in
184 preparation for cloning them.
186 Virt-tail follows (tails) a log file within a guest, like 'tail -f'.
189 %package -n virt-win-reg
190 Summary: Access and modify the Windows Registry of a Windows VM
194 # This replaces the libguestfs-tools package.
195 Provides: libguestfs-tools = 1:%{version}-%{release}
196 Obsoletes: libguestfs-tools <= 1:1.45.2-1
199 %description -n virt-win-reg
200 Virt-win-reg lets you look at and modify the Windows Registry of
201 Windows virtual machines.
206 Summary: Safe and secure diskimage-builder replacement
209 Requires: libguestfs-dib >= 1:1.45.2-1
212 %description -n virt-dib
213 Virt-dib is a safe and secure alternative to the OpenStack
214 diskimage-builder command. It is compatible with most
215 diskimage-builder elements.
219 %package bash-completion
220 Summary: Bash tab-completion scripts for %{name}
222 Requires: bash-completion >= 2.0
223 Requires: %{name} = %{version}-%{release}
226 %description bash-completion
227 Install this package if you want intelligent bash tab-completion
228 for the virt-* tools.
231 %package man-pages-ja
232 Summary: Japanese (ja) man pages for %{name}
234 Requires: %{name} = %{version}-%{release}
236 %description man-pages-ja
237 %{name}-man-pages-ja contains Japanese (ja) man pages
241 %package man-pages-uk
242 Summary: Ukrainian (uk) man pages for %{name}
244 Requires: %{name} = %{version}-%{release}
246 %description man-pages-uk
247 %{name}-man-pages-uk contains Ukrainian (uk) man pages
252 %if 0%{verify_tarball_signature}
253 %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
258 %if 0%{patches_touch_autotools}
266 # Building index-parse.c by hand works around a race condition in the
267 # autotools cruft, where two or more copies of yacc race with each
268 # other, resulting in a corrupted file.
269 make -j1 -C builder index-parse.c
271 make V=1 %{?_smp_mflags}
275 %ifarch %{test_arches}
277 export LIBGUESTFS_DEBUG=1
278 export LIBGUESTFS_TRACE=1
280 # This test is currently broken and needs further investigation.
281 export SKIP_TEST_MACHINE_READABLE_SH=1
283 # This test fails for me in local mock and Koji, but not when running
284 # in an unrestricted environment.
285 export SKIP_TEST_VIRT_FORMAT_SH=1
287 if ! make check -k ; then
288 # Dump out the log files of any failing tests to make
289 # debugging test failures easier.
290 for f in `find -name test-suite.log | xargs grep -l ^FAIL:`; do
291 echo '*****' $f '*****'
301 make DESTDIR=$RPM_BUILD_ROOT install
303 # Delete libtool files.
304 find $RPM_BUILD_ROOT -name '*.la' -delete
306 # Move installed documentation back to the source directory so
307 # we can install it using a %%doc rule.
308 mv $RPM_BUILD_ROOT%{_docdir}/%{name} installed-docs
309 gzip --best installed-docs/*.xml
316 %files -f %{name}.lang
319 %doc installed-docs/*
320 %dir %{_sysconfdir}/virt-builder
321 %dir %{_sysconfdir}/virt-builder/repos.d
322 %config(noreplace) %{_sysconfdir}/virt-builder/repos.d/*
323 %{_bindir}/virt-alignment-scan
324 %{_bindir}/virt-builder
325 %{_bindir}/virt-builder-repository
327 %{_bindir}/virt-customize
331 %{_bindir}/virt-filesystems
332 %{_bindir}/virt-format
333 %{_bindir}/virt-get-kernel
334 %{_bindir}/virt-index-validate
335 %{_bindir}/virt-inspector
338 %{_bindir}/virt-make-fs
339 %{_bindir}/virt-resize
340 %{_bindir}/virt-sparsify
341 %{_bindir}/virt-sysprep
343 %{_mandir}/man1/virt-alignment-scan.1*
344 %{_mandir}/man1/virt-builder-repository.1*
345 %{_mandir}/man1/virt-builder.1*
346 %{_mandir}/man1/virt-cat.1*
347 %{_mandir}/man1/virt-customize.1*
348 %{_mandir}/man1/virt-df.1*
349 %{_mandir}/man1/virt-diff.1*
350 %{_mandir}/man1/virt-edit.1*
351 %{_mandir}/man1/virt-filesystems.1*
352 %{_mandir}/man1/virt-format.1*
353 %{_mandir}/man1/virt-get-kernel.1*
354 %{_mandir}/man1/virt-index-validate.1*
355 %{_mandir}/man1/virt-inspector.1*
356 %{_mandir}/man1/virt-log.1*
357 %{_mandir}/man1/virt-ls.1*
358 %{_mandir}/man1/virt-make-fs.1*
359 %{_mandir}/man1/virt-resize.1*
360 %{_mandir}/man1/virt-sparsify.1*
361 %{_mandir}/man1/virt-sysprep.1*
362 %{_mandir}/man1/virt-tail.1*
365 %files -n virt-win-reg
368 %{_bindir}/virt-win-reg
369 %{_mandir}/man1/virt-win-reg.1*
377 %{_mandir}/man1/virt-dib.1*
381 %files bash-completion
383 %dir %{_datadir}/bash-completion/completions
384 %{_datadir}/bash-completion/completions/virt-*
388 %lang(ja) %{_mandir}/ja/man1/*.1*
392 %lang(uk) %{_mandir}/uk/man1/*.1*
396 * Thu Mar 25 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.2-4
397 - Add perl(Test::More) dependency for the Perl test suite.
398 - Add perl(Module::Build) dependency for the Perl bindings.
399 - Fix ounit2 dependency again.
401 * Wed Mar 24 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.2-2
402 - Add perl(Locale::TextDomain) dependency for virt-win-reg.
403 - Fix ounit2 dependency upstream.
405 * Tue Mar 23 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.2-1
406 - New guestfs-tools package, split off from libguestfs.