# -*- 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.1
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  0aabcf2c8611863e966e0463aaca3422df890d4c \
                    sha256  bf19dd7a3f3e5a19c2d46e3ddcc59dc5757831405761348f0bcb1c732774edaa \
                    size    12293579

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/
