lapack/lapack.spec
Stephan Kulow 96bba20005 Accepting request 112135 from devel:libraries:c_c++
- Fixed building on openSUSE 11.4 by fixing defattr
- Made the package groups consistent: Development/Libraries/Parallel
- Cleaned up spec file formatting
- Made all requires use the new package naming (forwarded request 112040 from TheBlackCat)

OBS-URL: https://build.opensuse.org/request/show/112135
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lapack?expand=0&rev=24
2012-04-12 07:36:39 +00:00

311 lines
11 KiB
RPMSpec

#
# spec file for package lapack
#
# Copyright (c) 2012 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: lapack
Version: 3.4.0
%define sonum 3
Release: 0
Summary: Linear Algebra Package
License: BSD-3-Clause
Group: Development/Libraries/Parallel
Url: http://www.netlib.org/%{name}/
Source0: http://www.netlib.org/%{name}/%{name}-%{version}.tgz
Patch1: lapack-3.2.2.patch
BuildRequires: doxygen
BuildRequires: gcc-fortran
BuildRequires: python
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems. The associated matrix
factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are
also provided, as are related computations such as reordering of the
Schur factorizations and estimating condition numbers. Dense and banded
matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in
both single and double precision.
%package -n lib%{name}%{sonum}
Summary: LAPACK Shared Library
Group: Development/Libraries/Parallel
%description -n lib%{name}%{sonum}
LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems. The associated matrix
factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are
also provided, as are related computations such as reordering of the
Schur factorizations and estimating condition numbers. Dense and banded
matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in
both single and double precision.
%package -n libblas%{sonum}
Summary: BLAS Shared Library
Group: Development/Libraries/Parallel
%description -n libblas%{sonum}
BLAS (Basic Linear Algebra Subprograms) is a standard library for
numerical algebra. BLAS provides a number of basic algorithms for
linear algebra.
%package devel
Summary: Linear Algebra Package
Group: Development/Libraries/Parallel
Requires: blas-devel = %{version}
Requires: lib%{name}%{sonum} = %{version}
Provides: %{name} = %{version}
Provides: %{name}-devel-static = %{version}
#TODO: Change back to '<' after next version update:
Obsoletes: %{name} <= %{version}
%description devel
LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems. The associated matrix
factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are
also provided, as are related computations such as reordering of the
Schur factorizations and estimating condition numbers. Dense and banded
matrices are handled, but not general sparse matrices. In all areas,
similar functionality is provided for real and complex matrices, in
both single and double precision.
%package -n blas-devel
Summary: Basic Linear Algebra Subprograms
Group: Development/Libraries/Parallel
Requires: libblas%{sonum} = %{version}
Provides: blas = %{version}
Provides: blas-devel-static = %{version}
#TODO: Change back to '<' after next version update:
Obsoletes: blas <= %{version}
%description -n blas-devel
BLAS (Basic Linear Algebra Subprograms) is a standard library for
numerical algebra. BLAS provides a number of basic algorithms for
linear algebra. BLAS is fast and well-tested, was written in FORTRAN 77
and built with gfortran. BLAS manual pages are available in the
blas-man package.
%package man
Summary: Manpages for LAPACK
Group: Development/Libraries/Parallel
Provides: %{name}-manpages = %{version}
Obsoletes: %{name}-manpages < %{version}
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description man
Manpages for LAPACK
%package -n blas-man
Summary: Documentation for BLAS (Basic Linear Algebra Subprograms)
Group: Development/Libraries/Parallel
Provides: blasman = %{version}
Obsoletes: blasman < %{version}
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description -n blas-man
The blas-man package contains documentation for BLAS (Basic Linear
Algebra subprograms) routines, in the form of man pages.
%prep
%setup -q
%patch1
%build
case "$RPM_ARCH" in
i[0-9]86) PRECFLAGS="-ffloat-store" ;;
*) PRECFLAGS="" ;;
esac
export PRECFLAGS
cp make.inc.example make.inc
make cleanlib
make %{?_smp_mflags} blaslib \
OPTS="%{optflags} -fPIC" \
NOOPT="%{optflags} -O0 -fPIC"
mv librefblas.a libblas_pic.a
mkdir tmp
( cd tmp; ar x ../libblas_pic.a )
gfortran -shared -Wl,-soname=libblas.so.3 -o libblas.so.%{version} tmp/*.o
ln -s libblas.so.%{version} libblas.so
rm -rf tmp
make cleanlib
make %{?_smp_mflags} blaslib \
OPTS="%{optflags}" \
NOOPT="%{optflags} -O0"
make blas_testing \
OPTS="%{optflags} $PRECFLAGS" \
NOOPT="%{optflags} $PRECFLAGS -O0"
if grep -B15 -A15 FAIL BLAS/*.out; then
echo
echo "blas_testing FAILED"
echo
false
else
true # No failures
fi
mv librefblas.a libblas.a
make cleanlib
make %{?_smp_mflags} lapacklib \
OPTS="%{optflags} -fPIC" \
NOOPT="%{optflags} -O0 -fPIC"
mv liblapack.a liblapack_pic.a
mkdir tmp
( cd tmp; ar x ../liblapack_pic.a )
gfortran -shared -Wl,-soname=liblapack.so.3 -o liblapack.so.%{version} tmp/*.o -L. -lblas
ln -s liblapack.so.%{version} liblapack.so
rm -rf tmp
make cleanlib
make %{?_smp_mflags} lapacklib \
OPTS="%{optflags}" \
NOOPT="%{optflags} -O0"
ln -s libblas.a librefblas.a
make lapack_testing \
OPTS="%{optflags} $PRECFLAGS" \
NOOPT="%{optflags} $PRECFLAGS -O0"
if grep -B15 -A15 FAIL TESTING/*.out; then
echo
echo "lapack_testing FAILED"
echo
false
else
true # No failures
fi
# Create man pages - and do some cleanup
make man
rm -f DOCS/man/man3/*tst*
rm -f DOCS/man/man3/TST*
rm -f DOCS/man/man3/MYSUB.3
rm -f DOCS/man/man3/INSTALL_lsame.f.3
rm -f DOCS/man/man3/xerbla.f.3
rm -f DOCS/man/man3/xerbla_array.f.3
rm -f DOCS/man/man3/*_.3
rm -f DOCS/man/man3/dsecnd_*.3
rm -f DOCS/man/man3/DSECND.3
rm -f DOCS/man/man3/second_*3
rm -f DOCS/man/man3/SECOND.3
rm -f DOCS/man/man3/LAPACK_version.f.3
rm -f DOCS/man/man3/SRC_ilaver.f.3
rm -f DOCS/man/man3/SRC_xerbla.f.3
rm -f DOCS/man/man3/SRC_xerbla_array.f.3
rm -f DOCS/man/man3/SLAMC2.3.gz
rm -f DOCS/man/man3/SLAMC3.3.gz
rm -f DOCS/man/man3/SLAMC4.3.gz
rm -f DOCS/man/man3/SLAMC5.3.gz
rm -f DOCS/man/man3/DLAMC2.3.gz
rm -f DOCS/man/man3/DLAMC3.3.gz
rm -f DOCS/man/man3/DLAMC4.3.gz
rm -f DOCS/man/man3/DLAMC5.3.gz
mv DOCS/man/man3/BLAS_SRC_lsame.f.3 DOCS/man/man3/lsame.f.3
mv DOCS/man/man3/BLAS_SRC_xerbla.f.3 DOCS/man/man3/xerbla.f.3
mv DOCS/man/man3/BLAS_SRC_xerbla_array.f.3 DOCS/man/man3/xerbla_array.f.3
mv DOCS/man/man3/INSTALL_ilaver.f.3 DOCS/man/man3/ilaver.f.3
%install
install -d %{buildroot}/%{_libdir}
install -m 644 libblas.a %{buildroot}/%{_libdir}
install -m 644 libblas_pic.a %{buildroot}/%{_libdir}
install -m 644 liblapack.a %{buildroot}/%{_libdir}
install -m 644 liblapack_pic.a %{buildroot}/%{_libdir}
install -m 755 libblas.so.%{version} %{buildroot}/%{_libdir}
ln -s libblas.so.%{version} %{buildroot}/%{_libdir}/libblas.so.3
ln -s libblas.so.%{version} %{buildroot}/%{_libdir}/libblas.so
install -m 755 liblapack.so.%{version} %{buildroot}/%{_libdir}
ln -s liblapack.so.%{version} %{buildroot}/%{_libdir}/liblapack.so.3
ln -s liblapack.so.%{version} %{buildroot}/%{_libdir}/liblapack.so
install -d %{buildroot}%{_mandir}/man3
install -m 0644 DOCS/man/man3/*.3 %{buildroot}%{_mandir}/man3/
find BLAS/SRC/ -name \*.f -type f -printf "%{_mandir}/man3/%f.3.gz\n" \
> blasmans
find BLAS/SRC/ -name \*.f -type f -printf "%f\n" \
| tr 'a-z' 'A-Z' |sed -e 's#\(.*\).F#'%{_mandir}/man3/'\1.3.gz#' \
>> blasmans
find SRC/ -name \*.f -type f -printf "%{_mandir}/man3/%f.3.gz\n" \
| grep -v -E 'lsame.f|sceil.f|xerbla.f|xerbla_array.f' \
| sort -u > lapackmans
find SRC/ -name \*.f -type f -printf "%f\n" \
| grep -v -E 'sceil.f|xerbla.f|xerbla_array.f' \
| tr 'a-z' 'A-Z' |sed -e 's#\(.*\).F#'%{_mandir}/man3/'\1.3.gz#' \
| sort -u >> lapackmans
echo %{_mandir}/man3/SLAMC1.3.gz >> lapackmans
echo %{_mandir}/man3/SLAMC2.3.gz >> lapackmans
echo %{_mandir}/man3/SLAMC3.3.gz >> lapackmans
echo %{_mandir}/man3/SLAMC4.3.gz >> lapackmans
echo %{_mandir}/man3/SLAMC5.3.gz >> lapackmans
echo %{_mandir}/man3/SLAMCH.3.gz >> lapackmans
echo %{_mandir}/man3/DLAMC1.3.gz >> lapackmans
echo %{_mandir}/man3/DLAMC2.3.gz >> lapackmans
echo %{_mandir}/man3/DLAMC3.3.gz >> lapackmans
echo %{_mandir}/man3/DLAMC4.3.gz >> lapackmans
echo %{_mandir}/man3/DLAMC5.3.gz >> lapackmans
echo %{_mandir}/man3/DLAMCH.3.gz >> lapackmans
echo %{_mandir}/man3/slamch.f.3.gz >> lapackmans
echo %{_mandir}/man3/slamchf77.f.3.gz >> lapackmans
echo %{_mandir}/man3/dlamch.f.3.gz >> lapackmans
echo %{_mandir}/man3/dlamchf77.f.3.gz >> lapackmans
ln -s SLAMC1.3.gz %{buildroot}/%{_mandir}/man3/SLAMC2.3.gz
ln -s SLAMC1.3.gz %{buildroot}/%{_mandir}/man3/SLAMC4.3.gz
ln -s SLAMC1.3.gz %{buildroot}/%{_mandir}/man3/SLAMC5.3.gz
ln -s SLAMCH.3.gz %{buildroot}/%{_mandir}/man3/SLAMC3.3.gz
ln -s DLAMC1.3.gz %{buildroot}/%{_mandir}/man3/DLAMC2.3.gz
ln -s DLAMC1.3.gz %{buildroot}/%{_mandir}/man3/DLAMC4.3.gz
ln -s DLAMC1.3.gz %{buildroot}/%{_mandir}/man3/DLAMC5.3.gz
ln -s DLAMCH.3.gz %{buildroot}/%{_mandir}/man3/DLAMC3.3.gz
%post -n libblas3 -p /sbin/ldconfig
%postun -n libblas3 -p /sbin/ldconfig
%post -n liblapack3 -p /sbin/ldconfig
%postun -n liblapack3 -p /sbin/ldconfig
%files -n lib%{name}%{sonum}
%defattr(-,root,root)
%doc LICENSE README
%{_libdir}/lib%{name}.so.%{version}
%{_libdir}/lib%{name}.so.%{sonum}
%files -n libblas%{sonum}
%defattr(-,root,root)
%doc LICENSE README
%{_libdir}/libblas.so.%{version}
%{_libdir}/libblas.so.%{sonum}
%files devel
%defattr(-,root,root)
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}.a
%{_libdir}/lib%{name}_pic.a
%files -n blas-devel
%defattr(-,root,root)
%{_libdir}/libblas.so
%{_libdir}/libblas.a
%{_libdir}/libblas_pic.a
%files man -f lapackmans
%defattr(-,root,root)
%files -n blas-man -f blasmans
%defattr(-,root,root)
%changelog