# -*- 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 108384 2013-07-22 09:52:36Z jmr@macports.org $

PortSystem 1.0
PortGroup python 1.0

name                py-docutils
version             0.11
categories-append   textproc
license             GPL-3+ PSF-2.1.1 BSD
maintainers         jmr alexnicksay.com:alex openmaintainer
description         A set of tools for processing plaintext documentation
long_description    Docutils is a set of tools for processing plaintext \
                    documentation into useful formats, such as HTML, XML, \
                    and LaTeX. Includes reStructuredText, the easy to read, \
                    easy to use, what-you-see-is-what-you-get plaintext \
                    markup language.
platforms           darwin
supported_archs     noarch

homepage            http://docutils.sourceforge.net/
master_sites        sourceforge:project/docutils/docutils/${version}/
distname            docutils-${version}

checksums           md5    20ac380a18b369824276864d98ec0ad6 \
                    sha1   3894ebcbcbf8aa54ce7c3d2c8f05460544912d67 \
                    rmd160 73fa71348388f4c47c70d8894e7c154d48e0c1b2

python.versions     24 25 26 27 31 32 33

if {$subport != $name} {
    depends_lib         port:py${python.version}-roman
    
    # we want e.g. *-2.7.py not *.py-2.7
    python.link_binaries no
    python.move_binaries no
    post-destroot {
        foreach f {rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xml rstpep2html rst2xetex} {
            if {${python.version} >= 26} {
                ln -s ${python.prefix}/bin/${f}.py ${destroot}${prefix}/bin/${f}-${python.branch}.py
            } else {
                move ${destroot}${prefix}/bin/${f}.py ${destroot}${prefix}/bin/${f}-${python.branch}.py
            }
        }
    }
    livecheck.type  none
} else {
    livecheck.url   http://sourceforge.net/api/file/index/project-id/38414/rss
    livecheck.regex {docutils/([0-9.]+)}    
}
