]> granicus.if.org Git - zfs/blob - rpm/redhat/zfs-kmod.spec.in
kmod-zfs-devel rpm should provide kmod-spl-devel
[zfs] / rpm / redhat / zfs-kmod.spec.in
1 %bcond_with     debug
2 %bcond_with     debuginfo
3
4 # See comment in zfs.spec.in.
5 %global __brp_mangle_shebangs_exclude_from arc_summary.py|arcstat.py|dbufstat.py|test-runner.py|zts-report.py
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:        @ZFS_META_LICENSE@
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\n\
24 Obsoletes:      spl-kmod)
25
26 # LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
27 %ifarch ppc ppc64 ppc64le aarch64
28 %global __global_ldflags %{nil}
29 %endif
30
31 %description
32 This package contains the ZFS kernel modules.
33
34 %define kmod_name @PACKAGE@
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:        ZFS kernel module(s) devel common
43 Group:          System Environment/Kernel
44 Provides:       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
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 debuginfo}
62 %define debuginfo --enable-debuginfo
63 %else
64 %define debuginfo --disable-debuginfo
65 %endif
66
67 %setup -n %{kmod_name}-%{version}
68 %build
69 %configure \
70         --with-config=kernel \
71         --with-linux=%{ksrc} \
72         --with-linux-obj=%{kobj} \
73         %{debug} \
74         %{debuginfo}
75 make %{?_smp_mflags}
76
77 %install
78 make install \
79         DESTDIR=${RPM_BUILD_ROOT} \
80         INSTALL_MOD_DIR=extra/%{kmod_name}
81 %{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
82
83 # find-debuginfo.sh only considers executables
84 %{__chmod} u+x  %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %files -n kmod-%{kmod_name}-devel
90 %{_usrsrc}/%{kmod_name}-%{version}
91 %{_usrsrc}/spl-%{version}