4 %bcond_with debug_kmem_tracking
5 %bcond_with atomic_spinlocks
9 Release: @RELEASE@
%{?dist}
11 Summary: Kernel module
(s
)
12 Group: System Environment
/Kernel
14 URL: http
://zfsonlinux.org
/
15 BuildRequires
: %kernel_module_package_buildreqs
16 Source0: @PACKAGE@
-%{version}.tar.gz
17 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
19 # Additional dependency information for the kmod sub-package must be specified
20 # by generating a preamble text file which kmodtool can append to the spec file.
22 Requires: @PACKAGE@
= %{version}\n\
23 Conflicts: @PACKAGE@
-dkms\n\n"
> %{_sourcedir}/kmod
-preamble
)
25 # LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
26 %ifarch ppc ppc64 ppc64le aarch64
27 %global __global_ldflags
%{nil}
31 This package contains the kernel modules required to emulate
32 several interfaces provided by the Solaris kernel.
36 %kernel_module_package -n
%{kmod_name} -p %{_sourcedir}/kmod
-preamble
38 %define ksrc
%{_usrsrc}/kernels/%{kverrel}
41 %package -n kmod
-%{kmod_name}-devel
42 Summary: SPL kernel module
(s
) devel common
43 Group: System Environment
/Kernel
45 %description -n kmod
-%{kmod_name}-devel
46 This package provides the header files and objects to build kernel modules
47 which depend on the SPL kernel module.
50 if ! [ -d "
%{ksrc}"
]; then
51 echo "Kernel build directory isn't
set properly
, cannot
continue"
56 %define debug
--enable-debug
58 %define debug
--disable
-debug
62 %define debug_log
--enable-debug
-log
64 %define debug_log
--disable
-debug
-log
67 %if %{with debug_kmem}
68 %define debug_kmem
--enable-debug
-kmem
70 %define debug_kmem
--disable
-debug
-kmem
73 %if %{with debug_kmem_tracking}
74 %define debug_kmem_tracking
--enable-debug
-kmem
-tracking
76 %define debug_kmem_tracking
--disable
-debug
-kmem
-tracking
79 %if %{with atomic_spinlocks}
80 %define atomic_spinlocks
--enable-atomic
-spinlocks
82 %define atomic_spinlocks
--disable
-atomic
-spinlocks
85 %setup -n
%{kmod_name}-%{version}
88 --with
-config
=kernel \
89 --with
-linux
=%{ksrc} \
90 --with
-linux
-obj
=%{kobj} \
94 %{debug_kmem_tracking} \
100 DESTDIR
=$
{RPM_BUILD_ROOT
} \
101 INSTALL_MOD_DIR
=extra
/%{kmod_name}
102 %{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.
*
103 # find-debuginfo.sh only considers executables
104 %{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra
/*/*/*
107 rm -rf $RPM_BUILD_ROOT
109 %files -n kmod
-%{kmod_name}-devel
110 %{_usrsrc}/%{kmod_name}-%{version}