# -*- 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 105404 2013-04-19 20:22:52Z snc@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-parsing
version             1.5.7
# Python3 uses version 2.x
if {$subport != $name} {
    if {[string range [option subport] 2 3] > 30} {
        version             2.0.0
    }
}
categories-append   lang
platforms           darwin
maintainers         snc openmaintainer
license             MIT

description         alternative approach to creating parsers in python

long_description    The parsing module is an alternative approach to creating \
                    and executing simple grammars, vs. the traditional \
                    lex/yacc approach, or the use of regular expressions. The \
                    parsing module provides a library of classes that client \
                    code uses to construct the grammar directly in Python code.

homepage            http://pyparsing.wikispaces.com/
master_sites        sourceforge:project/pyparsing/pyparsing/pyparsing-${version}
distname            pyparsing-${version}

checksums           rmd160  1a298790ce3569e74a1223de495cd5a5fd87e7b4 \
                    sha256  2b3a013582cbff858e71ff23129e01acc5e99f511578d106ffb1e74bde15e893

python.versions     25 26 27 31 32 33

if {$subport != $name} {
    if {[string range [option subport] 2 3] > 30} {
        checksums           rmd160  31390927fab542ee63775458b1a4c3f5c344c0b3 \
                            sha256  79f9a468b7faad54122369b333e09a7cb80e9b68af4401bf0d19c1e7af646d0e

    } else {
        post-destroot {
            set docdir ${destroot}${prefix}/share/doc/${subport}
            xinstall -d ${docdir}
            xinstall -m 644 -W ${worksrcpath} CHANGES HowToUsePyparsing.html \
                LICENSE README ${docdir}
            eval xinstall -m 644 [glob ${worksrcpath}/docs/*] ${docdir}
            eval xinstall -m 644 [glob ${worksrcpath}/examples/*] ${docdir}/examples/
        }
    }

    if {[string range [option subport] 2 3] == 33} {
        livecheck.regex pyparsing-(2(\\.\\d+)+)
    } elseif {[string range [option subport] 2 3] == 27} {
        livecheck.regex pyparsing-(1(\\.\\d+)+)
    } else {
        livecheck.type  none
    }
} else {
    livecheck.type  none
}
