From 73532e3bda14da6002d79aa7d76aee81b273a23e Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Thu, 23 Jun 2022 01:22:32 +0000 Subject: [PATCH] Move zlib, xz, and zstd to bcond This allows experiments to be run with reducing the size of the initramfs by having fewer bulky shared libraries in it, and also makes it easier for downstream distributions to make different configuration choices. We keep the defaults the same, building *with* all of these in order to not change what is practically being built in Fedora. Signed-off-by: Stewart Smith --- kmod.spec | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kmod.spec b/kmod.spec index a9e837b..fabb8b8 100644 --- a/kmod.spec +++ b/kmod.spec @@ -10,6 +10,9 @@ %bcond_with dist_conf %endif +%bcond_without zlib +%bcond_without xz +%bcond_without zstd Name: kmod Version: 30 @@ -25,12 +28,18 @@ Exclusiveos: Linux BuildRequires: gcc BuildRequires: chrpath +%if %{with zlib} BuildRequires: zlib-devel +%endif +%if %{with xz} BuildRequires: xz-devel +%endif BuildRequires: libxslt BuildRequires: openssl-devel BuildRequires: make +%if %{with zstd} BuildRequires: libzstd-devel +%endif Provides: module-init-tools = 4.0-1 Obsoletes: module-init-tools < 4.0-1 @@ -64,9 +73,15 @@ applications that wish to load or unload Linux kernel modules. %build %configure \ --with-openssl \ +%if %{with zlib} --with-zlib \ +%endif +%if %{with xz} --with-xz \ +%endif +%if %{with zstd} --with-zstd \ +%endif --enable-debug %{make_build} V=1