Index: security/Makefile =================================================================== --- security/Makefile +++ security/Makefile @@ -1270,6 +1270,7 @@ SUBDIR += tor SUBDIR += tor-devel SUBDIR += tpm-tools + SUBDIR += tpm2-abrmd SUBDIR += tpm2-tools SUBDIR += tpm2-tss SUBDIR += trezord Index: security/tpm2-abrmd/Makefile =================================================================== --- /dev/null +++ security/tpm2-abrmd/Makefile @@ -0,0 +1,42 @@ +# $FreeBSD$ + +PORTNAME= tpm2-abrmd +DISTVERSION= 2.2.0 +CATEGORIES= security +MASTER_SITES= https://github.com/tpm2-software/tpm2-abrmd/releases/download/${DISTVERSION}/ + +MAINTAINER= tstruk@gmail.com +COMMENT= TPM2 Access Broker & Resource Manager Deamon + +LICENSE= BSD2CLAUSE + +LIB_DEPENDS= libtss2-esys.so:security/tpm2-tss \ + libgio-2.0.so:devel/glib20 +RUN_DEPENDS= dbus-daemon:devel/dbus + +USES= gmake libtool pkgconfig gnome +USE_LDCONFIG= yes +USE_GNOME= glib20 +USE_RC_SUBR= tpm2-abrmd + +LIBS+= -L${LOCALBASE}/lib -lintl -lgio-2.0 + +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --with-dbuspolicydir=${PREFIX}/etc/dbus-1/system.d + +GROUPS= _tss +USERS= _tss + +SUB_LIST= DBUS_DAEMON=dbus + +post-install: + @${RM} ${STAGEDIR}${PREFIX}/lib/systemd/system-preset/tpm2-abrmd.preset + @${RM} ${STAGEDIR}${PREFIX}/lib/systemd/system/tpm2-abrmd.service + @${RM} ${STAGEDIR}${PREFIX}/share/dbus-1/system-services/com.intel.tss2.Tabrmd.service + @${RMDIR} ${STAGEDIR}${PREFIX}/lib/systemd/system + @${RMDIR} ${STAGEDIR}${PREFIX}/lib/systemd/system-preset + @${RMDIR} ${STAGEDIR}${PREFIX}/lib/systemd + @${RMDIR} ${STAGEDIR}${PREFIX}/share/dbus-1/system-services + @${RMDIR} ${STAGEDIR}${PREFIX}/share/dbus-1 + +.include Index: security/tpm2-abrmd/distinfo =================================================================== --- /dev/null +++ security/tpm2-abrmd/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1566436559 +SHA256 (tpm2-abrmd-2.2.0.tar.gz) = 2a75a09802290d88f7806d1294b0070f92dd3f138a211834caa4cc04bd876ed1 +SIZE (tpm2-abrmd-2.2.0.tar.gz) = 569459 Index: security/tpm2-abrmd/files/patch-dist_tpm2-abrmd.conf =================================================================== --- /dev/null +++ security/tpm2-abrmd/files/patch-dist_tpm2-abrmd.conf @@ -0,0 +1,11 @@ +--- dist/tpm2-abrmd.conf.orig 2019-08-27 23:12:36 UTC ++++ dist/tpm2-abrmd.conf +@@ -2,7 +2,7 @@ + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> + + +- ++ + + + Index: security/tpm2-abrmd/files/patch-src_tpm2-header.c =================================================================== --- /dev/null +++ security/tpm2-abrmd/files/patch-src_tpm2-header.c @@ -0,0 +1,18 @@ +--- src/tpm2-header.c.orig 2019-08-22 04:36:24 UTC ++++ src/tpm2-header.c +@@ -4,7 +4,6 @@ + * All rights reserved. + */ + #include +-#include + #include + #include + #include +@@ -13,6 +12,7 @@ + #include + + #include "tpm2-header.h" ++#include "util.h" + + /** + * Extract the 'tag' field from the tpm command header. This is a Index: security/tpm2-abrmd/files/patch-src_util.h =================================================================== --- /dev/null +++ security/tpm2-abrmd/files/patch-src_util.h @@ -0,0 +1,20 @@ +--- src/util.h.orig 2019-08-22 19:25:53 UTC ++++ src/util.h +@@ -9,8 +9,17 @@ + #include + #include + #include ++#if defined(__FreeBSD__) ++#include ++#endif + + #include "control-message.h" ++ ++#if defined(__FreeBSD__) ++#ifndef POLLRDHUP ++#define POLLRDHUP 0 ++#endif ++#endif + + /* Use to suppress "unused parameter" warnings: */ + #define UNUSED_PARAM(p) ((void)(p)) Index: security/tpm2-abrmd/files/tpm2-abrmd.in =================================================================== --- /dev/null +++ security/tpm2-abrmd/files/tpm2-abrmd.in @@ -0,0 +1,26 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: tpm2_abrmd +# REQUIRE: DAEMON %%DBUS_DAEMON%% +# KEYWORD: shutdown +# +# Add the following to /etc/rc.conf[.local] to enable this service +# +# tpm2_abrmd_enable="YES" +# + +. /etc/rc.subr + +name=tpm2_abrmd +desc=TPM2 Access Broker & Resource Management Daemon +rcvar=tpm2_abrmd_enable +load_rc_config ${name} + +: ${tpm2_abrmd_enable:=NO} + +command=%%PREFIX%%/sbin/tpm2-abrmd +tpm2_abrmd_user=_tss + +run_rc_command "$1" Index: security/tpm2-abrmd/pkg-descr =================================================================== --- /dev/null +++ security/tpm2-abrmd/pkg-descr @@ -0,0 +1,3 @@ +TPM2 Access Broker & Resource Management Daemon implementing the TCG spec. + +WWW: https://github.com/tpm2-software/tpm2-abrmd Index: security/tpm2-abrmd/pkg-plist =================================================================== --- /dev/null +++ security/tpm2-abrmd/pkg-plist @@ -0,0 +1,11 @@ +include/tss2/tss2-tcti-tabrmd.h +etc/dbus-1/system.d/tpm2-abrmd.conf +lib/libtss2-tcti-tabrmd.a +lib/libtss2-tcti-tabrmd.so +lib/libtss2-tcti-tabrmd.so.0 +lib/libtss2-tcti-tabrmd.so.0.0.0 +libdata/pkgconfig/tss2-tcti-tabrmd.pc +man/man3/Tss2_Tcti_Tabrmd_Init.3.gz +man/man7/tss2-tcti-tabrmd.7.gz +man/man8/tpm2-abrmd.8.gz +sbin/tpm2-abrmd