app-crypt/tpm2-pkcs11: New package
authorSalah Coronya <salah.coronya@gmail.com>
Fri, 17 Apr 2020 03:13:52 +0000 (22:13 -0500)
committerJoonas Niilola <juippis@gentoo.org>
Wed, 13 May 2020 13:16:46 +0000 (16:16 +0300)
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. This package intends to use a TPM2 device as
the cryptographic token.

Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Salah Coronya <salah.coronya@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/15404
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
app-crypt/tpm2-pkcs11/Manifest [new file with mode: 0644]
app-crypt/tpm2-pkcs11/metadata.xml [new file with mode: 0644]
app-crypt/tpm2-pkcs11/tpm2-pkcs11-1.2.0.ebuild [new file with mode: 0644]

diff --git a/app-crypt/tpm2-pkcs11/Manifest b/app-crypt/tpm2-pkcs11/Manifest
new file mode 100644 (file)
index 0000000..59b50a7
--- /dev/null
@@ -0,0 +1 @@
+DIST tpm2-pkcs11-1.2.0.tar.gz 1253641 BLAKE2B e4f673f6cb3b697426f4ba01324939214e74a74edee24a184de860d54d7b8c3f437716245552e06711c258eed88b7556771f2614f3a4dacdec5a986a5c9697d4 SHA512 e7de454b38388c4562fc92282855c1ed9a04c7968c358d6918137257fb5a1ca785c2297e8a34464ea04eed86acd9fc5b59c837027da9d3f195ec86ff0563feeb
diff --git a/app-crypt/tpm2-pkcs11/metadata.xml b/app-crypt/tpm2-pkcs11/metadata.xml
new file mode 100644 (file)
index 0000000..6ddd104
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>salah.coronya@gmail.com</email>
+               <name>Salah Coronya</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>proxy-maint@gentoo.org</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+</pkgmetadata>
+
diff --git a/app-crypt/tpm2-pkcs11/tpm2-pkcs11-1.2.0.ebuild b/app-crypt/tpm2-pkcs11/tpm2-pkcs11-1.2.0.ebuild
new file mode 100644 (file)
index 0000000..808767d
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8} )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_REQ_USE="sqlite"
+
+inherit distutils-r1
+
+DESCRIPTION="A PKCS#11 interface for TPM2 hardware"
+HOMEPAGE="https://tpm2-software.github.io/"
+SRC_URI="https://github.com/tpm2-software/tpm2-pkcs11/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64"
+
+# Test requires the IBM TPM simulator that's not in portage
+RESTRICT="test"
+
+RDEPEND="app-crypt/p11-kit
+       app-crypt/tpm2-abrmd
+       app-crypt/tpm2-tss
+       dev-db/sqlite:3
+       dev-libs/openssl
+       dev-python/cryptography[${PYTHON_USEDEP}]
+       dev-python/pyasn1[${PYTHON_USEDEP}]
+       dev-python/pyasn1-modules[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]"
+
+DEPEND="${RDEPEND}"
+BDEPEND="sys-devel/autoconf-archive
+       virtual/pkgconfig"
+
+src_configure() {
+       default
+}
+
+src_compile() {
+       default
+       cd "${S}/tools" || die
+       BUILD_DIR="${S}/tools" python_foreach_impl distutils-r1_python_compile
+}
+
+src_install() {
+       default
+       cd "${S}/tools" || die
+       BUILD_DIR="${S}/tools" python_foreach_impl distutils-r1_python_install
+       dobin "${S}/tools/tpm2_ptool"
+}