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

github.setup        softhsm SoftHSMv2 2.7.0
name                softhsm
revision            0
github.tarball_from archive
checksums           rmd160  3f3e7faa407321d0be52f80c4e3eb63a04770fa9 \
                    sha256  be14a5820ec457eac5154462ffae51ba5d8a643f6760514d4b4b83a77be91573 \
                    size    564143

license             BSD
description         \
    SoftHSM is an implementation of a cryptographic store accessible through \
    a PKCS #11 interface.
long_description    \
    ${description} \
    You can use it to explore PKCS #11 without having a Hardware Security \
    Module. SoftHSM Version 2 is using openssl for its cryptographic \
    operations.

categories          security
maintainers         {NLnetLabs.nl:jaap @Jakker} openmaintainer

homepage            https://www.softhsm.org/

patchfiles          0003-mouse07410-OSSLCryptoFactory.patch

depends_build       \
                    port:cppunit \
                    port:libtool \
                    port:pkgconfig
depends_lib         \
                    path:lib/libssl.dylib:openssl \
                    port:sqlite3

compiler.cxx_standard 2011

use_autoreconf      yes
configure.args      --with-sqlite3=${prefix} \
                    --with-objectstore-backend-db \
                    --with-openssl=${prefix}

build.type          gnu

destroot.keepdirs   ${destroot}${prefix}/var/lib/softhsm/tokens

test.run            yes
test.target         check

livecheck.regex     archive/refs/tags/((?!.*-rc)\[^\"]+)\\.tar\\.gz
