# -*- 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: Portfile 122828 2014-07-31 10:16:48Z cal@macports.org $

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 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}

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

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

  revision              1
  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}

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

subport ${realname}-avh {
  github.setup          petervanderdoes gitflow 1.7.0

  revision              1
  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

  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

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

use_configure           no
build {}
