# -*- 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: Portfile 55900 2009-08-20 23:05:28Z ryandesign@macports.org $

PortSystem			1.0

name                qrupdate
version             1.0.1
categories          math
maintainers         nomaintainer
description         library for fast updates of QR and Cholesky decompositions
long_description \
    a Fortran library for fast updates of QR and Cholesky decompositions
homepage            http://sourceforge.net/projects/${name}/
platforms           darwin
master_sites        sourceforge

checksums           md5 73d87b081e6fb89c9dc5b0ef0773b4dc \
                    sha1 679aa98ff823332ead25b5c5c9c01210155a510d \
                    md160 d1f120ae97d840bf7b932c7d18abb54360d7d1f6

depends_build       port:gcc43

patch {
#    foreach f {Makeconf Makeconf.g95} {
#        reinplace "s|PREFIX=/usr/local|PREFIX=${prefix}|" ${worksrcpath}/${f}
#    }
#    reinplace "s|\$\(PREFIX\)|\$(DESTDIR)\$(PREFIX)|g" ${worksrcpath}/src/Makefile
    reinplace "s|gfortran|gfortran-mp-4.3|" ${worksrcpath}/Makeconf
    if {[variant_isset g95]} {
        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/Makefile
        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/src/Makefile
    }
}

use_configure       no 
build.target        lib
destroot {
    xinstall -m 644 ${worksrcpath}/lib${name}.a ${destroot}${prefix}/lib
    system "ranlib ${destroot}${prefix}/lib/lib${name}.a"
}

variant g95 description {build with g95} {
    depends_build-delete    port:gcc43
    depends_build-append    port:g95
}
