# -*- 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                    augeas
version                 1.12.0
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
master_sites            http://download.augeas.net/

checksums               rmd160  989b454bdf814faab8164ad86b04cdd1e0635c97 \
                        sha256  321942c9cc32185e2e9cb72d0a70eea106635b50269075aca6714e3ec282cb87 \
                        size    2429279

depends_build           port:pkgconfig port:naturaldocs
depends_lib             port:readline port:libxml2

patchfiles              patch-fix-build.diff

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


livecheck.type          regex
livecheck.url           [lindex ${master_sites} 0]
livecheck.regex         ${name}-(\[0-9.\]+)${extract.suffix}
