]> git.proxmox.com Git - mirror_spl-debian.git/blame - rpm/redhat/spl-kmod.spec.in
New upstream version 0.7.2
[mirror_spl-debian.git] / rpm / redhat / spl-kmod.spec.in
CommitLineData
10946b02
AX
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
7Name: @PACKAGE@-kmod
8Version: @VERSION@
9Release: @RELEASE@%{?dist}
10
11Summary: Kernel module(s)
12Group: System Environment/Kernel
13License: GPLv2+
14URL: http://zfsonlinux.org/
15BuildRequires: %kernel_module_package_buildreqs
16Source0: @PACKAGE@-%{version}.tar.gz
17BuildRoot: %{_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 "\
22Requires: @PACKAGE@ = %{version}\n\
23Conflicts: @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble)
24
ec06701b
AX
25# LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
26%ifarch ppc ppc64 ppc64le aarch64
2ea56c1d
AX
27%global __global_ldflags %{nil}
28%endif
29
10946b02
AX
30%description
31This package contains the kernel modules required to emulate
32several interfaces provided by the Solaris kernel.
33
34%define kmod_name spl
10946b02
AX
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
42Summary: SPL kernel module(s) devel common
43Group: System Environment/Kernel
44
45%description -n kmod-%{kmod_name}-devel
46This package provides the header files and objects to build kernel modules
47which depend on the SPL kernel module.
48
49%prep
50if ! [ -d "%{ksrc}" ]; then
51 echo "Kernel build directory isn't set properly, cannot continue"
52 exit 1
53fi
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}
96make %{?_smp_mflags}
97
98%install
99make install \
100 DESTDIR=${RPM_BUILD_ROOT} \
101 INSTALL_MOD_DIR=extra/%{kmod_name}
102%{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
81dab2ed
AX
103# find-debuginfo.sh only considers executables
104%{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
10946b02
AX
105
106%clean
107rm -rf $RPM_BUILD_ROOT
108
109%files -n kmod-%{kmod_name}-devel
110%{_usrsrc}/%{kmod_name}-%{version}