summaryrefslogtreecommitdiff
blob: 0ee3facecabcb5be74c6c8d4eaf61a1cadc31e4d (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{5,6,7} )

inherit autotools python-any-r1

DESCRIPTION="Libtpms-based TPM emulator"
HOMEPAGE="https://github.com/stefanberger/swtpm"
SRC_URI="https://github.com/stefanberger/swtpm/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="fuse gnutls seccomp test"

COMMON_DEPEND="dev-libs/libtpms
	dev-libs/openssl:0
	fuse? (
		dev-libs/glib:2
		sys-fs/fuse:0
	      )
	gnutls? (
		   dev-libs/libtasn1:=
		   >=net-libs/gnutls-3.1.0[tools]
		)
	seccomp? ( sys-libs/libseccomp )
"

DEPEND="${COMMON_DEPEND}
	test? (
		net-misc/socat
		${PYTHON_DEPS}
	      )
"

RDEPEND="${COMMON_DEPEND}
	app-crypt/tpm-tools
	app-crypt/trousers
	dev-tcltk/expect"

src_prepare() {
	use test || eapply "${FILESDIR}/${PN}-disable-test-dependencies.patch"
	eapply "${FILESDIR}/${PN}-fix-localca-path.patch"
	default
	eautoreconf
}

src_configure() {
	econf \
	  --with-openssl \
	  --without-selinux \
	  $(use_with fuse cuse) \
	  $(use_with gnutls) \
	  $(use_with seccomp)
}

src_install() {
	default
	fowners tss:tss /var/lib/swtpm-localca
	keepdir /var/lib/swtpm-localca
}