2015-03-25 23:59:17 +00:00
|
|
|
%bcond_with debug
|
2018-01-10 18:49:27 +00:00
|
|
|
%bcond_with debuginfo
|
2015-03-25 23:59:17 +00:00
|
|
|
|
|
|
|
Name: @PACKAGE@-kmod
|
|
|
|
Version: @VERSION@
|
|
|
|
Release: @RELEASE@%{?dist}
|
|
|
|
|
|
|
|
Summary: Kernel module(s)
|
|
|
|
Group: System Environment/Kernel
|
|
|
|
License: @ZFS_META_LICENSE@
|
2020-10-09 03:10:13 +00:00
|
|
|
URL: https://github.com/openzfs/zfs
|
2015-03-25 23:59:17 +00:00
|
|
|
BuildRequires: %kernel_module_package_buildreqs
|
|
|
|
Source0: @PACKAGE@-%{version}.tar.gz
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
|
|
|
|
# Additional dependency information for the kmod sub-package must be specified
|
|
|
|
# by generating a preamble text file which kmodtool can append to the spec file.
|
|
|
|
%(/bin/echo -e "\
|
|
|
|
Requires: @PACKAGE@ = %{version}\n\
|
2021-04-07 17:10:34 +00:00
|
|
|
Conflicts: @PACKAGE@-dkms\n\
|
2021-04-11 19:02:26 +00:00
|
|
|
Obsoletes: kmod-spl\n\
|
2021-04-07 17:10:34 +00:00
|
|
|
Obsoletes: spl-kmod\n\n" > %{_sourcedir}/kmod-preamble)
|
2015-03-25 23:59:17 +00:00
|
|
|
|
2017-07-29 20:25:53 +00:00
|
|
|
# LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
|
|
|
|
%ifarch ppc ppc64 ppc64le aarch64
|
2017-03-06 17:17:24 +00:00
|
|
|
%global __global_ldflags %{nil}
|
|
|
|
%endif
|
|
|
|
|
2015-03-25 23:59:17 +00:00
|
|
|
%description
|
|
|
|
This package contains the ZFS kernel modules.
|
|
|
|
|
|
|
|
%define kmod_name @PACKAGE@
|
|
|
|
|
|
|
|
%kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
|
|
|
|
|
|
|
|
%define ksrc %{_usrsrc}/kernels/%{kverrel}
|
|
|
|
%define kobj %{ksrc}
|
|
|
|
|
|
|
|
%package -n kmod-%{kmod_name}-devel
|
|
|
|
Summary: ZFS kernel module(s) devel common
|
|
|
|
Group: System Environment/Kernel
|
2019-06-19 18:44:44 +00:00
|
|
|
Provides: kmod-spl-devel = %{version}
|
2015-03-25 23:59:17 +00:00
|
|
|
|
|
|
|
%description -n kmod-%{kmod_name}-devel
|
2018-02-16 01:53:18 +00:00
|
|
|
This package provides the header files and objects to build kernel modules.
|
2015-03-25 23:59:17 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
if ! [ -d "%{ksrc}" ]; then
|
|
|
|
echo "Kernel build directory isn't set properly, cannot continue"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
%if %{with debug}
|
|
|
|
%define debug --enable-debug
|
|
|
|
%else
|
|
|
|
%define debug --disable-debug
|
|
|
|
%endif
|
|
|
|
|
2018-01-10 18:49:27 +00:00
|
|
|
%if %{with debuginfo}
|
|
|
|
%define debuginfo --enable-debuginfo
|
|
|
|
%else
|
|
|
|
%define debuginfo --disable-debuginfo
|
|
|
|
%endif
|
|
|
|
|
2015-03-25 23:59:17 +00:00
|
|
|
%setup -n %{kmod_name}-%{version}
|
|
|
|
%build
|
|
|
|
%configure \
|
|
|
|
--with-config=kernel \
|
|
|
|
--with-linux=%{ksrc} \
|
|
|
|
--with-linux-obj=%{kobj} \
|
2018-01-10 18:49:27 +00:00
|
|
|
%{debug} \
|
2022-02-08 22:17:37 +00:00
|
|
|
%{debuginfo} \
|
|
|
|
%{?kernel_cc} \
|
|
|
|
%{?kernel_ld} \
|
|
|
|
%{?kernel_llvm}
|
2015-03-25 23:59:17 +00:00
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
%install
|
|
|
|
make install \
|
|
|
|
DESTDIR=${RPM_BUILD_ROOT} \
|
|
|
|
INSTALL_MOD_DIR=extra/%{kmod_name}
|
|
|
|
%{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
|
|
|
|
|
2016-01-20 01:48:17 +00:00
|
|
|
# find-debuginfo.sh only considers executables
|
2022-03-31 15:20:50 +00:00
|
|
|
%{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra/*/*
|
2016-01-20 01:48:17 +00:00
|
|
|
|
2015-03-25 23:59:17 +00:00
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%files -n kmod-%{kmod_name}-devel
|
|
|
|
%{_usrsrc}/%{kmod_name}-%{version}
|
2018-02-16 01:53:18 +00:00
|
|
|
%{_usrsrc}/spl-%{version}
|