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