# -*- 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

github.setup        RDFLib sparqlwrapper 1.8.5
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
name                py-sparqlwrapper

categories-append   devel databases
supported_archs     noarch
platforms           {darwin any}
license             W3C
maintainers         nomaintainer

description         SPARQL Endpoint interface to Python
long_description    This is a wrapper around a SPARQL service. It helps in \
                    creating the query URI and, possibly, convert the result \
                    into a more manageable format.

homepage            https://rdflib.github.io/sparqlwrapper

checksums           rmd160  6f1eca5820f34f2e6258bb46ec08a8f5e1a6f73b \
                    sha256  c04563e30e39d9b3132c8ac455a0ee15d4816d189bdf0f443b558d880e3f18e9 \
                    size    97364

python.versions     37

if {${name} ne ${subport}} {
    patchfiles      patch-setup.py.diff

    post-patch {
        system -W ${worksrcpath} "${prefix}/bin/2to3-${python.branch} --write --nobackups SPARQLWrapper"
    }

    depends_lib-append \
                    port:py${python.version}-setuptools

    depends_run-append \
                    port:py${python.version}-rdflib

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} README.rst MANAGEMENT.md \
            LICENSE.txt ChangeLog.txt AUTHORS.md ${destroot}${docdir}
    }
}