]> git.proxmox.com Git - mirror_zfs-debian.git/blame - rpm/redhat/zfs-kmod.spec.in
New upstream version 0.7.11
[mirror_zfs-debian.git] / rpm / redhat / zfs-kmod.spec.in
CommitLineData
ea04106b
AX
1%bcond_with debug
2%bcond_with debug_dmu_tx
3
4Name: @PACKAGE@-kmod
5Version: @VERSION@
6Release: @RELEASE@%{?dist}
7
8Summary: Kernel module(s)
9Group: System Environment/Kernel
10License: @ZFS_META_LICENSE@
11URL: http://zfsonlinux.org/
12BuildRequires: %kernel_module_package_buildreqs
13BuildRequires: kmod-spl-devel = %{version}
14Source0: @PACKAGE@-%{version}.tar.gz
15BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
16
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.
19%(/bin/echo -e "\
20Requires: spl-kmod\n\
21Requires: @PACKAGE@ = %{version}\n\
22Conflicts: @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble)
23
cae5b340
AX
24# LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
25%ifarch ppc ppc64 ppc64le aarch64
26%global __global_ldflags %{nil}
27%endif
28
ea04106b
AX
29%description
30This package contains the ZFS kernel modules.
31
32%define kmod_name @PACKAGE@
ea04106b
AX
33
34%kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
35
36%define ksrc %{_usrsrc}/kernels/%{kverrel}
37%define kobj %{ksrc}
38%define splsrc %{_usrsrc}/spl-%{version}
39%define splobj %{splsrc}/%{kverrel}
40
41%package -n kmod-%{kmod_name}-devel
42Summary: ZFS kernel module(s) devel common
43Group: System Environment/Kernel
44Requires: kmod-spl-devel = %{version}
45
46%description -n kmod-%{kmod_name}-devel
47This package provides the header files and objects to build kernel modules
48which depend on the spl kernel module.
49
50%prep
51if ! [ -d "%{ksrc}" ]; then
52 echo "Kernel build directory isn't set properly, cannot continue"
53 exit 1
54fi
55
56%if %{with debug}
57%define debug --enable-debug
58%else
59%define debug --disable-debug
60%endif
61
62%if %{with debug_dmu_tx}
63%define debug_dmu_tx --enable-debug-dmu-tx
64%else
65%define debug_dmu_tx --disable-debug-dmu-tx
66%endif
67
68%setup -n %{kmod_name}-%{version}
69%build
70%configure \
71 --with-config=kernel \
72 --with-linux=%{ksrc} \
73 --with-linux-obj=%{kobj} \
74 --with-spl="%{splsrc}" \
75 --with-spl-obj="%{splobj}" \
76 %{debug} \
77 %{debug_dmu_tx}
78make %{?_smp_mflags}
79
80%install
81make install \
82 DESTDIR=${RPM_BUILD_ROOT} \
83 INSTALL_MOD_DIR=extra/%{kmod_name}
84%{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
85
4d815aed
AX
86# find-debuginfo.sh only considers executables
87%{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
88
ea04106b
AX
89%clean
90rm -rf $RPM_BUILD_ROOT
91
92%files -n kmod-%{kmod_name}-devel
93%{_usrsrc}/%{kmod_name}-%{version}