# -*- 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/docker/machine 0.16.2 v
# Delete this on next update to use golang PortGroup's default ('archive')
github.tarball_from tarball
name                docker-machine
categories          devel
platforms           darwin
license             Apache-2
maintainers         {emcrisostomo @emcrisostomo} \
                    openmaintainer
description         Machine management for a container-centric world
long_description    Machine lets you create Docker hosts on your computer, \
                    on cloud providers, and inside your own data center. It \
                    creates servers, installs Docker on them, then configures \
                    the Docker client to talk to them.

depends_lib         port:docker

checksums           rmd160 016d09d9ea0c77a4071dfe982f6a2bc8c1f654cf \
                    sha256 0cc647df4cc7c6df45453cf1194e1f37bc6e82f2b464e5a6722ff196e76606df \
                    size   2823411

build.target          github.com/docker/machine/cmd/docker-machine

destroot {
    xinstall -d ${destroot}${prefix}/bin
    xinstall -m 755 ${worksrcpath}/docker-machine ${destroot}${prefix}/bin/
}

variant bash_completion {
    depends_run-append path:etc/bash_completion:bash-completion

    post-destroot {
        set completions_path ${prefix}/share/bash-completion/completions
        xinstall -d ${destroot}${completions_path}
        xinstall -m 644 {*}[glob ${worksrcpath}/contrib/completion/bash/*.bash] ${destroot}${completions_path}/
    }
}

variant zsh_completion description "Completion functions for zsh" {
    depends_run-append path:${prefix}/bin/zsh:zsh

    post-destroot {
        set site-functions ${destroot}${prefix}/share/zsh/site-functions
        xinstall -d ${site-functions}
        xinstall ${worksrcpath}/contrib/completion/zsh/_${name} ${site-functions}/
    }
}

github.livecheck.regex  {([^"r-]+)}
