]> git.proxmox.com Git - mirror_spl.git/blob - rpm/generic/spl-dkms.spec.in
Refresh RPM packaging
[mirror_spl.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 Conflicts: %{module}-kmod
20
21 %description
22 This package contains the dkms kernel modules required to emulate
23 several interfaces provided by the Solaris kernel.
24
25 %prep
26 %setup -q -n %{module}-%{version}
27
28 %build
29 %{mkconf} -n %{module} -v %{version} -f dkms.conf
30
31 %install
32 if [ "$RPM_BUILD_ROOT" != "/" ]; then
33 rm -rf $RPM_BUILD_ROOT
34 fi
35 mkdir -p $RPM_BUILD_ROOT/usr/src/
36 cp -rf ${RPM_BUILD_DIR}/%{module}-%{version} $RPM_BUILD_ROOT/usr/src/
37
38 %clean
39 if [ "$RPM_BUILD_ROOT" != "/" ]; then
40 rm -rf $RPM_BUILD_ROOT
41 fi
42
43 %files
44 %defattr(-,root,root)
45 /usr/src/%{module}-%{version}
46
47 %post
48 for POSTINST in /usr/lib/dkms/common.postinst; do
49 if [ -f $POSTINST ]; then
50 $POSTINST %{module} %{version}
51 exit $?
52 fi
53 echo "WARNING: $POSTINST does not exist."
54 done
55 echo -e "ERROR: DKMS version is too old and %{module} was not"
56 echo -e "built with legacy DKMS support."
57 echo -e "You must either rebuild %{module} with legacy postinst"
58 echo -e "support or upgrade DKMS to a more current version."
59 exit 1
60
61 %preun
62 dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
63 exit 0
64
65 %changelog
66 * Tue Mar 12 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.0-1
67 - Initial dkms packaging.
68