# -*- 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
# $Id: Portfile 117772 2014-03-12 17:06:55Z g5pw@macports.org $

PortSystem          1.0
PortGroup           python 1.0

set _name           scikits.samplerate
set _n              [string index ${_name} 0]

name                py-scikits-samplerate
version             0.3.3
categories-append   science audio
platforms           darwin
supported_archs     noarch
license             GPL

maintainers         bo.ingv.it:Peter.Danecek openmaintainer

description         A Python module for high quality audio resampling

long_description    \
    Samplerate is a small python package to do high quality audio resampling \
    for data in numpy arrays. It is a wrapper around the Secret Rabbit Code \
    by Erik de Castro Lopo (http://www.mega-nerd.com/SRC/), providing a high \
    quality converters based on the work of J.O. Smith from CCRMA, Stanford \
    University (https://ccrma.stanford.edu/~jos/resample/)

homepage            https://pypi.python.org/pypi/${_name}/${version}

distname            ${_name}-${version}
master_sites        https://pypi.python.org/packages/source/${_n}/${_name}/

checksums           md5     96c8d8ba3aa95a9db15994f78792efb4 \
                    rmd160  8eec6aa95de1b064bdc2c3c86170aa26f686712f \
                    sha256  05b06e729f58ab261a96f0d17e1b22733192c7450944762cceabce796ff77bdd

python.versions     26 27

livecheck.type  regex
livecheck.url   [lindex ${master_sites} 0]
livecheck.regex ">${_name}-(\\d+(\\.\\d+)+)\\${extract.suffix}<"

if {${name} ne ${subport}} {
    depends_build-append    port:py${python.version}-setuptools \
                            port:py${python.version}-numpy

    depends_lib-append      port:libsamplerate

    # Adding documentation and examples
    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d  ${dest_doc}
        xinstall -m 755 -W ${worksrcpath} \
            COPYING \
            README \
            Changelog \
                ${dest_doc}

        copy ${worksrcpath}/docs/html ${dest_doc}
        copy ${worksrcpath}/docs/pdf  ${dest_doc}
    }
    livecheck.type  none
}
