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

ruby.branches       3.3 3.2 3.1 3.0 2.7
ruby.setup          ronn-ng 0.9.1 fetch
github.setup        apjanke ronn-ng 0.9.1 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
categories-append   www devel
license             MIT
maintainers         {judaew @judaew} openmaintainer
supported_archs     noarch
platforms           any
description         An updated fork of ronn. Build man pages from Markdown.
long_description    Ronn-NG is a new, currently-maintained fork of the defunct \
                    original Ronn project.  Ronn builds manuals. It converts \
                    simple, human readable textfiles to roff for terminal \
                    display, and also to HTML for the web.
homepage            https://github.com/apjanke/ronn-ng

checksums           rmd160  67dcde879fab39f84612fbddb2ebed097eb6bdc8 \
                    sha256  41a7e9e621537654d1fd0cea5b60a0fca3c9d2a7ebddf6c7be8721612df88164 \
                    size    68096

if {${name} ne ${subport}} {
    depends_lib-append  port:rb${ruby.suffix}-mustache \
                        port:rb${ruby.suffix}-nokogiri \
                        port:rb${ruby.suffix}-kramdown

    patchfiles          patch-relax-dependencies.diff

    use_configure       no

    build.cmd           ${ruby.gem}
    build.target        build
    build.args          ronn-ng.gemspec

    build {
        command_exec build
    }

    destroot.cmd        ${ruby.gem}
    destroot.target     install
    destroot.args       --local --force --install-dir ${destroot}${ruby.gemdir}
    destroot.env-append rake=${ruby.rake}
    destroot.post_args  ronn-ng-${version}.gem

    destroot {
        command_exec destroot

        set binDir ${destroot}${ruby.gemdir}/bin
        if {[file isdirectory $binDir]} {
            foreach file [readdir $binDir] {
                file copy [file join $binDir $file] ${destroot}${ruby.bindir}
            }
        }
    }

    livecheck.type      none
}

github.livecheck.regex {([0-9.-]+)}
