1 %{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
3 %if ! 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
7 %define module @PACKAGE@
8 %define mkconf scripts
/dkms.mkconf
10 # Python permits the !/usr/bin/python shebang for scripts that are cross
11 # compatible between python2 and python3, but Fedora 28 does not. Fedora
12 # wants us to choose python3 for cross-compatible scripts. Since we want
13 # to support python2 and python3 users, exclude our scripts from Fedora 28's
14 # RPM build check, so that we don't get a bunch of build warnings.
16 # Details: https://github.com/zfsonlinux/zfs/issues/7360
18 %global __brp_mangle_shebangs_exclude_from splslab.py
23 Release: @RELEASE@
%{?dist}
24 Summary: Kernel module
(s
) (dkms
)
26 Group: System Environment
/Kernel
28 URL: http
://zfsonlinux.org
/
29 Source0: %{module}-%{version}.tar.gz
30 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
33 Requires: dkms
>= 2.2.0.2
34 Requires: gcc
, make, perl
35 %if 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
36 Requires: kernel
-devel
38 Provides: %{module}-kmod = %{version}
41 This package contains the dkms kernel modules required to emulate
42 several interfaces provided by the Solaris kernel.
45 %setup -q
-n
%{module}-%{version}
48 %{mkconf} -n %{module} -v %{version} -f dkms.conf
51 if [ "$RPM_BUILD_ROOT"
!= "
/"
]; then
52 rm -rf $RPM_BUILD_ROOT
54 mkdir -p $RPM_BUILD_ROOT
/usr
/src
/
55 cp
-rf $
{RPM_BUILD_DIR
}/%{module}-%{version} $RPM_BUILD_ROOT
/usr
/src
/
58 if [ "$RPM_BUILD_ROOT"
!= "
/"
]; then
59 rm -rf $RPM_BUILD_ROOT
64 /usr
/src
/%{module}-%{version}
67 for POSTINST
in /usr
/lib
/dkms
/common.postinst
; do
68 if [ -f $POSTINST
]; then
69 $POSTINST
%{module} %{version}
72 echo "WARNING
: $POSTINST does not exist."
74 echo -e "ERROR
: DKMS version is too old and
%{module} was not"
75 echo -e "built with legacy DKMS support."
76 echo -e "You must either rebuild
%{module} with legacy postinst"
77 echo -e "support or upgrade DKMS to a more current version."
81 CONFIG_H
="
/var
/lib
/dkms
/%{module}/%{version}/*/*/%{module}_config.h"
82 SPEC_META_ALIAS
="@PACKAGE@
-@VERSION@
-@RELEASE@"
83 DKMS_META_ALIAS
=`cat $CONFIG_H
2>/dev
/null |
84 awk
-F'"' '
/META_ALIAS
/ { print $
2; exit 0 }'`
85 if [ "$SPEC_META_ALIAS"
= "$DKMS_META_ALIAS"
]; then
87 echo -e "Uninstall of
%{module} module
($SPEC_META_ALIAS
) beginning
:"
88 dkms remove
-m
%{module} -v %{version} --all %{!?not_rpm:--rpm_safe_upgrade}
93 * %
(date "
+%a %b %d %Y"
) %packager %{version}-%{release}
94 - Automatic build by DKMS