# -*- 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

PortGroup           openssl 1.0

name                fossil
version             2.27
revision            0
epoch               20110901182519
categories          devel
license             BSD
maintainers         {ciserlohn @ci42} openmaintainer

description         Simple, high-reliability, distributed software configuration management

long_description    Fossil is a distributed software configuration management which supports \
                    distributed version control, distributed bug tracking, distributed wiki, \
                    and a distributed blog mechanism all in single integrated package. It provides \
                    an easy-to-use web interface to access and administrate projects over the \
                    built-in webserver or CGI.

homepage            https://fossil-scm.org/home/

master_sites        ${homepage}tarball/version-${version}/
distname            fossil-src-${version}

checksums           rmd160  ee20aed32ce570d6a945a87cb54b2d5c3520e18f \
                    sha256  0405a96ba4d286b46fb5c3217d6c13391a2c637da90c51a927ee0c31c58f9064 \
                    size    7181357

test.run            yes

openssl.branch      3

depends_lib-append  port:libiconv \
                    port:sqlite3 \
                    port:tcl \
                    port:zlib

configure.args-append       --disable-fusefs \
                            --with-sqlite=${prefix}/lib \
                            --with-tcl=${prefix}/lib \
                            --with-openssl=[openssl::install_area] \
                            --with-zlib=${prefix}/lib \
                            --with-th1-docs \
                            --with-th1-hooks \
                            --json

configure.env-append "CC_FOR_BUILD=${configure.cc} [get_canonical_archflags]"

configure.ldflags-append    -liconv

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 0644 -W ${worksrcpath} \
        COPYRIGHT-BSD2.txt \
        ${docdir}
}

notes "
It is recommended to rebuild repositories created with earlier versions of\
fossil. To rebuild a repository run:

fossil rebuild /<path>/<to>/<repository>

Rebuilding a repository is a safe operation\; executing it more than once will\
not harm the integrity of a repository.
"

livecheck.type      regex
livecheck.url       ${homepage}uv/releases.md
livecheck.regex     {([\d.]+) .rarr; [0-9a-z]+ .latest.}
