Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2020 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI=7 |
5 |
|
6 |
inherit autotools linux-info tmpfiles udev |
7 |
|
8 |
DESCRIPTION="TCG Trusted Platform Module 2.0 Software Stack" |
9 |
HOMEPAGE="https://github.com/tpm2-software/tpm2-tss" |
10 |
SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/${PV}/${P}.tar.gz" |
11 |
|
12 |
LICENSE="BSD-2" |
13 |
SLOT="0" |
14 |
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" |
15 |
IUSE="doc +fapi libressl mbedtls static-libs test" |
16 |
|
17 |
RESTRICT="!test? ( test )" |
18 |
|
19 |
REQUIRED_USE=" ?? ( libressl mbedtls ) |
20 |
fapi? ( !mbedtls )" |
21 |
|
22 |
RDEPEND="acct-group/tss |
23 |
acct-user/tss |
24 |
fapi? ( dev-libs/json-c |
25 |
net-misc/curl ) |
26 |
libressl? ( dev-libs/libressl:= ) |
27 |
mbedtls? ( net-libs/mbedtls:= ) |
28 |
!libressl? ( |
29 |
!mbedtls? ( dev-libs/openssl:= ) |
30 |
)" |
31 |
DEPEND="${RDEPEND} |
32 |
test? ( dev-util/cmocka )" |
33 |
BDEPEND="virtual/pkgconfig |
34 |
doc? ( app-doc/doxygen )" |
35 |
|
36 |
PATCHES=( |
37 |
"${FILESDIR}/${PN}-3.0.0-Dont-run-systemd-sysusers-in-Makefile.patch" |
38 |
"${FILESDIR}/${PN}-3.0.1-Fix-underquoting-in-configure-ac.patch" |
39 |
"${FILESDIR}/${PN}-2.4.5-fix-compile-with-libressl.patch" |
40 |
) |
41 |
|
42 |
pkg_setup() { |
43 |
local CONFIG_CHECK=" \ |
44 |
~TCG_TPM |
45 |
" |
46 |
linux-info_pkg_setup |
47 |
kernel_is ge 4 12 0 || ewarn "At least kernel 4.12.0 is required" |
48 |
} |
49 |
|
50 |
src_prepare() { |
51 |
default |
52 |
eautoreconf |
53 |
} |
54 |
|
55 |
src_configure() { |
56 |
econf \ |
57 |
--localstatedir=/var \ |
58 |
$(use_enable doc doxygen-doc) \ |
59 |
$(use_enable fapi) \ |
60 |
$(use_enable static-libs static) \ |
61 |
$(use_enable test unit) \ |
62 |
--disable-tcti-mssim \ |
63 |
--disable-defaultflags \ |
64 |
--disable-weakcrypto \ |
65 |
--with-crypto="$(usex mbedtls mbed ossl)" \ |
66 |
--with-runstatedir=/run \ |
67 |
--with-udevrulesdir="$(get_udevdir)/rules.d" \ |
68 |
--with-udevrulesprefix=60- \ |
69 |
--with-sysusersdir="/usr/lib/sysusers.d" \ |
70 |
--with-tmpfilesdir="/usr/lib/tmpfiles.d" |
71 |
} |
72 |
|
73 |
src_install() { |
74 |
default |
75 |
find "${D}" -name '*.la' -delete || die |
76 |
} |
77 |
|
78 |
pkg_postinst() { |
79 |
tmpfiles_process tpm2-tss-fapi.conf |
80 |
} |