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