# -*- 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 119468 2014-04-26 19:10:03Z snc@macports.org $

PortSystem      1.0
PortGroup           python 1.0

name                py-shapely
version             1.3.1
python.versions     27 33 34
python.default_version 27
categories-append     devel
platforms       darwin
maintainers     snc openmaintainer
license             BSD
homepage            http://toblerity.org/shapely/
description     Shapely is a Python package for manipulation \
                and analysis of 2D geospatial geometries

long_description \
                Shapely is a Python package for manipulation and \
                analysis of 2D geospatial geometries. It is based on \
                GEOS (http://geos.refractions.net). Shapely 1.0 is not \
                concerned with data formats or coordinate reference \
                systems.

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

checksums           md5     5ac028637fbd52b9752994bdbfd9446c \
                    rmd160  b66417af40e393191617b035566affbd6fd7ff40 \
                    sha256  f458f7033e6bb811893e6c4305b28535fc09a1a10bb0d1f35bd0dc2bd5613a25

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

    patchfiles      patch-shapely_geos.py.diff

    post-patch {
            reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/shapely/geos.py
            reinplace s|\\\"cython\\\"|"${python.prefix}/bin/cython"| ${worksrcpath}/setup.py
    }

    livecheck.type      none
} else {
    livecheck.url           http://pypi.python.org/packages/source/S/Shapely/
    livecheck.regex         Shapely-(\\d+(\\.\\d+)+)${extract.suffix}
}
