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

gitlab.setup    rockdaboot libhsts 0.1.0 libhsts-
revision        1

description     \
    Library to easily check a domain against the Chromium HSTS Preload list.

long_description \
    {*}${description} The HSTS preload list is a list of domains that support \
    HTTPS. The list is compiled by Google and is utilised by Chrome, Firefox \
    and others. With this information, a HTTP client may contact a website \
    without trying a plain-text HTTP connection first. It prevents \
    interception with redirects that take place over HTTP. None of the sent \
    data will ever be unencrypted.


categories      www devel
license         MIT
maintainers     {gmail.com:herby.gillot @herbygillot} \
                openmaintainer

set python_ver  313

set python_branch \
    [string index ${python_ver} 0].[string range ${python_ver} 1 end]

set python_bin  ${prefix}/bin/python${python_branch}

checksums       rmd160  9c53ed69320201d625f832cbf1241dc167fcc531 \
                sha256  3f9eb7ca48189d9ebfe3386e21a3ad393fc90f9bb2674f719daa451b765d2668 \
                size    47304

post-patch {
    reinplace -E "s/@@PYVER@@/${python_branch}/" \
        ${worksrcpath}/configure.ac
    reinplace -E "s|#!/usr/bin/env python|#!${python_bin}|" \
        ${worksrcpath}/src/hsts-make-dafsa
}

post-destroot {
    xinstall -m 0755 \
        ${worksrcpath}/src/hsts-make-dafsa ${destroot}${prefix}/bin/
}

patchfiles-append \
                patch-configure.ac.diff \
                patch-tests-Makefile.am.diff

depends_build-append \
                port:autoconf-archive \
                port:gettext \
                port:gsed \
                path:bin/pkg-config:pkgconfig \
                port:python${python_ver} \
                port:wget

depends_run-append \
                port:python${python_ver}

use_autoreconf  yes
autoreconf.args -fvi

configure.python \
                ${python_bin}

configure.args-append \
                --disable-silent-rules
