# -*- 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 115159 2013-12-27 08:30:29Z hum@macports.org $

PortSystem          1.0

name                pecco
version             2013-12-25
epoch               1
categories          math
maintainers         hum openmaintainer

description         simple C++ library for linear classification with conjunctive features
long_description    ${name} is a ${description}.

homepage            http://www.tkl.iis.u-tokyo.ac.jp/~ynaga/pecco/
platforms           darwin
license             {GPL-2 LGPL-2.1}

master_sites        ${homepage}
checksums           rmd160  5073265d1d6ea4cf5c262fb836ad50bd7abaacc0 \
                    sha256  7499080ee4323fc3814d73194151872f17af879bb78566bae028607c75a236f1

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS COPYING GPL LGPL README \
        ${destroot}${docdir}
    set exroot ${prefix}/share/examples
    xinstall -d ${destroot}${exroot}
    copy ${worksrcpath}/test ${destroot}${exroot}/${name}
}

variant dartsclone description {Use darts-clone} {
    depends_build-append       port:darts-clone
    configure.args-append      --with-trie-impl=darts-clone
}

variant float description {Use float as the type of weights} {
    configure.args-append      --enable-float
}

variant trie description {Encode weights into a trie in kernel_model} {
    configure.args-append      --enable-abuse-trie
}

default_variants    +dartsclone
    
livecheck.type      regex
livecheck.regex     "${name}-(\\d+(?:\\-\\d+)*)${extract.suffix}"
