# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit fortran versionator DESCRIPTION="Model-Independent Parameter Estimation" HOMEPAGE="http://www.sspa.com/pest" SRC_URI="http://www.sspa.com/pest/download/unixpest.zip doc? ( http://www.simulistics.com/documents/pestman.pdf )" # PEST uses '_' between versions MY_PV=$(replace_all_version_separators '_') # License is poorly specified on the SSPA web site. It only says that # Pest is freeware. LICENSE="public-domain" SLOT="0" KEYWORDS="~amd64" IUSE="doc" DEPEND="app-arch/unzip" # Need a Fortran 90 compiler. FORTRAN="gfortran ifc" S="${WORKDIR}/${PN}" src_unpack() { mkdir pest cd pest unpack unixpest.zip tar xvf "${S}/pest${MY_PV}.tar" # I decided it was cleaner to make all edits with sed, rather than a patch. sed -i \ -e "s;^F90=.*;F90=${FORTRANC};" \ -e "s;^LD=.*;LD=${FORTRANC};" \ *.mak makefile sed -i \ -e "s;^FFLAGS=.*;FFLAGS=${FFLAGS:--O2 -c};" \ *.mak sed -i \ -e "s;^INSTALLDIR=.*;INSTALLDIR=${D}/usr/bin;" \ -e 's;^install :;install :\n\tinstall -d $(INSTALLDIR);' \ makefile } src_compile() { FC="${FORTRANC}" export FC make cppp || die "cppp make failed" for mfile in pest.mak ppest.mak pestutl1.mak pestutl2.mak pestutl3.mak pestutl4.mak pestutl5.mak sensan.mak mpest.mak do make -f ${mfile} all || die "${mfile} make failed" done } src_install() { emake install || die "emake install failed" if use doc ; then dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}" insinto "$dir" doins "${DISTDIR}"/pestman.pdf fi }