aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbea <orbea@riseup.net>2023-04-13 17:52:44 -0700
committerorbea <orbea@riseup.net>2023-04-13 17:52:44 -0700
commit283ced32ed0b492e0bc45821ab22fcdcde64774b (patch)
tree79a15fb6edff7b743bbb86f1255898c8cd1aa0b6 /app-crypt
parentapp-crypt/tpm2-tss: update patch + workaround test failure (diff)
downloadlibressl-283ced32ed0b492e0bc45821ab22fcdcde64774b.tar.gz
libressl-283ced32ed0b492e0bc45821ab22fcdcde64774b.tar.bz2
libressl-283ced32ed0b492e0bc45821ab22fcdcde64774b.zip
app-crypt/tpm2-tss: add 3.2.1, 3.2.2, 4.0.0, 4.0.1
Signed-off-by: orbea <orbea@riseup.net>
Diffstat (limited to 'app-crypt')
-rw-r--r--app-crypt/tpm2-tss/Manifest4
-rw-r--r--app-crypt/tpm2-tss/files/tpm2-tss-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch61
-rw-r--r--app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch26
-rw-r--r--app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild90
-rw-r--r--app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild94
-rw-r--r--app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild97
-rw-r--r--app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild98
7 files changed, 470 insertions, 0 deletions
diff --git a/app-crypt/tpm2-tss/Manifest b/app-crypt/tpm2-tss/Manifest
index fbe1511..b76f835 100644
--- a/app-crypt/tpm2-tss/Manifest
+++ b/app-crypt/tpm2-tss/Manifest
@@ -1 +1,5 @@
DIST tpm2-tss-3.2.0.tar.gz 1629211 BLAKE2B a89aa4d89a50bdfb5a9652874d30e2138747bd022049f2be2d0b56e296329d0c41254033ec3a062dbd64fde54a62e952f54446c551e5788231827cd53fae045a SHA512 cabb411f074dfa94919ba914849aac77a0ac2f50622e28a1406cf575369148774748e0e2b7a7c566ec83561a96d4b883bac5a3b1763f4cf48668a0c5d68c0a23
+DIST tpm2-tss-3.2.1.tar.gz 1638566 BLAKE2B bdf5eeca1e7269a639cefd8b4a38e16c5b7c08518411a22718dcd14bc9fe3b621eee77cdd98f9ece0f6d9a52319bce5e0a502ff9a6e4ba6716341bd01f5967a9 SHA512 dbe5e29349d78621fcd608d9c75fa58f5e6462264b9654ca85af9f9faafebe1107d9f735a1b6ad4956a089b0dd96cbda3f46364cabd846f9fb29a419b074c78f
+DIST tpm2-tss-3.2.2.tar.gz 1638857 BLAKE2B 164c54b7c43a3379a9aae86fd39788a0906030bc2df9a96d7264635b0e281088f46f470d28098e194e77067f1c4412a8f1ef30d7877eb2410aeefee2d3639409 SHA512 efa71d04de907f74cf0e451a55124cb6fa804fddc2530ecc728a76030e0ae1e8597048c81cd4316397318f273e95754cf85745fc49966208b60babd398989aa6
+DIST tpm2-tss-4.0.0.tar.gz 1787084 BLAKE2B 9b9d466eab77ae71ec916c911f9e1321013fe49594e103610fcb03492a2f20e811a2faddc2237519b710a1931226d5664581cd671d2318319a92e16bcb5ccfb4 SHA512 1058aa74e2358bfb60a17b85291dc642d40b49bb076453810c5b2b0c37c72671c319d783c879f719ccbe7aaeb5f464e0144c6ee12d28242b477be5d579cb3f9c
+DIST tpm2-tss-4.0.1.tar.gz 1787139 BLAKE2B 627cdefeff6c64148f9da1425922a0a7a72debcee4930ffab208a3b9b66127c2d4f923e3e105bfd45410cdb13c19cb40cc15a720e9a05dd32ff622dabf5fcc32 SHA512 ed6ddc52cb0e8c1082a4bb001e1225eb9905fd2380da88db5fd69ff5b5d9d43a93eb67b634e49d53eb5d586832da3aef2c4c7e5f18d51bb730481f8913319d7d
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch
new file mode 100644
index 0000000..7e55f96
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch
@@ -0,0 +1,61 @@
+diff --git a/Makefile.am b/Makefile.am
+index 6242b19c..b30ec6e0 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -492,7 +492,6 @@ fapi-config.json: dist/fapi-config.json.in
+ -e 's|[@]userstatedir@|$(userstatedir)|g' \
+ < "$<" > "$@"
+
+-sysusers_DATA = dist/sysusers.d/tpm2-tss.conf
+ tmpfiles_DATA = tpm2-tss-fapi.conf
+
+ CLEANFILES += tpm2-tss-fapi.conf
+@@ -516,7 +515,6 @@ EXTRA_DIST += \
+ dist/fapi-config.json.in \
+ dist/fapi-profiles/P_RSA2048SHA256.json \
+ dist/fapi-profiles/P_ECCP256SHA256.json \
+- dist/sysusers.d/tpm2-tss.conf \
+ dist/tmpfiles.d/tpm2-tss-fapi.conf.in \
+ doc/fapi-config.md \
+ doc/fapi-profile.md \
+@@ -726,13 +724,6 @@ EXTRA_DIST += dist/tpm-udev.rules
+
+ install-dirs:
+ if HOSTOS_LINUX
+-if SYSD_SYSUSERS
+- @echo "systemd-sysusers $(DESTDIR)$(sysconfdir)/sysusers.d/tpm2-tss.conf"
+- @systemd-sysusers $(DESTDIR)$(sysconfdir)/sysusers.d/tpm2-tss.conf || echo "WARNING Failed to create the tss user and group"
+-else
+- @echo "call make_tss_user_and_group"
+- @$(call make_tss_user_and_group) || echo "WARNING Failed to create the tss user and group"
+-endif
+ if SYSD_TMPFILES
+ @echo "systemd-tmpfiles --create $(DESTDIR)$(sysconfdir)/tmpfiles.d/tpm2-tss-fapi.conf"
+ @systemd-tmpfiles --create $(DESTDIR)$(sysconfdir)/tmpfiles.d/tpm2-tss-fapi.conf|| echo "WARNING Failed to create the FAPI directories with the correct permissions"
+diff --git a/configure.ac b/configure.ac
+index 83554edd..c9599b93 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -483,22 +483,9 @@ AS_IF([test "x$enable_integration" = "xyes" && test "x$enable_self_generated_cer
+ [AC_MSG_WARN([Running integration tests without EK certificate verification, use --enable-self-generated-certificate for full test coverage])])
+
+ # Check for systemd helper tools used by make install
+-AC_CHECK_PROG(systemd_sysusers, systemd-sysusers, yes)
+-AM_CONDITIONAL(SYSD_SYSUSERS, test "x$systemd_sysusers" = "xyes")
+ AC_CHECK_PROG(systemd_tmpfiles, systemd-tmpfiles, yes)
+ AM_CONDITIONAL(SYSD_TMPFILES, test "x$systemd_tmpfiles" = "xyes")
+
+-# Check all tools used by make install
+-AS_IF([test "$HOSTOS" = "Linux"],
+- [ AC_CHECK_PROG(useradd, useradd, yes)
+- AC_CHECK_PROG(groupadd, groupadd, yes)
+- AC_CHECK_PROG(adduser, adduser, yes)
+- AC_CHECK_PROG(addgroup, addgroup, yes)
+- AS_IF([test "x$addgroup" != "xyes" && test "x$groupadd" != "xyes" ],
+- [AC_MSG_ERROR([addgroup or groupadd are needed.])])
+- AS_IF([test "x$adduser" != "xyes" && test "x$useradd" != "xyes" ],
+- [AC_MSG_ERROR([adduser or useradd are needed.])])])
+-
+ AC_SUBST([PATH])
+
+ dnl --------- Doxy Gen -----------------------
diff --git a/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch
new file mode 100644
index 0000000..ca51ab7
--- /dev/null
+++ b/app-crypt/tpm2-tss/files/tpm2-tss-4.0.0-Dont-install-files-into-run.patch
@@ -0,0 +1,26 @@
+diff --git a/Makefile.am b/Makefile.am
+index 2c81cfa9..2673995c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -767,13 +767,11 @@ define set_tss_permissions
+ endef
+
+ define make_fapi_dirs
+- ($(call make_tss_dir,$(DESTDIR)$(runstatedir)/tpm2-tss/eventlog/) || true) && \
+ ($(call make_tss_dir,$(DESTDIR)$(localstatedir)/lib/tpm2-tss/system/keystore/))
+ endef
+
+ define set_fapi_permissions
+ if test -z "${DESTDIR}"; then \ e
+- ($(call set_tss_permissions,$(DESTDIR)$(runstatedir)/tpm2-tss)) && \
+ ($(call set_tss_permissions,$(DESTDIR)$(localstatedir)/lib/tpm2-tss)) \
+ fi
+ endef
+@@ -784,7 +782,6 @@ endef
+
+ define check_fapi_dirs
+ if test -z "${DESTDIR}"; then \
+- ($(call check_dir,$(DESTDIR)$(runstatedir)/tpm2-tss/eventlog/)) && \
+ ($(call check_dir,$(DESTDIR)$(localstatedir)/lib/tpm2-tss/system/keystore/)) \
+ fi;
+ endef
diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild
new file mode 100644
index 0000000..fc628bd
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-3.2.1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/3"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="doc +fapi +openssl mbedtls static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+ "${FILESDIR}/${PN}-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch"
+)
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ eautoreconf
+ default
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --with-sysusersdir="/usr/lib/sysusers.d" \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild b/app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild
new file mode 100644
index 0000000..b8edead
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-3.2.2.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/3"
+KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv x86"
+IUSE="doc +fapi +openssl mbedtls static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+ "${FILESDIR}/${PN}-3.2.1-Dont-run-systemd-sysusers-in-Makefile.patch"
+)
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ eautoreconf
+ default
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ # Disable for libressl for now
+ # https://github.com/tpm2-software/tpm2-tss/pull/2380
+ # $(multilib_native_use_enable test self-generated-certificate) \
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --with-sysusersdir="/usr/lib/sysusers.d" \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild
new file mode 100644
index 0000000..a3e6f01
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.0.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/4"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )
+ policy? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+ "${FILESDIR}/${PN}-4.0.0-Dont-install-files-into-run.patch"
+ )
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ eautoreconf
+ default
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ # Disable for libressl for now
+ # https://github.com/tpm2-software/tpm2-tss/pull/2380
+ # $(multilib_native_use_enable test self-generated-certificate) \
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable policy) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --without-sysusersdir \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+ keepdir /var/lib/tpm2-tss/system/keystore
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
new file mode 100644
index 0000000..4cf21aa
--- /dev/null
+++ b/app-crypt/tpm2-tss/tpm2-tss-4.0.1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic linux-info multilib-minimal tmpfiles udev
+
+DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/4"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="doc +fapi +openssl mbedtls +policy static-libs test"
+
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( mbedtls openssl )
+ fapi? ( openssl !mbedtls )
+ policy? ( openssl !mbedtls )"
+
+RDEPEND="acct-group/tss
+ acct-user/tss
+ sys-apps/util-linux:=[${MULTILIB_USEDEP}]
+ fapi? ( dev-libs/json-c:=[${MULTILIB_USEDEP}]
+ >=net-misc/curl-7.80.0[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}
+ test? ( app-crypt/swtpm
+ dev-libs/uthash
+ dev-util/cmocka
+ fapi? ( >=net-misc/curl-7.80.0 ) )"
+BDEPEND="sys-apps/acl
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.2.0-libressl.patch"
+ "${FILESDIR}/${PN}-4.0.0-Dont-install-files-into-run.patch"
+ )
+
+pkg_setup() {
+ local CONFIG_CHECK=" \
+ ~TCG_TPM
+ "
+ linux-info_pkg_setup
+ kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required"
+}
+
+src_prepare() {
+ eautoreconf
+ default
+}
+
+multilib_src_configure() {
+ # tests fail with LTO enabbled. See bug 865275 and 865279
+ filter-lto
+
+ # Disable for libressl for now
+ # https://github.com/tpm2-software/tpm2-tss/pull/2380
+ # $(multilib_native_use_enable test self-generated-certificate) \
+
+ ECONF_SOURCE=${S} econf \
+ --localstatedir=/var \
+ $(multilib_native_use_enable doc doxygen-doc) \
+ $(use_enable fapi) \
+ $(use_enable policy) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_enable test unit) \
+ $(multilib_native_use_enable test integration) \
+ --disable-tcti-libtpms \
+ --disable-defaultflags \
+ --disable-weakcrypto \
+ --with-crypto="$(usex mbedtls mbed ossl)" \
+ --with-runstatedir=/run \
+ --with-udevrulesdir="$(get_udevdir)/rules.d" \
+ --with-udevrulesprefix=60- \
+ --without-sysusersdir \
+ --with-tmpfilesdir="/usr/lib/tmpfiles.d"
+}
+
+multilib_src_install() {
+ default
+ keepdir /var/lib/tpm2-tss/system/keystore
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ tmpfiles_process tpm2-tss-fapi.conf
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}