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
13 Release: @RELEASE@
%{?dist}
14 Summary: Kernel module
(s
) (dkms
)
16 Group: System Environment
/Kernel
17 License: @ZFS_META_LICENSE@
18 URL: http
://zfsonlinux.org
/
19 Source0: %{module}-%{version}.tar.gz
20 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
23 Requires: dkms
>= 2.2.0.3
24 Requires: spl
-dkms
= %{version}
25 Requires: gcc
, make, perl
26 %if 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
27 Requires: kernel
-devel
29 Provides: %{module}-kmod = %{version}
33 This package contains the dkms ZFS kernel modules.
36 %setup -q
-n
%{module}-%{version}
39 %{mkconf} -n %{module} -v %{version} -f dkms.conf
42 if [ "$RPM_BUILD_ROOT"
!= "
/"
]; then
43 rm -rf $RPM_BUILD_ROOT
45 mkdir -p $RPM_BUILD_ROOT
/usr
/src
/
46 cp
-rf $
{RPM_BUILD_DIR
}/%{module}-%{version} $RPM_BUILD_ROOT
/usr
/src
/
49 if [ "$RPM_BUILD_ROOT"
!= "
/"
]; then
50 rm -rf $RPM_BUILD_ROOT
55 /usr
/src
/%{module}-%{version}
58 for POSTINST
in /usr
/lib
/dkms
/common.postinst
; do
59 if [ -f $POSTINST
]; then
60 $POSTINST
%{module} %{version}
63 echo "WARNING
: $POSTINST does not exist."
65 echo -e "ERROR
: DKMS version is too old and
%{module} was not"
66 echo -e "built with legacy DKMS support."
67 echo -e "You must either rebuild
%{module} with legacy postinst"
68 echo -e "support or upgrade DKMS to a more current version."
72 CONFIG_H
="
/var
/lib
/dkms
/%{module}/%{version}/*/*/%{module}_config.h"
73 SPEC_META_ALIAS
="@PACKAGE@
-@VERSION@
-@RELEASE@"
74 DKMS_META_ALIAS
=`cat $CONFIG_H
2>/dev
/null |
75 awk
-F'"' '
/META_ALIAS
/ { print $
2; exit 0 }'`
76 if [ "$SPEC_META_ALIAS"
= "$DKMS_META_ALIAS"
]; then
78 echo -e "Uninstall of
%{module} module
($SPEC_META_ALIAS
) beginning
:"
79 dkms remove
-m
%{module} -v %{version} --all %{!?not_rpm:--rpm_safe_upgrade}
84 * %
(date "
+%a %b %d %Y"
) %packager %{version}-%{release}
85 - Automatic build by DKMS