# -*- 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

PortSystem          1.0

name                f2c
version             20240504
revision            0
checksums           rmd160  03c71c30f7cea5f7fab03e2d67216ff77b8f8611 \
                    sha256  57a2d68286369e61a513f453291423f06a241cdcd419144c3d3f391148c4c4e9 \
                    size    236609

categories          lang fortran
maintainers         {ryandesign @ryandesign} openmaintainer

description         Fortran to C converter

long_description    ${name} is a {*}${description}.

homepage            https://netlib.org/f2c/
master_sites        ${homepage}
dist_subdir         ${name}/${version}
distname            src
extract.suffix      .tgz

depends_run         port:libf2c

use_configure       no

variant universal {}

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

destroot {
    xinstall ${worksrcpath}/f2c ${destroot}${prefix}/bin
    xinstall -m 0644 ${worksrcpath}/f2c.1t ${destroot}${prefix}/share/man/man1/f2c.1
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 ${worksrcpath}/Notice ${destroot}${docdir}
}

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