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

set _name           cookies
set _n              [string index ${_name} 0]

name                py-${_name}
version             2.2.1
categories-append   devel
platforms           darwin
supported_archs     noarch
license             MIT

maintainers         {petr @petrrr} openmaintainer

description         Friendly, RFC 6265-compliant cookie parser/renderer module

long_description    \
    Python module for working with HTTP cookies: parsing and rendering \
    'Cookie:' request headers and 'Set-Cookie:' response headers, and \
    exposing a convenient API for creating and modifying cookies. \
    It can be used as a replacement of Python's `Cookie` or `http.cookies`.

homepage            https://github.com/sashahart/cookies

distname            ${_name}-${version}
master_sites        pypi:${_n}/${_name}/

checksums           md5     6f4c53aba3ed03e4e7b50812c2c2579a \
                    rmd160  a942793a1d643cb30ddf5d161e4c4b1e5c8dcf31 \
                    sha256  d6b698788cae4cfa4e62ef8643a9ca332b79bd96cb314294b864ae8d7eb3ee8e

python.versions     27 34 35 36

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

    # add documents
    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d ${dest_doc}
        xinstall -m 644 -W ${worksrcpath} README  ${dest_doc}
        # temporary: from GitHub, no LICENSE file in the tarball
        xinstall -m 644 -W ${filespath} LICENSE ${dest_doc}
    }

    livecheck.type  none
} else {
    livecheck.type  regex
    livecheck.url   https://pypi.python.org/pypi/${_name}/json
    livecheck.regex "\"${_name}-(\[.\\d\]+)\\${extract.suffix}\""
}