# -*- 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                basex
version             12.0
revision            0
categories          databases
platforms           any
supported_archs     noarch
license             BSD
maintainers         {makr @mohd-akram} openmaintainer

description         high-performance XML database engine

long_description    BaseX is a robust, high-performance XML database engine and \
                    a highly compliant XQuery processor with full support for \
                    the W3C Update and Full Text extensions. It serves as an \
                    excellent framework for building complex data-intensive Web \
                    applications. It comes with interactive user interfaces \
                    (desktop, web-based) that give you great insight into your \
                    data.

homepage            https://basex.org

master_sites        https://files.basex.org/releases/${version}

distname            BaseX[string map {. {}} ${version}]

use_zip             yes

checksums           rmd160  223affaac75b45534929519c655ecae8b19186e4 \
                    sha256  ffd4de680a768dc906efb17cf89dda4a99285d6c93157bd7c67c578299f9f197 \
                    size    11996806

use_configure       no

worksrcdir          basex

build {
    delete {*}[glob ${worksrcpath}/bin/*.bat]
}

set root            ${prefix}/libexec/basex

destroot {
    xinstall -d ${destroot}${root}
    copy {*}[glob ${worksrcpath}/*] ${destroot}${root}
    foreach f [glob -tails -directory ${destroot} ${root}/bin/*] {
        ln -s /$f ${destroot}${prefix}/bin
    }
}

livecheck.regex     {/releases/([0-9.]+)/}
livecheck.url       https://basex.org/download/
