]>
Commit | Line | Data |
---|---|---|
4c178928 | 1 | # spec file for RHEL/CentOS and Fedora |
7f1f1fff SB |
2 | %bcond_without gnutls |
3 | ||
4 | # Macros needed by SELinux | |
5 | %global selinuxtype targeted | |
6 | %global moduletype contrib | |
7 | %global modulename swtpm | |
8 | ||
9 | Summary: TPM Emulator | |
10 | Name: swtpm | |
3115dff0 | 11 | Version: 0.8.0 |
7f1f1fff SB |
12 | Release: 1%{?dist} |
13 | License: BSD | |
14 | Url: https://github.com/stefanberger/swtpm | |
15 | Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz | |
16 | ||
17 | BuildRequires: automake | |
18 | BuildRequires: autoconf | |
19 | BuildRequires: libtool | |
20 | BuildRequires: libtpms-devel >= 0.6.0 | |
21 | BuildRequires: glib2-devel | |
22 | BuildRequires: json-glib-devel | |
7f1f1fff SB |
23 | BuildRequires: expect |
24 | BuildRequires: net-tools | |
25 | BuildRequires: openssl-devel | |
26 | BuildRequires: socat | |
7f1f1fff | 27 | BuildRequires: softhsm |
4c178928 | 28 | %if (0%{?fedora}) || (0%{?rhel} && 0%{?rhel} < 9) |
7f1f1fff | 29 | BuildRequires: trousers >= 0.3.9 |
4c178928 | 30 | %endif |
7f1f1fff SB |
31 | %if %{with gnutls} |
32 | BuildRequires: gnutls >= 3.1.0 | |
33 | BuildRequires: gnutls-devel | |
34 | BuildRequires: gnutls-utils | |
35 | BuildRequires: libtasn1-devel | |
36 | BuildRequires: libtasn1 | |
37 | %endif | |
38 | BuildRequires: selinux-policy-devel | |
39 | BuildRequires: gcc | |
40 | BuildRequires: libseccomp-devel | |
41 | BuildRequires: tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd | |
42 | ||
43 | Requires: %{name}-libs = %{version}-%{release} | |
44 | Requires: libtpms >= 0.6.0 | |
45 | %{?selinux_requires} | |
46 | ||
47 | %description | |
48 | TPM emulator built on libtpms providing TPM functionality for QEMU VMs | |
49 | ||
50 | %package libs | |
51 | Summary: Private libraries for swtpm TPM emulators | |
52 | License: BSD | |
53 | ||
54 | %description libs | |
55 | A private library with callback functions for libtpms based swtpm TPM emulator | |
56 | ||
57 | %package devel | |
58 | Summary: Include files for the TPM emulator's CUSE interface for usage by clients | |
59 | License: BSD | |
60 | Requires: %{name}-libs%{?_isa} = %{version}-%{release} | |
61 | ||
62 | %description devel | |
63 | Include files for the TPM emulator's CUSE interface. | |
64 | ||
65 | %package tools | |
66 | Summary: Tools for the TPM emulator | |
67 | License: BSD | |
68 | Requires: swtpm = %{version}-%{release} | |
69 | Requires: trousers >= 0.3.9 bash gnutls-utils | |
70 | ||
71 | %description tools | |
72 | Tools for the TPM emulator from the swtpm package | |
73 | ||
74 | %package tools-pkcs11 | |
75 | Summary: Tools for creating a local CA based on a pkcs11 device | |
76 | License: BSD | |
77 | Requires: swtpm-tools = %{version}-%{release} | |
78 | Requires: tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd | |
79 | Requires: expect gnutls-utils trousers >= 0.3.9 | |
80 | ||
81 | %description tools-pkcs11 | |
82 | Tools for creating a local CA based on a pkcs11 device | |
83 | ||
84 | %prep | |
85 | %autosetup | |
86 | ||
87 | %build | |
88 | ||
89 | NOCONFIGURE=1 ./autogen.sh | |
90 | %configure \ | |
91 | %if %{with gnutls} | |
92 | --with-gnutls \ | |
93 | %endif | |
94 | --without-cuse | |
95 | ||
96 | %make_build | |
97 | ||
98 | %check | |
99 | make %{?_smp_mflags} check | |
100 | ||
101 | %install | |
102 | ||
103 | %make_install | |
104 | rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so} | |
105 | ||
106 | %post | |
107 | for pp in /usr/share/selinux/packages/swtpm.pp \ | |
108 | /usr/share/selinux/packages/swtpm_svirt.pp; do | |
109 | %selinux_modules_install -s %{selinuxtype} ${pp} | |
110 | done | |
111 | ||
112 | %postun | |
113 | if [ $1 -eq 0 ]; then | |
114 | for p in swtpm swtpm_svirt; do | |
115 | %selinux_modules_uninstall -s %{selinuxtype} $p | |
116 | done | |
117 | fi | |
118 | ||
119 | %posttrans | |
120 | %selinux_relabel_post -s %{selinuxtype} | |
121 | ||
122 | %ldconfig_post libs | |
123 | %ldconfig_postun libs | |
124 | ||
125 | %files | |
126 | %license LICENSE | |
127 | %doc README | |
128 | %{_bindir}/swtpm | |
129 | %{_mandir}/man8/swtpm.8* | |
130 | %{_datadir}/selinux/packages/swtpm.pp | |
131 | %{_datadir}/selinux/packages/swtpm_svirt.pp | |
132 | ||
133 | %files libs | |
134 | %license LICENSE | |
135 | %doc README | |
136 | ||
137 | %dir %{_libdir}/%{name} | |
138 | %{_libdir}/%{name}/libswtpm_libtpms.so.0 | |
139 | %{_libdir}/%{name}/libswtpm_libtpms.so.0.0.0 | |
140 | ||
141 | %files devel | |
142 | %dir %{_includedir}/%{name} | |
143 | %{_includedir}/%{name}/*.h | |
144 | %{_mandir}/man3/swtpm_ioctls.3* | |
145 | ||
146 | %files tools | |
147 | %doc README | |
148 | %{_bindir}/swtpm_bios | |
149 | %if %{with gnutls} | |
150 | %{_bindir}/swtpm_cert | |
151 | %endif | |
152 | %{_bindir}/swtpm_setup | |
153 | %{_bindir}/swtpm_ioctl | |
fd00c5ff | 154 | %{_bindir}/swtpm_localca |
7f1f1fff SB |
155 | %{_mandir}/man8/swtpm_bios.8* |
156 | %{_mandir}/man8/swtpm_cert.8* | |
157 | %{_mandir}/man8/swtpm_ioctl.8* | |
33aa1355 SH |
158 | %{_mandir}/man5/swtpm-localca.conf.5* |
159 | %{_mandir}/man5/swtpm-localca.options.5* | |
7f1f1fff | 160 | %{_mandir}/man8/swtpm-localca.8* |
9e21a3fe | 161 | %{_mandir}/man8/swtpm_localca.8* |
7f1f1fff | 162 | %{_mandir}/man8/swtpm_setup.8* |
33aa1355 | 163 | %{_mandir}/man5/swtpm_setup.conf.5* |
7f1f1fff SB |
164 | %config(noreplace) %{_sysconfdir}/swtpm_setup.conf |
165 | %config(noreplace) %{_sysconfdir}/swtpm-localca.options | |
166 | %config(noreplace) %{_sysconfdir}/swtpm-localca.conf | |
167 | %dir %{_datadir}/swtpm | |
168 | %{_datadir}/swtpm/swtpm-localca | |
169 | %{_datadir}/swtpm/swtpm-create-user-config-files | |
170 | %attr( 750, tss, root) %{_localstatedir}/lib/swtpm-localca | |
171 | ||
172 | %files tools-pkcs11 | |
173 | %{_mandir}/man8/swtpm-create-tpmca.8* | |
174 | %{_datadir}/swtpm/swtpm-create-tpmca | |
175 | ||
176 | %changelog | |
b79fd91c SB |
177 | * Tue Nov 09 2021 Stefan Berger <stefanb@linux.ibm.com> - 0.7.0-0.20211022git------- |
178 | - v0.7.0 release | |
179 | ||
7f1f1fff SB |
180 | * Mon Jun 7 2021 Stefan Berger <stefanb@linux.ibm.com> - 0.6.0-0.20210607git------- |
181 | - v0.6.0 release | |
182 | ||
183 | * Wed Oct 7 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.5.0-0.20201007git------- | |
184 | - v0.5.0 release | |
185 | ||
186 | * Fri Aug 28 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.4.0-20200218git------- | |
187 | - v0.4.0 release | |
188 | ||
189 | * Mon Feb 17 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.3.0-20200218git38f36f3 | |
190 | - v0.3.0 release | |
191 | ||
192 | * Fri Jul 19 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-20190716git817d3a8 | |
193 | - v0.2.0 release | |
194 | ||
195 | * Mon Feb 4 2019 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20190204git2c25d13 | |
196 | - v0.1.0 release | |
197 | ||
198 | * Mon Sep 17 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180918git67d7ea3 | |
199 | - Created initial version of rpm spec files | |
200 | - Version is now 0.1.0 | |
201 | - Bugzilla for this spec: https://bugzilla.redhat.com/show_bug.cgi?id=1611829 |