1 %{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
3 %if ! 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}%{?openEuler}
7 # Exclude input files from mangling
8 %global __brp_mangle_shebangs_exclude_from ^
/usr
/src
/.
*$
10 %define module @PACKAGE@
11 %define mkconf scripts
/dkms.mkconf
16 Release: @RELEASE@
%{?dist}
17 Summary: Kernel module
(s
) (dkms
)
19 Group: System Environment
/Kernel
20 License: @ZFS_META_LICENSE@
21 URL: https
://github.com
/openzfs
/zfs
22 Source0: %{module}-%{version}.tar.gz
23 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
26 Requires: dkms
>= 2.2.0.3
27 Requires(post
): dkms
>= 2.2.0.3
28 Requires(preun
): dkms
>= 2.2.0.3
29 Requires: gcc
, make, perl
, diffutils
30 Requires(post
): gcc
, make, perl
, diffutils
31 %if 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}%{?openEuler}
32 Requires: kernel
-devel
>= @ZFS_META_KVER_MIN@
, kernel
-devel
<= @ZFS_META_KVER_MAX@
.999
33 Requires(post
): kernel
-devel
>= @ZFS_META_KVER_MIN@
, kernel
-devel
<= @ZFS_META_KVER_MAX@
.999
34 Obsoletes
: spl
-dkms
<= %{version}
36 Provides: %{module}-kmod = %{version}
39 %if (0%{?fedora}%{?suse_version}%{?openEuler}) || (0%{?rhel} && 0%{?rhel} < 9)
40 # We don't directly use it, but if this isn't installed, rpmbuild as root can
43 BuildRequires
: ncompress
47 This package contains the dkms ZFS kernel modules.
50 %setup -q
-n
%{module}-%{version}
53 %{mkconf} -n %{module} -v %{version} -f dkms.conf
56 if [ "$RPM_BUILD_ROOT"
!= "
/"
]; then
57 rm -rf $RPM_BUILD_ROOT
59 mkdir -p $RPM_BUILD_ROOT
/usr
/src
/
60 cp
-rf $
{RPM_BUILD_DIR
}/%{module}-%{version} $RPM_BUILD_ROOT
/usr
/src
/
63 if [ "$RPM_BUILD_ROOT"
!= "
/"
]; then
64 rm -rf $RPM_BUILD_ROOT
69 /usr
/src
/%{module}-%{version}
72 dkms remove
-m
%{module} -v %{version} --all
75 /usr
/lib
/dkms
/common.postinst
%{module} %{version}