blob: 6beb67a183fa0178c01c32cf5af345303d96867f [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "A PKCS#11 interface for TPM2 hardware"
2DESCRIPTION = "PKCS #11 is a Public-Key Cryptography Standard that defines a standard method to access cryptographic services from tokens/ devices such as hardware security modules (HSM), smart cards, etc. In this project we intend to use a TPM2 device as the cryptographic token."
3SECTION = "security/tpm"
4LICENSE = "BSD-2-Clause"
Andrew Geissler064f75b2020-06-27 00:14:46 -05005LIC_FILES_CHKSUM = "file://LICENSE;md5=0fc19f620a102768d6dbd1e7166e78ab"
Brad Bishop19323692019-04-05 15:28:33 -04006
Andrew Geissler015e6aa2021-01-08 16:10:30 -06007DEPENDS = "autoconf-archive pkgconfig dstat sqlite3 openssl libtss2-dev tpm2-tools libyaml python3-setuptools-native"
Brad Bishop19323692019-04-05 15:28:33 -04008
Andrew Geissler064f75b2020-06-27 00:14:46 -05009SRC_URI = "git://github.com/tpm2-software/tpm2-pkcs11.git;branch=1.X \
Andrew Geisslerd1d22e62020-10-16 10:14:32 -050010 file://bootstrap_fixup.patch \
11 file://0001-remove-local-binary-checkes.patch"
Brad Bishop19323692019-04-05 15:28:33 -040012
Andrew Geisslerd1d22e62020-10-16 10:14:32 -050013SRCREV = "78bbf6a0237351830d0c3923b25ba0b57ae0b7e9"
Brad Bishop19323692019-04-05 15:28:33 -040014
15S = "${WORKDIR}/git"
16
Andrew Geissler015e6aa2021-01-08 16:10:30 -060017inherit autotools-brokensep pkgconfig python3native
Brad Bishop19323692019-04-05 15:28:33 -040018
19do_configure_prepend () {
20 ${S}/bootstrap
21}
Andrew Geisslerd1d22e62020-10-16 10:14:32 -050022
Andrew Geissler015e6aa2021-01-08 16:10:30 -060023do_compile_append() {
24 cd ${S}/tools
25 python3 setup.py build
26}
27
28do_install_append() {
29 cd ${S}/tools
30 export PYTHONPATH="${D}${PYTHON_SITEPACKAGES_DIR}"
31 ${PYTHON_PN} setup.py install --root="${D}" --prefix="${prefix}" --install-lib="${PYTHON_SITEPACKAGES_DIR}" --optimize=1 --skip-build
32
33 sed -i -e "s:${PYTHON}:${USRBINPATH}/env ${PYTHON_PN}:g" "${D}${bindir}"/tpm2_ptool
34}
35
Andrew Geisslerd1d22e62020-10-16 10:14:32 -050036RDEPNDS_${PN} = "tpm2-tools"
Andrew Geissler015e6aa2021-01-08 16:10:30 -060037
38PACKAGES =+ "${PN}-tools"
39RDEPENDS_${PN}-tools += "${PYTHON_PN}-setuptools ${PYTHON_PN}-pyyaml ${PYTHON_PN}-cryptography ${PYTHON_PN}-pyasn1-modules"
40
41FILES_${PN}-tools = "\
42 ${bindir}/tpm2_ptool \
43 ${libdir}/${PYTHON_DIR}/* \
44"