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 <trawets@amazon.com>
This commit is contained in:
Stewart Smith 2022-06-23 01:22:32 +00:00 committed by Stewart Smith
parent 095680a70d
commit 73532e3bda

View File

@ -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