Whamcloud - gitweb
LU-8343 build: fix kmod_version on SLES 12 21/21021/9
authorMinh Diep <minh.diep@intel.com>
Mon, 27 Jun 2016 22:51:15 +0000 (15:51 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Jul 2016 23:53:02 +0000 (23:53 +0000)
Starting SLES 12, the kernel-module-subpackage script added a 'k' in
Provides string, here is the sample

%package -n %{-n*}-kmp-%1
%define _this_kmp_version %{-v*}_k%(echo %2 | sed -r 'y/-/_/; \
%s/^(2\.6\.[0-9]+)_/\\1.0_/; # use 2.6.x.0 for mainline kernels')
Provides: %{-n*}-kmp = %_this_kmp_version

Change-Id: I5c4a8af03d70862aaca46e41b737a62491cc3cf7
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: http://review.whamcloud.com/21021
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Christopher J. Morrone <morrone2@llnl.gov>

index e12170f..c2b6ce1 100644 (file)
        %global requires_kmod_version %{version}
 %else  #for Suse
        %global requires_kmod_name %{lustre_name}-kmp
        %global requires_kmod_version %{version}
 %else  #for Suse
        %global requires_kmod_name %{lustre_name}-kmp
-       %global requires_kmod_version %{version}_%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
+       %if 0%{?suse_version} >= 1200
+               %global requires_kmod_version %{version}_k%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
+       %else
+               %global requires_kmod_version %{version}_%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
+       %endif
 Summary: Lustre File System
 Summary: Lustre File System