From: Alexey Lyashkov Date: Fri, 15 Jan 2021 15:21:15 +0000 (-0500) Subject: LU-12214 build: fix SLES build/install X-Git-Tag: 2.14.53~31 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=253a9e3bcd30bf411c57d77e137ff734eff1edb1 LU-12214 build: fix SLES build/install 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 Change-Id: I7e0fe83f9090e7616ab156fa75fed4821099406e Reviewed-on: https://review.whamcloud.com/39972 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- diff --git a/lustre.spec.in b/lustre.spec.in index ef2c316..453ad94 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -54,14 +54,16 @@ %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} @@ -122,7 +124,7 @@ %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} @@ -145,12 +147,6 @@ %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