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

github.setup        Toranktto bsd-plotutils 1.4.2
github.tarball_from archive
revision            0
conflicts           plotutils
categories          graphics
license             BSD
maintainers         {makr @mohd-akram} openmaintainer

description         Traditional plotting utilities and libraries taken from \
                    4.3BSD with some improvements.

long_description    {*}${description}

checksums           rmd160  f4c96f21683e708d6c51710160661eeb8028fd07 \
                    sha256  456394a4b37bfec5b0c745333d91754952b69fad400110fec5c71c72b82dce67 \
                    size    41306

post-patch {
    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/plot/plot.1 ${worksrcpath}/plot/plot.sh
    reinplace -E "s/f77plot|py27plot//g" ${worksrcpath}/libplot/bindings/Makefile
    system -W "${worksrcpath}" "for f in libplot/*/Makefile; do \
        echo 'LDADD+= -install_name \${PREFIX}/lib/lib\${LIB}.\${SHLIB_MAJOR}.dylib' >> \$f; \
        echo 'STRIP=' >> \$f; \
        done"
}

build.type          bsd

destroot.args-append    MANDIR=${prefix}/share/man/man
