2 %bcond_with debug_dmu_tx
6 Release: @RELEASE@
%{?dist}
8 Summary: Kernel module
(s
)
9 Group: System Environment
/Kernel
10 License: @ZFS_META_LICENSE@
11 URL: http
://zfsonlinux.org
/
12 BuildRequires
: %kernel_module_package_buildreqs
13 BuildRequires
: kmod
-spl
-devel
= %{version}
14 Source0: @PACKAGE@
-%{version}.tar.gz
15 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
17 # Additional dependency information for the kmod sub-package must be specified
18 # by generating a preamble text file which kmodtool can append to the spec file.
21 Requires: @PACKAGE@
= %{version}\n\
22 Conflicts: @PACKAGE@
-dkms\n\n"
> %{_sourcedir}/kmod
-preamble
)
24 # LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
25 %ifarch ppc ppc64 ppc64le aarch64
26 %global __global_ldflags
%{nil}
30 This package contains the ZFS kernel modules.
32 %define kmod_name @PACKAGE@
34 %kernel_module_package -n
%{kmod_name} -p %{_sourcedir}/kmod
-preamble
36 %define ksrc
%{_usrsrc}/kernels/%{kverrel}
38 %define splsrc
%{_usrsrc}/spl-%{version}
39 %define splobj
%{splsrc}/%{kverrel}
41 %package -n kmod
-%{kmod_name}-devel
42 Summary: ZFS kernel module
(s
) devel common
43 Group: System Environment
/Kernel
44 Requires: kmod
-spl
-devel
= %{version}
46 %description -n kmod
-%{kmod_name}-devel
47 This package provides the header files and objects to build kernel modules
48 which depend on the spl kernel module.
51 if ! [ -d "
%{ksrc}"
]; then
52 echo "Kernel build directory isn't
set properly
, cannot
continue"
57 %define debug
--enable-debug
59 %define debug
--disable
-debug
62 %if %{with debug_dmu_tx}
63 %define debug_dmu_tx
--enable-debug
-dmu
-tx
65 %define debug_dmu_tx
--disable
-debug
-dmu
-tx
68 %setup -n
%{kmod_name}-%{version}
71 --with
-config
=kernel \
72 --with
-linux
=%{ksrc} \
73 --with
-linux
-obj
=%{kobj} \
74 --with
-spl
="
%{splsrc}" \
75 --with
-spl
-obj
="
%{splobj}" \
82 DESTDIR
=$
{RPM_BUILD_ROOT
} \
83 INSTALL_MOD_DIR
=extra
/%{kmod_name}
84 %{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.
*
86 # find-debuginfo.sh only considers executables
87 %{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra
/*/*/*
90 rm -rf $RPM_BUILD_ROOT
92 %files -n kmod
-%{kmod_name}-devel
93 %{_usrsrc}/%{kmod_name}-%{version}