# $Id: Portfile 78882 2011-05-25 16:15:34Z and.damore@macports.org $

PortSystem          1.0
PortGroup           python27 1.0

name                py27-gdal
version             1.7.1
maintainers         and.damore openmaintainer
description         GDAL: Geospatial Data Abstraction Library
long_description \
    This Python package and extensions are a number of tools for programming \
    and manipulating the GDAL Geospatial Data Abstraction Library.
platforms           darwin
homepage            http://www.gdal.org
master_sites        http://pypi.python.org/packages/source/G/GDAL/
distname            GDAL-${version}
checksums           md5     38b838d528b309a28a3aa24d4fcef3cd \
                    sha1    6c0f47a8979bfaeed637f0b858e422bf7405444a \
                    rmd160  be64ffb4967952cbb3c0c4779c17c82061202b34

depends_lib         port:py27-numpy \
                    port:gdal

set python.prefix   ${frameworks_dir}/Python.framework/Versions/${python.branch}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name}
    xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name}/scripts

    xinstall -W ${worksrcpath} README.txt PKG-INFO \
        ${destroot}${prefix}/share/doc/${name}

    xinstall -m 644 ${worksrcpath}/samples/README \
        ${destroot}${prefix}/share/examples/${name}/
    eval xinstall -m 755 [glob ${worksrcpath}/samples/*.py] \
        ${destroot}${prefix}/share/examples/${name}/
    eval xinstall -m 755 [glob ${worksrcpath}/scripts/*.py] \
        ${destroot}${prefix}/share/examples/${name}/scripts
    eval xinstall -m 644 [glob ${worksrcpath}/scripts/*.dox] \
        ${destroot}${prefix}/share/examples/${name}/scripts
}
