Blame libmbd.spec

732f65
#
732f65
# spec file for package libmbd
732f65
#
732f65
# Copyright (c) 2022 SUSE LLC
732f65
#
732f65
# All modifications and additions to the file contributed by third parties
732f65
# remain the property of their copyright owners, unless otherwise agreed
732f65
# upon. The license for this file, and modifications and additions to the
732f65
# file, is the same license as for the pristine package itself (unless the
732f65
# license for the pristine package is not an Open Source License, in which
732f65
# case the license is the MIT License). An "Open Source License" is a
732f65
# license that conforms to the Open Source Definition (Version 1.9)
732f65
# published by the Open Source Initiative.
732f65
732f65
# Please submit bugfixes or comments via https://bugs.opensuse.org/
732f65
#
732f65
732f65
732f65
%global flavor @BUILD_FLAVOR@%{nil}
732f65
%global srcname libmbd
732f65
732f65
# SECTION MPI DEFINITIONS
732f65
%if "%{flavor}" == "mvapich2"
732f65
%global mpi_flavor mvapich2
732f65
%endif
732f65
732f65
%if "%{flavor}" == "openmpi4"
732f65
%global mpi_flavor openmpi
732f65
%define mpi_vers 4
732f65
%endif
732f65
732f65
%{?mpi_flavor:%{bcond_without mpi}}%{!?mpi_flavor:%{bcond_with mpi}}
732f65
%{?with_mpi:%{!?mpi_flavor:error "No MPI family specified!"}}
732f65
732f65
%if %{with mpi}
732f65
%define my_prefix  %{_libdir}/mpi/gcc/%{mpi_flavor}%{?mpi_vers}
732f65
%define my_bindir  %{my_prefix}/bin
732f65
%define my_libdir  %{my_prefix}/%{_lib}
732f65
%define my_incdir  %{my_prefix}/include
732f65
%define my_datadir %{my_prefix}/share
732f65
%define my_suffix  -%{mpi_flavor}%{?mpi_vers}
732f65
%else
732f65
%define my_prefix  %{_prefix}
732f65
%define my_bindir  %{_bindir}
732f65
%define my_libdir  %{_libdir}
732f65
%define my_incdir  %{_includedir}
732f65
%define my_datadir %{_datadir}
732f65
%endif
732f65
# /SECTION MPI DEFINITIONS
732f65
732f65
Name:           %{srcname}%{?my_suffix}
732f65
Version:        0.12.6
732f65
Release:        0
732f65
Summary:        Many-body dispersion library
732f65
License:        MPL-2.0
732f65
URL:            https://github.com/libmbd/libmbd
732f65
Source:         %{url}/releases/download/%{version}/%{srcname}-%{version}.tar.gz
732f65
BuildRequires:  cmake
732f65
BuildRequires:  gcc-fortran
732f65
BuildRequires:  lapack-devel
732f65
%if %{with mpi}
732f65
BuildRequires:  %{mpi_flavor}%{?mpi_vers}-devel
732f65
BuildRequires:  scalapack%{?my_suffix}-devel
732f65
%if 0%{?suse_version} >= 1550 && "%{flavor}" != "mvapich2"
732f65
BuildRequires:  %{mpi_flavor}%{?mpi_vers}-config
732f65
%endif
732f65
%endif
732f65
732f65
%description
732f65
Libmbd implements the many-body dispersion (MBD) method in several programming
732f65
languages and frameworks. This is the reference implementation in Fortran and
732f65
C.
732f65
732f65
%package devel
732f65
Summary:        Many-body dispersion library -- headers and sources
732f65
Requires:       %{name} = %{version}
732f65
%if %{with mpi}
732f65
Requires:       scalapack%{?my_suffix}-devel
732f65
%endif
732f65
732f65
%description devel
732f65
Libmbd implements the many-body dispersion (MBD) method in several programming
732f65
languages and frameworks. This is the reference implementation in Fortran and
732f65
C.
732f65
732f65
This package provides the files needed for developing against %{name}.
732f65
732f65
%prep
732f65
%autosetup -p1 -n %{srcname}-%{version}
732f65
732f65
%build
732f65
%if %{with mpi}
732f65
source %{my_bindir}/mpivars.sh
732f65
%endif
732f65
732f65
%cmake -DCMAKE_INSTALL_PREFIX:PATH=%{my_prefix}                     \
732f65
       -DCMAKE_PREFIX_PATH:PATH=%{my_prefix}                        \
732f65
       -DCMAKE_INSTALL_LIBDIR:PATH=%{my_libdir}                     \
732f65
       -DENABLE_SCALAPACK_MPI:BOOL=%{?with_mpi:ON}%{!?with_mpi:OFF} \
732f65
       -DSCALAPACK_LIBRARY:PATH=%{my_libdir}/libscalapack.so        \
732f65
       %{nil}
732f65
%cmake_build
732f65
732f65
%install
732f65
%cmake_install
732f65
732f65
%post -p /sbin/ldconfig
732f65
%postun -p /sbin/ldconfig
732f65
732f65
%files
732f65
%{my_libdir}/libmbd.so
732f65
732f65
%files devel
732f65
%license LICENSE
732f65
%doc README.md
732f65
%{my_incdir}/mbd
732f65
%if %{with mpi}
732f65
%dir %{my_libdir}/cmake
732f65
%endif
732f65
%{my_libdir}/cmake/mbd/
732f65
732f65
%changelog