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