# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=2 inherit fortran eutils toolchain-funcs flag-o-matic autotools DESCRIPTION="A library of F90 routines to read/write the ETSF file format" SRC_URI="http://www.etsf.eu/sites/default/files/${P}.tar_.gz" HOMEPAGE="http://www.etsf.eu/resources/software/libraries_and_tools" LICENSE="LGPL" SLOT="0" IUSE="examples" KEYWORDS="~amd64 ~x86" RDEPEND="sci-libs/netcdf" DEPEND="${RDEPEND}" src_unpack() { tar xf ${DISTDIR}/${A} } pkg_setup() { if use fortran ; then FORTRAN="gfortran ifc pgf90" fortran_pkg_setup fi } src_configure() { use debug || append-cppflags -DNDEBUG local myconf case "${FORTRANC}" in pgf90) myconf="${myconf} FC=pgf90 F90=pgf90" ;; ifc|ifort) myconf="${myconf} FC=ifort F90=ifort" ;; *) myconf="${myconf} FC=gfortran F90=gfortran" export F90FLAGS="-i4 ${F90FLAGS}" ;; esac # fortran 90 uses FCFLAGS export FCFLAGS="${FFLAGS:--O2}" econf \ --prefix=/usr \ $(use_enable examples build-tutorials) \ --with-netcdf-ldflags="-L/usr/lib -lnetcdff" \ --with-moduledir=/usr/include \ ${myconf} } src_install() { emake DESTDIR="${D}" install || die "emake install failed" dodoc README NEWS COPYING AUTHORS INSTALL ChangeLog || die "dodoc failed" }