File gmm++.spec of Package gmm++

#
# spec file for package gmm++
#
# Copyright (c) 2023 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 srcname gmm
%if 0%{suse_version} < 1600
%define gccver 11
%endif
# There is an unrelated gmmlib package in Factory, so naming this gmm++ is hopefully enough to distinguish
Name:           gmm++
Version:        5.4.4
Release:        0
Summary:        A templated matrix library
License:        LGPL-3.0-or-later WITH GCC-exception-3.1
URL:            https://getfem.org/gmm/intro.html
Source:         http://download-mirror.savannah.gnu.org/releases/getfem/stable/%{srcname}-%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE reproducible.patch badshah400@gmail.com -- Substitute build user with env var BUILD_HOST (to be set before configure) and date with one generated from SOURCE_DATE_EPOCH if defined.
Patch0:         reproducible.patch
# For Patch0
BuildRequires:  libtool
# /
BuildRequires:  gcc%{?gccver}-c++
BuildRequires:  mumps-devel

%description
Gmm++ provides some basic types of sparse and dense matrices and vectors. It
provides some generic operations on them (copy, addition, multiplication,
sub-vector and sub-matrices, solvers, etc.).

%package devel
Summary:        Headers files and configuration script for gmm++ - a matrix library
Requires:       gcc%{?gccver}-c++
BuildArch:      noarch

%description devel
This package provides the headers files and configuration script necessary for
developing against gmm++.

%prep
%autosetup -p1 -n %{srcname}-%{version}

%build
export CXX=g++%{?gccver:-%{gccver}}

# Test unconditionally uses mumps, so here we are...
export CXXFLAGS='%{optflags} -DGMM_USES_MUMPS -I/usr/include/mumps'

autoreconf -fvi
export BUILD_HOST='openSUSE'
%configure \
  --program-prefix=%{_bindir} \
	--enable-openmp
# Nothing to build

%install
export CXX=g++%{?gccver:-%{gccver}}
%make_install
mkdir -p %{buildroot}%{_bindir}
install -m0755 gmm-config %{buildroot}%{_bindir}/

%check
%make_build check || { cat tests/test-suite.log ; exit 1 ; }

%files devel
%license COPYING
%doc README
%{_bindir}/gmm-config
%{_includedir}/%{srcname}/

%changelog
openSUSE Build Service is sponsored by