Add a "try" operation for range locks
[zfs.git] / rpm / redhat / zfs-kmod.spec.in
blob3b566c7c5c57e09b830e1f653dbb7530ef210bee
1 %bcond_with debug
2 %bcond_with debuginfo
4 # See comment in zfs.spec.in.
5 %global __brp_mangle_shebangs_exclude_from arc_summary.py|arcstat.py|dbufstat.py|test-runner.py|zts-report.py
7 Name: @PACKAGE@-kmod
8 Version: @VERSION@
9 Release: @RELEASE@%{?dist}
11 Summary: Kernel module(s)
12 Group: System Environment/Kernel
13 License: @ZFS_META_LICENSE@
14 URL: https://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.
21 %(/bin/echo -e "\
22 Requires: @PACKAGE@ = %{version}\n\
23 Conflicts: @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble\n\
24 Obsoletes: spl-kmod)
26 # LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
27 %ifarch ppc ppc64 ppc64le aarch64
28 %global __global_ldflags %{nil}
29 %endif
31 %description
32 This package contains the ZFS kernel modules.
34 %define kmod_name @PACKAGE@
36 %kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
38 %define ksrc %{_usrsrc}/kernels/%{kverrel}
39 %define kobj %{ksrc}
41 %package -n kmod-%{kmod_name}-devel
42 Summary: ZFS kernel module(s) devel common
43 Group: System Environment/Kernel
44 Provides: kmod-spl-devel = %{version}
46 %description -n kmod-%{kmod_name}-devel
47 This package provides the header files and objects to build kernel modules.
49 %prep
50 if ! [ -d "%{ksrc}" ]; then
51 echo "Kernel build directory isn't set properly, cannot continue"
52 exit 1
55 %if %{with debug}
56 %define debug --enable-debug
57 %else
58 %define debug --disable-debug
59 %endif
61 %if %{with debuginfo}
62 %define debuginfo --enable-debuginfo
63 %else
64 %define debuginfo --disable-debuginfo
65 %endif
67 %setup -n %{kmod_name}-%{version}
68 %build
69 %configure \
70 --with-config=kernel \
71 --with-linux=%{ksrc} \
72 --with-linux-obj=%{kobj} \
73 %{debug} \
74 %{debuginfo}
75 make %{?_smp_mflags}
77 %install
78 make install \
79 DESTDIR=${RPM_BUILD_ROOT} \
80 INSTALL_MOD_DIR=extra/%{kmod_name}
81 %{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
83 # find-debuginfo.sh only considers executables
84 %{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
86 %clean
87 rm -rf $RPM_BUILD_ROOT
89 %files -n kmod-%{kmod_name}-devel
90 %{_usrsrc}/%{kmod_name}-%{version}
91 %{_usrsrc}/spl-%{version}