Blob Blame History Raw
# Architectures that we run the test suite on.
# As the test suite takes a very long time to run and is somewhat
# unreliable on !x86 architectures, only run it on x86-64.
%if !0%{?rhel}
%global test_arches x86_64
# RHEL 9 only:
# x86-64:  "/lib64/ CPU ISA level is lower than required"
#          (RHBZ#1919389)
%global test_arches NONE

# Verify tarball signature with GPGv2.
%global verify_tarball_signature 1

# If there are patches which touch autotools files, set this to 1.
%global patches_touch_autotools %{nil}

# The source directory.
%global source_directory 1.49-development

# Filter perl provides.

Summary:       Tools to access and modify virtual machine disk images
Name:          guestfs-tools
Version:       1.49.4
Release:       1%{?dist}
License:       GPLv2+

# Build only for architectures that have a kernel
ExclusiveArch: %{kernel_arches}
%if 0%{?rhel}
# No qemu-kvm on POWER (RHBZ#1946532).
ExcludeArch: %{power64}

# Source and patches.
%if 0%{verify_tarball_signature}

# Keyring used to verify tarball signature.
%if 0%{verify_tarball_signature}
Source2:       libguestfs.keyring

%if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool, gettext-devel

# Basic build requirements.
BuildRequires: gcc, gcc-c++
BuildRequires: make
BuildRequires: libguestfs-devel >= 1.45.3-1
BuildRequires: libguestfs-xfs
BuildRequires: perl(Pod::Simple)
BuildRequires: perl(Pod::Man)
BuildRequires: perl(Module::Build)
BuildRequires: perl(Test::More)
BuildRequires: /usr/bin/pod2text
BuildRequires: po4a
BuildRequires: pcre2-devel
BuildRequires: libxml2-devel
BuildRequires: jansson-devel
BuildRequires: libvirt-devel
BuildRequires: libxcrypt-devel
BuildRequires: ncurses-devel
BuildRequires: ocaml-libguestfs-devel
BuildRequires: ocaml-findlib-devel
BuildRequires: ocaml-gettext-devel
%if !0%{?rhel}
BuildRequires: ocaml-ounit-devel
BuildRequires: flex
BuildRequires: bison
BuildRequires: xz-devel
%if !0%{?rhel}
BuildRequires: zip
BuildRequires: unzip
%if !0%{?rhel}
BuildRequires: perl(Expect)
BuildRequires: bash-completion
BuildRequires: /usr/bin/qemu-img
BuildRequires: xorriso
BuildRequires: perl(Locale::TextDomain)
BuildRequires: perl(Sys::Guestfs)
BuildRequires: perl(Win::Hivex)
BuildRequires: perl(Win::Hivex::Regedit)
BuildRequires: perl-generators

%if 0%{verify_tarball_signature}
BuildRequires: gnupg2

# For virt-builder:
Requires:      curl
Requires:      gnupg2
Requires:      /usr/bin/qemu-img
Requires:      xz

# For virt-builder-repository:
Suggests:      osinfo-db

# For virt-inspector, since Fedora and RHEL >= 7 use XFS:
Recommends:    libguestfs-xfs

# For virt-edit and virt-customize:
Suggests:      perl

# This replaces the libguestfs-tools-c package.
Provides:      libguestfs-tools-c = 1:%{version}-%{release}
Obsoletes:     libguestfs-tools-c <= 1:1.45.2-1

guestfs-tools is a set of tools that can be used to make batch
configuration changes to guests, get disk used/free statistics
(virt-df), perform backups and guest clones, change
registry/UUID/hostname info, build guests from scratch (virt-builder)
and much more.

Virt-alignment-scan scans virtual machines looking for partition
alignment problems.

Virt-builder is a command line tool for rapidly making disk images
of popular free operating systems.

Virt-cat is a command line tool to display the contents of a file in a
virtual machine.

Virt-customize is a command line tool for customizing virtual machine
disk images.

Virt-df is a command line tool to display free space on virtual
machine filesystems.  Unlike other tools, it doesn’t just display the
amount of space allocated to a virtual machine, but can look inside
the virtual machine to see how much space is really being used.  It is
like the df(1) command, but for virtual machines, except that it also
works for Windows virtual machines.

Virt-diff shows the differences between virtual machines.

Virt-edit is a command line tool to edit the contents of a file in a
virtual machine.

Virt-filesystems is a command line tool to display the filesystems,
partitions, block devices, LVs, VGs and PVs found in a disk image
or virtual machine.  It replaces the deprecated programs
virt-list-filesystems and virt-list-partitions with a much more
capable tool.

Virt-format is a command line tool to erase and make blank disks.

Virt-get-kernel extracts a kernel/initrd from a disk image.

Virt-inspector examines a virtual machine and tries to determine the
version of the OS, the kernel version, what drivers are installed,
whether the virtual machine is fully virtualized (FV) or
para-virtualized (PV), what applications are installed and more.

Virt-log is a command line tool to display the log files from a
virtual machine.

Virt-ls is a command line tool to list out files in a virtual machine.

Virt-make-fs is a command line tool to build a filesystem out of
a collection of files or a tarball.

Virt-resize can resize existing virtual machine disk images.

Virt-sparsify makes virtual machine disk images sparse (thin-provisioned).

Virt-sysprep lets you reset or unconfigure virtual machines in
preparation for cloning them.

Virt-tail follows (tails) a log file within a guest, like 'tail -f'.

%package -n virt-win-reg
Summary:       Access and modify the Windows Registry of a Windows VM
License:       GPLv2+
BuildArch:     noarch

# This replaces the libguestfs-tools package.
Provides:      libguestfs-tools = 1:%{version}-%{release}
Obsoletes:     libguestfs-tools <= 1:1.45.2-1

%description -n virt-win-reg
Virt-win-reg lets you look at and modify the Windows Registry of
Windows virtual machines.

%if !0%{?rhel}
%package -n virt-dib
Summary:       Safe and secure diskimage-builder replacement
License:       GPLv2+
# This subpackage (only) must have an Epoch of 1 because it
# replaces a package in libguestfs which had an Epoch of 1.
Epoch:         1

Requires:      libguestfs-dib >= 1:1.45.2-1

%description -n virt-dib
Virt-dib is a safe and secure alternative to the OpenStack
diskimage-builder command.  It is compatible with most
diskimage-builder elements.

%package bash-completion
Summary:       Bash tab-completion scripts for %{name}
BuildArch:     noarch
Requires:      bash-completion >= 2.0
Requires:      %{name} = %{version}-%{release}

%description bash-completion
Install this package if you want intelligent bash tab-completion
for the virt-* tools.

%package man-pages-ja
Summary:       Japanese (ja) man pages for %{name}
BuildArch:     noarch
Requires:      %{name} = %{version}-%{release}

%description man-pages-ja
%{name}-man-pages-ja contains Japanese (ja) man pages
for %{name}.

%package man-pages-uk
Summary:       Ukrainian (uk) man pages for %{name}
BuildArch:     noarch
Requires:      %{name} = %{version}-%{release}

%description man-pages-uk
%{name}-man-pages-uk contains Ukrainian (uk) man pages
for %{name}.

%if 0%{verify_tarball_signature}
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%setup -q
%autopatch -p1

%if 0%{patches_touch_autotools}
autoreconf -i


# Building index-parse.c by hand works around a race condition in the
# autotools cruft, where two or more copies of yacc race with each
# other, resulting in a corrupted file.
make -j1 -C builder index-parse.c

make V=1 %{?_smp_mflags}

%ifarch %{test_arches}
# Only run the tests with non-debug (ie. non-Rawhide) kernels.
# XXX This tests for any debug kernel installed.
if grep CONFIG_DEBUG_MUTEXES=y /lib/modules/*/config ; then
    echo "Skipping tests because debug kernel is installed"
    exit 0

# Enable debugging.

# This test is currently broken and needs further investigation.

# This test fails for me in local mock and Koji, but not when running
# in an unrestricted environment.

# This test takes too long to run under Koji and times out.  It runs
# fine with KVM enabled.

if ! make check -k ; then
    # Dump out the log files of any failing tests to make
    # debugging test failures easier.
    for f in `find -name test-suite.log | xargs grep -l ^FAIL:`; do
        echo '*****' $f '*****'
        cat $f
    exit 1


# Delete libtool files.
find $RPM_BUILD_ROOT -name '*.la' -delete

# Move installed documentation back to the source directory so
# we can install it using a %%doc rule.
mv $RPM_BUILD_ROOT%{_docdir}/%{name} installed-docs
gzip --best installed-docs/*.xml

%if 0%{?rhel}
# Remove virt-dib if it was built.
rm -f $RPM_BUILD_ROOT%{_bindir}/virt-dib
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/virt-dib.1*

# Find locale files.
%find_lang %{name}

# Fix upgrades from old libguestfs-tools-c package
# which had /etc/virt-builder -> xdg/virt-builder.
# This can be removed in Fedora > 36.
%pretrans -p <lua>
path = "/etc/virt-builder"
st = posix.stat(path)
if st and st.type == "link" then

%files -f %{name}.lang
%license COPYING
%doc installed-docs/*
%dir %{_sysconfdir}/virt-builder
%dir %{_sysconfdir}/virt-builder/repos.d
%config(noreplace) %{_sysconfdir}/virt-builder/repos.d/*

%files -n virt-win-reg
%license COPYING

%if !0%{?rhel}
%files -n virt-dib
%license COPYING

%files bash-completion
%license COPYING
%dir %{_datadir}/bash-completion/completions

%files man-pages-ja
%lang(ja) %{_mandir}/ja/man1/*.1*

%files man-pages-uk
%lang(uk) %{_mandir}/uk/man1/*.1*

* Mon Aug 01 2022 Richard W.M. Jones <> - 1.49.4-1
- New upstream development version 1.49.4

* Thu Jul 21 2022 Fedora Release Engineering <> - 1.49.3-2
- Rebuilt for

* Fri Jul 01 2022 Richard W.M. Jones <> - 1.49.3-1
- New upstream development version 1.49.3

* Thu May 26 2022 Richard W.M. Jones <> - 1.49.2-1
- New upstream development version 1.49.2

* Thu May 12 2022 Richard W.M. Jones <> - 1.49.1-1
- New upstream development version 1.49.1

* Mon Mar 14 2022 Richard W.M. Jones <> - 1.48.0-1
- New upstream stable branch version 1.48.0

* Tue Mar 08 2022 Richard W.M. Jones <> - 1.47.5-1
- New upstream development version 1.47.8
- Add new guestfs-tools-release-notes-1.48(1) man page.

* Tue Mar 01 2022 Richard W.M. Jones <> - 1.47.4-1
- New upstream development version 1.47.4

* Thu Jan 20 2022 Fedora Release Engineering <> - 1.47.3-2
- Rebuilt for

* Sat Dec 04 2021 Richard W.M. Jones <> - 1.47.3-1
- New upstream development version 1.47.3

* Thu Jul 22 2021 Fedora Release Engineering <> - 1.47.2-2
- Rebuilt for

* Wed Jun 16 2021 Richard W.M. Jones <> - 1.47.2-1
- New upstream development version 1.47.2

* Wed Jun  2 2021 Richard W.M. Jones <> - 1.46.1-3
- Add gating tests (for RHEL 9)

* Thu May 13 2021 Richard W.M. Jones <> - 1.46.1-2
- BR perl-generators so deps of virt-win-reg subpackage are correct.

* Sat May 08 2021 Richard W.M. Jones <> - 1.46.1-1
- New stable branch version 1.46.1.

* Tue Apr 27 2021 Richard W.M. Jones <> - 1.46.0-1
- New stable branch version 1.46.0.

* Wed Apr 07 2021 Richard W.M. Jones <> - 1.45.3-4
- Use Epoch 1 for virt-dib subpackage (only).

* Wed Mar 31 2021 Richard W.M. Jones <> - 1.45.3-3
- Add BR xorriso, needed to run the tests.

* Mon Mar 29 2021 Richard W.M. Jones <> - 1.45.3-1
- New upstream version 1.45.3.
- Fix symlink replacement of virt-builder directory (RHBZ#1943838).

* Fri Mar 26 2021 Richard W.M. Jones <> - 1.45.2-5
- Skip that takes too long to run.

* Thu Mar 25 2021 Richard W.M. Jones <> - 1.45.2-4
- Add perl(Test::More) dependency for the Perl test suite.
- Add perl(Module::Build) dependency for the Perl bindings.
- Fix ounit2 dependency again.

* Wed Mar 24 2021 Richard W.M. Jones <> - 1.45.2-2
- Add perl(Locale::TextDomain) dependency for virt-win-reg.
- Fix ounit2 dependency upstream.

* Tue Mar 23 2021 Richard W.M. Jones <> - 1.45.2-1
- New guestfs-tools package, split off from libguestfs.