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

github.setup        jgrahamc gmsl 1.2.4 v
revision            0
categories          devel
license             BSD
maintainers         nomaintainer
description         GNU Make Standard Library
long_description    The GNU Make Standard Library (GMSL) is a collection of \
                    functions implemented using native GNU Make functionality \
                    that provide list and string manipulation, integer arithmetic, \
                    associative arrays, stacks and debugging facilities.
homepage            https://gmsl.jgc.org
platforms           any
supported_archs     noarch
checksums           rmd160  07e266c8cd9ebc67c44902c844971ecd9d9cec21 \
                    sha256  4f39335351c170195d02c157e25e04ad85a22f7a86e3c61452a5f18998021e99 \
                    size    22692

patchfiles          patch-gmsl-root.diff

post-patch {
    reinplace "s|@GMSL_ROOT@|${prefix}\/etc\/|g" \
        ${worksrcpath}/${name}
}

use_configure       no
build               {}

destroot {
    xinstall -m 644 -c ${worksrcpath}/${name} ${destroot}${prefix}/etc/
    xinstall -m 644 -c ${worksrcpath}/__${name} ${destroot}${prefix}/etc/
}

post-install {
    ui_msg  "Add following to your Makefile(s):"
    ui_msg  ""
    ui_msg  "  if \[ -f ${prefix}/etc/${name} ]; then"
    ui_msg  "    include ${prefix}/etc/${name}"
    ui_msg  "  fi"
    ui_msg  ""
}
