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

name                ttyrec
version             1.0.8
revision            2
categories          sysutils
maintainers         {cal @neverpanic} openmaintainer
platforms           darwin
license             BSD
description         ttyrec is a tty recorder and player.
long_description    \
    ttyrec is a tty recorder. Recorded data can be played back with the \
    included ttyplay command. ttyrec is just a derivative of script command \
    for recording timing information with microsecond accuracy as well. It \
    can record emacs -nw, vi, lynx, or any programs running on tty.

homepage            http://0xcc.net/ttyrec/
master_sites        ${homepage}

checksums           rmd160  f7538fa742d1c1e07b8b48f3fa79cfcf13ca8044 \
                    sha256  ef5e9bf276b65bb831f9c2554cd8784bd5b4ee65353808f82b7e2aef851587ec \
                    size    8528

use_configure       no

patchfiles          patch-ttyrec.c-openpty-in-utilh.diff \
                    implicit.patch
configure.cflags-append \
                    -DHAVE_openpty

variant universal {}

build.args          CC='${configure.cc}' \
                    CFLAGS='${configure.cflags} [get_canonical_archflags cc]' \
                    LDFLAGS='${configure.ldflags} [get_canonical_archflags ld]'

destroot {
    xinstall -m 755 -W ${worksrcpath} ttyrec ttyplay ttytime ${destroot}${prefix}/bin
    xinstall -m 644 -W ${worksrcpath} ttyrec.1 ttyplay.1 ttytime.1 ${destroot}${prefix}/share/man/man1
    
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} README ${destroot}${docdir}
}

livecheck.regex     "${name}-(\[0-9.\]+)\\${extract.suffix}"
livecheck.type      regex
livecheck.url       ${homepage}

