# $Id: Portfile 92174 2012-04-21 02:42:52Z aecollins1@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-gdata
version             2.0.17
categories-append   devel
maintainers         aecollins1
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     8c3600cf02c6c228e28e366b2e5d5c32 \
                    sha1    d2d9f60699611f95dd8c328691a2555e76191c0c \
                    rmd160  de5f151e7f2beed098d03e2b60c9a3621f3ec93d

python.versions     24 25 26 27
python.default_version 27

if {${subport} != ${name}} {

    if {${python.version} == 24} {
        depends_lib-append  port:py${python.version}-elementtree
    }
    depends_build-append    port:py${python.version}-distribute 

    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
    

