Blame SPECS/guestfs-tools.spec

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