# -*- 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                gmsl
version             1.1.9
revision            0
categories          devel
license             GPL-2+
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.sourceforge.net
master_sites        sourceforge
platforms           any
supported_archs     noarch
distname            ${name}-${version}
checksums           rmd160  4d28ab0290fa2c535aa5e9d1dfe1861a7a46c46f \
                    sha256  e9829575cddc5502aa95073530f5eb6b6814f676a3c1ba6d46400a4278ab9cd4 \
                    size    19845

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  ""
}
