Whamcloud - gitweb
LU-13309 osd-ldiskfs: remove per-page object_get/put in brw
[fs/lustre-release.git] / lustre.spec.in
index 3777f6c..d896fbf 100644 (file)
@@ -15,6 +15,8 @@
 %bcond_without shared
 %bcond_without static
 %bcond_with    systemd
+%bcond_with mofed
+%bcond_without mpi
 
 # By default both gss and gss keyring are disabled.
 # gss keyring requires the gss core. If the builder
 %define with_systemd 1
 %endif
 
+%{!?mpi_name: %global mpi_name openmpi}
+
 Summary: Lustre File System
 Name: %{lustre_name}
 Version: %{version}
@@ -167,7 +171,14 @@ BuildRequires: libselinux-devel
 Requires: libselinux
 %endif
 %if %{with lustre_modules}
-
+%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
@@ -269,6 +280,18 @@ 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
+%if %{with mpi}
+%if %{mpi_name} == "mpich"
+BuildRequires: mpich-devel
+%endif
+%if %{mpi_name} == "openmpi"
+%if %{_vendor} == "redhat" || 0%{?suse_version} < 1500
+BuildRequires: openmpi-devel
+%else
+BuildRequires: openmpi2-devel
+%endif
+%endif
+%endif
 
 %description tests
 This package contains a set of test binaries and scripts that are intended
@@ -368,6 +391,9 @@ fi
 # kmod tools/scripts require %{name} directory with kernel modules
 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
 
+%{?_openmpi_load}
+%{?_mpich_load}
+
 %eval_configure $CONFIGURE_ARGS \
        %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
        %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
@@ -384,6 +410,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}
@@ -391,6 +418,9 @@ fi
 make %{?_smp_mflags} -s %{?make_args}
 
 %install
+%{?_openmpi_load}
+%{?_mpich_load}
+
 make install DESTDIR=$RPM_BUILD_ROOT
 
 # RHEL's kernel_module_path macro expects that all the modules
@@ -494,12 +524,10 @@ echo '%{_bindir}/mcreate' >>lustre-tests.files
 echo '%{_bindir}/munlink' >>lustre-tests.files
 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
 echo '%{_sbindir}/wiretest' >>lustre-tests.files
-%if %{_vendor}=="redhat"
-if [ -n "@MPI_BIN@" ]; then
-       echo '@MPI_BIN@/*' >>lustre-tests.files
+if [ -n "$MPI_BIN" ]; then
+       echo "$MPI_BIN/*" >>lustre-tests.files
 fi
 %endif
-%endif
 
 %files -f lustre.files
 %defattr(-,root,root)