# -*- 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

PortSystem          1.0
PortGroup           github 1.0

github.setup        jubatus jubatus-mpio 0.4.5
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball

categories          devel
maintainers         nomaintainer

description         modified mpio (Multipurpose concurrent I/O framework for C++) for Jubatus

long_description    ${name} is {*}${description}.

homepage            https://github.com/frsyuki/mpio
license             Apache-2

dist_subdir         jubatus
checksums           rmd160  061a34635e4fca4f6dec8a144ff4ea7c82fa089f \
                    sha256  fb460b8a34654d5ed5b53b4c7e0e2f3ff349d1328ed831d1c3401d1f8c3152d3

depends_build       port:autoconf port:automake port:libtool

pre-configure {
    system -W ${worksrcpath} "./bootstrap"
}

platform darwin {
    if {${os.major} >= 13} {
        build.args          CXXFLAGS="${configure.cxxflags} -std=c++11 -DMP_FUNCTIONAL_STANDARD -DMP_MEMORY_STANDARD -DMP_UNORDERED_MAP_STANDARD"
    } else {
        build.args          CXXFLAGS=${configure.cxxflags}
    }
}

post-destroot {
    # install an additional document.
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS COPYING ChangeLog LICENSE NOTICE README.md \
        ${destroot}${docdir}
}
