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

PortSystem          1.0
PortGroup           github 1.0

github.setup        jubatus jubatus-msgpack-rpc 0.4.4

categories          devel
maintainers         hum openmaintainer

description         modified msgpack-rpc for Jubatus

long_description    ${name} is ${description}.

homepage            http://msgpack.org/
platforms           darwin
license             Apache-2

dist_subdir         jubatus
checksums           rmd160  fc33bf78e5320686d11c6377c18b5bb8d1cfda3c \
                    sha256  895c4e0562be6ebf2f4c0b1aa95d538def49f266796def2c6ae14dc7cb6d6696

depends_build       port:autoconf port:automake port:libtool

depends_lib         port:msgpack \
                    port:jubatus-mpio

configure.dir       ${worksrcpath}/cpp
build.dir           ${configure.dir}

pre-configure {
    system -W ${configure.dir} "./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 ${destroot.dir} \
        AUTHORS COPYING ChangeLog NOTICE README.md \
        ${destroot}${docdir}
}