]> git.proxmox.com Git - swtpm.git/blame - dist/swtpm.spec.in
rpm: Remove unnecessary string substitution
[swtpm.git] / dist / swtpm.spec.in
CommitLineData
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
3ec34c2b 10%global modulename swtpm
e09fc276
SB
11
12Summary: TPM Emulator
ce13edf5
SB
13Name: swtpm
14Version: @VERSION@
15Release: 0.%{gitdate}git%{gitshortcommit}%{?dist}
e09fc276 16License: BSD
5dd316bc 17Url: https://github.com/stefanberger/swtpm
ce13edf5 18Source0: %{url}/archive/%{gitcommit}/%{name}-%{gitshortcommit}.tar.gz
e09fc276 19
9df21613
SB
20BuildRequires: automake
21BuildRequires: autoconf
9df21613 22BuildRequires: libtool
9df21613 23BuildRequires: libtpms-devel >= 0.6.0
9df21613 24BuildRequires: glib2-devel
c125e34b 25BuildRequires: json-glib-devel
9df21613
SB
26BuildRequires: gmp-devel
27BuildRequires: expect
28BuildRequires: net-tools
29BuildRequires: openssl-devel
30BuildRequires: socat
ce13edf5 31BuildRequires: python3-twisted
6736dbdb 32BuildRequires: softhsm
9df21613 33BuildRequires: trousers >= 0.3.9
9df21613
SB
34%if %{with gnutls}
35BuildRequires: gnutls >= 3.1.0
36BuildRequires: gnutls-devel
37BuildRequires: gnutls-utils
38BuildRequires: libtasn1-devel
39BuildRequires: libtasn1
5db666e8 40%endif
ce13edf5
SB
41BuildRequires: selinux-policy-devel
42BuildRequires: gcc
758bf70a 43BuildRequires: libseccomp-devel
7419536f 44BuildRequires: tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
5db666e8 45
ce13edf5 46Requires: %{name}-libs = %{version}-%{release}
9df21613 47Requires: libtpms >= 0.6.0
ce13edf5 48%{?selinux_requires}
e09fc276
SB
49
50%description
51TPM emulator built on libtpms providing TPM functionality for QEMU VMs
52
53%package libs
ce13edf5 54Summary: Private libraries for swtpm TPM emulators
e09fc276
SB
55License: BSD
56
57%description libs
ce13edf5 58A private library with callback functions for libtpms based swtpm TPM emulator
e09fc276
SB
59
60%package devel
61Summary: Include files for the TPM emulator's CUSE interface for usage by clients
ce13edf5
SB
62License: BSD
63Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e09fc276
SB
64
65%description devel
66Include files for the TPM emulator's CUSE interface.
67
68%package tools
69Summary: Tools for the TPM emulator
70License: BSD
ce13edf5 71Requires: swtpm = %{version}-%{release}
5d613001 72Requires: trousers >= 0.3.9 bash gnutls-utils python3 python3-cryptography
e09fc276
SB
73
74%description tools
75Tools for the TPM emulator from the swtpm package
76
7419536f
SB
77%package tools-pkcs11
78Summary: Tools for creating a local CA based on a pkcs11 device
79License: BSD
80Requires: swtpm-tools = %{version}-%{release}
81Requires: tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools tpm2-abrmd
82Requires: expect gnutls-utils trousers >= 0.3.9
83
84%description tools-pkcs11
85Tools for creating a local CA based on a pkcs11 device
86
ce13edf5
SB
87%prep
88%autosetup -n %{name}-%{gitcommit}
89
90%build
91
92NOCONFIGURE=1 ./autogen.sh
93%configure \
94%if %{with gnutls}
95 --with-gnutls \
96%endif
97 --without-cuse
98
99%make_build
100
101%check
102make %{?_smp_mflags} check
103
104%install
105
106%make_install
107rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
108
109%post
110for pp in /usr/share/selinux/packages/swtpm.pp \
111 /usr/share/selinux/packages/swtpm_svirt.pp; do
112 %selinux_modules_install -s %{selinuxtype} ${pp}
113done
114
115%postun
116if [ $1 -eq 0 ]; then
117 for p in swtpm swtpm_svirt; do
118 %selinux_modules_uninstall -s %{selinuxtype} $p
119 done
120fi
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
3ec34c2b
AB
169%dir %{_datadir}/swtpm
170%{_datadir}/swtpm/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