Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "A PKCS#11 interface for TPM2 hardware" |
| 2 | DESCRIPTION = "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." |
| 3 | SECTION = "security/tpm" |
| 4 | LICENSE = "BSD-2-Clause" |
Andrew Geissler | 064f75b | 2020-06-27 00:14:46 -0500 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0fc19f620a102768d6dbd1e7166e78ab" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 6 | |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame^] | 7 | DEPENDS = "autoconf-archive pkgconfig dstat sqlite3 openssl libtss2-dev tpm2-tools libyaml p11-kit python3-setuptools-native" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 8 | |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame^] | 9 | SRC_URI = "git://github.com/tpm2-software/tpm2-pkcs11.git;branch=master \ |
Andrew Geissler | d1d22e6 | 2020-10-16 10:14:32 -0500 | [diff] [blame] | 10 | file://bootstrap_fixup.patch \ |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame^] | 11 | file://0001-remove-local-binary-checkes.patch \ |
| 12 | file://677.patch \ |
| 13 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 14 | |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame^] | 15 | SRCREV = "c2d53cc1af6b9df13c832715442853b21048c273" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | |
| 17 | S = "${WORKDIR}/git" |
| 18 | |
Andrew Geissler | 015e6aa | 2021-01-08 16:10:30 -0600 | [diff] [blame] | 19 | inherit autotools-brokensep pkgconfig python3native |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 20 | |
| 21 | do_configure_prepend () { |
| 22 | ${S}/bootstrap |
| 23 | } |
Andrew Geissler | d1d22e6 | 2020-10-16 10:14:32 -0500 | [diff] [blame] | 24 | |
Andrew Geissler | 015e6aa | 2021-01-08 16:10:30 -0600 | [diff] [blame] | 25 | do_compile_append() { |
| 26 | cd ${S}/tools |
| 27 | python3 setup.py build |
| 28 | } |
| 29 | |
| 30 | do_install_append() { |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame^] | 31 | install -d ${D}${libdir}/pkcs11 |
| 32 | install -d ${D}${datadir}/p11-kit |
| 33 | rm -f ${D}${libdir}/pkcs11/libtpm2_pkcs11.so |
| 34 | |
Andrew Geissler | 015e6aa | 2021-01-08 16:10:30 -0600 | [diff] [blame] | 35 | 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 Geissler | 015e6aa | 2021-01-08 16:10:30 -0600 | [diff] [blame] | 42 | PACKAGES =+ "${PN}-tools" |
Andrew Geissler | 015e6aa | 2021-01-08 16:10:30 -0600 | [diff] [blame] | 43 | |
| 44 | FILES_${PN}-tools = "\ |
| 45 | ${bindir}/tpm2_ptool \ |
| 46 | ${libdir}/${PYTHON_DIR}/* \ |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame^] | 47 | " |
| 48 | |
| 49 | FILES_${PN} += "\ |
| 50 | ${libdir}/pkcs11/* \ |
| 51 | ${datadir}/p11-kit/* \ |
| 52 | " |
| 53 | |
| 54 | RDEPNDS_${PN} = "tpm2-tools" |
| 55 | RDEPENDS_${PN}-tools += "${PYTHON_PN}-setuptools ${PYTHON_PN}-pyyaml ${PYTHON_PN}-cryptography ${PYTHON_PN}-pyasn1-modules" |