Use a "rich dependency" for the system-release req

Before this change, lvm2 pulls in fedora-release (or equivalent) which
pulls in a bunch of other packages, e.g. fedora-repos. This is
unnecessary for example in minimal constainers or initrd images. By
specifying the dependency conditionally, it will be satisfied on all
normal systems, while making it easier to skip in custom setups.
(filesystem requires setup which requires system-release, so normally
systemd-release always must be installed.) Also, use Requires(post)
because it is only used for presets which are used in %post. This
allows the system-release package to be removed after the installation
from the system.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-09-09 19:13:05 +02:00
parent 56bfeffe47
commit 39e659af1f

View File

@ -121,7 +121,7 @@ BuildRequires: sanlock-devel >= %{sanlock_version}
%endif
Requires: %{name}-libs = %{?epoch}:%{version}-%{release}
%if 0%{?fedora}
Requires: system-release >= %{system_release_version}
Requires(post): (system-release >= %{system_release_version} if system-release)
%endif
Requires: bash >= %{bash_version}
Requires(post): systemd-units >= %{systemd_version}, systemd-sysv