Fix Requires/Recommends

Add missing dependencies based on code audit. Also make the package
universally noarch by recommending qemu-img instead of requiring it (it
is not strictly required for all functionality).

Signed-off-by: Ondrej Mosnáček <omosnacek@gmail.com>
This commit is contained in:
Ondrej Mosnáček 2023-09-05 13:21:28 +02:00
parent 97581c1021
commit f75aa9d221
No known key found for this signature in database
GPG Key ID: BDE08B7A0C57B343

View File

@ -7,27 +7,29 @@ URL: https://github.com/canonical/%{name}
Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
# Don't build the cloud-utils main package on EPEL architectures that don't
# have qemu-img. Which means we need to make it a no-noarch package for EPEL
# for this to work properly.
%define BuildMainPackage 1
%if 0%{?rhel}
# don't build debuginfo packages
%global debug_package %{nil}
%ifarch i686 ppc64
%define BuildMainPackage 0
%endif
%else
BuildArch: noarch
%endif
Requires: %{name}-growpart
Requires: gawk
Requires: e2fsprogs
Requires: file
Requires: python3
Requires: qemu-img
Requires: util-linux
# cloud-localds
Recommends: tar
Recommends: dosfstools
Recommends: mtools
Recommends: genisoimage
# cloud-localds & mount-image-callback
Recommends: qemu-img
# resize-part-image
Requires: file
Requires: gzip
Requires: e2fsprogs
# resize-part-image & mount-image-callback
Requires: gawk
# vcs-run
Recommends: breezy
Recommends: git-core
Recommends: mercurial
Recommends: wget
%description
This package provides a useful set of utilities for managing cloud images.
@ -41,11 +43,12 @@ with a much simpler interface.
Summary: Script for growing a partition
Requires: gawk
Requires: util-linux
# gdisk is only required for resizing GPT partitions and depends on libicu
# (25MB). We don't make this a hard requirement to save some space in non-GPT
# systems.
Recommends: gdisk
Requires: util-linux
Recommends: lvm2
%description growpart
@ -65,7 +68,6 @@ package to grow the root partition on first boot.
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_mandir}/man1
%if %{BuildMainPackage}
# Install binaries and manpages
cp bin/* %{buildroot}%{_bindir}/
cp man/* %{buildroot}%{_mandir}/man1/
@ -79,7 +81,6 @@ rm -f %{buildroot}%{_mandir}/man1/cloud-run-instances.*
# Exclude euca2ools wrappers and manpages
rm -f %{buildroot}%{_bindir}/cloud-publish-*
rm -f %{buildroot}%{_mandir}/man1/cloud-publish-*
%endif
# Install the growpart binary and man page
cp bin/growpart %{buildroot}%{_bindir}/
@ -87,7 +88,6 @@ cp man/growpart.* %{buildroot}%{_mandir}/man1/
# Files for the main package
%if %{BuildMainPackage}
%files
%doc ChangeLog
%license LICENSE
@ -100,7 +100,6 @@ cp man/growpart.* %{buildroot}%{_mandir}/man1/
%doc %{_mandir}/man1/resize-part-image.*
%doc %{_mandir}/man1/write-mime-multipart.*
%doc %{_mandir}/man1/cloud-localds.*
%endif
# Files for the growpart subpackage