# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0

epoch               1
github.setup        ndbroadbent scm_breeze 1.0.0 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            2
categories          devel
maintainers         nomaintainer
license             MIT
supported_archs     noarch
platforms           any

description         Streamline your SCM workflow

long_description    \
    SCM Breeze is a set of shell scripts (for bash and zsh) that enhance your \
    interaction with tools such as git. It integrates with your shell to give you \
    numbered file shortcuts, a repository index with tab completion, and a \
    community driven collection of useful SCM functions.

# stealth update; remove for next version
dist_subdir         ${name}/${version}_1
checksums           rmd160  0c38cf8e3c1458fc185137bb9744f9eaed58bb2e \
                    sha256  b0f0b64888e930cdc5dcba24de71cc189511e61b6510626ec0ca97e82da26ca1 \
                    size    36138

use_configure       no

build {
    foreach f {install.sh uninstall.sh test test.sh .travis.yml} {
        delete ${worksrcpath}/$f
    }

    reinplace -E "s|export scmbDir=.+|export scmbDir=\\\"${prefix}/share/${name}\\\"|g" \
        ${worksrcpath}/${name}.sh
}

destroot {
    file mkdir ${destroot}${prefix}/share
    # realpath to work around breakage from https://github.com/macports/macports-base/pull/55
    move [realpath ${worksrcpath}] ${destroot}${prefix}/share/${name}
}

notes "
To use, execute the following commands:
=======================================
    cp ${prefix}/share/${name}/scmbrc.example ~/.scmbrc
    cp ${prefix}/share/${name}/git.scmbrc.example ~/.git.scmbrc

Then add the following line to your .bashrc or .zshrc:
======================================================
    \[ -s ${prefix}/share/${name}/${name}.sh \] && source ${prefix}/share/${name}/${name}.sh\
"