# -*- 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 90965 2012-03-20 09:46:24Z jmr@macports.org $

PortSystem 1.0
PortGroup python 1.0

name                py-mechanize
version             0.2.5
categories          python www
license             {BSD ZPL-2.1}
platforms           darwin
supported_archs     noarch
maintainers         krischik akitada openmaintainer
description         Stateful programmatic web browsing
long_description    Stateful programmatic web browsing, after Andy \
                    Lester's Perl module WWW::Mechanize.

homepage            http://wwwsearch.sourceforge.net/mechanize
master_sites        http://pypi.python.org/packages/source/m/mechanize \
                    ${homepage}/src
distname            mechanize-${version}
checksums           md5 32657f139fc2fb75bcf193b63b8c60b2 \
                    sha1 9d2fb74fc762e54848c0b3ed4b6a9c73722ef619 \
                    rmd160 f9deafaeb591cd4047a6f8845221463320c86d9b

python.versions     24 25 26 27

if {$subport != $name} {
    test.run            yes
    test.cmd            ${python.bin}
    test.target         test.py
    
    post-destroot {
        foreach f [glob -directory ${worksrcpath}/ *.txt *.html] {
            copy $f ${destroot}${prefix}/share/doc/${subport}/[file tail $f]
        }
        foreach f [glob -directory ${worksrcpath}/examples *] {
            copy $f ${destroot}${prefix}/share/doc/${subport}/examples/[file tail $f]
        }
    }
}
