# $Id: Portfile 84189 2011-09-20 06:09:59Z blb@macports.org $

PortSystem          1.0
PortGroup           python27 1.0

name                bkchem
version             0.13.0
revision            1
categories          science python
platforms           darwin
maintainers         nomaintainer
supported_archs     noarch
license             GPL-2+

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

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

checksums           sha1    ab38ba090682f36b1f34c7805f888c5c92e75186 \
                    rmd160  d6fba65d2c4cb58f9d9c3f6a4e8e850e2338ec8e

depends_lib-append  port:py27-tkinter
patchfiles          patch-setup.py.diff

# Not a module port so don't keep a python version in the link
python.link_binaries_suffix

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}
