# -*- 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

PortSystem          1.0
PortGroup           python 1.0

name                py-beautifulsoup4
version             4.13.3
revision            0

categories-append   textproc
license             MIT
maintainers         {mps @Schamschula} openmaintainer
supported_archs     noarch
platforms           {darwin any}
description         Python HTML/XML parser
long_description    Beautiful Soup is a Python HTML/XML parser designed for \
                    quick turnaround projects like screen-scraping.

checksums           rmd160  1fdc83f8e719a4acbeb57b6a54a0edd2ae4698e5 \
                    sha256  1bd32405dacc920b42b83ba01644747ed77456a65760e285fbc47633ceddaf8b \
                    size    619516

homepage            https://www.crummy.com/software/BeautifulSoup/

python.versions     27 35 36 39 310 311 312 313

if {${name} ne ${subport}} {
    if {${python.version} < 36} {
        version     4.6.3
        revision    0
        epoch       1

        checksums   rmd160  fc039d0cd41ef5612cdd57fcdfff4b1758a85a1a \
                    sha256  90f8e61121d6ae58362ce3bed8cd997efb00c914eae0ff3d363c32f9a9822d10 \
                    size    167469

    }

    if {${python.version} == 36} {
        version     4.11.1
        revision    0
        checksums   rmd160  0a9ccdd1c636048e47225e675456e34684ba1163 \
                    sha256  ad9aa55b65ef2808eb405f46cf74df7fcb7044d5cbc26487f96eb2ef2e436693 \
                    size    517113
    }

    if {${python.version} <= 36} {
        depends_build-append \
                    port:py${python.version}-setuptools
    }

    if {${python.version} > 36} {
        python.pep517_backend   hatch
    }

    if {${python.version} > 35} {
        depends_lib-append \
                    port:py${python.version}-soupsieve
    }

    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} \
            LICENSE \
            NEWS.txt \
            README.md \
            ${destroot}${docdir}
        if {${python.version} < 36} {
            xinstall -m 644 -W ${worksrcpath} \
                COPYING.txt ${destroot}${docdir}
        }
    }

    default_variants    +html5lib +lxml

    test.run        yes

    livecheck.type  none
}
