1 |
commit: 29420beac9c404288d3c9577958515f6018abd46 |
2 |
Author: Salah Coronya <salah.coronya <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Aug 2 01:55:12 2019 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 2 11:25:05 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29420bea |
7 |
|
8 |
app-crypt/swtpm: New ebuild |
9 |
|
10 |
swtpm is a libtpms TPM emulator. It is used by qemu to emulate a TPM for |
11 |
guests. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/675298 |
14 |
Signed-off-by: Salah Coronya <salah.coronya <AT> gmail.com> |
15 |
Package-Manager: Portage-2.3.66, Repoman-2.3.11 |
16 |
Closes: https://github.com/gentoo/gentoo/pull/11247 |
17 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
18 |
|
19 |
app-crypt/swtpm/Manifest | 1 + |
20 |
.../files/swtpm-disable-test-dependencies.patch | 36 +++++++++++++ |
21 |
app-crypt/swtpm/files/swtpm-fix-localca-path.patch | 29 ++++++++++ |
22 |
app-crypt/swtpm/metadata.xml | 16 ++++++ |
23 |
app-crypt/swtpm/swtpm-0.2.0.ebuild | 63 ++++++++++++++++++++++ |
24 |
5 files changed, 145 insertions(+) |
25 |
|
26 |
diff --git a/app-crypt/swtpm/Manifest b/app-crypt/swtpm/Manifest |
27 |
new file mode 100644 |
28 |
index 00000000000..c3415f424e0 |
29 |
--- /dev/null |
30 |
+++ b/app-crypt/swtpm/Manifest |
31 |
@@ -0,0 +1 @@ |
32 |
+DIST swtpm-0.2.0.tar.gz 297419 BLAKE2B 9045cfd127d2f7e8e2e202818a375b4f6398806a097ed0df73abb76426db3af65a0d27f5e7212ce099d796862d3a9b3d421e987cf159bdce8879fc764eb5e923 SHA512 bda54690c0438138ff7adcc212fb125d2bb62618b10305eeced776e014bb135ea1a1dd1271a99fb2c60bf7e418644ded029c3c09ec2c6c1258e5062122cacf19 |
33 |
|
34 |
diff --git a/app-crypt/swtpm/files/swtpm-disable-test-dependencies.patch b/app-crypt/swtpm/files/swtpm-disable-test-dependencies.patch |
35 |
new file mode 100644 |
36 |
index 00000000000..ff253667663 |
37 |
--- /dev/null |
38 |
+++ b/app-crypt/swtpm/files/swtpm-disable-test-dependencies.patch |
39 |
@@ -0,0 +1,36 @@ |
40 |
+diff --git a/Makefile.am b/Makefile.am |
41 |
+index 47b091a..61192bf 100644 |
42 |
+--- a/Makefile.am |
43 |
++++ b/Makefile.am |
44 |
+@@ -9,9 +9,7 @@ SUBDIRS = \ |
45 |
+ include \ |
46 |
+ man \ |
47 |
+ samples \ |
48 |
+- src \ |
49 |
+- tests |
50 |
+- |
51 |
++ src |
52 |
+ ACLOCAL_AMFLAGS = -I m4 |
53 |
+ |
54 |
+ EXTRA_DIST = \ |
55 |
+diff --git a/configure.ac b/configure.ac |
56 |
+index c7b4e98..8e6445b 100644 |
57 |
+--- a/configure.ac |
58 |
++++ b/configure.ac |
59 |
+@@ -330,16 +330,6 @@ if test "x$GAWK" = "x"; then |
60 |
+ AC_MSG_ERROR([gawk is required: gawk package]) |
61 |
+ fi |
62 |
+ |
63 |
+-AC_PATH_PROG([SOCAT], socat) |
64 |
+-if test "x$SOCAT" = "x"; then |
65 |
+- AC_MSG_ERROR([socat is required: socat package]) |
66 |
+-fi |
67 |
+- |
68 |
+-AC_PATH_PROG([PYTHON], python3) |
69 |
+-if test "x$PYTHON" = "x"; then |
70 |
+- AC_MSG_ERROR([python3 is required]) |
71 |
+-fi |
72 |
+- |
73 |
+ AC_ARG_ENABLE([hardening], |
74 |
+ AS_HELP_STRING([--disable-hardening], [Disable hardening flags])) |
75 |
+ |
76 |
|
77 |
diff --git a/app-crypt/swtpm/files/swtpm-fix-localca-path.patch b/app-crypt/swtpm/files/swtpm-fix-localca-path.patch |
78 |
new file mode 100644 |
79 |
index 00000000000..c83758da563 |
80 |
--- /dev/null |
81 |
+++ b/app-crypt/swtpm/files/swtpm-fix-localca-path.patch |
82 |
@@ -0,0 +1,29 @@ |
83 |
+diff --git a/samples/Makefile.am b/samples/Makefile.am |
84 |
+index 4558d66..6fc6d77 100644 |
85 |
+--- a/samples/Makefile.am |
86 |
++++ b/samples/Makefile.am |
87 |
+@@ -16,9 +16,9 @@ samplessysconf_DATA = \ |
88 |
+ swtpm-localca.options |
89 |
+ |
90 |
+ install-data-local: |
91 |
+- $(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/swtpm-localca |
92 |
++ $(MKDIR_P) $(DESTDIR)$(localstatedir)/swtpm-localca |
93 |
+ if test -z $(DESTDIR); then \ |
94 |
+- chown @TSS_USER@:@TSS_GROUP@ $(DESTDIR)$(localstatedir)/lib/swtpm-localca || true; \ |
95 |
++ chown @TSS_USER@:@TSS_GROUP@ $(DESTDIR)$(localstatedir)/swtpm-localca || true; \ |
96 |
+ fi |
97 |
+ |
98 |
+ EXTRA_DIST= \ |
99 |
+diff --git a/samples/swtpm-localca.conf.in b/samples/swtpm-localca.conf.in |
100 |
+index 1f0b48d..63f1fed 100644 |
101 |
+--- a/samples/swtpm-localca.conf.in |
102 |
++++ b/samples/swtpm-localca.conf.in |
103 |
+@@ -1,4 +1,4 @@ |
104 |
+-statedir = @LOCALSTATEDIR@/lib/swtpm-localca |
105 |
+-signingkey = @LOCALSTATEDIR@/lib/swtpm-localca/signkey.pem |
106 |
+-issuercert = @LOCALSTATEDIR@/lib/swtpm-localca/issuercert.pem |
107 |
+-certserial = @LOCALSTATEDIR@/lib/swtpm-localca/certserial |
108 |
++statedir = @LOCALSTATEDIR@/swtpm-localca |
109 |
++signingkey = @LOCALSTATEDIR@/swtpm-localca/signkey.pem |
110 |
++issuercert = @LOCALSTATEDIR@/swtpm-localca/issuercert.pem |
111 |
++certserial = @LOCALSTATEDIR@/swtpm-localca/certserial |
112 |
|
113 |
diff --git a/app-crypt/swtpm/metadata.xml b/app-crypt/swtpm/metadata.xml |
114 |
new file mode 100644 |
115 |
index 00000000000..261b73cab05 |
116 |
--- /dev/null |
117 |
+++ b/app-crypt/swtpm/metadata.xml |
118 |
@@ -0,0 +1,16 @@ |
119 |
+<?xml version="1.0" encoding="UTF-8"?> |
120 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
121 |
+<pkgmetadata> |
122 |
+ <maintainer type="person"> |
123 |
+ <email>salah.coronya@×××××.com</email> |
124 |
+ <name>Salah Coronya</name> |
125 |
+ </maintainer> |
126 |
+ <maintainer type="project"> |
127 |
+ <email>proxy-maint@g.o</email> |
128 |
+ <name>Proxy Maintainers</name> |
129 |
+ </maintainer> |
130 |
+ <use> |
131 |
+ <flag name="fuse">Support sys-fs/fuse based /dev/tpm interface</flag> |
132 |
+ </use> |
133 |
+</pkgmetadata> |
134 |
+ |
135 |
|
136 |
diff --git a/app-crypt/swtpm/swtpm-0.2.0.ebuild b/app-crypt/swtpm/swtpm-0.2.0.ebuild |
137 |
new file mode 100644 |
138 |
index 00000000000..0ee3facecab |
139 |
--- /dev/null |
140 |
+++ b/app-crypt/swtpm/swtpm-0.2.0.ebuild |
141 |
@@ -0,0 +1,63 @@ |
142 |
+# Copyright 1999-2019 Gentoo Authors |
143 |
+# Distributed under the terms of the GNU General Public License v2 |
144 |
+ |
145 |
+EAPI=7 |
146 |
+ |
147 |
+PYTHON_COMPAT=( python3_{5,6,7} ) |
148 |
+ |
149 |
+inherit autotools python-any-r1 |
150 |
+ |
151 |
+DESCRIPTION="Libtpms-based TPM emulator" |
152 |
+HOMEPAGE="https://github.com/stefanberger/swtpm" |
153 |
+SRC_URI="https://github.com/stefanberger/swtpm/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
154 |
+LICENSE="BSD" |
155 |
+SLOT="0" |
156 |
+KEYWORDS="~amd64" |
157 |
+IUSE="fuse gnutls seccomp test" |
158 |
+ |
159 |
+COMMON_DEPEND="dev-libs/libtpms |
160 |
+ dev-libs/openssl:0 |
161 |
+ fuse? ( |
162 |
+ dev-libs/glib:2 |
163 |
+ sys-fs/fuse:0 |
164 |
+ ) |
165 |
+ gnutls? ( |
166 |
+ dev-libs/libtasn1:= |
167 |
+ >=net-libs/gnutls-3.1.0[tools] |
168 |
+ ) |
169 |
+ seccomp? ( sys-libs/libseccomp ) |
170 |
+" |
171 |
+ |
172 |
+DEPEND="${COMMON_DEPEND} |
173 |
+ test? ( |
174 |
+ net-misc/socat |
175 |
+ ${PYTHON_DEPS} |
176 |
+ ) |
177 |
+" |
178 |
+ |
179 |
+RDEPEND="${COMMON_DEPEND} |
180 |
+ app-crypt/tpm-tools |
181 |
+ app-crypt/trousers |
182 |
+ dev-tcltk/expect" |
183 |
+ |
184 |
+src_prepare() { |
185 |
+ use test || eapply "${FILESDIR}/${PN}-disable-test-dependencies.patch" |
186 |
+ eapply "${FILESDIR}/${PN}-fix-localca-path.patch" |
187 |
+ default |
188 |
+ eautoreconf |
189 |
+} |
190 |
+ |
191 |
+src_configure() { |
192 |
+ econf \ |
193 |
+ --with-openssl \ |
194 |
+ --without-selinux \ |
195 |
+ $(use_with fuse cuse) \ |
196 |
+ $(use_with gnutls) \ |
197 |
+ $(use_with seccomp) |
198 |
+} |
199 |
+ |
200 |
+src_install() { |
201 |
+ default |
202 |
+ fowners tss:tss /var/lib/swtpm-localca |
203 |
+ keepdir /var/lib/swtpm-localca |
204 |
+} |