Blame SPECS/guestfs-tools.spec

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