5 # Set the package name prefix
9 %define module @PACKAGE@-all
11 %define module @PACKAGE@-zfs
14 %if %{without ldiskfs}
15 %define module @PACKAGE@-BADSTATE
17 %define module @PACKAGE@-ldiskfs
20 %define lustre_name @PACKAGE@
23 %define module @PACKAGE@-client
24 %define lustre_name @PACKAGE@-client
27 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
28 %global kmod_name kmod-%{lustre_name}
29 %define mkconf_options
30 %else #for Suse / Ubuntu
31 %global kmod_name %{lustre_name}-kmp
32 %define mkconf_options "-k updates"
36 %define mkconf lustre/scripts/dkms.mkconf
38 # There should be a better (non-arch dependent) way to require ext4
40 %define ext4_source_rpm kernel-debuginfo-common-x86_64
45 Release: %{buildid}%{?dist}
46 Summary: Kernel module(s) (dkms)
48 Group: System Environment/Kernel
50 URL: http://lustre.opensfs.org/
51 Source0: @PACKAGE@-%{version}.tar.gz
52 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
55 # DKMS >= 2.2.0.3-28.git.7c3e7c5 to fully support inter-modules deps
56 # (ie, "BUILD_DEPENDS[#]=<pkg>"), and have latest DKMS fixes integrated
57 # for bugs that prevented our module to build/install.
58 Requires: dkms >= 2.2.0.3-28.git.7c3e7c5
60 Requires: libyaml-devel
62 # If client package is installed when installing server, remove it since
63 # the server package also includes the client. This can be removed if/when
64 # the packages are split into independent client/server/common packages.
65 Obsoletes: @PACKAGE@-client < %{version}
67 Requires: spl-dkms >= 0.6.5
68 Requires: zfs-dkms >= 0.6.5
69 Requires: @PACKAGE@-osd-zfs-mount
70 Conflicts: @PACKAGE@-ldiskfs-dkms
71 Conflicts: @PACKAGE@-client-dkms
72 # lustre-zfs-dkms replicates the functionality old lustre-dkms package
73 Provides: @PACKAGE@-dkms
74 Obsoletes: @PACKAGE@-dkms
78 Requires: %{ext4_source_rpm}
79 Requires: @PACKAGE@-osd-ldiskfs-mount
80 Conflicts: @PACKAGE@-zfs-dkms
81 Conflicts: @PACKAGE@-client-dkms
82 %if "%{module}" != "@PACKAGE@-all"
83 Conflicts: @PACKAGE@-dkms
86 %if "%{module}" != "@PACKAGE@-all"
87 Conflicts: @PACKAGE@-all-dkms
90 Requires: gcc, make, perl
91 Requires: kernel-devel
92 Provides: %{kmod_name} = %{version}
93 Provides: @PACKAGE@-modules = %{version}
96 Provides: @PACKAGE@-osd-zfs = %{version}
99 Provides: @PACKAGE@-osd-ldiskfs = %{version}
101 Provides: @PACKAGE@-osd
103 Provides: @PACKAGE@-client
107 This package contains the dkms Lustre kernel modules.
110 The required %{ext4_source_rpm} package is available from
111 the repository with other debuginfo rpms.
115 %setup -q -n @PACKAGE@-%{version}
118 %{mkconf} -n %{module} -v %{version} -f dkms.conf %{mkconf_options}
121 if [ "$RPM_BUILD_ROOT" != "/" ]; then
122 rm -rf $RPM_BUILD_ROOT
124 mkdir -p $RPM_BUILD_ROOT/usr/src/
125 cp -rfp ${RPM_BUILD_DIR}/@PACKAGE@-%{version} $RPM_BUILD_ROOT/usr/src/
126 mv $RPM_BUILD_ROOT/usr/src/@PACKAGE@-%{version} $RPM_BUILD_ROOT/usr/src/%{module}-%{version}
129 if [ "$RPM_BUILD_ROOT" != "/" ]; then
130 rm -rf $RPM_BUILD_ROOT
134 %defattr(-,root,root)
135 /usr/src/%{module}-%{version}
138 for POSTINST in /usr/lib/dkms/common.postinst; do
139 if [ -f $POSTINST ]; then
140 $POSTINST %{module} %{version}
143 echo "WARNING: $POSTINST does not exist."
145 echo -e "ERROR: DKMS version is too old and %{module} was not"
146 echo -e "built with legacy DKMS support."
147 echo -e "You must either rebuild %{module} with legacy postinst"
148 echo -e "support or upgrade DKMS to a more current version."
152 dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
156 * Wed May 16 2018 Joe Grund <joe.grund@intel.com>
157 - Add patch requirement
158 * Mon Aug 1 2016 Nathaniel Clark <nathaniel.l.clark@intel.com>
159 - Add option to build either ldiskfs or zfs flavour of server version
160 * Sat Jan 23 2016 Bruno Faccini <bruno.faccini@intel.com>
161 - detect and handle cases where [spl,zfs]-dkms packages are not built
162 - also handle on-target configure issues
163 * Wed Oct 7 2015 Bruno Faccini <bruno.faccini@intel.com>
164 - adapted for Lustre Client DKMS creation
165 - allow for on-target reconfig to prevent static deps requires
166 * Mon Apr 8 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 2.3.63-1
167 - First DKMS packages.