5 # LUTF Turn off brp-python-precompile script as we don't want the python files
6 # to be compiled on installation
7 %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
9 # Set the package name prefix
13 %define module @PACKAGE@-all
15 %define module @PACKAGE@-zfs
18 %if %{without ldiskfs}
19 %define module @PACKAGE@-BADSTATE
21 %define module @PACKAGE@-ldiskfs
24 %define lustre_name @PACKAGE@
27 %define module @PACKAGE@-client
28 %define lustre_name @PACKAGE@-client
31 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "fedora"
32 %global kmod_name kmod-%{lustre_name}
33 %define mkconf_options %{nil}
36 %global kmod_name %{lustre_name}-kmp
37 %define mkconf_options -k updates
41 %define mkconf lustre/scripts/dkms.mkconf
43 # There should be a better (non-arch dependent) way to require ext4
45 %define ext4_source_rpm kernel-debuginfo-common-x86_64
50 Release: %{buildid}%{?dist}
51 Summary: Kernel module(s) (dkms)
53 Group: System Environment/Kernel
55 URL: http://lustre.opensfs.org/
56 Source0: @PACKAGE@-%{version}.tar.gz
57 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
60 # DKMS >= 2.2.0.3-28.git.7c3e7c5 to fully support inter-modules deps
61 # (ie, "BUILD_DEPENDS[#]=<pkg>"), and have latest DKMS fixes integrated
62 # for bugs that prevented our module to build/install.
63 Requires: dkms >= 2.2.0.3-28.git.7c3e7c5
64 Requires: flex bison libmount-devel libmount
66 Requires: libyaml-devel
69 Requires: libnl3-devel
71 # If client package is installed when installing server, remove it since
72 # the server package also includes the client. This can be removed if/when
73 # the packages are split into independent client/server/common packages.
74 Obsoletes: @PACKAGE@-client < %{version}
76 Requires: zfs-dkms >= 0.6.5
77 Conflicts: @PACKAGE@-ldiskfs-dkms
78 Conflicts: @PACKAGE@-client-dkms
79 # lustre-zfs-dkms replicates the functionality old lustre-dkms package
80 Provides: @PACKAGE@-dkms
81 Obsoletes: @PACKAGE@-dkms
85 Requires: %{ext4_source_rpm}
86 Conflicts: @PACKAGE@-zfs-dkms
87 Conflicts: @PACKAGE@-client-dkms
88 %if "%{module}" != "@PACKAGE@-all"
89 Conflicts: @PACKAGE@-dkms
92 %if "%{module}" != "@PACKAGE@-all"
93 Conflicts: @PACKAGE@-all-dkms
96 Requires: gcc, make, perl
97 Requires: kernel-devel
98 Provides: %{kmod_name} = %{version}
99 Provides: @PACKAGE@-modules = %{version}
102 Provides: @PACKAGE@-osd-zfs = %{version}
103 Provides: kmod-@PACKAGE@-osd-zfs = %{version}
104 Provides: @PACKAGE@-osd-zfs-mount = %{version}
107 Provides: @PACKAGE@-osd-ldiskfs = %{version}
108 Provides: kmod-@PACKAGE@-osd-ldiskfs = %{version}
109 Provides: @PACKAGE@-osd-ldiskfs-mount = %{version}
111 Provides: @PACKAGE@-osd
113 Provides: @PACKAGE@-client
117 This package contains the dkms Lustre kernel modules.
120 The required %{ext4_source_rpm} package is available from
121 the repository with other debuginfo rpms.
125 %setup -q -n @PACKAGE@-%{version}
128 %{mkconf} -n %{module} -v %{version} -f dkms.conf %{mkconf_options}
131 if [ "$RPM_BUILD_ROOT" != "/" ]; then
132 rm -rf $RPM_BUILD_ROOT
134 mkdir -p $RPM_BUILD_ROOT/usr/src/
135 cp -rfp ${RPM_BUILD_DIR}/@PACKAGE@-%{version} $RPM_BUILD_ROOT/usr/src/
136 mv $RPM_BUILD_ROOT/usr/src/@PACKAGE@-%{version} $RPM_BUILD_ROOT/usr/src/%{module}-%{version}
139 if [ "$RPM_BUILD_ROOT" != "/" ]; then
140 rm -rf $RPM_BUILD_ROOT
144 %defattr(-,root,root)
145 /usr/src/%{module}-%{version}
148 for POSTINST in /usr/lib/dkms/common.postinst; do
149 if [ -f $POSTINST ]; then
150 $POSTINST %{module} %{version}
153 echo "WARNING: $POSTINST does not exist."
155 echo -e "ERROR: DKMS version is too old and %{module} was not"
156 echo -e "built with legacy DKMS support."
157 echo -e "You must either rebuild %{module} with legacy postinst"
158 echo -e "support or upgrade DKMS to a more current version."
162 dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
166 * Wed May 16 2018 Joe Grund <joe.grund@intel.com>
167 - Add patch requirement
168 * Mon Aug 1 2016 Nathaniel Clark <nathaniel.l.clark@intel.com>
169 - Add option to build either ldiskfs or zfs flavour of server version
170 * Sat Jan 23 2016 Bruno Faccini <bruno.faccini@intel.com>
171 - detect and handle cases where [spl,zfs]-dkms packages are not built
172 - also handle on-target configure issues
173 * Wed Oct 7 2015 Bruno Faccini <bruno.faccini@intel.com>
174 - adapted for Lustre Client DKMS creation
175 - allow for on-target reconfig to prevent static deps requires
176 * Mon Apr 8 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 2.3.63-1
177 - First DKMS packages.