# -*- 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 102584 2013-02-05 04:25:13Z larryv@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-beautifulsoup4
license             BSD
version             4.1.1
categories-append   textproc
platforms           darwin
maintainers         lightnin openmaintainer
supported_archs     noarch

description         Python HTML/XML parser
long_description    Beautiful Soup is a Python HTML/XML parser designed for \
                    quick turnaround projects like screen-scraping.

homepage            http://www.crummy.com/software/BeautifulSoup/bs4/
master_sites        http://www.crummy.com/software/BeautifulSoup/bs4/download/4.1/
distname            beautifulsoup4-${version}
checksums           md5 fccee58b4d914fb489385d672fe89f43 \
                    sha1 6ff4662fdb78cfcec6b848a328750111d83e3346 \
                    rmd160 92b5521ff5e8717fef4ab9a1890d2e4a7c0f015d

python.versions     25 26 27 31 32
python.default_version 27

livecheck.type      regex
livecheck.regex     beautifulsoup4-(\[0-9.\]+)${extract.suffix}

if {${subport} != ${name}} {
    variant html5lib description {Build with HTML5 support} {
        depends_lib-append  port:py${python.version}-html5lib
    }

    variant lxml description {Build with lxml support} {
        depends_lib-append  port:py${python.version}-lxml
    }

    post-destroot   {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 644 -W ${worksrcpath} \
            AUTHORS.txt \
            COPYING.txt \
            NEWS.txt \
            PKG-INFO \
            README.txt \
            ${destroot}${docdir}
    }

    default_variants    +html5lib +lxml
}
