%global debug_package %{nil}

Name: spooles
Version: 2.2
Release: 1%{?dist}
Summary: SPOOLES is a library for solving sparse real and complex linear systems of equations, written in the C language using object oriented design.

License: Public Domain
URL: http://www.netlib.org/linalg/spooles/spooles.2.2.html
Source0: http://www.netlib.org/linalg/spooles/spooles.2.2.tgz
Source1: http://www.netlib.org/linalg/spooles/ReferenceManual.ps.gz
Source2: http://www.netlib.org/linalg/spooles/AllInOne.ps.gz
Source3: http://www.netlib.org/linalg/spooles/LinSol.ps.gz
Source4: http://www.netlib.org/linalg/spooles/Ordering.ps.gz
Source5: http://www.netlib.org/linalg/spooles/Eigen.ps.gz
Source6: http://www.netlib.org/linalg/spooles/PP99.ps.gz
Source7: http://www.netlib.org/linalg/spooles/Install.ps.gz
Patch0: spooles.patch

BuildRequires: gzip
BuildRequires: perl
BuildRequires: ghostscript

%description

SPOOLES is a library for solving sparse real and complex linear systems of
equations, written in the C language using object oriented design. At present,
there is the following functionality:

  Compute multiple minimum degree, generalized nested dissection and
  multisection orderings of matrices with symmetric structure.

  Factor and solve square linear systems of equations with symmetric
  structure, with or without pivoting for stability. The factorization can be
  symmetric LDLT, Hermitian LDLH, or nonsymmetric LDU. A direct factorization
  or a drop tolerance factorization can be computed. The factors and solve
  can be done in serial mode, multithreaded with Solaris or POSIX threads, or
  with MPI.

  Factor and solve overdetermined full rank systems of equations using a
  multifrontal QR factorization, in serial or using POSIX threads.

  Solve square linear systems using a variety of Krylov iterative methods.
  The preconditioner is a drop tolerance factorization, constructed with or
  without pivoting for stability.

%package devel

Summary: Development headers for SPOOLES
Requires: %{name} = %{version}-%{release}

%description devel
SPOOLES is a library for solving sparse real and complex linear systems of
equations, written in the C language using object oriented design.

This package contains the development headers for SPOOLES.

%package doc

Summary:  Documentation for SPOOLES

%description doc
SPOOLES is a library for solving sparse real and complex linear systems of
equations, written in the C language using object oriented design.

This package contains the documentation for SPOOLES.

%prep
%autosetup -c -n %{name}-%{version} -p1

%build
%make_build CFLAGS="$CFLAGS -Wno-int-conversion -Wno-error=format-security" \
            CXXFLAGS="$CXXFLAGS -Wno-int-conversion -Wno-error=format-security" lib

%install
mkdir -p %{buildroot}%{_libdir}
cp %{_builddir}/%{name}-%{version}/libspooles.so* %{buildroot}%{_libdir}
for f in $(ls *.h **/*.h); do
  d=$(dirname $f)
  mkdir -p %{buildroot}%{_includedir}/%{name}/$d
  cp $f %{buildroot}%{_includedir}/%{name}/$d
done
mkdir -p %{buildroot}%{_datadir}/%{name}
for f in %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}
do
  zcat $f | ps2pdf - %{buildroot}%{_datadir}/%{name}/$(basename $f .ps.gz).pdf
done

%files
%{_libdir}/libspooles.so*

%files devel
%{_includedir}/%{name}

%files doc
%{_datadir}/%{name}

%license 
%doc

%changelog