# -*- 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        jimjag dmake 4.13.1 v
revision            0
checksums           rmd160  a465767263cf58909ffaee2a3d23162fa62c9183 \
                    sha256  816664f5299b2c0ddbb717e9dcbd15f15438a724a174256b5eba0c6a6d15be6f \
                    size    677296

categories          devel
maintainers         {ryandesign @ryandesign} openmaintainer
license             GPL-1

description         ${name} is a re-implementation of the UNIX Make utility

long_description    {*}${description} with significant enhancements. \
                    ${name} executes commands found in an external file called \
                    a makefile to update one or more target names. \
                    Each target may depend on zero or more prerequisite \
                    targets. \
                    If any of the target's prerequisites is newer than the \
                    target or if the target itself does not exist, then \
                    ${name} will attempt to make the target.

homepage            https://jimjag.github.io/dmake/
github.tarball_from archive

post-extract {
    # Convert DOS to UNIX line endings so we can patch
    reinplace "s|\r||g" ${worksrcpath}/README.md
}

patchfiles          version.patch

test.run            yes
test.target         check

post-destroot {
    # https://github.com/jimjag/dmake/issues/4
    xinstall -m 0444 ${worksrcpath}/man/dmake.tf ${destroot}${prefix}/share/man/man1/dmake.1

    set docdir ${prefix}/share/${name}
    copy ${worksrcpath}/readme ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} CHANGES.md COPYING README.md ${destroot}${docdir}
}
