]> git.proxmox.com Git - swtpm.git/blame - dist/swtpm.spec.in
CHANGES: Extend documentation for changes in 0.4.0
[swtpm.git] / dist / swtpm.spec.in
CommitLineData
05288042 1%bcond_without gnutls
9df21613 2
5d613001
SB
3%global gitdate 20200828
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
12Summary: TPM Emulator
ce13edf5
SB
13Name: swtpm
14Version: @VERSION@
15Release: 0.%{gitdate}git%{gitshortcommit}%{?dist}
e09fc276 16License: BSD
ce13edf5
SB
17Url: http://github.com/stefanberger/swtpm
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
SB
24BuildRequires: glib2-devel
25BuildRequires: gmp-devel
26BuildRequires: expect
27BuildRequires: net-tools
28BuildRequires: openssl-devel
29BuildRequires: socat
ce13edf5 30BuildRequires: python3
5d613001
SB
31BuildRequires: python3-devel
32BuildRequires: python3-cryptography
33BuildRequires: python3-pip
34BuildRequires: python3-setuptools
ce13edf5 35BuildRequires: python3-twisted
6736dbdb 36BuildRequires: softhsm
9df21613 37BuildRequires: trousers >= 0.3.9
9df21613
SB
38%if %{with gnutls}
39BuildRequires: gnutls >= 3.1.0
40BuildRequires: gnutls-devel
41BuildRequires: gnutls-utils
42BuildRequires: libtasn1-devel
43BuildRequires: libtasn1
5db666e8 44%endif
ce13edf5
SB
45BuildRequires: selinux-policy-devel
46BuildRequires: gcc
758bf70a 47BuildRequires: libseccomp-devel
5db666e8 48
ce13edf5 49Requires: %{name}-libs = %{version}-%{release}
9df21613 50Requires: libtpms >= 0.6.0
ce13edf5 51%{?selinux_requires}
e09fc276
SB
52
53%description
54TPM emulator built on libtpms providing TPM functionality for QEMU VMs
55
56%package libs
ce13edf5 57Summary: Private libraries for swtpm TPM emulators
e09fc276
SB
58License: BSD
59
60%description libs
ce13edf5 61A private library with callback functions for libtpms based swtpm TPM emulator
e09fc276
SB
62
63%package devel
64Summary: Include files for the TPM emulator's CUSE interface for usage by clients
ce13edf5
SB
65License: BSD
66Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e09fc276
SB
67
68%description devel
69Include files for the TPM emulator's CUSE interface.
70
71%package tools
72Summary: Tools for the TPM emulator
73License: BSD
ce13edf5 74Requires: swtpm = %{version}-%{release}
5d613001 75Requires: trousers >= 0.3.9 bash gnutls-utils python3 python3-cryptography
e09fc276
SB
76
77%description tools
78Tools for the TPM emulator from the swtpm package
79
ce13edf5
SB
80%prep
81%autosetup -n %{name}-%{gitcommit}
82
83%build
84
85NOCONFIGURE=1 ./autogen.sh
86%configure \
87%if %{with gnutls}
88 --with-gnutls \
89%endif
90 --without-cuse
91
92%make_build
93
94%check
95make %{?_smp_mflags} check
96
97%install
98
99%make_install
100rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
6736dbdb
SB
101rm -f $RPM_BUILD_ROOT%{_mandir}/man8/swtpm-create-tpmca.8*
102rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/swtpm-create-tpmca
ce13edf5
SB
103
104%post
105for pp in /usr/share/selinux/packages/swtpm.pp \
106 /usr/share/selinux/packages/swtpm_svirt.pp; do
107 %selinux_modules_install -s %{selinuxtype} ${pp}
108done
109
110%postun
111if [ $1 -eq 0 ]; then
112 for p in swtpm swtpm_svirt; do
113 %selinux_modules_uninstall -s %{selinuxtype} $p
114 done
115fi
116
117%posttrans
118%selinux_relabel_post -s %{selinuxtype}
119
120%ldconfig_post libs
121%ldconfig_postun libs
122
e09fc276 123%files
ce13edf5
SB
124%license LICENSE
125%doc README
9df21613 126%{_bindir}/swtpm
e09fc276 127%{_mandir}/man8/swtpm.8*
5b09de83
SB
128%{_datadir}/selinux/packages/swtpm.pp
129%{_datadir}/selinux/packages/swtpm_svirt.pp
e09fc276 130
e09fc276 131%files libs
ce13edf5
SB
132%license LICENSE
133%doc README
134
135%dir %{_libdir}/%{name}
a246953a
SB
136%{_libdir}/%{name}/libswtpm_libtpms.so.0
137%{_libdir}/%{name}/libswtpm_libtpms.so.0.0.0
e09fc276
SB
138
139%files devel
e09fc276 140%dir %{_includedir}/%{name}
9df21613 141%{_includedir}/%{name}/*.h
39d0c3de 142%{_mandir}/man3/swtpm_ioctls.3*
e09fc276
SB
143
144%files tools
ce13edf5 145%doc README
9df21613
SB
146%{_bindir}/swtpm_bios
147%if %{with gnutls}
148%{_bindir}/swtpm_cert
e09fc276 149%endif
9df21613 150%{_bindir}/swtpm_setup
05d81603 151%{_bindir}/swtpm_setup.sh
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
ce13edf5 165%dir %{_datadir}/@PACKAGE@
9df21613 166%{_datadir}/@PACKAGE@/swtpm-localca
5d613001
SB
167%{_datadir}/swtpm/swtpm-create-user-config-files
168%{python3_sitelib}/py_swtpm_setup/*
169%{python3_sitelib}/swtpm_setup-*/*
170%attr( 750, @TSS_USER@, root) %{_localstatedir}/lib/swtpm-localca
e09fc276 171
e09fc276 172%changelog
74ae43bd 173* Mon Feb 17 2020 Stefan Berger <stefanb@linux.ibm.com> - 0.3.0-20200218git38f36f3
9c727805
SB
174- v0.3.0 release
175
bac3fc7c
SB
176* Fri Jul 19 2019 Stefan Berger <stefanb@linux.ibm.com> - 0.2.0-20190716git817d3a8
177- v0.2.0 release
178
179* Mon Feb 4 2019 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20190204git2c25d13
6736dbdb
SB
180- v0.1.0 release
181
ce13edf5 182* Mon Sep 17 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180918git67d7ea3
e1eca6c8
SB
183- Created initial version of rpm spec files
184- Version is now 0.1.0
ce13edf5 185- Bugzilla for this spec: https://bugzilla.redhat.com/show_bug.cgi?id=1611829