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