File dune-localfunctions.spec of Package dune-localfunctions

#
# spec file for package dune-localfunctions
#
# Copyright (c) 2022 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           dune-localfunctions
Version:        2.9.0
%define shortversion 2.9
Release:        0
Summary:        An interface and implementation for shape functions defined on the DUNE
License:        GPL-2.0
Group:          Development/Libraries/C and C++
Url:            https://www.dune-project.org/
Source0:        https://www.dune-project.org/download/%{version}/%{name}-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  dune-common-devel = %{version}
BuildRequires:  dune-geometry-devel = %{version}
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  gcc-fortran
BuildRequires:  tbb-devel
BuildRequires:  Vc-devel
BuildRequires:  Vc-devel-static
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       dune-common = %{version}
Requires:       dune-geometry = %{version}

%description
dune-localfunctions provides interface and implementation for shape functions
defined on the DUNE reference elements. In addition to the shape function,
interpolation operators and special keys are provided which can be used to
assemble global function spaces on finite-element localfunctions. 

%package devel
Summary:        Development and header files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       dune-common-devel = %{version}
Requires:       dune-geometry-devel = %{version}

%description devel
This package contains the development and header files for %{name}.

%package openmpi
Summary:        A discretisation module based on DUNE
Group:          Development/Libraries/C and C++
BuildRequires:  dune-common-openmpi-devel
BuildRequires:  dune-geometry-openmpi-devel

%description openmpi
dune-localfunctions provides interface and implementation for shape functions
defined on the DUNE reference elements. In addition to the shape function,
interpolation operators and special keys are provided which can be used to
assemble global function spaces on finite-element localfunctions. 


%package openmpi-devel
Summary:        Development and header files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       %{name}-openmpi = %{version}
Requires:       dune-common-openmpi-devel = %{version}
Requires:       dune-geometry-openmpi-devel
Requires:       openmpi2-devel

%description openmpi-devel
This package contains the development and header files for %{name}.

%prep
%setup -q

mkdir serial openmpi

%build
cd serial
cmake \
    -DCMAKE_DISABLE_FIND_PACKAGE_MPI=TRUE \
    -DDUNE_INSTALL_NONOBJECTLIBDIR=lib \
    -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    ..
make %{?_smp_mflags}
cd ..

cd openmpi
cmake \
    -DBUILD_SHARED_LIBS=ON \
    -DMPI_C_COMPILER=%{_libdir}/mpi/gcc/openmpi2/bin/mpicc \
    -DDUNE_INSTALL_NONOBJECTLIBDIR=lib \
    -DCMAKE_INSTALL_PREFIX=%{_libdir}/mpi/gcc/openmpi2 \
    ..
make %{?_smp_mflags}
cd ..

%install
for build_dir in serial openmpi; do
  cd $build_dir
  make DESTDIR=%{buildroot} install
  cd ..
done

find %{buildroot} -name '*.la' -exec rm {} \;

%fdupes -s %{buildroot}%{_includedir}


%files
%defattr(-,root,root,-)
%doc COPYING README.md
%{_prefix}/lib/dunecontrol/%{name}

%files devel
%defattr(-,root,root,-)
%{_includedir}/dune/localfunctions
%{_datadir}/%{name}/
%{_prefix}/lib/cmake/
%{_prefix}/lib/pkgconfig/*.pc

%files openmpi
%defattr(-,root,root,-)
%doc COPYING README.md
%dir %{_libdir}/mpi/gcc/openmpi2/lib/dunecontrol/%{name}
%{_libdir}/mpi/gcc/openmpi2/lib/dunecontrol/%{name}/dune.module

%files openmpi-devel
%defattr(-,root,root,-)
%{_libdir}/mpi/gcc/openmpi2/include/*
%{_libdir}/mpi/gcc/openmpi2/share/%{name}/
%{_libdir}/mpi/gcc/openmpi2/lib/cmake
%dir %{_libdir}/mpi/gcc/openmpi2/lib/pkgconfig
%{_libdir}/mpi/gcc/openmpi2/lib/pkgconfig/*.pc

%changelog
openSUSE Build Service is sponsored by