Blob Blame History Raw
%global	build64 0
%if 0%{?fedora} >= 26 || 0%{?rhel} >= 7
%{!?openblas_arches:%global openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64}
%ifnarch %{openblas_arches}
# matches openblas ExclusiveArch
%bcond_without atlas
%else
%if 0%{?__isa_bits} == 64
%global	build64 1
%endif
%endif
%endif

# We are linking FORTRAN symbols.  Thus we cannot link --as-needed.
%undefine _ld_as_needed

Name:		arpack
Version:	3.7.0
Release:	1%{dist}
Summary:	Fortran 77 subroutines for solving large scale eigenvalue problems

License:	BSD
URL:		https://github.com/opencollab/arpack-ng
Source0:	https://github.com/opencollab/arpack-ng/archive/%{version}/arpack-ng-%{version}.tar.gz

BuildRequires:	gcc-c++
BuildRequires:	gcc-gfortran
%if %{with atlas}
BuildRequires:	atlas-devel
%else
BuildRequires:	openblas-devel
%endif
BuildRequires:	libtool >= 2.4.2
Provides:	arpack-ng = %{version}-%{release}
Provides:	arpack-ng%{?_isa} = %{version}-%{release}

%description
ARPACK is a collection of Fortran 77 subroutines designed to solve large
scale eigenvalue problems.

The package is designed to compute a few eigenvalues and corresponding
eigenvectors of a general n by n matrix A. It is most appropriate for
large sparse or structured matrices A where structured means that a
matrix-vector product w <- Av requires order n rather than the usual
order n**2 floating point operations. This software is based upon an
algorithmic variant of the Arnoldi process called the Implicitly
Restarted Arnoldi Method (IRAM).


%package devel
Summary:	Files needed for developing arpack based applications
Requires:	arpack%{?_isa} = %{version}-%{release}
Provides:	arpack-ng-devel = %{version}-%{release}
Provides:	arpack-ng-devel%{?_isa} = %{version}-%{release}

%description devel
ARPACK is a collection of Fortran 77 subroutines designed to solve
large scale eigenvalue problems. This package contains the so
library links used for building arpack based applications.


%package doc
Summary:	Examples for the use of arpack
BuildArch:	noarch

%description doc
This package contains examples for the use of arpack.


%package static
Summary:	Static library for developing arpack based applications
Requires:	arpack-devel%{?_isa} = %{version}-%{release}
Provides:	arpack-ng-static = %{version}-%{release}
Provides:	arpack-ng-static%{?_isa} = %{version}-%{release}

%description static
ARPACK is a collection of Fortran 77 subroutines designed to solve
large scale eigenvalue problems. This package contains the static
library and so links used for building arpack based applications.


%prep
%autosetup -c
%{__mv} arpack-ng-%{version} src
pushd src
autoreconf -vif
popd
%if %{build64}
%{__cp} -pr src src64
%endif


%build
%if %{with atlas}
%if 0%{?fedora} || 0%{?rhel} >= 7
%global blaslib -L%{_libdir}/atlas -ltatlas
%else
%global blaslib -L%{_libdir}/atlas -lf77blas -latlas
%endif
%else
%global blaslib -lopenblasp
%endif
pushd src
%configure --enable-shared --enable-static \
    --with-blas="%{blaslib}" \
    --with-lapack="%{blaslib}" \
    --enable-icb
%make_build
popd
%if %{build64}
pushd src64
%configure --enable-shared --enable-static \
    LIBSUFFIX=64_ \
    SYMBOLSUFFIX=_64 \
    INTERFACE64=1 \
    --with-blas=%{blaslib}64_ \
    --with-lapack=%{blaslib}64_ \
    --enable-icb
%make_build
popd
%endif

%install
pushd src
%make_install
popd
%if %{build64}
pushd src64
%make_install
popd
%endif
# Get rid of .la files
%{__rm} -r %{buildroot}%{_libdir}/*.la
# Get rid of generic file names (https://github.com/opencollab/arpack-ng/issues/130)
%{__rm} -f %{buildroot}%{_includedir}/debug_c.{h,hpp}
%{__rm} -f %{buildroot}%{_includedir}/stat.h
%{__rm} -f %{buildroot}%{_includedir}/stat_c.{h,hpp}
%{__rm} -f %{buildroot}%{_includedir}/debug-arpack.h

%check
#pushd src
#%%make_build check
#pushd EXAMPLES ; make clean ; popd
#popd
#%%if %{build64}
#pushd src64
#%%make_build check
#pushd EXAMPLES ; make clean ; popd
#popd
#%%endif

%ldconfig_scriptlets

%files
%doc src/CHANGES src/README.md
%license src/COPYING
%{_libdir}/libarpack.so.*
%if %{build64}
%{_libdir}/libarpack64_.so.*
%endif

%files devel
%{_libdir}/pkgconfig/arpack.pc
%{_libdir}/libarpack.so
%if %{build64}
%{_libdir}/pkgconfig/arpack64_.pc
%{_libdir}/libarpack64_.so
%endif
%{_includedir}/arpack/*

%files doc
%doc src/EXAMPLES/ src/DOCUMENTS/
%doc src/CHANGES src/README.md
%license src/COPYING


%files static
%{_libdir}/libarpack.a
%if %{build64}
%{_libdir}/libarpack64_.a
%endif


%changelog
* Tue Sep 3 2019 Devrim Gündüz <devrim@gunduz.org> 3.7.0-1
- Initial packaging for EPEL 8, using Fedora rawhide spec file.