# -*- 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
PortGroup           python 1.0
PortGroup           select 1.0

github.setup        ioflo ioflo 2.0.2 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
name                py-ioflo
revision            0

categories-append   lang
supported_archs     noarch
platforms           {darwin any}
license             Apache-2
maintainers         nomaintainer

description         ioflo is a framework and DSL for building reasoning \
                    automation systems.
long_description    IoFlo is a magically powerful open interoperable software \
                    framework that enables non experts to intelligently \
                    automate their own programmable world. IoFlo has its roots \
                    in the research and development of autonomous underwater \
                    vehicles, autonomic ships, and automated buildings. These \
                    are cool applications that can be scarily complex. That \
                    complexity was the prime motivation for IoFlo and its \
                    ancestors, to make programming autonomous/autonomic systems \
                    easy even for people without PhDs.

homepage            https://ioflo.com

checksums           rmd160  4e313cd54f4d7395dca93440cceae1cf72ccc1c7 \
                    sha256  f7d17771d1fc7b09094778e7b510a69569dd347b19cd634837e487469acd5da9 \
                    size    837441

python.versions     38

if {${name} ne ${subport}} {
    depends_build-append  \
                    port:py${python.version}-setuptools-git

    depends_run     port:ioflo_select

    post-destroot {
        delete ${destroot}${prefix}/bin/ioflo[string index ${python.version} 0]-${python.branch}
        delete ${destroot}${prefix}/bin/ioflo${python.branch}-${python.branch}

        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} README.txt LICENSE \
            LICENSE-2.0.txt ChangeLog.md LEGAL ${destroot}${docdir}
    }

    select.group    ${python.rootname}
    select.file     ${filespath}/${python.rootname}${python.version}

    notes "
    To make the Python ${python.branch} version of ioflo the one that is run \
    when you execute the commands without a version suffix, e.g. 'ioflo', run:

    sudo port select --set ${select.group} [file tail ${select.file}]
    "
}
