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