# -*- 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           github 1.0
PortGroup           cmake 1.1
PortGroup           legacysupport 1.1

# https://trac.macports.org/ticket/59180
legacysupport.newest_darwin_requires_legacy 10

github.setup        h2o h2o 2.2.6 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            1
categories          www
license             MIT
maintainers         {l2dy @l2dy} openmaintainer
description         the optimized HTTP/2 server
long_description    H2O is a new generation HTTP server that provides quicker \
                    response to users with less CPU utilization when compared to \
                    older generation of web servers. Designed from ground-up, \
                    the server takes full advantage of HTTP/2 features including \
                    prioritized content serving and server push, promising \
                    outstanding experience to the visitors of your web site.
homepage            https://h2o.examp1e.net/

checksums           rmd160  70574e3c904520dd059826a0a49577f6fc0e86b9 \
                    sha256  17406e6590ce014398246be5f4e50aa2264d71f7a19ed53ec611e61e94c6c647 \
                    size    16258023

depends_build-append \
                    port:pkgconfig

depends_lib         path:lib/libssl.dylib:openssl

configure.pre_args-append \
                    -DWITH_BUNDLED_SSL=OFF \
                    -DWITH_MRUBY=OFF

startupitem.create     yes
startupitem.executable ${prefix}/bin/h2o -c ${prefix}/etc/h2o.conf

post-activate {
    if {![file exists ${prefix}/etc/h2o.conf]} {
        file copy ${prefix}/share/doc/h2o/examples/h2o/h2o.conf ${prefix}/etc/h2o.conf
        reinplace "s|examples/|${prefix}/share/doc/h2o/examples/|g" ${prefix}/etc/h2o.conf
    }
}

github.livecheck.regex {([0-9.]+)}
