# -*- 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-imdb
version             6.8
revision            0

platforms           darwin
supported_archs     noarch
license             GPL-2+
maintainers         nomaintainer

description         python module providing access to the IMDb movie database
long_description    py-imdb is a Python package useful to retrieve and manage \
                    the data of the IMDb movie database.

homepage            https://imdbpy.sourceforge.io/
master_sites        sourceforge:imdbpy
distname            IMDbPY-${version}

checksums           rmd160  b420c6d0b80cae2ef96e25508c522cc5b60cb064 \
                    sha256  e3a0c9b97c444b2ce1a0d87f0ad2ac40937306859ef4aff8aa49b7c1a3073e63 \
                    size    305351

python.versions     27 37

if {${name} ne ${subport}} {
    depends_lib-append \
                    port:py${python.version}-lxml \
                    port:py${python.version}-setuptools \
                    port:py${python.version}-sqlalchemy

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath}/docs GPL.txt LICENSE.txt \
            Changelog.rst imdbpy.cfg ${destroot}${docdir}

        move ${destroot}${docdir}/imdbpy.cfg \
            ${destroot}${docdir}/imdbpy.cfg.sample-${python.branch}
    }

    post-activate {
        if {![file exists ${prefix}/etc/imdbpy.cfg]} {
            copy ${prefix}/share/doc/${subport}/imdbpy.cfg.sample-${python.branch} \
                ${prefix}/etc/imdbpy.cfg
        }
    }

    livecheck.type  none
}
