blob: 3a0917a1023910b219b81f2a562ed2521f997e47 [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
Patrick Williams53961c22022-01-20 11:06:23 -06009SRC_URI = "git://github.com/tpm2-software/tpm2-pkcs11.git;branch=master;protocol=https \
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 \
Patrick Williams53961c22022-01-20 11:06:23 -060012 file://0001-ssl-compile-against-OSSL-3.0.patch \
13 file://0002-ossl-require-version-1.1.0-or-greater.patch \
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070014 "
Brad Bishop19323692019-04-05 15:28:33 -040015
Patrick Williams53961c22022-01-20 11:06:23 -060016SRCREV = "11fd2532ce10e97834a57dfb25bff6c613a5a851"
Brad Bishop19323692019-04-05 15:28:33 -040017
18S = "${WORKDIR}/git"
19
Andrew Geissler015e6aa2021-01-08 16:10:30 -060020inherit autotools-brokensep pkgconfig python3native
Brad Bishop19323692019-04-05 15:28:33 -040021
Patrick Williams213cb262021-08-07 19:21:33 -050022do_configure:prepend () {
Brad Bishop19323692019-04-05 15:28:33 -040023 ${S}/bootstrap
24}
Andrew Geisslerd1d22e62020-10-16 10:14:32 -050025
Patrick Williams213cb262021-08-07 19:21:33 -050026do_compile:append() {
Andrew Geissler015e6aa2021-01-08 16:10:30 -060027 cd ${S}/tools
28 python3 setup.py build
29}
30
Patrick Williams213cb262021-08-07 19:21:33 -050031do_install:append() {
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070032 install -d ${D}${libdir}/pkcs11
33 install -d ${D}${datadir}/p11-kit
34 rm -f ${D}${libdir}/pkcs11/libtpm2_pkcs11.so
35
Andrew Geissler015e6aa2021-01-08 16:10:30 -060036 cd ${S}/tools
37 export PYTHONPATH="${D}${PYTHON_SITEPACKAGES_DIR}"
38 ${PYTHON_PN} setup.py install --root="${D}" --prefix="${prefix}" --install-lib="${PYTHON_SITEPACKAGES_DIR}" --optimize=1 --skip-build
39
40 sed -i -e "s:${PYTHON}:${USRBINPATH}/env ${PYTHON_PN}:g" "${D}${bindir}"/tpm2_ptool
41}
42
Andrew Geissler015e6aa2021-01-08 16:10:30 -060043PACKAGES =+ "${PN}-tools"
Andrew Geissler015e6aa2021-01-08 16:10:30 -060044
Patrick Williams213cb262021-08-07 19:21:33 -050045FILES:${PN}-tools = "\
Andrew Geissler015e6aa2021-01-08 16:10:30 -060046 ${bindir}/tpm2_ptool \
47 ${libdir}/${PYTHON_DIR}/* \
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070048 "
49
Patrick Williams213cb262021-08-07 19:21:33 -050050FILES:${PN} += "\
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070051 ${libdir}/pkcs11/* \
52 ${datadir}/p11-kit/* \
53 "
54
55RDEPNDS_${PN} = "tpm2-tools"
Patrick Williams213cb262021-08-07 19:21:33 -050056RDEPENDS:${PN}-tools += "${PYTHON_PN}-setuptools ${PYTHON_PN}-pyyaml ${PYTHON_PN}-cryptography ${PYTHON_PN}-pyasn1-modules"