# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils fortran MyPN="${PN/-reference/}" DESCRIPTION="C interface to the BLAS" LICENSE="public-domain" HOMEPAGE="http://www.netlib.org/blas/" SRC_URI="http://www.netlib.org/blas/blast-forum/${MyPN}.tgz" SLOT="0" IUSE="" KEYWORDS="~x86" DEPEND="sys-devel/libtool virtual/blas" FORTRAN="gfortran g77 ifc" S="${WORKDIR}/CBLAS" src_unpack() { unpack ${A} epatch "${FILESDIR}"/cblas-gentoo.patch } src_compile() { RPATH="${DESTTREE}/$(get_libdir)" cd "${S}"/src make all FC="libtool --mode=compile --tag=F77 ${FORTRANC}" \ FFLAGS="${FFLAGS}" CC="libtool --mode=compile --tag=CC gcc" \ CFLAGS="${CFLAGS} -DADD_" || die "make failed" libtool --mode=link --tag=F77 ${FORTRANC} -o libcblas.la *.lo \ -rpath "${RPATH}" || die "failed to link static libraries" libtool --mode=link --tag=F77 ${FORTRANC} -shared *.lo \ -Wl,-soname -Wl,libcblas.so.0 -o libcblas.so.0.0.0 || \ die "failed to link shared libraries" } src_install() { dodir "${RPATH}" || die "failed to create lib directory" cd "${S}"/src strip --strip-unneeded libcblas.so.0.0.0 || \ die "failed strippin shared libs" strip --strip-debug .libs/libcblas.a || \ die "failed to strip static libs" exeinto "${RPATH}" doexe libcblas.so.0.0.0 || die "failed to install shared library" dosym libcblas.so.0.0.0 "${RPATH}"/libcblas.so.0 || die dosym libcblas.so.0.0.0 "${RPATH}"/libcblas.so || die libtool --mode=install install -s libcblas.la "${D}/${RPATH}"\ || die "failed to install static library" insinto "${DESTTREE}"/include doins cblas_f77.h cblas.h || die "failed to install header files" dodoc "${S}"/README || die "failed to install docs" }