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

set realname            git-flow
set description_common  {Git extensions for Vincent Driessen branching.}

github.setup            nvie gitflow 0.4.1
fetch.type              git
name                    ${realname}
revision                2
categories              devel
platforms               darwin
maintainers             {maiar.org:jason-macports @gorticus} openmaintainer
license                 {BSD LGPL-2.1+}
supported_archs         noarch

description             ${description_common} (nvie)
long_description        ${description_common} \
                        This is the canonical nvie version, not maintained.
conflicts               ${realname}-devel ${realname}-avh ${realname}-hf

depends_run-append      port:git port:getopt

if {${subport} eq ${name}} {

    destroot.destdir      prefix=${destroot}${prefix}

    post-fetch {
        # Does the github portgroup support 'clone --recursive'?
        # This will be removed once the python re-write is complete.
        system -W ${worksrcpath} "git submodule update --init"
    }
}

subport ${realname}-devel {
    github.setup        nvie gitflow 15aab26490facf285acef56cb5d61025eacb3a69

    version             20120925
    revision            0
    license             {BSD LGPL-2.1+}
    description         ${description_common} (nvie devel)
    long_description    ${description_common} \
                        This is the nvie develop branch, not maintained.
    conflicts           ${realname} ${realname}-avh ${realname}-hf

    destroot.destdir    prefix=${destroot}${prefix}

    post-fetch {
        # Does the github portgroup support 'clone --recursive'?
        # This will be removed once the python re-write is complete.
        system -W ${worksrcpath} "git submodule update --init"
    }

    livecheck.type      none
}

subport ${realname}-avh {
    github.setup        petervanderdoes gitflow 1.11.0
    fetch.type          standard

    revision            0
    license             {BSD LGPL-2.1+}
    description         ${description_common} (avh Edition)
    long_description    ${description_common} \
                        This is the AVH Edition, and is actively developed.
    conflicts           ${realname} ${realname}-devel ${realname}-hf

    distfiles           ${distname}${extract.suffix}
    checksums           rmd160  53fcf8b2f0a1a96783b015eba95d9f60ae9ddeb5 \
                        sha256  25b8b5f5a5429ff1392510ba1a988e6e0091c5e817b49fcfbef60c057f09738d

    destroot.destdir    prefix=${destroot}${prefix}
}

subport ${realname}-hf {
    github.setup        datasift gitflow 1.5.2

    revision            1
    license             {BSD LGPL-2.1+}
    description         ${description_common} (HubFlow)
    long_description    ${description_common} \
                        This is the HubFlow version, and is actively developed.
    conflicts           ${realname} ${realname}-devel ${realname}-avh

    destroot.env        INSTALL_INTO="${destroot}${prefix}/bin"
    destroot.cmd        ./install.sh
    destroot.destdir

    post-fetch {
        # Does the github portgroup support 'clone --recursive'?
        # This will be removed once the python re-write is complete.
        system -W ${worksrcpath} "git submodule update --init"
    }
}

use_configure           no
build {}
