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

name                py-appscript
version             1.2.2
revision            0

license             public-domain
maintainers         nomaintainer
description         High-level application scripting package for Python
long_description    Appscript is a high-level, user-friendly MacPython to \
                    Apple event bridge that allows you to control scriptable \
                    Mac OS X applications using ordinary Python scripts. \
                    Appscript makes MacPython a serious alternative to Apple's \
                    own AppleScript language for automating your Mac.

homepage            http://appscript.sourceforge.net/

checksums           md5 3cfc066085cb08d957ac894609f94840 \
                    rmd160 749cebfd4f5844fee3052a1abf1bcd582a0584f1 \
                    sha256 64552e87a6b8fac437951f14dd66370576dd2a311bded2aef041580f82fa2c1f

deprecated.upstream_support no
python.versions     310

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

    patchfiles      setup.py.patch
    if {(![variant_isset universal] && ${configure.build_arch} in {i386 ppc})
            || ([variant_isset universal] && ("i386" in ${configure.universal_archs}
                || "ppc" in ${configure.universal_archs}))} {
        patchfiles-append   no-lp64.patch
    }

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} README.rst \
            ${destroot}${docdir}
        file copy ${worksrcpath}/sample ${destroot}${docdir}
        file copy ${worksrcpath}/doc ${destroot}${docdir}
    }
}
