Fixes to SELinux policy

Improvements on various other parts
This commit is contained in:
Stefan Berger 2018-10-02 12:30:03 -04:00
parent f11f467163
commit 36b691a3bf
3 changed files with 3 additions and 170 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/swtpm.spec
/swtpm-ce13edf.tar.gz
/swtpm-0143c41.tar.gz

View File

@ -1,2 +1,2 @@
SHA512 (swtpm.spec) = 98ede51c9738a1e2fda633023ed8c361d1c9db3b120bc41f553e13a410234fe890d0ddb95763384b328c888eaa25266e2ed562e0f6c7b5f2e0170be0215bf8cd
SHA512 (swtpm-ce13edf.tar.gz) = adb319e1a0e6b926dc2cf2eb306d1c9ea9d04ced00eba5b0d54a9a65dd1365c594552175fd746859ce4f4a050a3d41104b9dc36136c2bf0be302eae9b87ab696
SHA512 (swtpm.spec) = 17ac4ad0c869cb6005d8f2943c7ae361f0e2cb0e57b2f7fb4606e6cd39a997d7935fd03ff968520150deb71da3fba33b5c642816cce5b6050c3de23b9ef69c46
SHA512 (swtpm-0143c41.tar.gz) = d40a77e9218dbb5df79a56d91dd17d3eaa24995ee6cf86cde07348e4cc87ccd52cca2fb68e1bd17786b526ef13d0cdc3bd8b9cd66c6a961d2d1ba6f85af7919f

View File

@ -1,168 +0,0 @@
%bcond_without gnutls
%global gitdate 20180925
%global gitcommit ce13edf590f45f7532d732d24f57953615d82119
%global gitshortcommit %(c=%{gitcommit}; echo ${c:0:7})
# Macros needed by SELinux
%global selinuxtype targeted
%global moduletype contrib
%global modulename swtpm
Summary: TPM Emulator
Name: swtpm
Version: 0.1.0
Release: 0.%{gitdate}git%{gitshortcommit}%{?dist}
License: BSD
Url: http://github.com/stefanberger/swtpm
Source0: %{url}/archive/%{gitcommit}/%{name}-%{gitshortcommit}.tar.gz
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: libtpms-devel >= 0.6.0
BuildRequires: glib2-devel
BuildRequires: gmp-devel
BuildRequires: expect
BuildRequires: net-tools
BuildRequires: openssl-devel
BuildRequires: socat
BuildRequires: python3
BuildRequires: python3-twisted
BuildRequires: trousers >= 0.3.9
BuildRequires: tpm-tools >= 1.3.8-6
%if %{with gnutls}
BuildRequires: gnutls >= 3.1.0
BuildRequires: gnutls-devel
BuildRequires: gnutls-utils
BuildRequires: libtasn1-devel
BuildRequires: libtasn1
%endif
BuildRequires: selinux-policy-devel
BuildRequires: gcc
Requires: %{name}-libs = %{version}-%{release}
Requires: libtpms >= 0.6.0
%{?selinux_requires}
%description
TPM emulator built on libtpms providing TPM functionality for QEMU VMs
%package libs
Summary: Private libraries for swtpm TPM emulators
License: BSD
%description libs
A private library with callback functions for libtpms based swtpm TPM emulator
%package devel
Summary: Include files for the TPM emulator's CUSE interface for usage by clients
License: BSD
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
Include files for the TPM emulator's CUSE interface.
%package tools
Summary: Tools for the TPM emulator
License: BSD
Requires: swtpm = %{version}-%{release}
Requires: trousers >= 0.3.9 tpm-tools >= 1.3.8-6 expect bash net-tools gnutls-utils
%description tools
Tools for the TPM emulator from the swtpm package
%prep
%autosetup -n %{name}-%{gitcommit}
%build
NOCONFIGURE=1 ./autogen.sh
%configure \
%if %{with gnutls}
--with-gnutls \
%endif
--without-cuse
%make_build
%check
make %{?_smp_mflags} check
%install
%make_install
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la,so}
%post
for pp in /usr/share/selinux/packages/swtpm.pp \
/usr/share/selinux/packages/swtpm_svirt.pp; do
%selinux_modules_install -s %{selinuxtype} ${pp}
done
%postun
if [ $1 -eq 0 ]; then
for p in swtpm swtpm_svirt; do
%selinux_modules_uninstall -s %{selinuxtype} $p
done
fi
%posttrans
%selinux_relabel_post -s %{selinuxtype}
%ldconfig_post libs
%ldconfig_postun libs
%files
%license LICENSE
%doc README
%{_bindir}/swtpm
%{_mandir}/man8/swtpm.8*
%{_datadir}/selinux/packages/swtpm.pp
%{_datadir}/selinux/packages/swtpm_svirt.pp
%files libs
%license LICENSE
%doc README
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/libswtpm_libtpms.so.0
%{_libdir}/%{name}/libswtpm_libtpms.so.0.0.0
%files devel
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%{_mandir}/man3/swtpm_ioctls.3*
%files tools
%doc README
%{_bindir}/swtpm_bios
%if %{with gnutls}
%{_bindir}/swtpm_cert
%endif
%{_bindir}/swtpm_setup
%attr( 755, tss , tss) %{_bindir}/swtpm_setup.sh
%{_bindir}/swtpm_ioctl
%{_mandir}/man8/swtpm_bios.8*
%{_mandir}/man8/swtpm_cert.8*
%{_mandir}/man8/swtpm_ioctl.8*
%{_mandir}/man8/swtpm-localca.conf.8*
%{_mandir}/man8/swtpm-localca.options.8*
%{_mandir}/man8/swtpm-localca.8*
%{_mandir}/man8/swtpm_setup.8*
%{_mandir}/man8/swtpm_setup.conf.8*
%{_mandir}/man8/swtpm_setup.sh.8*
%config(noreplace) %{_sysconfdir}/swtpm_setup.conf
%config(noreplace) %{_sysconfdir}/swtpm-localca.options
%config(noreplace) %{_sysconfdir}/swtpm-localca.conf
%dir %{_datadir}/swtpm
%{_datadir}/swtpm/swtpm-localca
%attr( 755, tss, tss) %{_localstatedir}/lib/swtpm-localca
%changelog
* Mon Sep 25 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180924gitce13edf
- Initial Fedora build
* Mon Sep 17 2018 Stefan Berger <stefanb@linux.vnet.ibm.com> - 0.1.0-0.20180918git67d7ea3
- Created initial version of rpm spec files
- Version is now 0.1.0
- Bugzilla for this spec: https://bugzilla.redhat.com/show_bug.cgi?id=1611829