File metis.spec of Package metis
#
# spec file for package metis
#
# Copyright (c) 2014 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:           metis
Version:        5.1.0
%define somajor 5
Release:        0
Summary:        Serial Graph Partitioning and Fill-reducing Matrix Ordering
License:        Apache-2.0
Group:          Productivity/Scientific/Math
Url:            http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
Source0:        http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE metis-cmake.patch
Patch1:         metis-cmake.patch
# PATCH-FIX-OPENSUSE metis-programs-no-compilation-time.patch -- Fix W: file-contains-date-and-time
Patch2:         metis-programs-no-compilation-time.patch
BuildRequires:  cmake >= 2.8
BuildRequires:  gcc
BuildRequires:  gcc-c++
Recommends:     %{name}-doc = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%description
METIS is a family of programs for partitioning unstructured graphs and hypergraph
and computing fill-reducing orderings of sparse matrices. The underlying algorithms
used by METIS are based on the state-of-the-art multilevel paradigm that has been
shown to produce high quality results and scale to very large problems.
%package     -n libmetis%{somajor}
Summary:        Serial Graph Partitioning and Fill-reducing Matrix Ordering library
Group:          System/Libraries
%description -n libmetis%{somajor}
METIS library provides to partitioning unstructured graphs and hypergraph
and computing fill-reducing orderings of sparse matrices. The underlying algorithms
used by METIS are based on the state-of-the-art multilevel paradigm that has been
shown to produce high quality results and scale to very large problems.
%package        devel
Summary:        Metis development files
Group:          Development/Libraries/C and C++
Requires:       libmetis%{somajor} = %{version}
%description    devel
METIS library provides to partitioning unstructured graphs and hypergraph
and computing fill-reducing orderings of sparse matrices. The underlying algorithms
used by METIS are based on the state-of-the-art multilevel paradigm that has been
shown to produce high quality results and scale to very large problems.
This package provides development files.
%package        doc
Summary:        Metis documentation
Group:          Documentation/Other
BuildArch:      noarch
%description    doc
METIS is a family of programs for partitioning unstructured graphs and hypergraph
and computing fill-reducing orderings of sparse matrices. The underlying algorithms
used by METIS are based on the state-of-the-art multilevel paradigm that has been
shown to produce high quality results and scale to very large problems.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
# set width (32 or 64 bits) of the elementary data type, see Install.txt
sed -i 's|#define IDXTYPEWIDTH 32|#define IDXTYPEWIDTH %{__isa_bits}|' include/metis.h
%build
%cmake \
    -DCMAKE_C_FLAGS="%{optflags} -fopenmp -pthread" \
    -DCMAKE_CXX_FLAGS="%{optflags} -fopenmp -pthread" \
    ..
make %{?_smp_mflags}
%install
%cmake_install
%check
cp -p %{buildroot}%{_bindir}/* graphs
pushd graphs
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./ndmetis mdual.graph
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./mpmetis metis.mesh 2
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./gpmetis test.mgraph 4
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./gpmetis copter2.graph 4
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./graphchk 4elt.graph
popd
%post -n libmetis%{somajor} -p /sbin/ldconfig
%postun -n libmetis%{somajor} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc Changelog LICENSE.txt
%{_bindir}/*
%files -n libmetis%{somajor}
%defattr(-,root,root)
%{_libdir}/libmetis.so.%{somajor}*
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}.h
%{_libdir}/libmetis.so
%files doc
%defattr(-,root,root)
%doc manual/manual.pdf
%changelog