# -*- 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                tinyows
version             1.2.2
revision            0
maintainers         {yahoo.com:n_larsson @nilason} openmaintainer
categories          gis
license             GPL-2+

description         TinyOWS is a small footprint WFS server
long_description    TinyOWS is a WFS server part of MapServer that can be installed in a\
                    standalone configuration using FastCGI.

homepage            https://mapserver.org/tinyows
master_sites        https://download.osgeo.org/mapserver

checksums           rmd160  cd6ce678ecf4f2d593d937b7af57044989bcf7d2 \
                    sha256  fb14a17c8d7c1625bff5f115895cd550bc758b0e048baa21ae0b228e3919839f \
                    size    1218690

patchfiles          patch-Makefile_in.diff \
                    patch-ows_define_h.diff

depends_lib         port:libxml2 \
                    port:postgresql16 \
                    port:pg16-postgis \
                    port:fcgi

depends_build       port:autoconf \
                    port:flex

configure.args      --with-xml2-config=${prefix}/bin/xml2-config \
                    --with-pg_config=${prefix}/lib/postgresql16/bin/pg_config \
                    --with-shp2pgsql=${prefix}/lib/postgresql16/bin/pg_config \
                    --with-fastcgi=${prefix}

pre-configure {
    system "mv ${worksrcpath}/configure.in ${worksrcpath}/configure.ac"
    system "cd ${worksrcpath} && autoupdate"
    system "cd ${worksrcpath} && ./autogen.sh"
}

notes               "A demo configuration file has been copied into '${prefix}/etc/tinyows.xml'." \
                    "Edit it, and/or copy to location of your choise, according to your needs." \
                    "Set its path to environment variable TINYOWS_CONFIG_FILE" \
                    "(see https://mapserver.org/tinyows/configfile.html)." \
                    "Copy or link '${prefix}/bin/tinyows' to your Fast CGI directory."

livecheck.type      regex
livecheck.url       https://download.osgeo.org/mapserver
livecheck.regex     tinyows-(\[0-9.\]+)${extract.suffix}
