# $Id: Portfile 114324 2013-12-05 08:44:51Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-imdb
version             4.8.2
revision            1
license             GPL-2+
python.versions     24 25 26
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.

platforms           darwin

homepage            http://imdbpy.sourceforge.net/
master_sites        sourceforge:imdbpy
distname            IMDbPY-${version}

checksums           rmd160  7641b6743fdc82dc01d673a6fe8be737000b4b16 \
                    sha256  38973f80f794238fded6ca1794d4832c9c039d33664f0da27fc5adf595c2588f

if {${name} ne ${subport}} {
    depends_build   port:py${python.version}-setuptools
    depends_lib     port:py${python.version}-lxml \
                    port:py${python.version}-sqlalchemy
    build.cmd-append      --without-sqlobject
    destroot.cmd-append   --without-sqlobject
    post-destroot {
       move ${destroot}${python.prefix}/etc/imdbpy.cfg \
          ${destroot}${python.prefix}/etc/imdbpy.cfg.sample-${python.branch}
       eval move [glob ${destroot}${python.prefix}/doc/*] \
          ${destroot}${prefix}/share/doc/${subport}
    }
    post-activate {
        if {![file exists ${python.prefix}/etc/imdbpy.cfg]} {
            copy ${python.prefix}/etc/imdbpy.cfg.sample-${python.branch} ${python.prefix}/etc/imdbpy.cfg
        }
    }
}
