6 Release: @RELEASE@
%{?dist}
8 Summary: Kernel module
(s
)
9 Group: System Environment
/Kernel
10 License: @ZFS_META_LICENSE@
11 URL: https
://github.com
/openzfs
/zfs
12 BuildRequires
: %kernel_module_package_buildreqs
13 Source0: @PACKAGE@
-%{version}.tar.gz
14 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
16 # Additional dependency information for the kmod sub-package must be specified
17 # by generating a preamble text file which kmodtool can append to the spec file.
19 Requires: @PACKAGE@
= %{version}\n\
20 Conflicts: @PACKAGE@
-dkms"
> %{_sourcedir}/kmod
-preamble
)
22 # LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
23 %ifarch ppc ppc64 ppc64le aarch64
24 %global __global_ldflags
%{nil}
28 This package contains the ZFS kernel modules.
30 %define kmod_name @PACKAGE@
32 %kernel_module_package -n
%{kmod_name} -p %{_sourcedir}/kmod
-preamble
34 %define ksrc
%{_usrsrc}/kernels/%{kverrel}
37 %package -n kmod
-%{kmod_name}-devel
38 Summary: ZFS kernel module
(s
) devel common
39 Group: System Environment
/Kernel
41 %description -n kmod
-%{kmod_name}-devel
42 This package provides the header files and objects to build kernel modules.
45 if ! [ -d "
%{ksrc}"
]; then
46 echo "Kernel build directory isn't
set properly
, cannot
continue"
51 %define debug
--enable-debug
53 %define debug
--disable
-debug
57 %define debuginfo
--enable-debuginfo
59 %define debuginfo
--disable
-debuginfo
62 %setup -n
%{kmod_name}-%{version}
65 --with
-config
=kernel \
66 --with
-linux
=%{ksrc} \
67 --with
-linux
-obj
=%{kobj} \
75 # Module signing (modsign)
77 # This must be run _after_ find-debuginfo.sh runs, otherwise that will strip
78 # the signature off of the modules.
79 # (Based on Fedora's kernel.spec workaround)
80 %define __modsign_install_post \
81 sign_pem
="
%{ksrc}/certs
/signing_key.pem"
; \
82 sign_x509
="
%{ksrc}/certs
/signing_key.x509"
; \
83 if [ -f "$
{sign_x509
}"
]\
85 echo "Signing kernel modules ..."
; \
86 for kmod
in $
(find
%{buildroot}/lib/modules/%{kverrel}/extra
/ -name \
*.ko
); do \
87 %{ksrc}/scripts/sign-file sha256 ${sign_pem} ${sign_x509} ${kmod}; \
92 # hack to ensure signing happens after find-debuginfo.sh runs
93 %define __spec_install_post \
94 %{?__debug_package:%{__debug_install_post}}\
95 %{__arch_install_post}\
97 %{__modsign_install_post}
101 DESTDIR
=$
{RPM_BUILD_ROOT
} \
102 INSTALL_MOD_DIR
=extra
/%{kmod_name}
103 %{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.
*
105 # find-debuginfo.sh only considers executables
106 %{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra
/*/*
109 rm -rf $RPM_BUILD_ROOT
111 %files -n kmod
-%{kmod_name}-devel
112 %{_usrsrc}/%{kmod_name}-%{version}