File dune-geometry.spec of Package dune-geometry

#
# spec file for package dune-geometry
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%define shortversion 2.7
Name:           dune-geometry
Version:        2.7.1
Release:        0
Summary:        Everything related to the DUNE reference elements
License:        GPL-2.0-only
Group:          Development/Libraries/C and C++
URL:            https://www.dune-project.org/
Source0:        http://www.dune-project.org/download/%{version}/%{name}-%{version}.tar.gz
Source1:        http://www.dune-project.org/download/%{version}/%{name}-%{version}.tar.gz.asc
BuildRequires:  Vc-devel
BuildRequires:  Vc-devel-static
BuildRequires:  cmake
BuildRequires:  dune-common-devel = %{version}
BuildRequires:  dune-common-openmpi-devel = %{version}
BuildRequires:  gcc-c++
BuildRequires:  gcc-fortran
BuildRequires:  gmp-devel
BuildRequires:  pkgconfig
BuildRequires:  tbb-devel
Requires:       dune-common = %{version}
Requires:       libdunegeometry = %{version}

%description
dune-geometry includes everything related to the DUNE reference elements.
This includes the reference elements themselves, mappings on the reference
elements (geometries), and quadratures.

%package -n libdunegeometry
Summary:        Everything related to the DUNE reference elements
Group:          System/Libraries

%description -n libdunegeometry
dune-geometry includes everything related to the DUNE reference elements.
This includes the reference elements themselves, mappings on the reference
elements (geometries), and quadratures.

%package devel
Summary:        Everything related to the DUNE reference elements
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       dune-common-devel = %{version}
Requires:       gmp-devel
Requires:       libdunegeometry = %{version}

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

%package openmpi
Summary:        Everything related to the DUNE reference elements
Group:          Development/Libraries/C and C++

%description openmpi
dune-geometry includes everything related to the DUNE reference elements.
This includes the reference elements themselves, mappings on the reference
elements (geometries), and quadratures.

%package -n libdunegeometry-openmpi
Summary:        Everything related to the DUNE reference elements
Group:          System/Libraries

%description -n libdunegeometry-openmpi
dune-geometry includes everything related to the DUNE reference elements.
This includes the reference elements themselves, mappings on the reference
elements (geometries), and quadratures.

%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:       gmp-devel
Requires:       libdunegeometry-openmpi = %{version}
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_build
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_build
cd ..

%install
for build_dir in serial openmpi; do
    cd $build_dir
    %make_install
    cd ..
done

find %{buildroot} -type f -name "*.la" -delete -print

%post -n libdunegeometry -p /sbin/ldconfig
%postun -n libdunegeometry -p /sbin/ldconfig
%post -n libdunegeometry-openmpi -p /sbin/ldconfig
%postun -n libdunegeometry-openmpi -p /sbin/ldconfig

%files
%doc README.md
%license COPYING
%{_prefix}/lib/dunecontrol/%{name}
%{_datadir}/doc/%{name}

%files -n libdunegeometry
%{_libdir}/*.so

%files devel
%{_includedir}/dune/*
%{_datadir}/%{name}/
%{_libdir}/cmake/
%{_libdir}/pkgconfig/*.pc

%files openmpi
%doc README.md
%license COPYING
%{_libdir}/mpi/gcc/openmpi2/share/doc/%{name}
%dir %{_libdir}/mpi/gcc/openmpi2/lib/dunecontrol/%{name}
%{_libdir}/mpi/gcc/openmpi2/lib/dunecontrol/%{name}/dune.module

%files -n libdunegeometry-openmpi
%{_libdir}/mpi/gcc/openmpi2/%{_lib}/*.so

%files openmpi-devel
%{_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