# -*- 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 68041 2010-05-25 06:01:13Z takeshi@macports.org $

PortSystem 1.0

name            udunits2
version         2.1.14
distname        udunits-${version}
maintainers     takeshi
platforms       darwin
categories      science

description     Improved Unidata unit conversion libraray
long_description \
    The UDUNITS package supports units of physical quantities           \
    (e.g., meters, seconds).  Specifically, it supports conversion      \
    between string and binary representations of units,                 \
    arithmetic manipulation of units, and conversion of numeric values  \
    between compatible units. The UDUNIT-2 package differs from         \
    the original UDUNITS package in the following ways:                 \
    support for non-ASCII characters, support for logarithmic units,    \
    persistent value converters, improved API, XML unit database,       \
    and no Fortran or Perl API.

homepage        http://www.unidata.ucar.edu/software/udunits/

master_sites    ftp://ftp.unidata.ucar.edu/pub/udunits/ \
                ftp://www.gfd-dennou.org/arch-large1/ucar/unidata/pub/udunits
checksums       md5     17698289a0d6b04551fe6d6a389af41c \
                sha1    ab82f04bb284d129dd2e384cd708431451ae7e39 \
                rmd160  829c4a0547994a08508f196c21b7b584b4ef8763

depends_lib     port:expat

patch {
    reinplace "s|SUBDIRS = expat|SUBDIRS = |" ${worksrcpath}/Makefile.in
    reinplace "s|../expat/libexpat.la|${prefix}/lib/libexpat.la|" ${worksrcpath}/lib/Makefile.in
}

configure.args-append   --includedir=${prefix}/include/${name} \
                        --disable-dependency-tracking

livecheck.type  regex
livecheck.url   http://www.unidata.ucar.edu/downloads/udunits/index.jsp
livecheck.regex {Current release ([0-9]+\.[0-9]+\.[0-9]+)} 
