# -*- 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            libnc-dap
version         3.7.3
platforms       darwin
maintainers     takeshi
categories      science
description     an alternative implementation of Unidata's netCDF 3.6 API
master_sites    ftp://ftp.unidata.ucar.edu/pub/opendap/source/ \
                http://opendap.org/pub/source/
checksums       md5    b69f3fb1b26b65903e41c2aa832cab34         \
                sha1   785726c7920daeb11de8989753da44e166ebd8e5 \
                rmd160 d99025ad66a54d7676fe44a6a29d93c272a2e582
homepage        http://www.opendap.org/
long_description \
    The netCDF Client Library is an alternative implementation of   \
    Unidata's netCDF 3.6 API. Our version adds the capability to    \
    dereference OPeNDAP URLs. You can substitute our version of     \
    the library when linking your application and then simply pass  \
    an OPeNDAP URL in where you would normally use a file name.
patchfiles      patch-Makefile.in.diff
depends_build   port:pkgconfig
depends_lib     port:curl \
                port:libdap \
                port:libxml2

if {![variant_isset g95] && ![variant_isset gcc43]} {
    default_variants +gcc44
}

variant gcc43 conflicts g95 gcc44 description {Build using gcc43} {
    depends_build-append    port:gcc43
    configure.fc            ${prefix}/bin/gfortran-mp-4.3
}

variant gcc44 conflicts g95 gcc43 description {Build using gcc44} {
    depends_build-append    port:gcc44
    configure.fc            ${prefix}/bin/gfortran-mp-4.4
}

variant g95 conflicts gcc43 gcc44 description {Build using g95} {
    depends_build-append    port:g95
    configure.fc            ${prefix}/bin/g95
}

pre-build {
    if {[variant_isset universal]} {
        reinplace "s|single_module|single_module ${configure.universal_ldflags}|" ${worksrcpath}/libtool
    } else {
        reinplace "s|single_module|single_module ${configure.cc_archflags}|" ${worksrcpath}/libtool
    }
}