-
Notifications
You must be signed in to change notification settings - Fork 0
/
lustre-dkms.spec.in
74 lines (61 loc) · 1.93 KB
/
lustre-dkms.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
%define module @PACKAGE@
%define buildid 1
%define mkconf lustre/scripts/dkms.mkconf
Name: %{module}-dkms
Version: @VERSION@
Release: %{buildid}%{?dist}
Summary: Kernel module(s) (dkms)
Group: System Environment/Kernel
License: GPLv2+
URL: http://lustre.opensfs.org/
Source0: %{module}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Requires: dkms >= 2.2.0.3-28.git.7c3e7c5
Requires: spl-dkms >= 0.6.1
Requires: zfs-dkms >= 0.6.1
Requires: gcc, make, perl
Requires: kernel-devel
Provides: %{module}-kmod = %{version}
Provides: %{module}-modules = %{version}
%description
This package contains the dkms Lustre kernel modules.
%prep
%setup -q -n %{module}-%{version}
%build
%{mkconf} -n %{module} -v %{version} -f dkms.conf
sed -i 's/BUILDID[[:print:]]*/BUILDID = %{buildid}/' META
sed -i 's/PRISTINE[[:print:]]*/PRISTINE = 1/' META
cp META ldiskfs/META
%install
if [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
mkdir -p $RPM_BUILD_ROOT/usr/src/
cp -rfp ${RPM_BUILD_DIR}/%{module}-%{version} $RPM_BUILD_ROOT/usr/src/
%clean
if [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
%files
%defattr(-,root,root)
/usr/src/%{module}-%{version}
%post
for POSTINST in /usr/lib/dkms/common.postinst; do
if [ -f $POSTINST ]; then
$POSTINST %{module} %{version}
exit $?
fi
echo "WARNING: $POSTINST does not exist."
done
echo -e "ERROR: DKMS version is too old and %{module} was not"
echo -e "built with legacy DKMS support."
echo -e "You must either rebuild %{module} with legacy postinst"
echo -e "support or upgrade DKMS to a more current version."
exit 1
%preun
dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
exit 0
%changelog
* Fri Apr 8 2013 Brian Behlendorf <[email protected]> - 2.3.63-1
- First DKMS packages.