# -*- 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 55366 2009-08-09 22:59:33Z takeshi@macports.org $

PortSystem                  1.0

name                        cdo
version                     1.3.2
revision                    2
platforms                   darwin
maintainers                 takeshi
categories                  science
description                 Climate Data Operators
homepage                    http://www.mpimet.mpg.de/fileadmin/software/cdo/
master_sites                ${homepage}
checksums                   md5    596010619ee73a9ee142fd0e2c63a124         \
                            sha1   4488a834d07efa0a39d24d09dedc8f78c010af40 \
                            rmd160 26d1f0cad933875be996ca6831e31e5b25c53549
long_description \
    CDO is a collection of command line Operators               \
    to manipulate and analyse Climate Data files.               \
    Supported file formats are GRIB, netCDF, SERVICE and EXTRA. \
    There are more than 200 operators available.
depends_lib                 port:netcdf

configure.args              --with-netcdf=${prefix} \
                            --disable-dependency-tracking

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/doc
    eval xinstall -m 644 [glob ${worksrcpath}/doc/*.pdf] ${destroot}${prefix}/share/doc/${name}/doc
    foreach f {AUTHORS COPYING ChangeLog INSTALL NEWS OPERATORS README} {
        eval xinstall -m 644 [glob ${worksrcpath}/${f}] ${destroot}${prefix}/share/doc/${name}
    }
}

variant netcdf4 description {enable netcdf4} {
    depends_lib-append      port:hdf5-18
    configure.args-append   --with-hdf5=${prefix} \
                            --with-szlib=${prefix}
}

livecheck.check             regex
livecheck.url               ${homepage}
livecheck.regex             {Current version is ([0-9]+\.[0-9]+\.[0-9]+)}
