# -*- 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 90063 2012-02-20 15:27:38Z hum@macports.org $

PortSystem          1.0

name                giza-pp
version             20110924
categories          textproc
maintainers         hum openmaintainer

description         a statistical machine translation toolkit
long_description    GIZA++ is a statistical machine translation toolkit that is \
                    used to train IBM Models 1-5 and an HMM word alignment model. \
                    This package also contains the source for the mkcls tool \
                    which generates the word classes necessary for training some \
                    of the alignment models.

homepage            http://code.google.com/p/giza-pp/
platforms           darwin
license             GPL-2

master_sites        googlecode
checksums           rmd160  b99824325ea5bd6175084b8198a7da36318d6ef5 \
                    sha256  69b403ea5c20b3a794a28cc741690a1f501d5d3b2af042732060d2b964b57793

distname            ${name}
extract.suffix      .tgz

use_configure       no

variant universal {}

if {${configure.compiler} == "clang"} {
    configure.compiler llvm-gcc-4.2
}

build.args          CXX=${configure.cxx} CFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]"

destroot {
    foreach exe {GIZA++ snt2plain.out plain2snt.out snt2cooc.out} {
        xinstall -m 755 ${worksrcpath}/GIZA++-v2/${exe} ${destroot}${prefix}/bin
    }
    xinstall -m 755 ${worksrcpath}/mkcls-v2/mkcls   ${destroot}${prefix}/bin
    set doc ${destroot}${prefix}/share/doc/${name}
    file mkdir ${doc}
    xinstall -m 644 ${worksrcpath}/GIZA++-v2/README ${doc}/README.GIZA++
    xinstall -m 644 ${worksrcpath}/mkcls-v2/README  ${doc}/README.mkcls
}

livecheck.type      none
