# -*- 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 119274 2014-04-21 23:00:43Z sean@macports.org $

PortSystem              1.0
PortGroup               python 1.0
PortGroup               bitbucket 1.0

epoch                   20130201

set realname            hggit
name                    py-hggit

categories-append       devel
license                 GPL-2
platforms               darwin
supported_archs         noarch
maintainers             easieste sean openmaintainer

homepage                http://hg-git.github.com/
description             Push to and pull from a Git server repository from Mercurial.
long_description        This is the Hg-Git plugin for Mercurial, adding the ability \
                        to push to and pull from a Git server repository from Mercurial.\
                        This means you can collaborate on Git based projects from Mercurial, \
                        or use a Git server as a collaboration point for a team with \
                        developers using both Git and Mercurial.

# can't set python.versions before adding custom subports
subport py27-$realname-devel {}

if {[string match "*-devel" $subport]} {
    bitbucket.setup     durin42 hg-git 51b3b3b4927e
    name                py-$realname-devel
    version             0.5.99
    revision            5

    checksums           rmd160  e9e53f657f13cdb2199cf913261a0f33b6e7dbac \
                        sha256  d9f36e3d34772aefdf26c6be112e1a34d0fdbca8b6183e2cc310f566eb3d5279
} else {
    bitbucket.setup     durin42 hg-git 0.5.0
    name                py-${realname}
    revision            1

    checksums           rmd160  21d7d383f4881e659c86906c0d818790388bd51c \
                        sha256  eb3b5c6327ac0050de0184a0e2da9ba1abdf7ae4eb8010c388902b40fa493019
}

python.versions         27

if {${name} ne ${subport}} {
    depends_lib-append  bin:hg:mercurial \
                        bin:dulwich-2.7:py${python.version}-dulwich

    conflicts           py${python.version}-$realname-devel
    if {[string match "*-devel" $subport]} {
        conflicts       py${python.version}-$realname
    } else {
        livecheck.type      none
    }

    notes               "
To enable ${realname}, add the following to your ~/.hgrc:

\[extensions\]
${realname} =
"
}
