# -*- 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
# $Id: Portfile 117990 2014-03-18 15:07:09Z mmoll@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-py2app
version             0.8
categories-append   devel
license             {MIT PSF}
maintainers         jmr openmaintainer
description         converts python scripts into executable Mac OS X apps
long_description \
    A distutils extension which converts python scripts into executable \
    Mac OS X applications, able to run without requiring an existing python \
    installation.  This is a replacement for bundlebuilder.

platforms           darwin

homepage            http://wiki.python.org/moin/MacPython/py2app
master_sites        https://pypi.python.org/packages/source/p/py2app/
distname            py2app-${version}

checksums           md5 b72b65c5a0b86b569963e7372aa9ba43 \
                    rmd160 5c40b179e47f875a27b1479cb6e5ebf249c40f77 \
                    sha256 8caa118a728c33f5456f7c34a53da7714674aadbd2fd15182a488656e8c5cf0a

python.versions     24 25 26 27 31 32 33 34

if {${name} ne ${subport}} {
    depends_lib     port:py${python.version}-macholib

    post-destroot {
        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport} \
        ${destroot}${prefix}/share/examples/${subport}
        xinstall -m 644 -W ${worksrcpath} LICENSE.txt README.txt \
        ${destroot}${prefix}/share/doc/${subport}
        eval file copy [glob ${worksrcpath}/examples/*] \
        ${destroot}${prefix}/share/examples/${subport}
    }
    livecheck.type  none
    if {${python.version} <= 25} {
        version     0.6.4
        checksums   md5 40e7f788e897567ba2ad2855e43ac127 \
                    sha256 b42a3d7392c1c716e2ddd8f20f5f200a96415d1badbc981edfffc4971f70c3d9
        distname    py2app-${version}
    }
} else {
    livecheck.type  regex
    livecheck.url   https://pypi.python.org/pypi/py2app/
    livecheck.regex py2app (0\.\[0-9\]+(\.\[0-9\]+)?)
}
