]> git.proxmox.com Git - mirror_spl-debian.git/blob - rpm/generic/spl-kmod.spec.in
b4350784d23589835c905842399d7d8380c59613
[mirror_spl-debian.git] / rpm / generic / spl-kmod.spec.in
1 %define module @PACKAGE@
2 #define repo rpmfusion
3 #define repo chaos
4
5 # (un)define the next line to either build for the newest or all current kernels
6 %define buildforkernels newest
7 #define buildforkernels current
8 #define buildforkernels akmod
9
10 %bcond_with debug
11 %bcond_with debug_log
12 %bcond_with debug_kmem
13 %bcond_with debug_kmem_tracking
14 %bcond_with atomic_spinlocks
15
16
17 Name: %{module}-kmod
18
19 Version: @VERSION@
20 Release: @RELEASE@%{?dist}
21 Summary: Kernel module(s)
22
23 Group: System Environment/Kernel
24 License: GPLv2+
25 URL: http://zfsonlinux.org/
26 Source0: %{module}-%{version}.tar.gz
27 Source10: kmodtool
28 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id} -u -n)
29
30 # The developments headers will conflict with the dkms packages.
31 Conflicts: %{module}-dkms
32
33 %if %{defined repo}
34
35 # Building for a repository use the proper build-sysbuild package
36 # to determine which kernel-devel packages should be installed.
37 BuildRequires: %{_bindir}/kmodtool
38 %{!?kernels:BuildRequires: buildsys-build-%{repo}-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu}}
39
40 %else
41
42 # Building local packages attempt to to use the installed kernel.
43 %{?rhel:BuildRequires: kernel-devel}
44 %{?fedora:BuildRequires: kernel-devel}
45 %{?suse_version:BuildRequires: kernel-source}
46
47 %if !%{defined kernels} && !%{defined build_src_rpm}
48 %if 0%{?rhel}%{?fedora}%{?suse_version}
49 %define kernels %(ls -1 /usr/src/kernels)
50 %else
51 %define kernels %(ls -1 /lib/modules)
52 %endif
53 %endif
54 %endif
55
56 # LDFLAGS are not sanitized by arch/powerpc/Makefile (unlike other arches)
57 %ifarch ppc ppc64 ppc64le
58 %global __global_ldflags %{nil}
59 %endif
60
61 %if 0%{?fedora} >= 17
62 %define prefix /usr
63 %endif
64
65 # Kmodtool does its magic here. A patched version of kmodtool is shipped
66 # because the latest versions may not be available for your distribution.
67 # https://bugzilla.rpmfusion.org/show_bug.cgi?id=2714
68 %{expand:%(bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) }
69
70
71 %description
72 This package contains the kernel modules required to emulate
73 several interfaces provided by the Solaris kernel.
74
75 %prep
76 # Error out if there was something wrong with kmodtool.
77 %{?kmodtool_check}
78
79 # Print kmodtool output for debugging purposes:
80 bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null
81
82 %if %{with debug}
83 %define debug --enable-debug
84 %else
85 %define debug --disable-debug
86 %endif
87
88 %if %{with debug_log}
89 %define debug_log --enable-debug-log
90 %else
91 %define debug_log --disable-debug-log
92 %endif
93
94 %if %{with debug_kmem}
95 %define debug_kmem --enable-debug-kmem
96 %else
97 %define debug_kmem --disable-debug-kmem
98 %endif
99
100 %if %{with debug_kmem_tracking}
101 %define debug_kmem_tracking --enable-debug-kmem-tracking
102 %else
103 %define debug_kmem_tracking --disable-debug-kmem-tracking
104 %endif
105
106 %if %{with atomic_spinlocks}
107 %define atomic_spinlocks --enable-atomic-spinlocks
108 %else
109 %define atomic_spinlocks --disable-atomic-spinlocks
110 %endif
111
112 # Leverage VPATH from configure to avoid making multiple copies.
113 %define _configure ../%{module}-%{version}/configure
114
115 %setup -q -c -T -a 0
116
117 for kernel_version in %{?kernel_versions}; do
118 %{__mkdir} _kmod_build_${kernel_version%%___*}
119 done
120
121 %build
122 for kernel_version in %{?kernel_versions}; do
123 cd _kmod_build_${kernel_version%%___*}
124 %configure \
125 --with-config=kernel \
126 %if 0%{?rhel}%{?fedora}
127 --with-linux="${kernel_version##*___}" \
128 --with-linux-obj="${kernel_version##*___}" \
129 %else
130 --with-linux="$( \
131 if [ -e "/lib/modules/${kernel_version%%___*}/source" ]; then \
132 echo "/lib/modules/${kernel_version%%___*}/source"; \
133 else \
134 echo "/lib/modules/${kernel_version%%___*}/build"; \
135 fi)" \
136 --with-linux-obj="/lib/modules/${kernel_version%%___*}/build" \
137 %endif
138 %{debug} \
139 %{debug_log} \
140 %{debug_kmem} \
141 %{debug_kmem_tracking} \
142 %{atomic_spinlocks}
143 make %{?_smp_mflags}
144 cd ..
145 done
146
147
148 %install
149 rm -rf ${RPM_BUILD_ROOT}
150
151 # Relies on the kernel 'modules_install' make target.
152 for kernel_version in %{?kernel_versions}; do
153 cd _kmod_build_${kernel_version%%___*}
154 make install \
155 DESTDIR=${RPM_BUILD_ROOT} \
156 %{?prefix:INSTALL_MOD_PATH=%{?prefix}} \
157 INSTALL_MOD_DIR=%{kmodinstdir_postfix}
158 cd ..
159 done
160
161 # find-debuginfo.sh only considers executables
162 chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
163 %{?akmod_install}
164
165
166 %clean
167 rm -rf $RPM_BUILD_ROOT
168
169 %changelog
170 * Mon Jun 12 2017 Tony Hutter <hutter2@llnl.gov> - 0.6.5.10-1
171 - Linux 4.12 compat: PF_FSTRANS was removed zfsonlinux/spl#614
172 - Clear PF_FSTRANS over spl_filp_fallocate() zfsonlinux/splzfsonlinux/zfs#4529
173 - glibc 2.25 compat: remove assert(X=Y) zfsonlinux/spl#610
174 - Linux 4.11 compat: remove stub for __put_task_struct zfsonlinux/spl#608
175 - Linux 4.11 compat: add linux/sched/signal.h zfsonlinux/spl#608
176 - Linux 4.11 compat: vfs_getattr() takes 4 args zfsonlinux/spl#608
177 - Fix powerpc build zfsonlinux/spl#607
178 - Linux 4.11 compat: set_task_state() removed zfsonlinux/spl#603
179 * Fri Feb 3 2017 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5.9-1
180 - Use kernel slab for vn_cache and vn_file_cache zfsonlinux/spl#599
181 - Fix splat-cred.c cred usage zfsonlinux/spl#556
182 - Fix splat memleak zfsonlinux/spl#590
183 - Fix p0 initializer zfsonlinux/spl#576
184 - Fix aarch64 type warning zfsonlinux/spl#574
185 - Linux 4.8 compat: Fix RW_READ_HELD zfsonlinux/zfs#5233
186 - Linux 4.9 compat: group_info changes zfsonlinux/spl#581
187 - Fix crgetgroups out-of-bound and misc cred fix zfsonlinux/spl#556
188 * Fri Sep 9 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.8-1
189 - Fix HAVE_MUTEX_OWNER test for kernels prior to 4.6 zfsonlinux/spl#566
190 - Add handling for kernel 4.7's CONFIG_TRIM_UNUSED_KSYMS zfsonlinux/spl#565
191 - Linux 4.8 compat: rw_semaphore atomic_long_t count zfsonlinux/spl#563
192 - Implement a proper rw_tryupgrade zfsonlinux/spl#554
193 - Add rw_tryupgrade() zfsonlinux/spl#534 zfsonlinux/zfs#4388
194 - Fix taskq_wait_outstanding re-evaluate tq_next_id zfsonlinux/spl#553
195 - Fix race between taskq_destroy and dynamic spawning thread zfsonlinux/spl#553 zfsonlinux/spl#550
196 - Use kernel provided mutex owner zfsonlinux/spl#553 zfsonlinux/spl#550
197 - Add isa_defs for MIPS zfsonlinux/spl#558
198 - Linux 4.7 compat: inode_lock() and friends zfsonlinux/spl#549
199 - Fix: handle NULL case in spl_kmem_free_track() zfsonlinux/spl#567
200 * Thu May 12 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.7-1
201 - Fix PPC build failure zfsonlinux/spl#516
202 * Tue Mar 22 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.6-1
203 - Remove artificial architecture restrictions in packaging
204 - Add support for s390[x] zfsonlinux/spl#537
205 * Wed Mar 9 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.5-1
206 - Linux 4.5 compatibility zfsonlinux/spl#524
207 - Create working debuginfo packages on Red Hat zfsonlinux/zfs#4224
208 - Allow copy-builtin to run multiple times zfsonlinux/spl#526
209 - Use safer flags for in-kernel memory allocations zfsonlinux/spl#523
210 - Fix potential deadlock in cv_wait() zfsonlinux/zfs#4106
211 - Fix livelock in shrinker zfsonlinux/zfs#3936
212 * Fri Jan 8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
213 - Build fixes on SPARC and some kernels
214 - Fix taskq dynamic spawning deadlock
215 - Fix builtin kernel builds
216 - Fix crash due to overflow in P2ROUNDUP macro
217 - Fix deadlock during direct memory reclaim
218 * Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
219 - Fix CPU hotplug zfsonlinux/spl#482
220 - Disable dynamic taskqs by default to avoid deadlock zfsonlinux/spl#484
221 * Tue Sep 29 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.2-1
222 - Released 0.6.5.2-1
223 - Fix PAX Patch/Grsec SLAB_USERCOPY panic zfsonlinux/zfs#3796
224 - Always remove during dkms uninstall/update zfsonlinux/spl#476
225 * Thu Sep 19 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.1-1
226 - Released 0.6.5.1-1, no changes from spl-0.6.5
227 * Thu Sep 10 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5-1
228 - Released 0.6.5-1, detailed release notes are available at:
229 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.6.5
230 * Wed Apr 8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1
231 - Released 0.6.4-1
232 * Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1
233 - Released 0.6.3-1
234 * Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
235 - Released 0.6.2-1
236 * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
237 - First official stable release.