# -*- 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            tj git-extras 2.2.0
maintainers             nomaintainer
platforms               darwin
categories              devel
supported_archs         noarch

description             Git utilities
long_description        \
    ${description} -- repo summary, repl, changelog population, author \
    commit percentages and more
license                 MIT

checksums               rmd160  5147eb7fd8470a30dd04861944e7c3a1daeaeddb \
                        sha256  1cfeaa9f2644a37541f8c4e8f175222c70b36fe9672fc7f9c9ef248c0071e4bb

patchfiles              patch-bin-git-extras.diff \
                        patch-Makefile.diff

use_configure           no

build {}

destroot.destdir        PREFIX=${destroot}${prefix}
post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${subport}
    xinstall -d ${docdir}
    eval xinstall -m 644 [glob ${worksrcpath}/man/*.html] ${docdir}
}

pre-activate {
    # git-extras @1.7.0_0 installed a file to /opt/local/etc/bash_completion.d/
    # remove it if found
    set filepath ${prefix}/etc/bash_completion.d/git-extras
    if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
        if {[catch {delete ${filepath}}]} {
            ui_warn "Cannot delete ${filepath}; please remove it manually"
        }
    }
}