6f2364b
# Architectures that we run the test suite on.
6f2364b
#
6f2364b
# As the test suite takes a very long time to run and is somewhat
6f2364b
# unreliable on !x86 architectures, only run it on x86-64.
6f2364b
%if !0%{?rhel}
6f2364b
%global test_arches x86_64
6f2364b
%else
6f2364b
# RHEL 9 only:
6f2364b
# x86-64:  "/lib64/libc.so.6: CPU ISA level is lower than required"
6f2364b
#          (RHBZ#1919389)
6f2364b
%global test_arches NONE
6f2364b
%endif
6f2364b
6f2364b
# Verify tarball signature with GPGv2.
6f2364b
%global verify_tarball_signature 1
6f2364b
6f2364b
# If there are patches which touch autotools files, set this to 1.
db0bb32
%global patches_touch_autotools %{nil}
6f2364b
6f2364b
# The source directory.
9f2c12e
%global source_directory 1.48-stable
6f2364b
6f2364b
# Filter perl provides.
6f2364b
%{?perl_default_filter}
6f2364b
6f2364b
Summary:       Tools to access and modify virtual machine disk images
6f2364b
Name:          guestfs-tools
7882c4f
Version:       1.48.3
7882c4f
Release:       1%{?dist}
6f2364b
License:       GPLv2+
6f2364b
6f2364b
# Build only for architectures that have a kernel
6f2364b
ExclusiveArch: %{kernel_arches}
bec9c7a
%if 0%{?rhel}
bec9c7a
# No qemu-kvm on POWER (RHBZ#1946532).
bec9c7a
ExcludeArch: %{power64}
bec9c7a
%endif
6f2364b
6f2364b
# Source and patches.
6f2364b
URL:           http://libguestfs.org/
6f2364b
Source0:       http://download.libguestfs.org/guestfs-tools/%{source_directory}/%{name}-%{version}.tar.gz
6f2364b
%if 0%{verify_tarball_signature}
6f2364b
Source1:       http://download.libguestfs.org/guestfs-tools/%{source_directory}/%{name}-%{version}.tar.gz.sig
6f2364b
%endif
6f2364b
6f2364b
# Keyring used to verify tarball signature.
6f2364b
%if 0%{verify_tarball_signature}
6f2364b
Source2:       libguestfs.keyring
6f2364b
%endif
6f2364b
6f2364b
%if 0%{patches_touch_autotools}
6f2364b
BuildRequires: autoconf, automake, libtool, gettext-devel
6f2364b
%endif
6f2364b
6f2364b
# Basic build requirements.
6f2364b
BuildRequires: gcc, gcc-c++
6f2364b
BuildRequires: make
5703585
BuildRequires: libguestfs-devel >= 1.45.3-1
6f2364b
BuildRequires: libguestfs-xfs
6f2364b
BuildRequires: perl(Pod::Simple)
6f2364b
BuildRequires: perl(Pod::Man)
6f2364b
BuildRequires: perl(Module::Build)
6f2364b
BuildRequires: perl(Test::More)
6f2364b
BuildRequires: /usr/bin/pod2text
6f2364b
BuildRequires: po4a
6f2364b
BuildRequires: pcre2-devel
6f2364b
BuildRequires: libxml2-devel
6f2364b
BuildRequires: jansson-devel
6f2364b
BuildRequires: libvirt-devel
6f2364b
BuildRequires: libxcrypt-devel
6f2364b
BuildRequires: ncurses-devel
6f2364b
BuildRequires: ocaml-libguestfs-devel
6f2364b
BuildRequires: ocaml-findlib-devel
6f2364b
BuildRequires: ocaml-gettext-devel
6f2364b
%if !0%{?rhel}
6f2364b
BuildRequires: ocaml-ounit-devel
6f2364b
%endif
6f2364b
BuildRequires: flex
6f2364b
BuildRequires: bison
6f2364b
BuildRequires: xz-devel
6f2364b
%if !0%{?rhel}
6f2364b
BuildRequires: zip
6f2364b
BuildRequires: unzip
6f2364b
%endif
6f2364b
%if !0%{?rhel}
6f2364b
BuildRequires: perl(Expect)
6f2364b
%endif
6f2364b
BuildRequires: bash-completion
6f2364b
BuildRequires: /usr/bin/qemu-img
e1c8031
BuildRequires: xorriso
6f2364b
BuildRequires: perl(Locale::TextDomain)
6f2364b
BuildRequires: perl(Sys::Guestfs)
6f2364b
BuildRequires: perl(Win::Hivex)
6f2364b
BuildRequires: perl(Win::Hivex::Regedit)
f7d2224
BuildRequires: perl-generators
6f2364b
6f2364b
%if 0%{verify_tarball_signature}
6f2364b
BuildRequires: gnupg2
6f2364b
%endif
6f2364b
6f2364b
# For virt-builder:
6f2364b
Requires:      curl
6f2364b
Requires:      gnupg2
6f2364b
Requires:      /usr/bin/qemu-img
6f2364b
Requires:      xz
6f2364b
6f2364b
# For virt-builder-repository:
6f2364b
Suggests:      osinfo-db
6f2364b
6f2364b
# For virt-inspector, since Fedora and RHEL >= 7 use XFS:
6f2364b
Recommends:    libguestfs-xfs
6f2364b
6f2364b
# For virt-edit and virt-customize:
6f2364b
Suggests:      perl
6f2364b
6f2364b
# This replaces the libguestfs-tools-c package.
6f2364b
Provides:      libguestfs-tools-c = 1:%{version}-%{release}
6f2364b
Obsoletes:     libguestfs-tools-c <= 1:1.45.2-1
6f2364b
6f2364b
6f2364b
%description
6f2364b
guestfs-tools is a set of tools that can be used to make batch
6f2364b
configuration changes to guests, get disk used/free statistics
6f2364b
(virt-df), perform backups and guest clones, change
6f2364b
registry/UUID/hostname info, build guests from scratch (virt-builder)
6f2364b
and much more.
6f2364b
6f2364b
Virt-alignment-scan scans virtual machines looking for partition
6f2364b
alignment problems.
6f2364b
6f2364b
Virt-builder is a command line tool for rapidly making disk images
6f2364b
of popular free operating systems.
6f2364b
6f2364b
Virt-cat is a command line tool to display the contents of a file in a
6f2364b
virtual machine.
6f2364b
6f2364b
Virt-customize is a command line tool for customizing virtual machine
6f2364b
disk images.
6f2364b
6f2364b
Virt-df is a command line tool to display free space on virtual
6f2364b
machine filesystems.  Unlike other tools, it doesn’t just display the
6f2364b
amount of space allocated to a virtual machine, but can look inside
6f2364b
the virtual machine to see how much space is really being used.  It is
6f2364b
like the df(1) command, but for virtual machines, except that it also
6f2364b
works for Windows virtual machines.
6f2364b
6f2364b
Virt-diff shows the differences between virtual machines.
6f2364b
6f2364b
Virt-edit is a command line tool to edit the contents of a file in a
6f2364b
virtual machine.
6f2364b
6f2364b
Virt-filesystems is a command line tool to display the filesystems,
6f2364b
partitions, block devices, LVs, VGs and PVs found in a disk image
6f2364b
or virtual machine.  It replaces the deprecated programs
6f2364b
virt-list-filesystems and virt-list-partitions with a much more
6f2364b
capable tool.
6f2364b
6f2364b
Virt-format is a command line tool to erase and make blank disks.
6f2364b
6f2364b
Virt-get-kernel extracts a kernel/initrd from a disk image.
6f2364b
6f2364b
Virt-inspector examines a virtual machine and tries to determine the
6f2364b
version of the OS, the kernel version, what drivers are installed,
6f2364b
whether the virtual machine is fully virtualized (FV) or
6f2364b
para-virtualized (PV), what applications are installed and more.
6f2364b
6f2364b
Virt-log is a command line tool to display the log files from a
6f2364b
virtual machine.
6f2364b
6f2364b
Virt-ls is a command line tool to list out files in a virtual machine.
6f2364b
6f2364b
Virt-make-fs is a command line tool to build a filesystem out of
6f2364b
a collection of files or a tarball.
6f2364b
6f2364b
Virt-resize can resize existing virtual machine disk images.
6f2364b
6f2364b
Virt-sparsify makes virtual machine disk images sparse (thin-provisioned).
6f2364b
6f2364b
Virt-sysprep lets you reset or unconfigure virtual machines in
6f2364b
preparation for cloning them.
6f2364b
6f2364b
Virt-tail follows (tails) a log file within a guest, like 'tail -f'.
6f2364b
6f2364b
6f2364b
%package -n virt-win-reg
6f2364b
Summary:       Access and modify the Windows Registry of a Windows VM
6f2364b
License:       GPLv2+
6f2364b
BuildArch:     noarch
6f2364b
6f2364b
# This replaces the libguestfs-tools package.
6f2364b
Provides:      libguestfs-tools = 1:%{version}-%{release}
6f2364b
Obsoletes:     libguestfs-tools <= 1:1.45.2-1
6f2364b
6f2364b
6f2364b
%description -n virt-win-reg
6f2364b
Virt-win-reg lets you look at and modify the Windows Registry of
6f2364b
Windows virtual machines.
6f2364b
6f2364b
6f2364b
%if !0%{?rhel}
6f2364b
%package -n virt-dib
6f2364b
Summary:       Safe and secure diskimage-builder replacement
6f2364b
License:       GPLv2+
c947385
# This subpackage (only) must have an Epoch of 1 because it
c947385
# replaces a package in libguestfs which had an Epoch of 1.
c947385
Epoch:         1
6f2364b
6f2364b
Requires:      libguestfs-dib >= 1:1.45.2-1
6f2364b
6f2364b
6f2364b
%description -n virt-dib
6f2364b
Virt-dib is a safe and secure alternative to the OpenStack
6f2364b
diskimage-builder command.  It is compatible with most
6f2364b
diskimage-builder elements.
6f2364b
%endif
6f2364b
6f2364b
6f2364b
%package bash-completion
6f2364b
Summary:       Bash tab-completion scripts for %{name}
6f2364b
BuildArch:     noarch
6f2364b
Requires:      bash-completion >= 2.0
6f2364b
Requires:      %{name} = %{version}-%{release}
6f2364b
6f2364b
6f2364b
%description bash-completion
6f2364b
Install this package if you want intelligent bash tab-completion
6f2364b
for the virt-* tools.
6f2364b
6f2364b
6f2364b
%package man-pages-ja
6f2364b
Summary:       Japanese (ja) man pages for %{name}
6f2364b
BuildArch:     noarch
6f2364b
Requires:      %{name} = %{version}-%{release}
6f2364b
6f2364b
%description man-pages-ja
6f2364b
%{name}-man-pages-ja contains Japanese (ja) man pages
6f2364b
for %{name}.
6f2364b
6f2364b
6f2364b
%package man-pages-uk
6f2364b
Summary:       Ukrainian (uk) man pages for %{name}
6f2364b
BuildArch:     noarch
6f2364b
Requires:      %{name} = %{version}-%{release}
6f2364b
6f2364b
%description man-pages-uk
6f2364b
%{name}-man-pages-uk contains Ukrainian (uk) man pages
6f2364b
for %{name}.
6f2364b
6f2364b
6f2364b
%prep
6f2364b
%if 0%{verify_tarball_signature}
6f2364b
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
6f2364b
%endif
6f2364b
%setup -q
6f2364b
%autopatch -p1
6f2364b
6f2364b
%if 0%{patches_touch_autotools}
6f2364b
autoreconf -i
6f2364b
%endif
6f2364b
6f2364b
6f2364b
%build
6f2364b
%{configure}
6f2364b
6f2364b
# Building index-parse.c by hand works around a race condition in the
6f2364b
# autotools cruft, where two or more copies of yacc race with each
6f2364b
# other, resulting in a corrupted file.
6f2364b
make -j1 -C builder index-parse.c
6f2364b
6f2364b
make V=1 %{?_smp_mflags}
6f2364b
6f2364b
6f2364b
%check
6f2364b
%ifarch %{test_arches}
6f2364b
# Enable debugging.
6f2364b
export LIBGUESTFS_DEBUG=1
6f2364b
export LIBGUESTFS_TRACE=1
6f2364b
6f2364b
# This test is currently broken and needs further investigation.
6f2364b
export SKIP_TEST_MACHINE_READABLE_SH=1
6f2364b
6f2364b
# This test fails for me in local mock and Koji, but not when running
6f2364b
# in an unrestricted environment.
6f2364b
export SKIP_TEST_VIRT_FORMAT_SH=1
6f2364b
4084f31
# This test takes too long to run under Koji and times out.  It runs
4084f31
# fine with KVM enabled.
4084f31
export SKIP_TEST_VIRT_RESIZE_PL=1
4084f31
6f2364b
if ! make check -k ; then
6f2364b
    # Dump out the log files of any failing tests to make
6f2364b
    # debugging test failures easier.
6f2364b
    for f in `find -name test-suite.log | xargs grep -l ^FAIL:`; do
6f2364b
        echo '*****' $f '*****'
6f2364b
        cat $f
6f2364b
        echo
6f2364b
    done
6f2364b
    exit 1
6f2364b
fi
6f2364b
%endif
6f2364b
6f2364b
6f2364b
%install
6f2364b
make DESTDIR=$RPM_BUILD_ROOT install
6f2364b
6f2364b
# Delete libtool files.
6f2364b
find $RPM_BUILD_ROOT -name '*.la' -delete
6f2364b
6f2364b
# Move installed documentation back to the source directory so
6f2364b
# we can install it using a %%doc rule.
6f2364b
mv $RPM_BUILD_ROOT%{_docdir}/%{name} installed-docs
6f2364b
gzip --best installed-docs/*.xml
6f2364b
8c0856b
%if 0%{?rhel}
8c0856b
# Remove virt-dib if it was built.
8c0856b
rm -f $RPM_BUILD_ROOT%{_bindir}/virt-dib
8c0856b
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/virt-dib.1*
8c0856b
%endif
8c0856b
6f2364b
# Find locale files.
6f2364b
%find_lang %{name}
6f2364b
6f2364b
2fb9953
# Fix upgrades from old libguestfs-tools-c package
2fb9953
# which had /etc/virt-builder -> xdg/virt-builder.
2fb9953
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/
2fb9953
# This can be removed in Fedora > 36.
2fb9953
%pretrans -p <lua>
2fb9953
path = "/etc/virt-builder"
2fb9953
st = posix.stat(path)
2fb9953
if st and st.type == "link" then
2fb9953
  os.remove(path)
2fb9953
end
2fb9953
2fb9953
6f2364b
%files -f %{name}.lang
6f2364b
%license COPYING
6f2364b
%doc README
6f2364b
%doc installed-docs/*
6f2364b
%dir %{_sysconfdir}/virt-builder
6f2364b
%dir %{_sysconfdir}/virt-builder/repos.d
6f2364b
%config(noreplace) %{_sysconfdir}/virt-builder/repos.d/*
6f2364b
%{_bindir}/virt-alignment-scan
6f2364b
%{_bindir}/virt-builder
6f2364b
%{_bindir}/virt-builder-repository
6f2364b
%{_bindir}/virt-cat
6f2364b
%{_bindir}/virt-customize
6f2364b
%{_bindir}/virt-df
6f2364b
%{_bindir}/virt-diff
6f2364b
%{_bindir}/virt-edit
6f2364b
%{_bindir}/virt-filesystems
6f2364b
%{_bindir}/virt-format
6f2364b
%{_bindir}/virt-get-kernel
6f2364b
%{_bindir}/virt-index-validate
6f2364b
%{_bindir}/virt-inspector
6f2364b
%{_bindir}/virt-log
6f2364b
%{_bindir}/virt-ls
6f2364b
%{_bindir}/virt-make-fs
6f2364b
%{_bindir}/virt-resize
6f2364b
%{_bindir}/virt-sparsify
6f2364b
%{_bindir}/virt-sysprep
6f2364b
%{_bindir}/virt-tail
339e04f
%{_mandir}/man1/guestfs-tools-release-notes-1*.1*
6f2364b
%{_mandir}/man1/virt-alignment-scan.1*
6f2364b
%{_mandir}/man1/virt-builder-repository.1*
6f2364b
%{_mandir}/man1/virt-builder.1*
6f2364b
%{_mandir}/man1/virt-cat.1*
6f2364b
%{_mandir}/man1/virt-customize.1*
6f2364b
%{_mandir}/man1/virt-df.1*
6f2364b
%{_mandir}/man1/virt-diff.1*
6f2364b
%{_mandir}/man1/virt-edit.1*
6f2364b
%{_mandir}/man1/virt-filesystems.1*
6f2364b
%{_mandir}/man1/virt-format.1*
6f2364b
%{_mandir}/man1/virt-get-kernel.1*
6f2364b
%{_mandir}/man1/virt-index-validate.1*
6f2364b
%{_mandir}/man1/virt-inspector.1*
6f2364b
%{_mandir}/man1/virt-log.1*
6f2364b
%{_mandir}/man1/virt-ls.1*
6f2364b
%{_mandir}/man1/virt-make-fs.1*
6f2364b
%{_mandir}/man1/virt-resize.1*
6f2364b
%{_mandir}/man1/virt-sparsify.1*
6f2364b
%{_mandir}/man1/virt-sysprep.1*
6f2364b
%{_mandir}/man1/virt-tail.1*
6f2364b
6f2364b
6f2364b
%files -n virt-win-reg
6f2364b
%license COPYING
6f2364b
%doc README
6f2364b
%{_bindir}/virt-win-reg
6f2364b
%{_mandir}/man1/virt-win-reg.1*
6f2364b
6f2364b
6f2364b
%if !0%{?rhel}
6f2364b
%files -n virt-dib
6f2364b
%license COPYING
6f2364b
%doc README
6f2364b
%{_bindir}/virt-dib
6f2364b
%{_mandir}/man1/virt-dib.1*
6f2364b
%endif
6f2364b
6f2364b
6f2364b
%files bash-completion
6f2364b
%license COPYING
6f2364b
%dir %{_datadir}/bash-completion/completions
6f2364b
%{_datadir}/bash-completion/completions/virt-*
6f2364b
6f2364b
6f2364b
%files man-pages-ja
6f2364b
%lang(ja) %{_mandir}/ja/man1/*.1*
6f2364b
6f2364b
6f2364b
%files man-pages-uk
6f2364b
%lang(uk) %{_mandir}/uk/man1/*.1*
6f2364b
6f2364b
6f2364b
%changelog
7882c4f
* Wed Jan 11 2023 Richard W.M. Jones <rjones@redhat.com> - 1.48.3-1
7882c4f
- New upstream stable branch version 1.48.3
7882c4f
89c6588
* Fri Nov 25 2022 Richard W.M. Jones <rjones@redhat.com> - 1.48.2-3
89c6588
- Reenable opensuse repository again
89c6588
b6688bc
* Mon Nov 21 2022 Richard W.M. Jones <rjones@redhat.com> - 1.48.2-2
b6688bc
- Disable opensuse repository
b6688bc
99b595d
* Thu May 26 2022 Richard W.M. Jones <rjones@redhat.com> - 1.48.2-1
99b595d
- New upstream stable branch version 1.48.2
99b595d
4e33a12
* Thu May 12 2022 Richard W.M. Jones <rjones@redhat.com> - 1.48.1-1
4e33a12
- New upstream stable branch version 1.48.1
4e33a12
9f2c12e
* Mon Mar 14 2022 Richard W.M. Jones <rjones@redhat.com> - 1.48.0-1
9f2c12e
- New upstream stable branch version 1.48.0
9f2c12e
339e04f
* Tue Mar 08 2022 Richard W.M. Jones <rjones@redhat.com> - 1.47.5-1
339e04f
- New upstream development version 1.47.8
339e04f
- Add new guestfs-tools-release-notes-1.48(1) man page.
339e04f
0e8cbbf
* Tue Mar 01 2022 Richard W.M. Jones <rjones@redhat.com> - 1.47.4-1
0e8cbbf
- New upstream development version 1.47.4
0e8cbbf
8dcd55c
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.47.3-2
8dcd55c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
8dcd55c
1bfaf21
* Sat Dec 04 2021 Richard W.M. Jones <rjones@redhat.com> - 1.47.3-1
1bfaf21
- New upstream development version 1.47.3
1bfaf21
885e5fe
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.47.2-2
885e5fe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
885e5fe
b132cc8
* Wed Jun 16 2021 Richard W.M. Jones <rjones@redhat.com> - 1.47.2-1
b132cc8
- New upstream development version 1.47.2
b132cc8
9e0fd61
* Wed Jun  2 2021 Richard W.M. Jones <rjones@redhat.com> - 1.46.1-3
9e0fd61
- Add gating tests (for RHEL 9)
9e0fd61
f7d2224
* Thu May 13 2021 Richard W.M. Jones <rjones@redhat.com> - 1.46.1-2
f7d2224
- BR perl-generators so deps of virt-win-reg subpackage are correct.
f7d2224
12ac128
* Sat May 08 2021 Richard W.M. Jones <rjones@redhat.com> - 1.46.1-1
12ac128
- New stable branch version 1.46.1.
12ac128
db0bb32
* Tue Apr 27 2021 Richard W.M. Jones <rjones@redhat.com> - 1.46.0-1
db0bb32
- New stable branch version 1.46.0.
db0bb32
c947385
* Wed Apr 07 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.3-4
c947385
- Use Epoch 1 for virt-dib subpackage (only).
c947385
e1c8031
* Wed Mar 31 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.3-3
e1c8031
- Add BR xorriso, needed to run the tests.
0ebebd7
5703585
* Mon Mar 29 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.3-1
5703585
- New upstream version 1.45.3.
2fb9953
- Fix symlink replacement of virt-builder directory (RHBZ#1943838).
2fb9953
4084f31
* Fri Mar 26 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.2-5
4084f31
- Skip test-virt-resize.pl that takes too long to run.
4084f31
6f2364b
* Thu Mar 25 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.2-4
6f2364b
- Add perl(Test::More) dependency for the Perl test suite.
6f2364b
- Add perl(Module::Build) dependency for the Perl bindings.
6f2364b
- Fix ounit2 dependency again.
6f2364b
6f2364b
* Wed Mar 24 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.2-2
6f2364b
- Add perl(Locale::TextDomain) dependency for virt-win-reg.
6f2364b
- Fix ounit2 dependency upstream.
6f2364b
6f2364b
* Tue Mar 23 2021 Richard W.M. Jones <rjones@redhat.com> - 1.45.2-1
6f2364b
- New guestfs-tools package, split off from libguestfs.