1SUMMARY = "TPM2 Access Broker & Resource Manager"
2DESCRIPTION = "This is a system daemon implementing the TPM2 access \
3broker (TAB) & Resource Manager (RM) spec from the TCG. The daemon (tpm2-abrmd) \
4is implemented using Glib and the GObject system. In this documentation and \
5in the code we use `tpm2-abrmd` and `tabrmd` interchangeably. \
6"
7SECTION = "security/tpm"
8
9LICENSE = "BSD-2-Clause"
10LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=500b2e742befc3da00684d8a1d5fd9da"
11
12DEPENDS = "autoconf-archive dbus glib-2.0 tpm2-tss glib-2.0-native \
13            libtss2 libtss2-mu libtss2-tcti-device libtss2-tcti-mssim"
14
15SRC_URI = "\
16    https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz \
17    file://tpm2-abrmd-init.sh \
18    file://tpm2-abrmd.default \
19"
20
21SRC_URI[sha256sum] = "d59aff34164aa705b05155b86607f6b66918a433104f754a3fcf76216dd9f465"
22
23UPSTREAM_CHECK_URI = "https://github.com/tpm2-software/${BPN}/releases"
24
25inherit autotools pkgconfig systemd update-rc.d useradd
26
27SYSTEMD_PACKAGES += "${PN}"
28SYSTEMD_SERVICE:${PN} = "tpm2-abrmd.service"
29SYSTEMD_AUTO_ENABLE:${PN} = "disable"
30
31INITSCRIPT_NAME = "${PN}"
32INITSCRIPT_PARAMS = "start 99 2 3 4 5 . stop 19 0 1 6 ."
33
34USERADD_PACKAGES = "${PN}"
35GROUPADD_PARAM:${PN} = "tss"
36USERADD_PARAM:${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss"
37
38PACKAGECONFIG ?="${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd', '', d)}"
39PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}, --with-systemdsystemunitdir=no"
40
41do_install:append() {
42    install -d "${D}${sysconfdir}/init.d"
43    install -m 0755 "${WORKDIR}/tpm2-abrmd-init.sh" "${D}${sysconfdir}/init.d/tpm2-abrmd"
44
45    install -d "${D}${sysconfdir}/default"
46    install -m 0644 "${WORKDIR}/tpm2-abrmd.default" "${D}${sysconfdir}/default/tpm2-abrmd"
47}
48
49FILES:${PN} += "${libdir}/systemd/system-preset \
50		${datadir}/dbus-1"
51
52RDEPENDS:${PN} += "tpm2-tss"
53
54BBCLASSEXTEND = "native"
55