# -*- 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                bkchem
version             0.13.0
revision            1
categories          science python chemistry
maintainers         nomaintainer
supported_archs     noarch
platforms           {darwin any}
license             GPL-2+

description         Free chemical drawing program.
long_description    Free chemical drawing program written in Python by Beda \
                    Kosata.

homepage            https://bkchem.zirael.org
master_sites        ${homepage}/download/

checksums           sha1    ab38ba090682f36b1f34c7805f888c5c92e75186 \
                    rmd160  d6fba65d2c4cb58f9d9c3f6a4e8e850e2338ec8e

python.default_version  27

depends_lib-append  port:py${python.version}-tkinter
patchfiles          patch-setup.py.diff

post-patch {
    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
    reinplace "s|__PYTHON__|${python.bin}|g" ${worksrcpath}/setup.py
    reinplace "s|__PYTHON_PKGD__|${python.pkgd}|g" ${worksrcpath}/setup.py
}

post-destroot {
    file delete -force "${destroot}${prefix}/share"
    move ${destroot}${python.prefix}/share ${destroot}${prefix}
}

livecheck.type      regex
livecheck.url       ${homepage}/download_en.html
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
