# -*- 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 91072 2012-03-23 13:36:49Z snc@macports.org $

PortSystem 1.0
PortGroup python 1.0

name			py-elementtree
# if version or revision change, be sure to update the py24 subport revision
version			1.2.6-20050316
python.versions 24 25 26 27
# originally for py24
# python.default_version 24
categories		python
platforms		darwin
maintainers		snc openmaintainer
license         MIT
description		flexible container object for python
long_description	The Element type is a simple but flexible container \
				object, designed to store hierarchical data structures, such \
				as simplified XML infosets, in memory. The element type can be \
				described as a cross between a Python list and a Python \
				dictionary.

homepage		http://effbot.org/zone/element-index.htm

if {${subport} != ${name}} {
    if {${python.version} == 24} {
        revision        1
    }
    master_sites	http://effbot.org/downloads/
    distname		elementtree-${version}
    checksums           rmd160  813aaf07a0fcdfb23d29b648a8e082e1674539f5 \
                        sha256  b5dd2c4e234f325abc1c7fb17815cb6cbcfef062f01065ddb05a6d6b96452f18
    use_zip			yes
    patchfiles		patch-setup.py

    depends_build-append	port:py${python.version}-distribute

    post-extract { file copy ${filespath}/ez_setup.py ${worksrcpath} }

    test.run		yes
    test.cmd		${python.bin}
    test.target		selftest.py

    post-destroot	{
        xinstall -m 644 ${worksrcpath}/README ${destroot}${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${prefix}/share/doc/${subport}/examples
        xinstall -m 644 -W ${worksrcpath}/samples simple-ns.xml simple.xml \
            ${destroot}${prefix}/share/doc/${subport}/examples
        eval file copy [glob ${worksrcpath}/docs/*] \
            ${destroot}${prefix}/share/doc/${subport}
    }
    livecheck.type  none
} else {
    livecheck.type	regex
    livecheck.url	http://effbot.org/downloads/
    livecheck.regex	elementtree-(\[0-9\.-\]+).tar.gz
}
