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

github.setup        StreakyCobra gws 0.1.16
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
categories          devel sysutils
platforms           any
supported_archs     noarch
maintainers         nomaintainer
license             MIT

description         helper for git workspaces
long_description \
    gws is a KISS, bash, colorful helper to manage workspaces \
    composed of git repositories.

checksums           rmd160  169096d3774bf592fe469768376b98d1ad9e33d7 \
                    sha256  2cdfdd38b1ee3db4b904285c725397668e77ef79b599395a6a37e12778b1bd3a \
                    size    19033

patchfiles          patch-interpreter.diff

post-patch {
    reinplace "s:@@PREFIX@@:${prefix}:g" ${worksrcpath}/src/gws
}

depends_run         port:bash \
                    port:git


use_configure no
build {}

destroot {
    xinstall -m 0755 ${worksrcpath}/src/gws ${destroot}${prefix}/bin/gws
    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/gws
    xinstall -m 0644 -W ${worksrcpath} README.md LICENSE CHANGELOG ${destroot}${prefix}/share/doc/gws/
    xinstall -d -m 0755 ${destroot}${prefix}/share/zsh/site-functions/
    xinstall -m 0644 ${worksrcpath}/completions/zsh ${destroot}${prefix}/share/zsh/site-functions/_gws
    xinstall -d -m 0755 ${destroot}${prefix}/share/bash-completion/completions/
    xinstall -m 0644 ${worksrcpath}/completions/bash ${destroot}${prefix}/share/bash-completion/completions/gws
}
