# -*- 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
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
name                    ${realname}
revision                3
categories              devel
platforms               any
maintainers             nomaintainer
license                 {BSD LGPL-2.1+}
supported_archs         noarch

description             {*}${description_common} (nvie)
long_description        {*}${description_common} \
                        This is the original nvie version, not maintained.

conflicts               ${realname} ${realname}-devel ${realname}-avh ${realname}-hf
conflicts-delete        ${subport}

depends_run-append      port:git \
                        port:util-linux

if {${subport} ne "${realname}-avh"} {
    fetch.type          git
    post-fetch {
        # This will be removed once the python re-write is complete.
        system -W ${worksrcpath} "patch -p0 < [shellescape ${filespath}/gitmodules.patch]"
        system -W ${worksrcpath} "git submodule update --init"
    }
}

if {${subport} ne "${realname}-hf"} {
    destroot.destdir    prefix=${destroot}${prefix}
}

subport ${realname}-devel {
    github.setup        nvie gitflow 15aab26490facf285acef56cb5d61025eacb3a69
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    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.

    livecheck.type      none
}

subport ${realname}-avh {
    github.setup        petervanderdoes gitflow 1.12.3
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    revision            0
    license             {BSD LGPL-2.1+}
    description         {*}${description_common} (avh Edition)
    long_description    {*}${description_common} \
                        This is the AVH Edition, not maintained.

    distfiles           ${distname}${extract.suffix}
    checksums           rmd160  046157420cc45deb35a9aede5f88c30a23926a45 \
                        sha256  12fefdfa90c0cef2711af048334bb3f5fd15638803ccaf9e791153ce96439b27 \
                        size    66179
}

subport ${realname}-hf {
    github.setup        datasift gitflow 1.5.2
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    revision            1
    license             {BSD LGPL-2.1+}
    description         {*}${description_common} (HubFlow)
    long_description    {*}${description_common} \
                        This is the HubFlow version, not maintained.

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

use_configure           no
build {}
