# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id:$

PortSystem          1.0

name                minpack
version             19961126
categories          math devel
license             bsd
platforms           darwin
maintainers         gmail.com:jjstickel openmaintainer

description         Minpack includes software for solving nonlinear equations\
    and nonlinear least squares problems.

long_description    Minpack includes software for solving nonlinear\
    equations and nonlinear least squares problems.  Five algorithmic\
    paths each include a core subroutine and an easy-to-use driver.  The\
    algorithms proceed either from an analytic specification of the\
    Jacobian matrix or directly from the problem functions.  The paths\
    include facilities for systems of equations with a banded Jacobian\
    matrix, for least squares problems with a large amount of data, and\
    for checking the consistency of the Jacobian matrix with the\
    functions.

homepage            http://www.netlib.org/minpack/
master_sites        http://ftp.debian.org/debian/pool/main/m/minpack/

set patch_version       16

distfiles           ${name}_${version}.orig.tar.gz\
    ${name}_${version}-${patch_version}.diff.gz

checksums           minpack_${version}.orig.tar.gz \
                    rmd160  a22ca3230cd3a4cf9f71774a146d456ac48aff70 \
                    sha256  afd0e514d256f053aca8b48071412a39c36ff74b76ec0d48ab3e9d9be9c48a11 \
                    minpack_${version}-${patch_version}.diff.gz \
                    rmd160  df70756913760ada08b7acbefec4f094b9c5db84 \
                    sha256  5647d2a0f3d494b56c6fb249dd159d583c864a6a4bef9ab90d1717534fdd880a

extract.only        ${name}_${version}.orig.tar.gz

worksrcdir          ${name}-${version}.orig

patchfiles           minpack_${version}-${patch_version}.diff.gz
patch.pre_args	     -p1

post-patch {
    system "chmod +x ${worksrcpath}/configure"
}

variant gcc47 conflicts gcc48 gcc49 description {Use the gcc47 compiler} {
    depends_lib-append  port:gcc47
    configure.compiler  macports-gcc-4.7
}
variant gcc48 conflicts gcc47 gcc49 description {Use the gcc48 compiler} {
    depends_lib-append  port:gcc48
    configure.compiler  macports-gcc-4.8
}
variant gcc49 conflicts gcc47 gcc48 description {Use the gcc49 compiler} {
    depends_lib-append  port:gcc49
    configure.compiler  macports-gcc-4.9
}
if { ![variant_isset gcc48] && ![variant_isset gcc49] } {
	default_variants      +gcc47
}

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -d ${docdir}
    xinstall -m 644 ${worksrcpath}/ex/file06 ${docdir}/minpack-documentation.txt
    xinstall -m 644 ${worksrcpath}/readme ${docdir}/readme
    xinstall -m 644 ${worksrcpath}/debian/copyright ${docdir}/copyright
}
