# -*- 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        docker machine 0.8.1 v
name                docker-machine
categories          devel
platforms           darwin
license             Apache-2
maintainers         nomaintainer
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:go port:docker

checksums           rmd160  d72b2be8bd5967c79b2a0639151b1a5996c4a16e \
                    sha256  38f3dd480bdbf8ed5b4415d59933c5a01ee51527b768ecf7f1561f3319f9a18d

use_configure       no
build.target        build
build.env           GOPATH=${workpath}/go
build.dir           ${workpath}/go/src/github.com/docker/machine

# what kind of tool does this?
post-extract {
    file mkdir ${workpath}/go/src/github.com/docker
    ln -sf ${worksrcpath} ${workpath}/go/src/github.com/docker/machine
    file mkdir ${worksrcpath}/src/github.com/docker
    ln -sf ${worksrcpath} ${worksrcpath}/src/github.com/docker/machine
}

destroot {
    xinstall -d ${destroot}${prefix}/bin
    xinstall -m 755 {*}[glob ${worksrcpath}/bin/*] ${destroot}${prefix}/bin/

    if {[variant_isset bash_completion]} {
        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 bash_completion {
    depends_run-append path:etc/bash_completion:bash-completion
}

livecheck.regex     archive/[join ${github.tag_prefix} ""](\[^"r-\]+)${extract.suffix}