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

# clock_{get,set}time, getline, O_CLOEXEC
legacysupport.newest_darwin_requires_legacy 15

github.setup            hercules-team augeas 1.15.0 release-
github.tarball_from     releases
revision                0
categories              sysutils
license                 LGPL-2.1+
maintainers             nomaintainer

description             configuration editing tool

long_description        ${name} is a {*}${description}. It parses configuration \
                        files in their native formats and transforms them \
                        into a tree. Configuration changes are made by \
                        manipulating this tree and saving it back into native \
                        config files

homepage                https://augeas.net/

checksums               rmd160  4a1928c3aed7c7632af7fe0c0278cf9b1d618390 \
                        sha256  95b2b5c4c10c964024c694d6349024e8033dcfa1aaba88884ea09394908d30ff \
                        size    2667596

depends_build-append    path:bin/pkg-config:pkgconfig \
                        port:naturaldocs
depends_lib-append      port:readline \
                        port:libxml2

configure.args          --disable-silent-rules \
                        ac_cv_path_ND_PROG=${prefix}/bin/NaturalDocs \
                        ac_cv_prog_AWK=/usr/bin/awk

# this port doesn't build the examples as 32 bit <https://trac.macports.org/ticket/57897>
if {(!(${universal_possible} && [variant_isset universal]) && ${configure.build_arch} in "i386 ppc") ||
    (${universal_possible} && [variant_isset universal] &&
    ("i386" in ${configure.universal_archs} || "ppc" in ${configure.universal_archs}))} {
    post-patch {
        reinplace "s|examples||" ${worksrcpath}/Makefile.am
    }
    use_autoreconf       yes
}

post-destroot {
    file mkdir ${destroot}${prefix}/share/doc/${name}
    move ${worksrcpath}/doc/naturaldocs/output/c_api ${destroot}${prefix}/share/doc/${name}
    move ${worksrcpath}/doc/naturaldocs/output/lenses ${destroot}${prefix}/share/doc/${name}
}
