]> git.proxmox.com Git - mirror_spl-debian.git/blob - rpm/generic/spl-dkms.spec.in
148d612edf3f1c93e7ab0973c0028e1fd6194a78
[mirror_spl-debian.git] / rpm / generic / spl-dkms.spec.in
1 %define module @PACKAGE@
2 %define mkconf scripts/dkms.mkconf
3
4 Name: %{module}-dkms
5
6 Version: @VERSION@
7 Release: @RELEASE@%{?dist}
8 Summary: Kernel module(s) (dkms)
9
10 Group: System Environment/Kernel
11 License: GPLv2+
12 URL: http://zfsonlinux.org/
13 Source0: %{module}-%{version}.tar.gz
14 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
15 BuildArch: noarch
16
17 Requires: dkms >= 2.2.0.2
18 Provides: %{module}-kmod = %{version}
19
20 %description
21 This package contains the dkms kernel modules required to emulate
22 several interfaces provided by the Solaris kernel.
23
24 %prep
25 %setup -q -n %{module}-%{version}
26
27 %build
28 %{mkconf} -n %{module} -v %{version} -f dkms.conf
29
30 %install
31 if [ "$RPM_BUILD_ROOT" != "/" ]; then
32 rm -rf $RPM_BUILD_ROOT
33 fi
34 mkdir -p $RPM_BUILD_ROOT/usr/src/
35 cp -rf ${RPM_BUILD_DIR}/%{module}-%{version} $RPM_BUILD_ROOT/usr/src/
36
37 %clean
38 if [ "$RPM_BUILD_ROOT" != "/" ]; then
39 rm -rf $RPM_BUILD_ROOT
40 fi
41
42 %files
43 %defattr(-,root,root)
44 /usr/src/%{module}-%{version}
45
46 %post
47 for POSTINST in /usr/lib/dkms/common.postinst; do
48 if [ -f $POSTINST ]; then
49 $POSTINST %{module} %{version}
50 exit $?
51 fi
52 echo "WARNING: $POSTINST does not exist."
53 done
54 echo -e "ERROR: DKMS version is too old and %{module} was not"
55 echo -e "built with legacy DKMS support."
56 echo -e "You must either rebuild %{module} with legacy postinst"
57 echo -e "support or upgrade DKMS to a more current version."
58 exit 1
59
60 %preun
61 dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
62 exit 0
63
64 %changelog
65 * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
66 - First official stable release.