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

github.setup        dfoxfranke libaes_siv 1.0.0 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            2
categories          security devel
maintainers         {fwright.net:fw @fhgwright} openmaintainer

description         A C implementation of AES-SIV

long_description    This is an RFC5297-compliant C implementation of AES-SIV, \
                    written by Daniel Franke on behalf of Akamai Technologies \
                    and published under the Apache License (v2.0). It uses \
                    OpenSSL for the underlying AES and CMAC implementations \
                    and follows a similar interface style.

license             apache-2

# This project's release tarballs are in the 'archive' subdirectory.
# Using the default master_sites gets a slightly different tarball.
github.master_sites ${github.homepage}/archive/${git.branch}

checksums           rmd160  c9e247100cb462650a16bd18aee05677adca8751 \
                    sha256  a974406dc3e3addbecdc0f0c1e2050bede1c7b4394595e9536094a87dac617c9 \
                    size    18829

default_variants    +doc

variant doc description {Build manpages (depends on asciidoc)} {
    depends_build-append    port:asciidoc
}
if {![variant_isset doc]} {
    configure.args-append   -DDISABLE_DOCS=1
}

# NOTE: doesn't work with libressl
depends_lib-append  port:openssl

patchfiles          patch-cmake.diff

# NOTE: upstream code doesn't build correctly out of source
cmake.out_of_source no

test.run            yes