summaryrefslogtreecommitdiff
path: root/app-crypt/swtpm/swtpm-0.10.1.ebuild
blob: 5baebee371cbfd060d08ba5ff2271dd8d444ce4b (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright 2021-2025 BaldEagleOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8

PYTHON_COMPAT=( python3_{9,10,11,12,13} )

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 libressl seccomp test"
RESTRICT="!test? ( test )"

RDEPEND="
	fuse? (
		dev-libs/glib:2
		sys-fs/fuse:0
	)
	acct-group/tss
	acct-user/tss
	dev-libs/libtasn1:=
	>=net-libs/gnutls-3.1.0[pkcs11,tools]
	!libressl? (
		dev-libs/openssl:0=
		>=dev-libs/libtpms-0.10.0[-libressl]
	)
	libressl? (
		dev-libs/libressl:0=
		>=dev-libs/libtpms-0.10.0[libressl]
	)
	seccomp? ( sys-libs/libseccomp )
	dev-libs/json-glib
	dev-tcltk/expect
	net-misc/socat
"

DEPEND="
	${RDEPEND}
	test?	(
		net-misc/socat
		dev-tcltk/expect
	)
"

PATCHES=(
	"${FILESDIR}/${PN}-0.5.0-fix-localca-path.patch"
	"${FILESDIR}/${PN}-0.10.0-build-sys-Remove-WError.patch"
	"${FILESDIR}/${PN}-0.8.2-slibtool.patch"
)

src_prepare() {
	python_setup
	default
	eautoreconf
}

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

src_compile() {
	default
}

src_install() {
	default
	python_foreach_impl python_optimize
	fowners -R tss:root /var/lib/swtpm-localca
	fperms 750 /var/lib/swtpm-localca
	keepdir /var/lib/swtpm-localca
	find "${D}" -name '*.la' -delete || die
}

src_test() {
	default
}