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

name                py-magic
version             0.4.15
revision            0
categories-append   devel
platforms           darwin
license             MIT
supported_archs     noarch

python.versions     27 35 36 37

maintainers         {stromnov @stromnov} openmaintainer

description         File type identification using libmagic

long_description    Determines the mime type of a file using magic \
                    numbers. Can also operate on arbitrary data streams. \
                    Much like the Unix file(1) program.

homepage            https://github.com/ahupp/python-magic
master_sites        pypi:p/python-magic

distname            python-magic-${version}

checksums           rmd160  ad4925d65a20c56ff8696070ac7afdd824989c29 \
                    sha256  f3765c0f582d2dfc72c15f3b5a82aecfae9498bd29ca840d72f37d7bd38bfcd5 \
                    size    73194

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

    patchfiles          patch-prefix-lib.diff

    post-patch {
        reinplace -E "s:__PREFIX__:${prefix}:g" ${worksrcpath}/magic.py
    }

    livecheck.type      none
} else {
    livecheck.name      python-magic
}