blob: 63ec18d94a9f5566299ce6113b4ebd99163c4475 [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
William A. Kennington IIIee32beb2021-06-02 12:48:35 -07007DEPENDS = "autoconf-archive pkgconfig dstat sqlite3 openssl libtss2-dev tpm2-tools libyaml p11-kit python3-setuptools-native"
Brad Bishop19323692019-04-05 15:28:33 -04008
William A. Kennington IIIee32beb2021-06-02 12:48:35 -07009SRC_URI = "git://github.com/tpm2-software/tpm2-pkcs11.git;branch=master \
Andrew Geisslerd1d22e62020-10-16 10:14:32 -050010 file://bootstrap_fixup.patch \
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070011 file://0001-remove-local-binary-checkes.patch \
12 file://677.patch \
13 "
Brad Bishop19323692019-04-05 15:28:33 -040014
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070015SRCREV = "c2d53cc1af6b9df13c832715442853b21048c273"
Brad Bishop19323692019-04-05 15:28:33 -040016
17S = "${WORKDIR}/git"
18
Andrew Geissler015e6aa2021-01-08 16:10:30 -060019inherit autotools-brokensep pkgconfig python3native
Brad Bishop19323692019-04-05 15:28:33 -040020
21do_configure_prepend () {
22 ${S}/bootstrap
23}
Andrew Geisslerd1d22e62020-10-16 10:14:32 -050024
Andrew Geissler015e6aa2021-01-08 16:10:30 -060025do_compile_append() {
26 cd ${S}/tools
27 python3 setup.py build
28}
29
30do_install_append() {
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070031 install -d ${D}${libdir}/pkcs11
32 install -d ${D}${datadir}/p11-kit
33 rm -f ${D}${libdir}/pkcs11/libtpm2_pkcs11.so
34
Andrew Geissler015e6aa2021-01-08 16:10:30 -060035 cd ${S}/tools
36 export PYTHONPATH="${D}${PYTHON_SITEPACKAGES_DIR}"
37 ${PYTHON_PN} setup.py install --root="${D}" --prefix="${prefix}" --install-lib="${PYTHON_SITEPACKAGES_DIR}" --optimize=1 --skip-build
38
39 sed -i -e "s:${PYTHON}:${USRBINPATH}/env ${PYTHON_PN}:g" "${D}${bindir}"/tpm2_ptool
40}
41
Andrew Geissler015e6aa2021-01-08 16:10:30 -060042PACKAGES =+ "${PN}-tools"
Andrew Geissler015e6aa2021-01-08 16:10:30 -060043
44FILES_${PN}-tools = "\
45 ${bindir}/tpm2_ptool \
46 ${libdir}/${PYTHON_DIR}/* \
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070047 "
48
49FILES_${PN} += "\
50 ${libdir}/pkcs11/* \
51 ${datadir}/p11-kit/* \
52 "
53
54RDEPNDS_${PN} = "tpm2-tools"
55RDEPENDS_${PN}-tools += "${PYTHON_PN}-setuptools ${PYTHON_PN}-pyyaml ${PYTHON_PN}-cryptography ${PYTHON_PN}-pyasn1-modules"