Whamcloud - gitweb
LU-12214 build: fix SLES build/install 72/39972/20
authorAlexey Lyashkov <alexey.lyashkov@hpe.com>
Fri, 15 Jan 2021 15:21:15 +0000 (10:21 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 22 Jul 2021 01:49:52 +0000 (01:49 +0000)
Redhat and SuSe can have different library name for same devel,
lets drop a strong requrement to the library package name and
ask rpm to use an autoprovide option.

Test-Parameters: trivial
Test-Parameters: clientdistro=sles15sp1 ossdistro=el7.7 mdsdistro=el8.2
HPE-bug-id: LUS-7204
Fixes: e1bf37870d LU-12214 build: fix build with gss enabled
Fixes: d746e64fe1 LU-13562 build: SUSE build support for azure
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Change-Id: I7e0fe83f9090e7616ab156fa75fed4821099406e
Reviewed-on: https://review.whamcloud.com/39972
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre.spec.in

index ef2c316..453ad94 100644 (file)
 %if %{defined kdir}
        %define _take_kver 1
 %endif
+%if %{defined kobjdir}
+       %define _take_kobj 1
+%endif
 %{!?kdir:    %global kdir    /lib/modules/%{_kver}/source}
 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{_kver}/source" ]; then echo "/lib/modules/%{_kver}/build"; else echo "%{kdir}"; fi)}
 
-
-%if 0%{?suse_version} >= 1310
-       %define _flavor %(basename %{kobjdir})
+%if 0%{?suse_version} >= 1310 && %{defined _take_kobj}
+       %global _flavor %(basename "%{kobjdir}")
 %else
-       %define _flavor default
+       %global _flavor default
 %endif
 
 %if %{defined _take_kver}
 
 %global modules_fs_path /lib/modules/%{_kver}/%{kmoddir}
 # requires want to set a version including epoch
-%global krequires %(echo %{kver} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/\.aarch64$//' -e 's/-default$//' -e s/%{_flavor}//)
+%global krequires %(echo %{kver} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/\.aarch64$//' -e 's/-default$//' -e 's/-%{_flavor}//')
 
 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
        %global requires_kmod_name kmod-%{lustre_name}
 %endif
 %endif
 
-%if %{_vendor}=="redhat" || %{_vendor}=="fedora"
-       %global requires_yaml_name libyaml
-%else  #for Suse
-       %global requires_yaml_name libyaml-0-2
-%endif
-
 # RHEL >= 7 comes with systemd
 %if 0%{?rhel} >= 7
 %define with_systemd 1
@@ -189,13 +185,11 @@ BuildRoot: %{_tmppath}/lustre-%{version}-root
 %if %{with lustre_modules}
 Requires: %{requires_kmod_name} = %{requires_kmod_version}
 %endif
-Requires: zlib
-Requires: %{requires_yaml_name}
 %if %{with lustre_tests_lutf}
 Requires: python3 >= 3.6.0
 BuildRequires: python3-devel >= 3.6.0, swig
 %endif
-BuildRequires: libtool libyaml-devel zlib-devel libnl3-devel binutils-devel
+BuildRequires: libtool libyaml-devel zlib-devel libnl3-devel
 %if %{_vendor}=="redhat"
 BuildRequires: redhat-rpm-config
 BuildRequires: pkgconfig