File sparskit.spec of Package sparskit
#
# spec file for package sparskit
#
# 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 major 2
%define minor 0
%define libname libskit%{major}_%{minor}
Name: sparskit
Version: 2.0.0.20210601
Release: 0
Summary: A basic tool-kit for sparse matrix computations
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
URL: https://www-users.cse.umn.edu/~saad/software/SPARSKIT/
Source: https://www-users.cse.umn.edu/~saad/software/SPARSKIT/SPARSKIT2.tar.gz
# PATCH-FEATURE-OPENSUSE sparskit2-cmake.patch : cmaking sparskit thanks to debian
Patch0: sparskit2-cmake.patch
# PATCH-FIX-UPSTREAM sparskit-2.0.0-undefined-symbol.patch : add undefined symbols thanks to debian
Patch1: sparskit-2.0.0-undefined-symbol.patch
BuildRequires: blas-devel
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
%description
SPARSKIT is a package of FORTRAN subroutines for working with sparse matrices.
It includes general sparse matrix manipulation routines as well as a few
iterative solvers.
%package -n %libname
Summary: SPARSKIT Shared Library
Group: Development/Libraries/C and C++
%description -n %libname
SPARSKIT is a package of FORTRAN subroutines for working with sparse matrices.
It includes general sparse matrix manipulation routines as well as a few
iterative solvers.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}
%description devel
SPARSKIT is a package of FORTRAN subroutines for working with sparse matrices.
It includes general sparse matrix manipulation routines as well as a few
iterative solvers.
%prep
%setup -n SPARSKIT2
%patch0 -p1
%patch1 -p1
mkdir -p static shared
%build
%cmake \
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DCMAKE_SHARED_LINKER_FLAGS="-z muldefs" \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_TESTING:BOOL=OFF \
%{nil}
%cmake_build
%install
%cmake_install
# mkdir -p %{buildroot}%{_libdir}
# %install -D -m 0755 shared/libskit.so.%{version} %{buildroot}%{_libdir}/libskit.so.%{version}
# ln -s libskit.so.%{version} $RPM_BUILD_ROOT/%{_libdir}/libskit.so.%{major}.%{minor}
# ln -s libskit.so.%{version} $RPM_BUILD_ROOT/%{_libdir}/libskit.so
%check
./static/ITSOL/riters.ex
%post -n %libname -p /sbin/ldconfig
%postun -n %libname -p /sbin/ldconfig
%files -n %libname
%{_libdir}/libskit.so.%{version}
%{_libdir}/libskit.so.%{major}.%{minor}
%files devel
%doc README DOC/QUICK_REF DOC/paper.pdf
%{_libdir}/libskit.so
%changelog