From 4a7366c4f161a98611a292394a9662a0c507f904 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Fri, 8 Sep 2017 17:11:33 +0200 Subject: Add recipes to test pkcs11 functionality in Aktualizr --- .../files/0001-Cross-compilation-tweaks.patch | 86 ++++++++++++++++++++++ recipes-support/softhsm/softhsm_git.bb | 27 +++++++ 2 files changed, 113 insertions(+) create mode 100644 recipes-support/softhsm/files/0001-Cross-compilation-tweaks.patch create mode 100644 recipes-support/softhsm/softhsm_git.bb (limited to 'recipes-support/softhsm') diff --git a/recipes-support/softhsm/files/0001-Cross-compilation-tweaks.patch b/recipes-support/softhsm/files/0001-Cross-compilation-tweaks.patch new file mode 100644 index 0000000..b3a7622 --- /dev/null +++ b/recipes-support/softhsm/files/0001-Cross-compilation-tweaks.patch @@ -0,0 +1,86 @@ +From b6add28acb884b6006216e8422cc18504483c72e Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Fri, 8 Sep 2017 15:08:40 +0200 +Subject: [PATCH] Cross-compilation tweaks + +--- + m4/acx_openssl.m4 | 2 ++ + m4/acx_openssl_ecc.m4 | 3 +++ + m4/acx_openssl_fips.m4 | 2 ++ + m4/acx_openssl_gost.m4 | 2 ++ + 4 files changed, 9 insertions(+) + +diff --git a/m4/acx_openssl.m4 b/m4/acx_openssl.m4 +index e90c78f..9de6055 100644 +--- a/m4/acx_openssl.m4 ++++ b/m4/acx_openssl.m4 +@@ -25,6 +25,7 @@ AC_DEFUN([ACX_OPENSSL],[ + AC_CHECK_HEADERS([openssl/ssl.h],,[AC_MSG_ERROR([Can't find OpenSSL headers])]) + AC_CHECK_LIB(crypto, BN_new,,[AC_MSG_ERROR([Can't find OpenSSL library])]) + ++ if test "$cross_compiling" != yes; then + AC_MSG_CHECKING([for OpenSSL version]) + CHECK_OPENSSL_VERSION=m4_format(0x%02x%02x%02x000L, $1, $2, $3) + AC_LANG_PUSH([C]) +@@ -51,6 +52,7 @@ AC_DEFUN([ACX_OPENSSL],[ + AC_MSG_ERROR([OpenSSL library too old ($1.$2.$3 or later required)]) + ],[]) + AC_LANG_POP([C]) ++ fi + + CPPFLAGS=$tmp_CPPFLAGS + LIBS=$tmp_LIBS +diff --git a/m4/acx_openssl_ecc.m4 b/m4/acx_openssl_ecc.m4 +index 612c505..ba2389d 100644 +--- a/m4/acx_openssl_ecc.m4 ++++ b/m4/acx_openssl_ecc.m4 +@@ -1,4 +1,5 @@ + AC_DEFUN([ACX_OPENSSL_ECC],[ ++ if test "$cross_compiling" != yes; then + AC_MSG_CHECKING(for OpenSSL ECC support) + + tmp_CPPFLAGS=$CPPFLAGS +@@ -32,6 +33,8 @@ AC_DEFUN([ACX_OPENSSL_ECC],[ + ],[]) + AC_LANG_POP([C]) + ++ fi ++ + CPPFLAGS=$tmp_CPPFLAGS + LIBS=$tmp_LIBS + ]) +diff --git a/m4/acx_openssl_fips.m4 b/m4/acx_openssl_fips.m4 +index 0491397..896cdbf 100644 +--- a/m4/acx_openssl_fips.m4 ++++ b/m4/acx_openssl_fips.m4 +@@ -1,4 +1,5 @@ + AC_DEFUN([ACX_OPENSSL_FIPS],[ ++ if test "$cross_compiling" != yes; then + AC_MSG_CHECKING(for OpenSSL FIPS capable library) + + tmp_CPPFLAGS=$CPPFLAGS +@@ -47,4 +48,5 @@ AC_DEFUN([ACX_OPENSSL_FIPS],[ + + CPPFLAGS=$tmp_CPPFLAGS + LIBS=$tmp_LIBS ++ fi + ]) +diff --git a/m4/acx_openssl_gost.m4 b/m4/acx_openssl_gost.m4 +index dca489b..34c39d8 100644 +--- a/m4/acx_openssl_gost.m4 ++++ b/m4/acx_openssl_gost.m4 +@@ -1,4 +1,5 @@ + AC_DEFUN([ACX_OPENSSL_GOST],[ ++ if test "$cross_compiling" != yes; then + AC_MSG_CHECKING(for OpenSSL GOST support) + + tmp_CPPFLAGS=$CPPFLAGS +@@ -62,4 +63,5 @@ AC_DEFUN([ACX_OPENSSL_GOST],[ + + CPPFLAGS=$tmp_CPPFLAGS + LIBS=$tmp_LIBS ++ fi + ]) +-- +2.7.4 + diff --git a/recipes-support/softhsm/softhsm_git.bb b/recipes-support/softhsm/softhsm_git.bb new file mode 100644 index 0000000..c26903d --- /dev/null +++ b/recipes-support/softhsm/softhsm_git.bb @@ -0,0 +1,27 @@ +SUMMARY = "HSM emulator" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ef3f77a3507c3d91e75b9f2bdaee4210" + +inherit autotools-brokensep + + +SRC_URI = "git://github.com/opendnssec/SoftHSMv2.git;branch=master \ + file://0001-Cross-compilation-tweaks.patch" +SRCREV="1f7498c0c65b1b1ad5e1bdbd87e9d4b100705745" + +S = "${WORKDIR}/git" + +DEPENDS += " openssl" + +EXTRA_OECONF = "--disable-gost --with-openssl=${STAGING_LIBDIR}/.." + +do_configure() { + unset docdir + sh ./autogen.sh + oe_runconf +} + +FILES_${PN} = "${bindir} \ + ${libdir}/softhsm \ + ${sysconfdir} \ + ${localstatedir}/lib/softhsm " -- cgit v1.2.3-54-g00ecf