# -*- 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 68388 2010-06-02 21:57:24Z singingwolfboy@macports.org $

PortSystem 1.0
PortGroup python26 1.0

name                py26-yaml
version             3.09
revision            0
categories-append   devel
maintainers         akitada openmaintainer
description         YAML 1.1 parser and emitter for Python
long_description \
    PyYAML is a YAML parser and emitter for Python, which supports YAML 1.1, \
    unicode input and output, low-level event-based parser and emitter API, \
    high-level API for serializing and deserializing native Python objects.

platforms           darwin

homepage            http://pyyaml.org/wiki/PyYAML
master_sites        http://pyyaml.org/download/pyyaml/
distname            PyYAML-${version}

checksums           md5     f219af2361e87fdc5e85e95b84c11d87 \
                    sha1    6131d6a42bbd3e88d7efa3784d69395a136267be \
                    rmd160  b5a5228db448e9c9507682cb36f620596a4a234c

variant libyaml description {Enable LibYAML bindings} {
    depends_lib-append      port:libyaml \
                            port:py26-pyrex
    patchfiles              patch-setup.py
}

post-patch {
    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
    xinstall -m 644 -W ${worksrcpath} LICENSE README \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath}/examples/yaml-highlight yaml_hl.cfg yaml_hl.py \
        ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
}
