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

go.setup             github.com/subpop/mqttcli 0.2.6 v
# Delete this on next update to use golang PortGroup's default ('archive')
github.tarball_from  tarball
revision             0

categories           net
maintainers          {sub-pop.net:link @subpop} openmaintainer
license              GPL-3

description          A simple MQTT command-line client

long_description     mqttcli is a program that provides two subcommands (pub \
                     and sub) that allow command-line level access to an MQTT \
                     broker. \
                     sub subscribes to a topic and prints messages received to \
                     standard output. pub publishes the provided message to the \
                     provided topic. Both programs accept flags that can be \
                     provided as a config file.

checksums            ${distname}${extract.suffix} \
                         rmd160  3a880af96eb881e881c3f978adb3e1b825617905 \
                         sha256  f738d082b338fadc517303f5fa83eb4c36b1227037b5b72fd08ac275c8b8d933 \
                         size    18159

depends_build-append port:asciidoc

build.target        -o ${worksrcpath} ./cmd/sub ./cmd/pub

go.vendors          golang.org/x/sync \
                        lock    v0.1.0 \
                        rmd160  bf68702d961107a225cce561701852f129f16a3d \
                        sha256  50a67a11e715a61c022f218604adc63e61684de5f5db2330741077439c4ce68f \
                        size    19355 \
                    golang.org/x/net \
                        lock    v0.23.0 \
                        rmd160  314021a9d4fc510f2acfbfa131810944101c66bf \
                        sha256  7c2b7d3c9062bc8cd529f8f1b2aa16d5a8616a90cb3cbdbf326bd5c6f0fb51f1 \
                        size    1509183 \
                    github.com/sgreben/flagvar \
                        lock    v1.10.1 \
                        rmd160  934ec87e31bde9273943106c250c749b079ac834 \
                        sha256  e1ef55de216f294dfb4bab214419f3c0f04cbd0e8f5d6df5b526c56dbe593622 \
                        size    16988 \
                    github.com/peterbourgon/ff \
                        lock    v3.4.0 \
                        rmd160  758175c6809dfdd2a5b89c087271d1674f400477 \
                        sha256  cbb5a4f0e9eab6a47b4ab3f6376563d43e9dd117323e0bce4d901392cae43e9c \
                        size    30999 \
                    github.com/gorilla/websocket \
                        lock    v1.5.0 \
                        rmd160  ff5a4278af87e04d06521f4cf1db6fd48c0403b2 \
                        sha256  e26e73242d694a6a43458bec8d7e32f6a3d355539484eeb04c5b0c182dc79d9f \
                        size    54163 \
                    github.com/gobwas/glob \
                        lock    v0.2.3 \
                        rmd160  1f472cf991498a8091446eb788fe85e0c5403185 \
                        sha256  2de3694ee0ff41a96b66f9aa3eec51048e620cdd09acc8685f18c3abcd6e14ae \
                        size    25971 \
                    github.com/eclipse/paho.mqtt.golang \
                        lock    v1.4.3 \
                        rmd160  8473065094a94d85e7ca09fe9a035d4ed4c6adcb \
                        sha256  cc8550b30332d327bb6a5c32b287e5e9d620b4b8a9f77730d26a9e48f0fd18ce \
                        size    111502

post-build {
    system "a2x --doctype manpage --format manpage --destination-dir ${worksrcpath} ${worksrcpath}/doc/sub.adoc"
    system "a2x --doctype manpage --format manpage --destination-dir ${worksrcpath} ${worksrcpath}/doc/pub.adoc"
}

destroot {
    xinstall -W ${worksrcpath} pub sub ${destroot}${prefix}/bin/
    xinstall -W ${worksrcpath} -m 0644 pub.1 sub.1 ${destroot}${prefix}/share/man/man1/
}
