# -*- 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 90589 2012-03-09 12:23:30Z hum@macports.org $

PortSystem          1.0

name                openfst
version             1.3.1
categories          devel
platforms           darwin
license             Apache-2.0
maintainers         hum openmaintainer

description         C++ finite-state transducers library

long_description    OpenFst is a library for constructing, combining, \
                    optimizing, and searching weighted finite-state \
                    transducers (FSTs).

homepage            http://www.openfst.org/
master_sites        ${homepage}twiki/pub/FST/FstDownload/

checksums           rmd160  b730ad3804e5a03688a1abf978c3eb36338986a3 \
                    sha256  82fc431a41430516fe3eee2b4b8ea31242acb4c6adccd8a3f8fc9f6f5aabcf94

# OpenFst doesn't like Xcode's compiler before Snow Leopard.
# See http://www.openfst.org/twiki/bin/view/FST/CompilingOnMacOSX
if {${os.platform} == "darwin" && ${os.major} < 10} {
    variant gcc43 conflicts gcc44 gcc45 description {Compile with gcc 4.3} {
        configure.compiler macports-gcc-4.3
        depends_lib-append port:gcc43
    }
    
    variant gcc44 conflicts gcc43 gcc45 description {Compile with gcc 4.4} {
        configure.compiler macports-gcc-4.4
        depends_lib-append port:gcc44
    }
    
    variant gcc45 conflicts gcc43 gcc44 description {Compile with gcc 4.5} {
        configure.compiler macports-gcc-4.5
        depends_lib-append port:gcc45
    }
    
    if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45]} {
        default_variants +gcc45
    }
}

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS \
        COPYING \
        NEWS \
        README \
        ${docdir}
}

livecheck.type      regex
livecheck.url       ${homepage}twiki/bin/view/FST/FstDownload
livecheck.regex     ${name}-(\[0-9.\]+)\\.
