# -*- 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 119817 2014-05-07 18:22:36Z sean@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           github 1.0

name                py-dulwich
categories-append   devel
maintainers         yahoo.com.au:mail_ben_schmidt sean openmaintainer
platforms           darwin
license             GPL-2+

homepage            http://samba.org/~jelmer/dulwich/
description         Pure-Python Git Library
long_description    Simple Pure-Python implementation of the Git file \
                    formats and protocols. Dulwich is the place where \
                    Mr. and Mrs. Git live in one of the Monty Python sketches.

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

if {[string match "*-devel" $subport]} {
    github.setup        jelmer dulwich 9d026566b20c
    name                py-dulwich-devel
    version             0.9.6.99

    checksums           rmd160  e82aff22e58c8fb5b6563fe52490c69ddb1a392c \
                        sha256  fed5d06d8b168017d9e1a27a411135f9e2d83eb31f05644601728c40669cae54
} else {
    github.setup        jelmer dulwich 0.9.6 dulwich-
    name                py-dulwich

    checksums           rmd160  0f2664641e7fa0e5ddce0a4e1be2a3c9abbf0722 \
                        sha256  adff71c692020e3be5a833391995477db12ee2938999b61482e16669c335db2d
}

python.versions         27

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

    patchfiles          patch-strnlen-lion.diff

    build.target-append build_ext
    build.args          --inplace
} else {
    livecheck.type  regex
    livecheck.regex dulwich-(\[0-9.\]+)${extract.suffix}
}
