# -*- 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
# $Id: Portfile 119206 2014-04-20 16:43:53Z jeremyhu@macports.org $

PortSystem          1.0

name                cyassl
version             2.9.4
revision            1
categories          devel security
platforms           darwin
maintainers         yassl.com:chris
homepage            http://www.wolfssl.com/yaSSL/Products-cyassl.html
license             GPL-2
description         CyaSSL Embedded SSL Library

long_description    \
    The CyaSSL embedded SSL library is a lightweight SSL library written \
    in ANSI C and targeted for embedded and RTOS environments - primarily \
    because of its small size, speed, and feature set.  It is commonly \
    used in standard operating environments as well because of its \
    royalty-free pricing and excellent cross platform support.  CyaSSL \
    supports industry standards up to the current TLS and DTLS 1.2 levels, \
    is up to 20 times smaller than OpenSSL, and offers progressive ciphers \
    such as HC-128, RABBIT, and NTRU.

master_sites        http://www.wolfssl.com/
use_zip             yes

checksums           md5     87e42367e43983463d29191e42b27422 \
                    sha1    64840f1bc6270874e2fc1bae2f88a728f567b1c4 \
                    rmd160  0d28ab39121b3cc0af0bdcf06cdb0fbfe646ac6d \
                    sha256  4c68a6157f3a197f6fbd07456506e0b4a65a38ec08441fb22265d188b69a49be

configure.args      --enable-opensslExtra \
                    --enable-dtls \
                    --enable-savesession \
                    --enable-atomicuser \
                    --enable-pkcallbacks \
                    --enable-aesgcm \
                    --enable-aesccm \
                    --enable-camellia \
                    --enable-md2 \
                    --enable-md4 \
                    --enable-nullcipher \
                    --enable-ripemd \
                    --enable-blake2 \
                    --enable-sha384 \
                    --enable-sha512 \
                    --enable-sessioncerts \
                    --enable-keygen \
                    --enable-certgen \
                    --enable-certreq \
                    --enable-sep \
                    --enable-hkdf \
                    --enable-dsa \
                    --enable-ecc \
                    --enable-fpecc \
                    --enable-eccencrypt \
                    --enable-psk \
                    --enable-pwdbased \
                    --enable-hc128 \
                    --enable-rabbit \
                    --enable-ocsp \
                    --enable-crl \
                    --enable-crl-monitor \
                    --enable-sni \
                    --enable-maxfragment \
                    --enable-truncatedhmac \
                    --enable-renegotiation-indication \
                    --enable-supportedcurves \
                    --enable-tlsx \
                    --enable-pkcs7 \
                    --enable-scep \
                    --enable-testcert \
                    --enable-fastmath \
                    --enable-gcc-hardening \
                    --enable-static \

variant debug description {Enable CyaSSL debugging support} {
    configure.args-append \
        --enable-debug
}

variant aesni description {Enable CyaSSL Intel AES-NI support, if available} {
    configure.args-append \
        --enable-aesni
}

variant sniffer description {Enable CyaSSL sniffer support} {
    depends_lib-append \
        port:libpcap
    configure.args-append \
        --enable-sniffer
}

patchfiles      honor_cflags.patch

use_autoreconf  yes
autoreconf.args -fvi
