]> git.proxmox.com Git - mirror_spl.git/blob - rpm/redhat/spl-kmod.spec.in
Fix powerpc build
[mirror_spl.git] / rpm / redhat / spl-kmod.spec.in
1 %bcond_with debug
2 %bcond_with debug_log
3 %bcond_with debug_kmem
4 %bcond_with debug_kmem_tracking
5 %bcond_with atomic_spinlocks
6
7 Name: @PACKAGE@-kmod
8 Version: @VERSION@
9 Release: @RELEASE@%{?dist}
10
11 Summary: Kernel module(s)
12 Group: System Environment/Kernel
13 License: GPLv2+
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)
18
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)
24
25 # LDFLAGS are not sanitized by arch/powerpc/Makefile (unlike other arches)
26 %ifarch ppc ppc64 ppc64le
27 %global __global_ldflags %{nil}
28 %endif
29
30 %description
31 This package contains the kernel modules required to emulate
32 several interfaces provided by the Solaris kernel.
33
34 %define kmod_name spl
35
36 %kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
37
38 %define ksrc %{_usrsrc}/kernels/%{kverrel}
39 %define kobj %{ksrc}
40
41 %package -n kmod-%{kmod_name}-devel
42 Summary: SPL kernel module(s) devel common
43 Group: System Environment/Kernel
44
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.
48
49 %prep
50 if ! [ -d "%{ksrc}" ]; then
51 echo "Kernel build directory isn't set properly, cannot continue"
52 exit 1
53 fi
54
55 %if %{with debug}
56 %define debug --enable-debug
57 %else
58 %define debug --disable-debug
59 %endif
60
61 %if %{with debug_log}
62 %define debug_log --enable-debug-log
63 %else
64 %define debug_log --disable-debug-log
65 %endif
66
67 %if %{with debug_kmem}
68 %define debug_kmem --enable-debug-kmem
69 %else
70 %define debug_kmem --disable-debug-kmem
71 %endif
72
73 %if %{with debug_kmem_tracking}
74 %define debug_kmem_tracking --enable-debug-kmem-tracking
75 %else
76 %define debug_kmem_tracking --disable-debug-kmem-tracking
77 %endif
78
79 %if %{with atomic_spinlocks}
80 %define atomic_spinlocks --enable-atomic-spinlocks
81 %else
82 %define atomic_spinlocks --disable-atomic-spinlocks
83 %endif
84
85 %setup -n %{kmod_name}-%{version}
86 %build
87 %configure \
88 --with-config=kernel \
89 --with-linux=%{ksrc} \
90 --with-linux-obj=%{kobj} \
91 %{debug} \
92 %{debug_log} \
93 %{debug_kmem} \
94 %{debug_kmem_tracking} \
95 %{atomic_spinlocks}
96 make %{?_smp_mflags}
97
98 %install
99 make install \
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/*/*/*
105
106 %clean
107 rm -rf $RPM_BUILD_ROOT
108
109 %files -n kmod-%{kmod_name}-devel
110 %{_usrsrc}/%{kmod_name}-%{version}