]> git.proxmox.com Git - mirror_zfs-debian.git/blob - rpm/redhat/zfs-kmod.spec.in
Imported Upstream version 0.6.5.3
[mirror_zfs-debian.git] / rpm / redhat / zfs-kmod.spec.in
1 %bcond_with debug
2 %bcond_with debug_dmu_tx
3
4 Name: @PACKAGE@-kmod
5 Version: @VERSION@
6 Release: @RELEASE@%{?dist}
7
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)
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 "\
20 Requires: spl-kmod\n\
21 Requires: @PACKAGE@ = %{version}\n\
22 Conflicts: @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble)
23
24 %description
25 This package contains the ZFS kernel modules.
26
27 %define kmod_name @PACKAGE@
28 %define debug_package %{nil}
29
30 %kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
31
32 %define ksrc %{_usrsrc}/kernels/%{kverrel}
33 %define kobj %{ksrc}
34 %define splsrc %{_usrsrc}/spl-%{version}
35 %define splobj %{splsrc}/%{kverrel}
36
37 %package -n kmod-%{kmod_name}-devel
38 Summary: ZFS kernel module(s) devel common
39 Group: System Environment/Kernel
40 Requires: kmod-spl-devel = %{version}
41
42 %description -n kmod-%{kmod_name}-devel
43 This package provides the header files and objects to build kernel modules
44 which depend on the spl kernel module.
45
46 %prep
47 if ! [ -d "%{ksrc}" ]; then
48 echo "Kernel build directory isn't set properly, cannot continue"
49 exit 1
50 fi
51
52 %if %{with debug}
53 %define debug --enable-debug
54 %else
55 %define debug --disable-debug
56 %endif
57
58 %if %{with debug_dmu_tx}
59 %define debug_dmu_tx --enable-debug-dmu-tx
60 %else
61 %define debug_dmu_tx --disable-debug-dmu-tx
62 %endif
63
64 %setup -n %{kmod_name}-%{version}
65 %build
66 %configure \
67 --with-config=kernel \
68 --with-linux=%{ksrc} \
69 --with-linux-obj=%{kobj} \
70 --with-spl="%{splsrc}" \
71 --with-spl-obj="%{splobj}" \
72 %{debug} \
73 %{debug_dmu_tx}
74 make %{?_smp_mflags}
75
76 %install
77 make install \
78 DESTDIR=${RPM_BUILD_ROOT} \
79 INSTALL_MOD_DIR=extra/%{kmod_name}
80 %{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85 %files -n kmod-%{kmod_name}-devel
86 %{_usrsrc}/%{kmod_name}-%{version}