%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}
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
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
# 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} \
%{!?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}
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
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)