Whamcloud - gitweb
LU-11720 spec: srpm should be free of kernel requiements
[fs/lustre-release.git] / lustre.spec.in
index f4f4acc..8ab88ce 100644 (file)
@@ -176,7 +176,27 @@ BuildRequires: systemd
 Userspace tools and files for the Lustre file system.
 
 %if %{with lustre_modules}
-%kernel_module_package -n %{name} -p %SOURCE1 -f %SOURCE2 default
+%if 0%{?rhel} == 7
+# until we have achieved full kABI compatibility we need to
+# restrict the kernel range that can be used to the kernel
+# version from the RHEL minor release
+# this is supposed to be done for kmods automatically but
+# RHBZ#1467319 seems to be getting in the way
+# this is true for el7.0 through el7.4
+%define preamble %{expand:%(
+TMPFILE=`mktemp`
+cat %{SOURCE1} > $TMPFILE
+kver=%{kver}
+linuxversion=${kver%%%%-*}
+linuxrelease=${kver##*-}
+kabiminor=${linuxrelease%%%%.*}
+echo "Requires:       kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> $TMPFILE
+echo $TMPFILE
+)}
+%else
+%define preamble %{SOURCE1}
+%endif
+%kernel_module_package -n %{name} -p %preamble -f %SOURCE2 default
 
 %if %{with ldiskfs}
 %kernel_module_package -n %{name}-osd-ldiskfs -p %SOURCE3 -f %SOURCE4 default
@@ -384,7 +404,6 @@ echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
 %if %{with gss_keyring}
 echo '%{_sysconfdir}/init.d/lsvcgss' >>lustre.files
 echo '%{_sysconfdir}/sysconfig/lsvcgss' >>lustre.files
-echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
 %endif
 %endif
 
@@ -392,6 +411,9 @@ echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
 %endif
 %endif
+%if %{with gss_keyring}
+echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
+%endif
 
 # fc18 needs 'x' permission for library files
 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
@@ -476,6 +498,9 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files
 %{_includedir}/linux/lustre
 %endif
 %{_sysconfdir}/udev/rules.d/99-lustre.rules
+%if %{with servers}
+%{_sysconfdir}/udev/rules.d/99-lustre-server.rules
+%endif
 %if %{with zfs}
 %config(noreplace) %{_sysconfdir}/ldev.conf
 %endif