# -*- 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 90831 2012-03-15 06:07:28Z jmr@macports.org $

PortSystem          1.0
PortGroup           python26 1.0

name                py26-logilab-hmm
version             0.5.0
maintainers         minimoog.org:sb
description         Python Hidden Markov model implementation
long_description    logilab-hmm is an implementation of Hidden Markov model \
                    and associated algorithms (Viterbi and Baum-Welsh).

platforms           darwin

homepage            http://www.logilab.org/project/logilab-hmm
master_sites        http://ftp.logilab.org/pub/hmm/
distname            logilab-hmm-${version}

livecheck.url       http://ftp.logilab.org/pub/hmm/
livecheck.type      regex
livecheck.regex     {logilab-hmm-(\d+(?:\.\d+)*)\.tar\.gz}

checksums           md5     81f63768df022714e66f6d471245800a \
                    sha1    6be2012ab3b7ed6ceac42b48a821f6e194c71f6f \
                    rmd160  b62f3ac49e4d2681138e55490430c4bdfdf418f6

depends_lib         port:py26-logilab-common port:py26-numpy

universal_variant   no
python.add_archflags no

variant gcc42 conflicts gcc43 gcc44 gcc45 description "Use gfortran-mp-4.2 as fortran compiler" {
  configure.compiler    macports-gcc-4.2
  depends_lib-append    port:gcc42
  set fc_options        "config_fc --fcompiler gnu95 --f77exec ${prefix}/bin/gfortran-mp-4.2 --f90exec ${prefix}/bin/gfortran-mp-4.2"
  build.cmd-append      ${fc_options}
  destroot.cmd-append   ${fc_options}
}

variant gcc43 conflicts gcc42 gcc44 gcc45 description "Use gfortran-mp-4.3 as fortran compiler" {
  configure.compiler    macports-gcc-4.3
  depends_lib-append    port:gcc43
  set fc_options        "config_fc --fcompiler gnu95 --f77exec ${prefix}/bin/gfortran-mp-4.3 --f90exec ${prefix}/bin/gfortran-mp-4.3"
  build.cmd-append      ${fc_options}
  destroot.cmd-append   ${fc_options}
}

variant gcc44 conflicts gcc42 gcc43 gcc45 description "Use gfortran-mp-4.4 as fortran compiler" {
  configure.compiler    macports-gcc-4.4
  depends_lib-append    port:gcc44
  set fc_options        "config_fc --fcompiler gnu95 --f77exec ${prefix}/bin/gfortran-mp-4.4 --f90exec ${prefix}/bin/gfortran-mp-4.4"
  build.cmd-append      ${fc_options}
  destroot.cmd-append   ${fc_options}
}

variant gcc45 conflicts gcc42 gcc43 gcc44 description "Use gfortran-mp-4.5 as fortran compiler" {
  configure.compiler    macports-gcc-4.5
  depends_lib-append    port:gcc45
  set fc_options        "config_fc --fcompiler gnu95 --f77exec ${prefix}/bin/gfortran-mp-4.5 --f90exec ${prefix}/bin/gfortran-mp-4.5"
  build.cmd-append      ${fc_options}
  destroot.cmd-append   ${fc_options}
}

if { ![variant_isset gcc42] && ![variant_isset gcc43] && ![variant_isset gcc44] } {
  default_variants      +gcc45
}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} README \
        ${destroot}${prefix}/share/doc/${name}
    file delete ${destroot}/${python.prefix}/lib/python2.6/site-packages/logilab/__init__.py
}
