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