]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/redhat/zfs-kmod.spec.in
Fix aarch64 build
[mirror_zfs.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 # LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
25 %ifarch ppc ppc64 ppc64le aarch64
26 %global __global_ldflags %{nil}
27 %endif
28
29 %description
30 This package contains the ZFS kernel modules.
31
32 %define kmod_name @PACKAGE@
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
42 Summary: ZFS kernel module(s) devel common
43 Group: System Environment/Kernel
44 Requires: kmod-spl-devel = %{version}
45
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.
49
50 %prep
51 if ! [ -d "%{ksrc}" ]; then
52 echo "Kernel build directory isn't set properly, cannot continue"
53 exit 1
54 fi
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}
78 make %{?_smp_mflags}
79
80 %install
81 make install \
82 DESTDIR=${RPM_BUILD_ROOT} \
83 INSTALL_MOD_DIR=extra/%{kmod_name}
84 %{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
85
86 # find-debuginfo.sh only considers executables
87 %{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %files -n kmod-%{kmod_name}-devel
93 %{_usrsrc}/%{kmod_name}-%{version}