# $Id: Portfile 66118 2010-04-06 04:57:38Z jmr@macports.org $

PortSystem          1.0
PortGroup           python26 1.0

name                py26-pygments
version             1.3.1
revision            1
license             BSD
categories-append   devel
maintainers         openmaintainer erickt
description         Python syntax highlighter
long_description \
    Pygments is a fast syntax highlighter written in Python with a \
    special focus on details. Can highlight source code in many supported \
    languages: Python, Ruby, PHP, HTML etc. Outputs arbitrarily-styled \
    HTML or LaTeX, comes with many builtin styles.

platforms           darwin
if {[info exists supported_archs]} {
    supported_archs noarch
}

homepage            http://pygments.org
master_sites        http://pypi.python.org/packages/source/P/Pygments
distname            Pygments-${version}

depends_lib         port:py26-distribute

checksums           md5     54be67c04834f13d7e255e1797d629a5 \
                    sha1    947f90c5f71e83ec68161b33204b860a4cfd0742 \
                    rmd160  f5c6ea125a5faa4eef9ead232cae698cdf080d5a

post-destroot {
    ln -sf ${python.prefix}/bin/pygmentize \
        ${destroot}${prefix}/bin/pygmentize-${python.branch}

    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} AUTHORS CHANGES LICENSE TODO \
        ${destroot}${docdir}
    copy ${worksrcpath}/docs/build ${destroot}${docdir}/html

    set man1 ${python.prefix}/share/man/man1
    xinstall -d ${destroot}${man1}
    xinstall -m 644 ${worksrcpath}/docs/pygmentize.1 ${destroot}${man1}
    ln -sf ${man1}/pygmentize.1 \
        ${destroot}${prefix}/share/man/man1/pygmentize-${python.branch}.1
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     {Pygments-(\d+(?:\.\d+)*)}
