# $Id: Portfile 134664 2015-04-02 14:05:29Z and.damore@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-gdata
version             2.0.18
categories-append   devel
maintainers         nomaintainer
license             Apache-2
supported_archs     noarch

description         Google Data API Python Client Library
long_description \
    The Google Data Python Client Library provides a library that makes it \
    easy to access data through the Google Data APIs. Many Google services \
    (such as Google Calendar and Documents) support the Google Data API \
    protocol.
platforms           darwin
homepage            http://code.google.com/p/gdata-python-client/
master_sites        http://gdata-python-client.googlecode.com/files/
distname            gdata-${version}

checksums           md5     13b6e6dd8f9e3e9a8e005e05a8329408 \
                    sha1    4cd6804f2af81697219307421996c6055c7c16e4 \
                    rmd160  cbaf2d2540102e8d77462ad75bcf3bfa390671c2

python.versions     26 27

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

    post-destroot {
        eval reinplace \
            "s|/home/afshar/working/gdata-python-client/src|${python.prefix}/lib/python${python.branch}/site-packages|g" \
            [glob ${worksrcpath}/pydocs/*.html]

        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
        eval file copy [glob ${worksrcpath}/pydocs/*.html] \
            ${destroot}${prefix}/share/doc/${subport}

        eval reinplace "s|#!/usr/bin/python|#!${prefix}/bin/python${python.branch}|g" \
            [glob ${worksrcpath}/samples/*/*.py]
        file copy ${worksrcpath}/samples \
            ${destroot}${prefix}/share/doc/${subport}/
    }

} 

livecheck.type      googlecode
livecheck.regex     gdata-(\[0-9\.-\]+).tar.gz
    

