# -*- 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 102046 2013-01-26 12:35:30Z hum@macports.org $

PortSystem          1.0

name                openfst
version             1.3.3
categories          devel
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/
platforms           darwin
license             Apache-2

master_sites        ${homepage}twiki/pub/FST/FstDownload/
checksums           rmd160  197e49ac1bd1b956dcc04eecb9cd9147022c9815 \
                    sha256  b3672384056999abdbce861d2065074cbca471a23c4a89072460fddd0c33e3f6

# 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.\]+)\\.
