# -*- 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        vigneshwaranr bd 1.03 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0

categories          sysutils
platforms           any
supported_archs     noarch
license             MIT
maintainers         nomaintainer

description         a tool to cd into parent directories, instead of ../../.., etc
long_description    Quickly go back to a specific parent directory in bash \
                    instead of typing \"cd ../../..\" redundantly.

checksums           rmd160  8dda2fbc4a75a6b7234cac3acd0b1ef44606d701 \
                    sha256  56f7e9207c453f15a364dcd1b601ffc161c984e015ade4a4966686cf41c2f02e \
                    size    143339

depends_lib-append  port:bash-completion

use_configure       no
build {}

destroot {
    set bash_completion ${destroot}/${prefix}/share/bash-completion/completions
    set completion_dir  ${prefix}/share/${name}/completion
    set doc_dir         ${destroot}${prefix}/share/doc/${name}

    xinstall -d -m 0755 \
        ${bash_completion} ${destroot}${completion_dir} ${doc_dir}/screenshot

    xinstall -m 0755 \
        ${worksrcpath}/${name} ${destroot}${prefix}/bin/${name}

    xinstall -m 0644 \
        ${worksrcpath}/bash_completion.d/${name} ${destroot}${completion_dir}

    xinstall -m 0644 \
        ${worksrcpath}/screenshot/${name}.png ${doc_dir}/screenshot

    xinstall -m 0644 -W ${worksrcpath} LICENSE README.md ${doc_dir}

    ln -s ${completion_dir}/${name} ${bash_completion}/${name}
}

notes "
If this is a new install... To complete the installation,\
add this alias to your bash file:

    alias bd='. bd -si'

Read more: ${prefix}/share/doc/${name}/README.md
"
