]> git.proxmox.com Git - swtpm.git/blame - dist/swtpm.spec.in
test: Use TPM_ResetEstablishmentBit command in some tests
[swtpm.git] / dist / swtpm.spec.in
CommitLineData
e09fc276
SB
1# --- swtpm rpm-spec ---
2
3%define name @PACKAGE@
4%define version @VERSION@
5%define release 1
6
7Summary: TPM Emulator
8Name: %{name}
9Version: %{version}
10Release: %{release}%{?dist}
11License: BSD
12Group: Applications/Emulators
13Source: %{name}-%{version}.tar.gz
14BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
15
16# due to gnutls backlevel API:
17%if 0%{?rhel} >= 7 || 0%{?fedora} >= 19
18 %define with_gnutls 1
19%else
20 %define with_gnutls 0
21%endif
22
23BuildRequires: automake autoconf bash coreutils libtool sed
24BuildRequires: libtpms-devel fuse-devel glib2-devel gmp-devel
09516897 25BuildRequires: expect bash net-tools nss-devel
e09fc276
SB
26%if %{with_gnutls}
27BuildRequires: gnutls >= 3.1.0 gnutls-devel
cb5dc4e9 28BuildRequires: libtasn1-devel libtasn1 kernel-modules-extra
ba2f0af6
SB
29%if 0%{?fedora}
30BuildRequires: libtasn1-tools
31%endif
e09fc276 32%endif
cb5dc4e9 33Requires: fuse expect kernel-modules-extra
e09fc276
SB
34
35%description
36TPM emulator built on libtpms providing TPM functionality for QEMU VMs
37
38%package libs
39Summary: Common libraries for TPM emulators
40Group: System Environment/Libraries
41License: BSD
42
43%description libs
44A library with callback functions for libtpms based TPM emulator
45
46%package cuse
47Summary: TPM emulator with CUSE interface
48Group: Applications/Emulators
49License: GPL
50BuildRequires: selinux-policy-devel
51
52%description cuse
53TPM Emulator with CUSE interface
54
55%package devel
56Summary: Include files for the TPM emulator's CUSE interface for usage by clients
57Group: Development/Libraries
58Requires: %{name}%{?_isa} = %{version}-%{release}
59
60%description devel
61Include files for the TPM emulator's CUSE interface.
62
63%package tools
64Summary: Tools for the TPM emulator
65License: BSD
66Group: Applications/Emulators
67Requires: swtpm fuse
68Requires: trousers >= 0.3.9 tpm-tools >= 1.3.7 expect bash net-tools
69
70%description tools
71Tools for the TPM emulator from the swtpm package
72
73%files
74%defattr(-,root,root,-)
75%attr( 755, root, root) %{_bindir}/swtpm
76%{_mandir}/man8/swtpm.8*
77
78%files cuse
79%defattr(-,root,root,-)
80%attr( 755, root, root) %{_bindir}/swtpm_cuse
81%{_mandir}/man8/swtpm_cuse.8*
82%attr( 755, root, root) %{_datadir}/swtpm/*.pp
83
84%files libs
85%{_libdir}/libswtpm_libtpms.so.*
86
87%files devel
88%defattr(-, root, root, -)
89%{_libdir}/libswtpm_libtpms.so
90
91%dir %{_includedir}/%{name}
92%attr(644, root, root) %{_includedir}/%{name}/*.h
93
94%files tools
95%defattr(-,root,root,-)
96%attr( 755, root, root) %{_bindir}/swtpm_bios
97%if %{with_gnutls}
98%attr( 755, root, root) %{_bindir}/swtpm_cert
99%endif
100%attr( 755, root, root) %{_bindir}/swtpm_setup
101%attr( 755, tss , tss) %{_bindir}/swtpm_setup.sh
102%attr( 755, root, root) %{_bindir}/swtpm_ioctl
103%{_mandir}/man8/swtpm_bios.8*
104%{_mandir}/man8/swtpm_cert.8*
105%{_mandir}/man8/swtpm_ioctl.8*
106%{_mandir}/man8/swtpm-localca.conf.8*
107%{_mandir}/man8/swtpm-localca.options.8*
108%{_mandir}/man8/swtpm-localca.sh.8*
109%{_mandir}/man8/swtpm_setup.8*
110%{_mandir}/man8/swtpm_setup.conf.8*
111%{_mandir}/man8/swtpm_setup.sh.8*
112%config(noreplace) %{_sysconfdir}/swtpm_setup.conf
113%config(noreplace) %{_sysconfdir}/swtpm-localca.options
114%config(noreplace) %{_sysconfdir}/swtpm-localca.conf
115%attr( 755, root, root) %{_datadir}/@PACKAGE@/swtpm-localca.sh
116
117
118%prep
119%setup -q
120
121%build
122
123./bootstrap.sh
124%configure \
125 --prefix=/usr \
126%if %{with_gnutls}
127 --with-gnutls
128%endif
129
130make %{?_smp_mflags}
131
132%check
7d0fec4f 133make %{?_smp_mflags} check
e09fc276
SB
134
135%install
136
137make %{?_smp_mflags} install DESTDIR=${RPM_BUILD_ROOT}
138rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.a ${RPM_BUILD_ROOT}%{_libdir}/*.la
139
140%post cuse
141if [ -n "$(type -p semodule)" ]; then
142 for pp in /usr/share/swtpm/*.pp ; do
143 echo "Activating SELinux policy $pp"
144 semodule -i $pp
145 done
146fi
147
148if [ -n "$(type -p restorecon)" ]; then
149 restorecon /usr/bin/swtpm_cuse
150fi
151
152%postun cuse
153if [ -n "$(type -p semodule)" ]; then
154 for p in swtpmcuse_svirt swtpmcuse ; do
155 echo "Removing SELinux policy $p"
156 semodule -r $p
157 done
158fi
159
160%post libs -p /sbin/ldconfig
161%postun libs -p /sbin/ldconfig
162
163%changelog