File refblas3.spec of Package refblas3
Group: Development/Libraries
Name: refblas3
Prefix: /usr
Release: 1
# Where to get the BLAS version ? Seems unversionned
Version: 3.0
Source: ftp://ftp.netlib.org/blas/blas.tgz
Patch: refblas3-make.patch
URL: http://www.netlib.org/blas
Summary: Fortran77 reference implementation of the LEVEL 1, 2, and 3 BLAS routines in all precisions
License: Freely distributable
BuildRoot: /var/tmp/refblas-buildroot
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
#BuildRequires: compat-gcc-34-g77 compat-libf2c-34
BuildRequires: gcc-gfortran
requires: gcc-gfortran
%endif
#%if 0%{?fedora_version} == 5
#BuildRequires: gcc-gfortran
#requires: gcc-gfortran
#%endif
%if 0%{?suse_version}
#BuildRequires: compat-g77
BuildRequires: gcc-fortran
requires: gcc-fortran
%endif
Packager: David Cournapeau <cournape@gmail.com>
# Common values
%define STATICBLASNAME libblas.a
%define SHAREDBLASNAME libblas.so
%define SOVERSIONMAJOR 3
%define SOVERSIONMINOR 0
%define SOVERSIONMICRO 0
%define SHAREDFULLBLASNAME %{SHAREDBLASNAME}.%{SOVERSIONMAJOR}.%{SOVERSIONMINOR}.%{SOVERSIONMICRO}
provides: %{SHAREDBLASNAME}.%{SOVERSIONMAJOR}
conflicts: blas
%define F77 gfortran
%description
The BLAS (Basic Linear Algebra Subprograms) are routines that provide standard
building blocks for performing basic vector and matrix operations. The Level 1
BLAS perform scalar, vector and vector-vector operations, the Level 2 BLAS
perform matrix-vector operations, and the Level 3 BLAS perform matrix-matrix
operations. Because the BLAS are efficient, portable, and widely available,
they are commonly used in the development of high quality linear algebra
software, LAPACK for example.
# For devel pkg
%package devel
Summary: BLAS development libraries
Group: Development/Libraries
provides: %{STATICBLASNAME}
requires: refblas3
conflicts: blas
%description devel
BLAS development libraries for applications that link statically.
%prep
%setup -c
cd BLAS
%patch -p 1
%build
cd BLAS
F77FLAGS="-W -Wall -O3 -funroll-loops" LIBSTNAME=%{STATICBLASNAME} FORTRAN=%{F77} make stlib
F77FLAGS="-W -Wall -O3 -funroll-loops" LIBSSNAME=%{SHAREDBLASNAME} FORTRAN=%{F77} make sslib
%install
rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT/usr/doc/refblas3-%{version}
mv BLAS/%{SHAREDBLASNAME} BLAS/%{SHAREDFULLBLASNAME}
install -m 644 BLAS/%{STATICBLASNAME} $RPM_BUILD_ROOT%{_libdir}
install -m 644 BLAS/%{SHAREDFULLBLASNAME} $RPM_BUILD_ROOT%{_libdir}
cd $RPM_BUILD_ROOT%{_libdir}
ln -sf %{SHAREDFULLBLASNAME} %{SHAREDBLASNAME}.%{SOVERSIONMAJOR}
ln -sf %{SHAREDFULLBLASNAME} %{SHAREDBLASNAME}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_libdir}/%{SHAREDFULLBLASNAME}
%{_libdir}/%{SHAREDBLASNAME}.%{SOVERSIONMAJOR}
%files devel
%defattr(-,root,root)
%{_libdir}/%{STATICBLASNAME}
%{_libdir}/%{SHAREDBLASNAME}