# $Id: Portfile 117476 2014-02-28 14:58:11Z raimue@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0

name                task
version             2.3.0
maintainers         nomaintainer

categories          office
description         A command-line todo list manager
long_description    Taskwarrior is a command-line todo list manager \
                    with an interactive interface, GTD features, color themes, \
                    data synchronization, dependencies, custom reports, and \
                    charts.

platforms           darwin
license             MIT

homepage            http://taskwarrior.org/
master_sites        http://taskwarrior.org/download/

checksums           sha1 b5390a1c1232bcb727f5a595ac1141184810d09d \
                    rmd160  2e391987af89f290f096ba0a18f0cd01d368ac52 \
                    sha256  2b9a289109e691e305b84631622299853134cf195d4c9af962759b640176ac73

post-destroot {
    # Install bash completions
    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    xinstall ${worksrcpath}/scripts/bash/task.sh ${destroot}${prefix}/share/bash-completion/completions/task

    # Install zsh completions
    set site-functions ${destroot}${prefix}/share/zsh/site-functions
    xinstall -d ${site-functions}
    xinstall ${worksrcpath}/scripts/zsh/_task ${site-functions}/_task

    # Install vim runtime files
    set vim-files ${destroot}${prefix}/share/vim
    xinstall -d ${vim-files}
    file copy ${worksrcpath}/scripts/vim ${vim-files}/vimfiles
    # Delete README with install instructions due to its generic filename
    file delete ${vim-files}/vimfiles/README
}

livecheck.type  regex
livecheck.url   ${homepage}/projects/taskwarrior/wiki/Download
livecheck.regex ${name}-(\\d(?:\\.\\d)+)\\.tar
