# -*- 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               app 1.0
PortGroup               github 1.0

github.setup            ADTPro adtpro 2_1_0 v_
revision                0
checksums               rmd160  80862646a17617389d617ad03a3d6da3ea634d8c \
                        sha256  b5ece4d6aa19dd31a2bebdf7b11129ebac7b3402b1818f00e3571610d26c0b86 \
                        size    1217467

version                 [string map {_ .} ${github.version}]
categories              emulators
maintainers             {ryandesign @ryandesign} openmaintainer
license                 GPL-2+
platforms               {darwin any}
supported_archs         noarch
use_configure           no

description \
    transfers disks and disk images between Apple IIs and modern computers

long_description \
    Apple Disk Transfer ProDOS (ADTPro) transfers diskettes and logical \
    disk images between Apple II-era computers and the modern world. \
    Disks can be transferred using a Super Serial card, IIgs modem port or \
    IIc/Laser 128 serial port\; an Uthernet Ethernet card\; or the built-in \
    cassette ports.

homepage                https://adtpro.com
github.tarball_from     releases
distname                ${github.author}-${version}

post-extract {
    copy ${filespath}/${name}.in ${workpath}/${name}
}

post-patch {
    reinplace "s|@MY_DIR@|${my_dir}|g" ${workpath}/${name}
}

build {}

set my_dir ${prefix}/libexec/${name}

destroot {
    set my_ddir ${destroot}${my_dir}
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${my_ddir}/lib ${docdir}
    xinstall -W ${worksrcpath} ac.sh adtpro.sh ${my_ddir}
    xinstall -W ${worksrcpath}/lib ADTPro-${version}.jar ${my_ddir}/lib
    copy ${worksrcpath}/lib/AppleCommander ${worksrcpath}/lib/jssc ${my_ddir}/lib
    copy ${worksrcpath}/disks ${my_ddir}
    xinstall -m 0644 -W ${worksrcpath} ADTPro.html LICENSE README ${docdir}
}

app.name                ADTPro
app.executable          ${workpath}/${name}
app.icon                lib/ADTPro.ico
