# -*- 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
PortGroup           github 1.0

name                py-shapely
github.setup        Toblerity Shapely 1.6.4
python.versions     27 34 35 36 37
categories-append   devel
platforms           darwin
maintainers         {snc @nerdling} 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       pypi:S/Shapely

checksums           md5     4846fc466221356fb6cd6e2eb6714b0f \
                    rmd160  1acd9df39ac68c4aaf6e93f6fe84b43769222710 \
                    sha256  03fb8d96671d9260d5029f89ce74afad6d50d4f313116b812519652be66093c3

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

    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.type  regex
    livecheck.url   https://pypi.python.org/pypi/Shapely/json
    livecheck.regex {Shapely-(\d+(?:\.\d+)*)\.[tz]}
}