# -*- 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-m2crypto
version            0.36.0
revision           1
categories-append  crypto devel
platforms          darwin
# demos include some Apache-2 and ZPL-2 files but are not installed
license            MIT
maintainers        {gmail.com:allan.que @aque} openmaintainer

description        Crypto and SSL toolkit for Python
long_description   M2Crypto is the most complete Python wrapper for OpenSSL.
homepage           https://pypi.python.org/pypi/${python.rootname}

master_sites       pypi:m/${python.rootname}/
distname           M2Crypto-${version}
checksums          size    1127584 \
                   rmd160  e813fd1da12a8b8a5550931129d29977a25cef5d \
                   sha256  1542c18e3ee5c01db5031d0b594677536963e3f54ecdf5315aeecb3a595b4dc1

python.versions    27 35 36 37 38 39

if {${name} ne ${subport}} {
  depends_build      port:py${python.version}-setuptools
  depends_lib-append port:swig-python \
                     path:lib/libssl.dylib:openssl

  if {${python.version} < 35} {
    depends_lib-append \
                     port:py${python.version}-typing
  }

  patchfiles         patch-setup.py

  build.env-append   SWIG_FEATURES=-I${prefix}/include
  build.cmd-append   build_ext --openssl=${prefix}

  test.run           yes

  livecheck.type     none
}
