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

name                cupl
version             1.10
categories          lang
license             BSD
maintainers         nomaintainer

description         CUPL/CORC interpreter

long_description    Interpreter for the archaic CUPL and CORC programming \
                    languages. Includes full documentation and a chrestomathy \
                    of programs.

homepage            http://www.catb.org/~esr/cupl/
master_sites        ${homepage}

checksums           rmd160  ad861d318f3cb6fc97943fbae66695788b2b262d \
                    sha256  9eb7b945de31ce40980b1fe5e290fcb862bf258b22b31619a0f5b2a01a305fb6 \
                    size    105087

depends_build       port:bison

patchfiles          Makefile.patch \
                    cupl.h.patch \
                    cupl.l.patch \
                    cupl.y.patch \
                    execute.c.patch \
                    interpret.c.patch \
                    main.c.patch \
                    monitor.c.patch

# mv: y.tab.c: No such file or directory
use_parallel_build  no

build.target        cupl

# The Makefile directs us to set these variables this way for production use.
build.args          CDEBUG= \
                    YFLAGS=-l

test.run            yes
test.dir            ${worksrcpath}/test
test.cmd            ./TESTALL
test.target

destroot {
    xinstall -m 755 ${worksrcpath}/cupl ${destroot}${prefix}/bin
    xinstall -m 644 ${worksrcpath}/cupl.1 ${destroot}${prefix}/share/man/man1
    set docdir ${destroot}${prefix}/share/doc/cupl
    xinstall -m 755 -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} README COPYING NEWS corc.doc cupl.doc ${docdir}
    copy ${worksrcpath}/test ${docdir}
}
