Whamcloud - gitweb
LU-12214 build: fix build with mofed
[fs/lustre-release.git] / lustre.spec.in
index 41fdf71..515fe2d 100644 (file)
@@ -15,6 +15,7 @@
 %bcond_without shared
 %bcond_without static
 %bcond_with    systemd
+%bcond_with mofed
 
 # By default both gss and gss keyring are disabled.
 # gss keyring requires the gss core. If the builder
@@ -154,9 +155,12 @@ BuildRequires: pkg-config
 %if %{with servers}
 Requires: lustre-osd
 Requires: lustre-osd-mount
+Obsoletes: lustre-server < %{version}
+Provides: lustre-server = %{version}-%{release}
+%endif
 Obsoletes: lustre-client < %{version}
 Provides: lustre-client = %{version}-%{release}
-%endif
+
 # GSS requires this: BuildRequires: libgssapi-devel >= 0.10
 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
 #suse don't support selinux
@@ -164,14 +168,19 @@ BuildRequires: libselinux-devel
 Requires: libselinux
 %endif
 %if %{with lustre_modules}
-
-%if 0%{?rhel} >= 8
-%if %{undefined kernel_module_package_buildreqs}
-BuildRequires: redhat-rpm-config kernel-rpm-macros elfutils-libelf-devel kmod
+%if %{with mofed}
+BuildRequires: mlnx-ofa_kernel-devel
+%if %{_vendor} == "redhat"
+Requires: kmod-mlnx-ofa_kernel
+%else
+Requires: mlnx-ofa_kernel-kmp
 %endif
 %endif
-
+%if 0%{?rhel} >= 8 && %{undefined kernel_module_package_buildreqs}
+BuildRequires: redhat-rpm-config kernel-rpm-macros elfutils-libelf-devel kmod
+%else
 BuildRequires: %kernel_module_package_buildreqs
+%endif
 %if %{_vendor}=="redhat"
 BuildRequires: redhat-rpm-config
 %endif
@@ -215,7 +224,10 @@ echo $TMPFILE
 %if %{with lustre_utils}
 %package osd-ldiskfs-mount
 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
+BuildRequires: e2fsprogs-devel
+Requires: ldiskfsprogs
 Provides: lustre-osd-mount = %{version}
+Obsoletes: lustre-osd-mount < %{version}
 Group: System Environment/Kernel
 
 %description osd-ldiskfs-mount
@@ -230,6 +242,7 @@ LDISKFS hooks for mount/mkfs into a dynamic library.
 %package osd-zfs-mount
 Summary: osd-zfs-mount contains mount's zfs specific dso.
 Provides: lustre-osd-mount = %{version}
+Obsoletes: lustre-osd-mount < %{version}
 Group: System Environment/Kernel
 
 %description osd-zfs-mount
@@ -244,7 +257,7 @@ ZFS hooks for mount/mkfs into a dynamic library.
 %package resource-agents
 Summary: HA Resuable Cluster Resource Scripts for Lustre
 Group: System Environment/Base
-Requires: lustre
+Requires: %{name}
 Requires: resource-agents
 
 %description resource-agents
@@ -256,12 +269,11 @@ environment for both Pacemaker and rgmanager.
 %package tests
 Summary: Lustre testing framework
 Group: System Environment/Kernel
-Provides: %{name}-tests = %{version}
+Provides: lustre-tests = %{version}
 %if %{with lustre_iokit}
-Requires: %{name} = %{version}, lustre-iokit
-%else
-Requires: %{name} = %{version}
+Requires: lustre-iokit
 %endif
+Requires: lustre-client = %{version}
 Requires: %{requires_kmod_name} = %{requires_kmod_version}
 Requires: %{requires_kmod_tests_name} = %{requires_kmod_version}
 Requires: attr, rsync, perl, lsof, libtool, /usr/bin/getconf
@@ -380,6 +392,7 @@ fi
        %{!?with_manpages:--disable-manpages} \
        %{!?with_systemd:--with-systemdsystemunitdir=no} \
        %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \
+       %{?with_mofed:--with-o2ib=/usr/src/ofa_kernel/default} \
        --with-linux=%{kdir} \
        --with-linux-obj=%{kobjdir} \
        --with-kmp-moddir=%{kmoddir}/%{name}
@@ -396,7 +409,7 @@ make install DESTDIR=$RPM_BUILD_ROOT
 # RHEL, we handle this here in the spec file rather than in
 # Lustre's build system.  This is not expected to bother SLES's
 # kernel_module_path macro.
-basemodpath=$RPM_BUILD_ROOT%{modules_fs_path}/%{lustre_name}
+basemodpath=$RPM_BUILD_ROOT%{modules_fs_path}/%{name}
 %if %{with ldiskfs}
 mkdir -p $basemodpath-osd-ldiskfs/fs
 mv $basemodpath/fs/osd_ldiskfs.ko $basemodpath-osd-ldiskfs/fs/osd_ldiskfs.ko
@@ -532,6 +545,7 @@ fi
 %{_mandir}/man?/*
 %endif
 %{_datadir}/lustre
+%{_datadir}/bash-completion/completions/*
 %{_includedir}/lustre
 %{_includedir}/linux/lnet
 %{_includedir}/linux/lustre