From 39e659af1f2eca2542a675f0e43fd44882f49084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 9 Sep 2021 19:13:05 +0200 Subject: [PATCH] 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. --- lvm2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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