summaryrefslogtreecommitdiff
blob: 37841aeebeb02b5f63e4eb50cb33d56c08495f49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{7,8,9} )
DISTUTILS_USE_SETUPTOOLS=rdepend
PYTHON_REQ_USE="sqlite"

inherit autotools 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"

IUSE="fapi"

# python-pkcs11 is required but not in Portage. python-pkcs11 in turn requires
# aenum which is ALSO not in portage. Futhermore, aenum has a dead homepage.
RESTRICT="test"

RDEPEND="app-crypt/p11-kit
	app-crypt/tpm2-abrmd
	app-crypt/tpm2-tools[fapi?]
	!fapi? ( app-crypt/tpm2-tss )
	fapi? ( >=app-crypt/tpm2-tss-3.0.1[fapi] )
	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"

PATCHES=(
	"$FILESDIR/${PN}-1.3.2-Remove-WError.patch"
)

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	econf \
		$(use_enable fapi)
}

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"
	find "${D}" -name '*.la' -delete || die
}