# Contributor: Frank Felhoffer <silveraid@hackme.ca>
# Maintainer: Frank Felhoffer <silveraid@hackme.ca>
pkgname=softhsm
pkgver=2.3.0
pkgrel=1
pkgdesc="cryptographic store accessible through a PKCS #11"
url="http://www.softhsm.org/"
arch="all"
license="BSD-2-Clause"
depends="libressl"
makedepends="libressl-dev automake autoconf libtool file"
install=""
subpackages="$pkgname-doc"
source="softhsm-$pkgver.tar.gz::https://github.com/opendnssec/SoftHSMv2/archive/$pkgver.tar.gz
        01_aes_mac_fix.patch"
builddir="$srcdir/SoftHSMv2-2.3.0"
patch_args="-p1"

prepare() {
        default_prepare
        cd "$builddir"
        sh autogen.sh
}

build() {
        cd "$builddir"
        ./configure \
                --prefix=/usr \
                --sysconfdir=/etc \
                --localstatedir=/var \
                --disable-gost \
                --disable-static
        make
}

package() {
        cd "$builddir"
        make -j1 DESTDIR="$pkgdir/" install
}

sha512sums="d5b09a3e28f9cb441a9c74fdd0253466462c480165c1f0def263e48751ec978f82d621c51cfca54ba926ad32a5b33cfd3baba4386338352b54ecc66e9ea052cf  softhsm-2.3.0.tar.gz
d9906fe0b8b9177f651a1839c1a1ea9369b1b664b928b067675d4b3c3c5f669500d1ff464b4ab3356e02e48954d2fdb3cf08255d353d445a86d2711f39b37af7  01_aes_mac_fix.patch"

