]> git.proxmox.com Git - mirror_zfs-debian.git/blame - rpm/generic/zfs-dkms.spec.in
Imported Upstream version 0.6.4.2
[mirror_zfs-debian.git] / rpm / generic / zfs-dkms.spec.in
CommitLineData
ea04106b
AX
1%{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
2
f3757573
BB
3%define module @PACKAGE@
4%define mkconf scripts/dkms.mkconf
5
6Name: %{module}-dkms
7
8Version: @VERSION@
9Release: @RELEASE@%{?dist}
10Summary: Kernel module(s) (dkms)
11
12Group: System Environment/Kernel
13License: @ZFS_META_LICENSE@
14URL: http://zfsonlinux.org/
15Source0: %{module}-%{version}.tar.gz
16BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17BuildArch: noarch
18
a08ee875 19Requires: dkms >= 2.2.0.3-20
68a2e016 20Requires: spl-dkms = %{version}
c06d4368
AX
21Requires: gcc, make, perl
22Requires: kernel-devel
f3757573 23Provides: %{module}-kmod = %{version}
f3757573
BB
24
25%description
26This package contains the dkms ZFS kernel modules.
27
28%prep
29%setup -q -n %{module}-%{version}
30
31%build
32%{mkconf} -n %{module} -v %{version} -f dkms.conf
33
34%install
35if [ "$RPM_BUILD_ROOT" != "/" ]; then
36 rm -rf $RPM_BUILD_ROOT
37fi
38mkdir -p $RPM_BUILD_ROOT/usr/src/
39cp -rf ${RPM_BUILD_DIR}/%{module}-%{version} $RPM_BUILD_ROOT/usr/src/
40
41%clean
42if [ "$RPM_BUILD_ROOT" != "/" ]; then
43 rm -rf $RPM_BUILD_ROOT
44fi
45
46%files
47%defattr(-,root,root)
48/usr/src/%{module}-%{version}
49
50%post
51for POSTINST in /usr/lib/dkms/common.postinst; do
52 if [ -f $POSTINST ]; then
53 $POSTINST %{module} %{version}
54 exit $?
55 fi
56 echo "WARNING: $POSTINST does not exist."
57done
58echo -e "ERROR: DKMS version is too old and %{module} was not"
59echo -e "built with legacy DKMS support."
60echo -e "You must either rebuild %{module} with legacy postinst"
61echo -e "support or upgrade DKMS to a more current version."
62exit 1
63
64%preun
ea04106b
AX
65# Only remove the modules if they are for this %{version}-%{release}. A
66# package upgrade can replace them if only the %{release} is changed.
67RELEASE="/var/lib/dkms/%{module}/%{version}/build/%{module}.release"
68if [ -f $RELEASE ] && [ `cat $RELEASE`%{?dist} = "%{version}-%{release}" ]; then
69 echo -e
70 echo -e "Uninstall of %{module} module (version %{version}) beginning:"
71 dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
72fi
f3757573
BB
73exit 0
74
75%changelog
ea04106b
AX
76* %(date "+%a %b %d %Y") %packager %{version}-%{release}
77- Automatic build by DKMS