# -*- 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 91625 2012-04-07 01:47:32Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-sphinx
version             1.1.3
revision            1
categories-append   textproc devel
license             BSD
maintainers         jmr gmail.com:michel.sylvan openmaintainer
description         Python documentation generator
long_description \
    Sphinx is a tool that makes it easy to create intelligent and beautiful \
    documentation for Python projects (or other documents consisting of \
    multiple reStructuredText sources), written by Georg Brandl. It was \
    originally created to translate the new Python documentation, but has now \
    been cleaned up in the hope that it will be useful to many other projects.

platforms           darwin
supported_archs     noarch

homepage            http://sphinx.pocoo.org/
master_sites        http://pypi.python.org/packages/source/S/Sphinx/
distname            Sphinx-${version}

checksums           md5 8f55a6d4f87fc6d528120c5d1f983e98 \
                    rmd160 5d4fe35a3d22d31965692d427421fde02b508a38 \
                    sha256 34dc95b70a2b07a61b5d61034c34b05f82514aab54ad27adedb49cee911bb8e9

python.versions     24 25 26 27

if {$subport != $name} {

    depends_lib     port:py${python.version}-docutils

    depends_run     port:py${python.version}-pygments \
                    port:py${python.version}-jinja2 \
                    port:sphinx_select

    if {${python.version} <= 25} {
        post-destroot {
            foreach f [glob -directory "${destroot}${prefix}/bin" *] {
                move ${f} ${f}-${python.branch}
            }
        }
    }

    select.group    sphinx
    select.file     ${filespath}/py${python.version}-sphinx

    notes "
To make the Python ${python.branch} version of Sphinx the one that is run when\
you execute the commands without a version suffix, e.g. 'sphinx-build', run:

port select --set ${select.group} [file tail ${select.file}]
"

    livecheck.type  none

} else {

    livecheck.type  regex
    livecheck.regex {<p>Current version: <b>([0-9.]+)</b></p>}

}
