# -*- 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 87936 2011-12-13 12:36:43Z snc@macports.org $

PortSystem        1.0
PortGroup           python 1.0

name                py-hgsvn
version             0.1.9
python.versions     24 25 26 27
python.default_version  27
categories              python devel
platforms               darwin
maintainers         saispo gmail.com:larry.velazquez openmaintainer
license                 GPL-3+
homepage                http://pypi.python.org/pypi/hgsvn
description             hgsvn is a set of scripts for Subversion and Mercurial
long_description		This set of scripts allows to work locally on \
						Subversion-managed projects using the Mercurial \
						distributed version control system.

master_sites            http://pypi.python.org/packages/source/h/hgsvn
distname                hgsvn-${version}

checksums           rmd160  3f6c9b0bbda5c8454478436d0c0589e04d8394e1 \
                    sha256  de45c04a1b3c3e104fcfc99973609239240c3b22789b6e87e29323c7b86c333f

if {$subport != $name} {

    depends_lib-append  port:py${python.version}-distribute \
                        port:mercurial \
                        port:subversion

    if {${python.version} == 24} {
        depends_run-append  port:py-elementtree
    }

    post-destroot {
            xinstall -m 644 -W ${worksrcpath} AUTHORS.txt COPYING.txt README.txt TODO.txt  \
                    ${destroot}${prefix}/share/doc/py${python.version}-hgsvn
        if {${python.version} == 25 || ${python.version} == 24} {
            move ${destroot}${prefix}/bin/hgimportsvn ${destroot}${prefix}/bin/hgimportsvn-${python.version}
            move ${destroot}${prefix}/bin/hgpullsvn   ${destroot}${prefix}/bin/hgpullsvn-${python.version}
            move ${destroot}${prefix}/bin/hgpushsvn   ${destroot}${prefix}/bin/hgpushsvn-${python.version}
        }
    }

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${homepage}
    livecheck.regex     hgsvn (\\d+(\\.\\d+)+)
}
