# -*- 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 88768 2012-01-11 01:48:56Z ryandesign@macports.org $

PortSystem          1.0

name                libf2c
version             20110801
categories          lang
platforms           darwin
maintainers         ryandesign

description         library to which you must link code you have converted from Fortran to C using f2c

long_description    ${name} is the ${description}.

homepage            http://www.netlib.org/f2c/
master_sites        ${homepage}
dist_subdir         ${name}/${version}
distname            ${name}
use_zip             yes

checksums           rmd160  dfff83383f3ffc2d290d4a206dfc92abcd171050 \
                    sha256  f13c01421e9668dc86c78159d87c2f802dd1f8e62037834285c7ab77200d97d5

extract.mkdir       yes

patchfiles          patch-makefile.u.diff

use_configure       no

variant universal {}

build.args          -f makefile.u \
                    CC="${configure.cc} [get_canonical_archflags cc]" \
                    CFLAGS="${configure.cflags}"

pre-build {
    system -W ${worksrcpath} "${build.cmd} [join ${build.args}] hadd"
}

destroot.args       [join ${build.args}]
destroot.destdir    LIBDIR=${destroot}${prefix}/lib

post-destroot {
    xinstall -m 644 ${worksrcpath}/f2c.h ${destroot}${prefix}/include
}

livecheck.type      moddate
livecheck.url       [lindex ${master_sites} 0]${distfiles}
