File dune-typetree.spec of Package dune-typetree

#
# spec file for package dune-typetree
#
# Copyright (c) 2020 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-typetree
Version:        2.7.1
Release:        0
Summary:        DUNE Module for typed tree objects
License:        GPL-2.0
Group:          Development/Libraries/C and C++
Url:            http://www.dune-project.org/
Source0:        http://www.dune-project.org/download/staging/%{version}/%{name}-%{version}-rc1.tar.gz
#Source1:        http://www.dune-project.org/download/pdelab/2.4.1/%{name}-%{version}.tar.gz.asc
BuildRequires:  cmake
BuildRequires:  dune-common-devel >= %{version}
BuildRequires:  dune-common-openmpi-devel >= %{version}
BuildRequires:  gcc-c++
BuildRequires:  gcc-fortran
BuildRequires:  pkgconfig
Requires:       dune-common >= %{version}

%description
dune-typetree is a template library for constructing and operating on statically
typed trees of objects. It is based around the idea of defining loosely coupled,
componentized algorithms.

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

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


%package openmpi
Summary:        DUNE Module for typed tree objects
Group:          Development/Libraries/C and C++
Requires:       dune-common-openmpi >= %{version}

%description openmpi
dune-typetree is a template library for constructing and operating on statically
typed trees of objects. It is based around the idea of defining loosely coupled,
componentized algorithms.

%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}

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

%prep
%setup -q -n %{name}-%{version}-rc1

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 {} \;

%clean
rm -rf %{buildroot}

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

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

%files openmpi
%defattr(-,root,root,-)
%doc COPYING README.md CHANGELOG.md
%{_libdir}/mpi/gcc/openmpi2/lib/dunecontrol/
%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