Package also the python tools under separate subpackage

This commit is contained in:
Jakub Jelen 2019-04-23 12:58:41 +02:00
parent d44460e4f1
commit 2972d2166e

View File

@ -25,6 +25,11 @@ BuildRequires: p11-kit-devel
# for tests
BuildRequires: libcmocka-devel
BuildRequires: dbus-daemon
# for tools
BuildRequires: python3-devel
%package tools
Summary: The tools required to setup and configure TPM2 for PKCS#11
%description
PKCS #11 is a Public-Key Cryptography Standard that defines a standard method
@ -32,6 +37,9 @@ to access cryptographic services from tokens/ devices such as hardware security
modules (HSM), smart cards, etc. In this project we intend to use a TPM2 device
as the cryptographic token.
%description tools
The tools required to setup and configure TPM2 for PKCS#11.
%prep
%setup -q -n tpm2-pkcs11-%{commit0}
@ -40,17 +48,24 @@ as the cryptographic token.
./bootstrap
%configure --enable-unit
make %{?_smp_mflags}
cd tools
%py3_build
%check
make check
cd tools
%{__python3} setup.py test
%install
%make_install
rm $RPM_BUILD_ROOT%{_libdir}/pkgconfig/tpm2-pkcs11.pc
[ -f $RPM_BUILD_ROOT%{_libdir}/pkcs11/libtpm2_pkcs11.la ] && \
rm $RPM_BUILD_ROOT%{_libdir}/pkcs11/libtpm2_pkcs11.la
cd tools
%py3_install
sed -i "s/python/python3/g" tpm2_ptool
install -Dpm 755 tpm2_ptool $RPM_BUILD_ROOT%{_bindir}/tpm2_ptool
%files
%doc
@ -59,6 +74,10 @@ rm $RPM_BUILD_ROOT%{_libdir}/pkgconfig/tpm2-pkcs11.pc
%%dir %{_libdir}/pkcs11
%{_libdir}/pkcs11/libtpm2_pkcs11.so
%{_libdir}/pkcs11/libtpm2_pkcs11.so.0*
%files tools
%{_bindir}/tpm2_ptool
%{python3_sitelib}/tpm2_pkcs11/*
%{python3_sitelib}/tpm2_pkcs11_tools-*/*