# -*- 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-google-api
python.rootname     google-api-python-client
version             1.7.11
revision            0

categories-append   www devel
platforms           darwin
supported_archs     noarch
license             Apache-2 MIT
maintainers         nomaintainer

description         client library for accessing the Plus, Moderator, and many \
                    other Google APIs
long_description    ${description}

homepage            https://github.com/googleapis/google-api-python-client
master_sites        pypi:g/${python.rootname}/
distname            ${python.rootname}-${version}

checksums           rmd160  5bc9b7adce5d4a0e6ad3864e3f6286f706cb6a8f \
                    sha256  a8a88174f66d92aed7ebbd73744c2c319b4b1ce828e565f9ec721352d2e2fb8c \
                    size    142837

python.versions     27 35 36 37 38

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

    depends_lib-append \
                    port:py${python.version}-httplib2 \
                    port:py${python.version}-google-auth \
                    port:py${python.version}-google-auth-httplib2 \
                    port:py${python.version}-six \
                    port:py${python.version}-uritemplate

    post-destroot {
        delete ${destroot}${python.pkgd}/uritemplate

        set egg-info ${destroot}${python.pkgd}/google_api_python_client-${version}-py${python.branch}.egg-info
        foreach d [glob -dir ${egg-info} *] {
            file attributes ${d} -permissions 0644
        }

        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} README.md CHANGELOG \
            LICENSE ${destroot}${docdir}

        xinstall -d -m 555 ${destroot}${prefix}/share/examples
    }

    livecheck.type  none
}