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