3 # Set the package name prefix
5 %define module @PACKAGE@
7 %define module @PACKAGE@-client
10 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
11 %global requires_kmod_name kmod-%{module}
12 %define mkconf_options
13 %else #for Suse / Ubuntu
14 %global requires_kmod_name %{module}-kmp
15 %define mkconf_options "-k updates"
19 %define mkconf lustre/scripts/dkms.mkconf
24 Release: %{buildid}%{?dist}
25 Summary: Kernel module(s) (dkms)
27 Group: System Environment/Kernel
29 URL: http://lustre.opensfs.org/
30 Source0: @PACKAGE@-%{version}.tar.gz
31 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
34 # DKMS >= 2.2.0.3-28.git.7c3e7c5 to fully support inter-modules deps
35 # (ie, "BUILD_DEPENDS[#]=<pkg>"), and have latest DKMS fixes integrated
36 # for bugs that prevented our module to build/install.
37 Requires: dkms >= 2.2.0.3-28.git.7c3e7c5
39 # Only zfs Lustre DKMS Server is supported
40 Requires: spl-dkms >= 0.6.1
41 Requires: zfs-dkms >= 0.6.1
42 Requires: %{module}-osd-zfs-mount
43 # If client package is installed when installing server, remove it since
44 # the server package also includes the client. This can be removed if/when
45 # the packages are split into independent client/server/common packages.
46 Obsoletes: @PACKAGE@-client < %{version}
48 Requires: gcc, make, perl
49 Requires: kernel-devel
50 Provides: %{requires_kmod_name} = %{version}
51 Provides: %{module}-modules = %{version}
53 # Only zfs Lustre DKMS Server is supported
54 Provides: %{module}-osd-zfs = %{version}
55 Provides: %{module}-osd
59 This package contains the dkms Lustre kernel modules.
62 %setup -q -n @PACKAGE@-%{version}
65 %{mkconf} -n %{module} -v %{version} -f dkms.conf %{mkconf_options}
68 if [ "$RPM_BUILD_ROOT" != "/" ]; then
69 rm -rf $RPM_BUILD_ROOT
71 mkdir -p $RPM_BUILD_ROOT/usr/src/
72 cp -rfp ${RPM_BUILD_DIR}/@PACKAGE@-%{version} $RPM_BUILD_ROOT/usr/src/
73 %if %{without servers}
74 # To have the directory reflect the DKMS RPM name!
75 mv $RPM_BUILD_ROOT/usr/src/@PACKAGE@-%{version} $RPM_BUILD_ROOT/usr/src/%{module}-%{version}
79 if [ "$RPM_BUILD_ROOT" != "/" ]; then
80 rm -rf $RPM_BUILD_ROOT
85 /usr/src/%{module}-%{version}
88 for POSTINST in /usr/lib/dkms/common.postinst; do
89 if [ -f $POSTINST ]; then
90 $POSTINST %{module} %{version}
93 echo "WARNING: $POSTINST does not exist."
95 echo -e "ERROR: DKMS version is too old and %{module} was not"
96 echo -e "built with legacy DKMS support."
97 echo -e "You must either rebuild %{module} with legacy postinst"
98 echo -e "support or upgrade DKMS to a more current version."
102 dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
106 * Sat Jan 23 2016 Bruno Faccini <bruno.faccini@intel.com>
107 - detect and handle cases where [spl,zfs]-dkms packages are not built
108 - also handle on-target configure issues
109 * Wed Oct 7 2015 Bruno Faccini <bruno.faccini@intel.com>
110 - adapted for Lustre Client DKMS creation
111 - allow for on-target reconfig to prevent static deps requires
112 * Mon Apr 8 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 2.3.63-1
113 - First DKMS packages.