# $Id: Portfile 89810 2012-02-11 08:55:39Z and.damore@macports.org $
# -*- 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 python 1.0

name                py-roman
version             1.4.0
python.versions     24 25 26 27
python.default_version 27
categories-append   textproc
license             PSF-2.1.1
platforms           darwin
supported_archs     noarch
maintainers         nomaintainer
description         Integer to Roman numerals converter
long_description    ${description}
homepage            http://pypi.python.org/pypi/roman/
master_sites        http://pypi.python.org/packages/source/r/roman/
distname            roman-${version}

checksums           md5     4f8832ed4108174b159c2afb4bd1d1dd \
                    sha1    3d9cf0c46a4e3558785a9f7c90cd96a2d31dc9b0 \
                    rmd160  9c9f1d8de8e19f6dcab02a28b2a28a1a7f3dd546

if {$subport != $name} {
    depends_lib     port:py${python.version}-distribute

    pre-activate {
        if {[file exists ${python.pkgd}/roman.py] 
            && ![catch {set vers [lindex [registry_active py${python.version}-docutils] 0]}]
            && [vercmp [lindex $vers 1] 0.6] < 0} {
            set deactivate_proc registry_deactivate_composite
            if {[info commands registry_deactivate_composite] == {}} {
                set deactivate_proc registry_deactivate
            }
            $deactivate_proc py${python.version}-docutils "" [list ports_nodepcheck 1]
        }
    }
}

livecheck.type      regex
livecheck.regex     {roman-(\d+(?:\.\d+)*)}
