-
Notifications
You must be signed in to change notification settings - Fork 143
/
swtpm.spec.in
236 lines (189 loc) · 6.26 KB
/
swtpm.spec.in
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# spec file for RHEL/CentOS and Fedora
%bcond_without gnutls
# Macros needed by SELinux
%global selinuxtype targeted
%global moduletype contrib
%global modulename swtpm
Summary: TPM Emulator
Name: swtpm
Version: @VERSION@
Release: 1%{?dist}
License: BSD-3-Clause
Url: https://github.com/stefanberger/swtpm
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: libtpms-devel >= 0.6.0
BuildRequires: glib2-devel
BuildRequires: json-glib-devel
BuildRequires: expect
BuildRequires: net-tools
BuildRequires: openssl-devel
BuildRequires: socat
BuildRequires: softhsm
%if (0%{?fedora}) || (0%{?rhel} && 0%{?rhel} < 9)
BuildRequires: trousers >= 0.3.9
%endif
%if %{with gnutls}
BuildRequires: gnutls >= 3.4.0
BuildRequires: gnutls-devel
BuildRequires: gnutls-utils
BuildRequires: libtasn1-devel
BuildRequires: libtasn1
%endif
BuildRequires: selinux-policy-devel
BuildRequires: gcc
BuildRequires: libseccomp-devel
BuildRequires: tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
BuildRequires: gmp-devel
Requires: %{name}-libs = %{version}-%{release}
Requires: libtpms >= 0.6.0
Requires: (%{name}-selinux if selinux-policy-targeted)
%description
TPM emulator built on libtpms providing TPM functionality for QEMU VMs
%package libs
Summary: Private libraries for swtpm TPM emulators
License: BSD-3-Clause
%description libs
A private library with callback functions for libtpms based swtpm TPM emulator
%package devel
Summary: Include files for the TPM emulator's CUSE interface for usage by clients
License: BSD-3-Clause
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
Include files for the TPM emulator's CUSE interface.
%package tools
Summary: Tools for the TPM emulator
License: BSD-3-Clause
Requires: swtpm = %{version}-%{release}
Requires: trousers >= 0.3.9 bash gnutls-utils
%description tools
Tools for the TPM emulator from the swtpm package
%package tools-pkcs11
Summary: Tools for creating a local CA based on a pkcs11 device
License: BSD-3-Clause
Requires: swtpm-tools = %{version}-%{release}
Requires: tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
Requires: expect gnutls-utils trousers >= 0.3.9
%description tools-pkcs11
Tools for creating a local CA based on a pkcs11 device
%package selinux
Summary: SELinux security policy for swtpm
Requires(post): swtpm = %{version}-%{release}
BuildArch: noarch
%if ! 0%{?flatpak}
%{?selinux_requires}
%endif
%description selinux
SELinux security policy for swtpm.
%package tests
Summary: Installed swtpm tests
Requires: swtpm-tools-pkcs11 = %{version}-%{release}
%description tests
Installed swtpm tests
%prep
%autosetup
%build
NOCONFIGURE=1 ./autogen.sh
%configure \
%if %{with gnutls}
--with-gnutls \
%endif
--without-cuse
%make_build
%check
make %{?_smp_mflags} check
%install
%make_install
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
%post selinux
for pp in /usr/share/selinux/packages/swtpm.pp \
/usr/share/selinux/packages/swtpm_libvirt.pp \
/usr/share/selinux/packages/swtpm_svirt.pp; do
%selinux_modules_install -s %{selinuxtype} ${pp}
done
%postun selinux
if [ $1 -eq 0 ]; then
for p in swtpm swtpm_libvirt swtpm_svirt; do
%selinux_modules_uninstall -s %{selinuxtype} $p
done
fi
%posttrans selinux
%selinux_relabel_post -s %{selinuxtype}
%ldconfig_post libs
%ldconfig_postun libs
%files
%license LICENSE
%doc README
%{_bindir}/swtpm
%{_mandir}/man8/swtpm.8*
%files selinux
%{_datadir}/selinux/packages/swtpm.pp
%{_datadir}/selinux/packages/swtpm_libvirt.pp
%{_datadir}/selinux/packages/swtpm_svirt.pp
%files libs
%license LICENSE
%doc README
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/libswtpm_libtpms.so.0
%{_libdir}/%{name}/libswtpm_libtpms.so.0.0.0
%files devel
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%{_mandir}/man3/swtpm_ioctls.3*
%files tools
%doc README
%{_bindir}/swtpm_bios
%if %{with gnutls}
%{_bindir}/swtpm_cert
%endif
%{_bindir}/swtpm_setup
%{_bindir}/swtpm_ioctl
%{_bindir}/swtpm_localca
%{_mandir}/man8/swtpm_bios.8*
%{_mandir}/man8/swtpm_cert.8*
%{_mandir}/man8/swtpm_ioctl.8*
%{_mandir}/man5/swtpm-localca.conf.5*
%{_mandir}/man5/swtpm-localca.options.5*
%{_mandir}/man8/swtpm-localca.8*
%{_mandir}/man8/swtpm_localca.8*
%{_mandir}/man8/swtpm_setup.8*
%{_mandir}/man5/swtpm_setup.conf.5*
%config(noreplace) %{_sysconfdir}/swtpm_setup.conf
%config(noreplace) %{_sysconfdir}/swtpm-localca.options
%config(noreplace) %{_sysconfdir}/swtpm-localca.conf
%dir %{_datadir}/swtpm
%{_datadir}/swtpm/swtpm-localca
%{_datadir}/swtpm/swtpm-create-user-config-files
%attr( 750, @TSS_USER@, root) %{_localstatedir}/lib/swtpm-localca
%files tools-pkcs11
%{_mandir}/man8/swtpm-create-tpmca.8*
%{_datadir}/swtpm/swtpm-create-tpmca
%files tests
%{_libexecdir}/installed-tests/swtpm/
%changelog
* Fri Nov 15 2024 Stefan Berger <stefanb@linux.ibm.com> - 0.10.0-0.20241115git-------
- v0.10.0 release
* Mon Jun 17 2024 Stefan Berger <stefanb@linux.ibm.com> - 0.9.0-0.20240617git-------
- v0.9.0 release
* Thu Nov 10 2022 Stefan Berger <stefanb@linux.ibm.com> - 0.8.0-0.20221110git-------
- v0.8.0 release
* Tue Nov 09 2021 Stefan Berger <stefanb@linux.ibm.com> - 0.7.0-0.20211022git-------
- v0.7.0 release
* Mon Jun 7 2021 Stefan Berger <stefanb@linux.ibm.com> - 0.6.0-0.20210607git-------
- v0.6.0 release
* Wed Oct 7 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.5.0-0.20201007git-------
- v0.5.0 release
* Fri Aug 28 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.4.0-20200218git-------
- v0.4.0 release
* Mon Feb 17 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.3.0-20200218git38f36f3
- v0.3.0 release
* Fri Jul 19 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-20190716git817d3a8
- v0.2.0 release
* Mon Feb 4 2019 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20190204git2c25d13
- v0.1.0 release
* Mon Sep 17 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180918git67d7ea3
- Created initial version of rpm spec files
- Version is now 0.1.0
- Bugzilla for this spec: https://bugzilla.redhat.com/show_bug.cgi?id=1611829