File scotch.spec of Package scotch

#
# spec file for package scotch
#
# Copyright (c) 2024 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/
#


Name:	scotch
Version:	0
%define         sover 7
Release:	0
Summary:	Graph, mesh and hypergraph partitioning library
License:	CECILL-C
Group:	Productivity/Scientific/Math
URL:	https://gitlab.inria.fr/scotch/scotch
Source:	_service
BuildRequires:	openmpi5-macros-devel
BuildRequires:	cmake
BuildRequires:	bison
BuildRequires:	fdupes
BuildRequires:	flex
BuildRequires:	libbz2-devel
BuildRequires:	make
BuildRequires:	zlib-devel
BuildRequires:	lzma-devel
BuildRequires:	libbz2-devel
BuildRequires:	gcc
BuildRequires:	gcc-c++
BuildRequires:	gcc-fortran
BuildRequires:	libopenblas_openmp-devel
BuildRequires:	blacs-openmpi5-devel
BuildRequires:	libscalapack2-openmpi5-devel
%openmpi_requires

%description
Scotch is a software package for graph and mesh/hypergraph partitioning and
sparse matrix ordering.
%package	-n	lib%name-%sover
Summary:	Graph, mesh and hypergraph partitioning library
Group:	System/Libraries

%description	-n	lib%name-%sover
Scotch is a software package for graph and mesh/hypergraph partitioning and
sparse matrix ordering.
%package devel
Summary:	Development libraries for scotch
Group:	Development/Libraries/C and C++
Requires:	lib%name-%sover = %{version}

%description	devel
This package contains development libraries for libscotch.

%prep

%setup -q -n %_sourcedir/%name-%version -T -D
%__mkdir -p %_builddir/%_sourcedir
%__ln -rs %_sourcedir/%name-%version %_builddir/%_sourcedir
%build
%setup_openmpi
export CXX=mpicxx CC=mpicc FC=mpif90
%cmake -DENABLE_TESTS=OFF \
-DINTSIZE:STRING=64 \
-DCOMMON_PTHREAD_AFFINITY_LINUX=ON \
-DSCOTCH_PARMETIS_VERSION=5 \
-DLIBSCOTCHERR=%{name}err \
-DLIBPTSCOTCHERR=pt%{name}err \
-DCMAKE_INSTALL_PREFIX:PATH=%openmpi_prefix
%cmake_build

%install
%cmake_install
%__sed -i '73a #include <stdint.h>' %{buildroot}/%openmpi_prefix/include/parmetis.h


%files
%license	LICENSE_en.txt	LICENCE_fr.txt
%doc	README.txt	README.md
%dir %openmpi_prefix
%dir %openmpi_prefix/bin
%openmpi_prefix/bin/*
%dir %openmpi_prefix/share
%dir %openmpi_prefix/share/man
%dir %openmpi_prefix/share/man/man1
%openmpi_prefix/share/man/man1/*
%files	-n	lib%name-%sover
%dir %openmpi_prefix
%dir %openmpi_prefix/%{_lib}

%openmpi_prefix/%{_lib}/lib%name.so.*
%openmpi_prefix/%{_lib}/lib%{name}err.so.*
%openmpi_prefix/%{_lib}/lib%{name}errexit.so.*

%openmpi_prefix/%{_lib}/libpt%{name}.so.*
%openmpi_prefix/%{_lib}/libpt%{name}err.so.*
%openmpi_prefix/%{_lib}/libpt%{name}errexit.so.*

%openmpi_prefix/%{_lib}/libesmumps.so.*
%openmpi_prefix/%{_lib}/libptesmumps.so.*
%openmpi_prefix/%{_lib}/lib%{name}metisv?.so.*
%openmpi_prefix/%{_lib}/libpt%{name}parmetisv?.so.*


%files	devel
%dir %openmpi_prefix/%{_lib}
%dir %openmpi_prefix/include

%openmpi_prefix/%{_lib}/lib%name.so
%openmpi_prefix/%{_lib}/lib%{name}err.so
%openmpi_prefix/%{_lib}/lib%{name}errexit.so

%openmpi_prefix/%{_lib}/libpt%{name}.so
%openmpi_prefix/%{_lib}/libpt%{name}err.so
%openmpi_prefix/%{_lib}/libpt%{name}errexit.so

%openmpi_prefix/%{_lib}/libesmumps.so
%openmpi_prefix/%{_lib}/libptesmumps.so
%openmpi_prefix/%{_lib}/lib%{name}metisv?.so
%openmpi_prefix/%{_lib}/libpt%{name}parmetisv?.so

%dir %openmpi_prefix/%{_lib}/cmake/
%openmpi_prefix/%{_lib}/cmake/%name/
%openmpi_prefix/include/*.h

%changelog

openSUSE Build Service is sponsored by