--- /dev/null
+DIST tpm2-abrmd-2.0.3.tar.gz 563029 BLAKE2B 89c20066b05818825a2addacaf123568ec095d021e9811b78d11c336af9a9e97fe280a08b4478331663efd1da9b2db54207ca53728398aefe4407bfe4b0c7efd SHA512 70b431b9d09e1c1db819aabf6ca8e40a7553573339f43a6c872ad685b7822e5046bd8ede25dcd0608ce2d8fa32257f6c1dd7f234aa7d6a447ac795625d4e0fac
--- /dev/null
+diff --git a/configure.ac b/configure.ac
+index ecbc3bb..5973ff5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -135,7 +135,6 @@ AM_CONDITIONAL([ENABLE_INTEGRATION],[test "x$enable_integration" = "xyes"])
+ # these macros are defined in m4/flags.m4
+ AX_ADD_COMPILER_FLAG([-Wall])
+ AX_ADD_COMPILER_FLAG([-Wextra])
+-AX_ADD_COMPILER_FLAG([-Werror])
+ AX_ADD_COMPILER_FLAG([-std=gnu99])
+ AX_ADD_COMPILER_FLAG([-Wformat])
+ AX_ADD_COMPILER_FLAG([-Wformat-security])
+@@ -143,19 +142,9 @@ AX_ADD_COMPILER_FLAG([-Wno-missing-braces])
+ # work around for Glib usage of function pointers type casting
+ # https://bugzilla.gnome.org/show_bug.cgi?id=793272
+ AX_ADD_COMPILER_FLAG([-Wno-cast-function-type])
+-AX_ADD_COMPILER_FLAG([-fdata-sections])
+-AX_ADD_COMPILER_FLAG([-ffunction-sections])
+-AX_ADD_COMPILER_FLAG([-fstack-protector-all])
+-AX_ADD_COMPILER_FLAG([-fpic])
+-AX_ADD_COMPILER_FLAG([-fPIC])
+ AX_ADD_PREPROC_FLAG([-D_GNU_SOURCE])
+ AX_ADD_PREPROC_FLAG([-U_FORTIFY_SOURCE])
+ AX_ADD_PREPROC_FLAG([-D_FORTIFY_SOURCE=2])
+-AX_ADD_LINK_FLAG([-Wl,--gc-sections])
+-AX_ADD_LINK_FLAG([-Wl,--no-undefined])
+-AX_ADD_LINK_FLAG([-Wl,-z,noexecstack])
+-AX_ADD_LINK_FLAG([-Wl,-z,now])
+-AX_ADD_LINK_FLAG([-Wl,-z,relro])
+
+ AC_SUBST([PATH])
+
--- /dev/null
+TPM2_ABRMD_ARGS=
--- /dev/null
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+description="TPM2 Access Broker & Resource Manager"
+command="/usr/sbin/tpm2-abrmd"
+command_args="${TPM2_ABRMD_ARGS} --logger=syslog"
+command_background=1
+command_user="tss:tss"
+pidfile="/var/run/${RC_SVCNAME}.pid"
+
+depend() {
+ use logger
+ after coldplug
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>crypto@gentoo.org</email>
+ <name>Crypto</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">tpm2-software/tpm2-abrmd</remote-id>
+ </upstream>
+</pkgmetadata>
--- /dev/null
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools systemd user
+
+DESCRIPTION="TPM2 Access Broker & Resource Manager"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-abrmd"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="static-libs test"
+
+RDEPEND="sys-apps/dbus:=
+ dev-libs/glib:=
+ app-crypt/tpm2-tss:="
+DEPEND="${RDEPEND}
+ test? ( dev-util/cmocka )"
+BDEPEND="virtual/pkgconfig
+ dev-util/gdbus-codegen"
+
+PATCHES=(
+ "${FILESDIR}/${P}-build.patch"
+)
+
+pkg_setup() {
+ enewgroup tss
+ enewuser tss -1 -1 / tss
+}
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static) \
+ $(use_enable test unit) \
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d" \
+ --with-systemdpresetdir="$(systemd_get_systemunitdir)/../system-preset" \
+ --with-systemdpresetdisable \
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}