# -*- 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            sgrep2
version         1.94a
revision        1
checksums       rmd160  d75f644fc4ba9b0eb916f8097bf58ebe4b73154c \
                sha256  d5b16478e3ab44735e24283d2d895d2c9c80139c95228df3bdb2ac446395faf9 \
                size    193267

categories      textproc
maintainers     nomaintainer
description     structured grep is a tool for searching SGML, XML and   \
                HTML files
long_description \
    sgrep (structured grep) is a tool for searching and indexing text,  \
    SGML, XML and HTML files and filtering text streams using structural\
    criteria.

homepage        https://www.cs.helsinki.fi/u/jjaakkol/sgrep.html
master_sites    debian:s/sgrep

distname        sgrep_${version}.orig
worksrcdir      sgrep-${version}

patchfiles      implicit.patch

configure.args  --program-suffix=2 \
                --mandir=${prefix}/share/man \
                --datadir=${prefix}/share/${name}

test.run        yes
test.target     check

platform darwin arm {
    depends_build-append \
                port:automake

    # Workaround ancient configuration files not detecting Apple Silicon (aarch64)
    post-extract {
        set automake_ver 1.17
        foreach file {config.guess config.sub} {
            delete ${worksrcpath}/${file}
            copy ${prefix}/share/automake-${automake_ver}/${file} ${worksrcpath}/${file}
        }
    }
}
