# -*- 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 114785 2013-12-15 11:45:57Z hum@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-beautifulsoup4
license             MIT
version             4.3.2
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/
master_sites        http://www.crummy.com/software/BeautifulSoup/bs4/download/4.3/
distname            beautifulsoup4-${version}
checksums           rmd160  d2811f99b7fda7ff02ca7aa3e4383273edf2ea6d \
                    sha256  a2b29bd048ca2fe54a046b29770964738872a9747003a371344a93eedf7ad58e

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

livecheck.type      regex
livecheck.regex     (4\\.\[0-9.\]+)

if {${name} ne ${subport}} {
    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
}
