]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/redhat/zfs-kmod.spec.in
Fix systemd spec file macros
[mirror_zfs.git] / 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
45 %description -n kmod-%{kmod_name}-devel
46 This package provides the header files and objects to build kernel modules.
47
48 %prep
49 if ! [ -d "%{ksrc}" ]; then
50 echo "Kernel build directory isn't set properly, cannot continue"
51 exit 1
52 fi
53
54 %if %{with debug}
55 %define debug --enable-debug
56 %else
57 %define debug --disable-debug
58 %endif
59
60 %if %{with debuginfo}
61 %define debuginfo --enable-debuginfo
62 %else
63 %define debuginfo --disable-debuginfo
64 %endif
65
66 %setup -n %{kmod_name}-%{version}
67 %build
68 %configure \
69 --with-config=kernel \
70 --with-linux=%{ksrc} \
71 --with-linux-obj=%{kobj} \
72 %{debug} \
73 %{debuginfo}
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 # find-debuginfo.sh only considers executables
83 %{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %files -n kmod-%{kmod_name}-devel
89 %{_usrsrc}/%{kmod_name}-%{version}
90 %{_usrsrc}/spl-%{version}