From 39e659af1f2eca2542a675f0e43fd44882f49084 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sep 09 2021 18:26:26 +0000 Subject: 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. --- diff --git a/lvm2.spec b/lvm2.spec index dd1450c..387d2f1 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -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