Blame SPECS/tpm2-pkcs11.spec

ad10f4
%ifarch s390x
ad10f4
# https://bugzilla.redhat.com/show_bug.cgi?id=1861276 -> Disable LTO for now
ad10f4
%define _lto_cflags %{nil}
ad10f4
%endif
ad10f4
ad10f4
#global candidate RC0
ad10f4
ad10f4
Name:		tpm2-pkcs11
ad10f4
Version:	1.6.0
ad10f4
Release:	1%{?candidate:.%{candidate}}%{?dist}
ad10f4
Summary:	PKCS#11 interface for TPM 2.0 hardware
ad10f4
ad10f4
License:	BSD
ad10f4
URL:		https://github.com/tpm2-software/tpm2-pkcs11
ad10f4
Source0:	https://github.com/tpm2-software/%{name}/releases/download/%{version}%{?candidate:-%{candidate}}/%{name}-%{version}%{?candidate:-%{candidate}}.tar.gz
ad10f4
Source1:	https://github.com/tpm2-software/%{name}/releases/download/%{version}%{?candidate:-%{candidate}}/%{name}-%{version}%{?candidate:-%{candidate}}.tar.gz.asc
ad10f4
# William Roberts (Bill Roberts) key from pgp.mit.edu
ad10f4
Source2:	gpgkey-8E1F50C1.gpg
ad10f4
# Revert of ea5f1c078aff7fb09fb5fc78403d4f8c868c4ea6 to build on EPEL 8
ad10f4
Patch0:		revert-require-py37.patch
ad10f4
Patch1:		0001-Backup-with-sqlite3-special-command.patch
ad10f4
Patch2:		0002-utils-fix-stringop-overread-in-str_padded_copy.patch
ad10f4
Patch3:		0003-utils-remove-debug-log-message-from-str_padded_copy.patch
ad10f4
Patch4:		0004-tpm2_ptool-do-not-re-encode-the-signed-data-when-imp.patch
ad10f4
Patch5:		0005-db-fix-upgrade-backup.patch
ad10f4
Patch6:		0006-db-fix-upgrade-to-version-4.patch
ad10f4
ad10f4
ad10f4
BuildRequires:  autoconf-archive
ad10f4
BuildRequires:  automake
ad10f4
BuildRequires:  libtool
ad10f4
BuildRequires:	gcc
ad10f4
BuildRequires:	make
ad10f4
BuildRequires:	python3
ad10f4
BuildRequires:	libgcrypt-devel
ad10f4
BuildRequires:	libyaml-devel
ad10f4
BuildRequires:	openssl-devel
ad10f4
BuildRequires:	p11-kit-devel
ad10f4
BuildRequires:	sqlite-devel
ad10f4
BuildRequires:	tpm2-tools
ad10f4
BuildRequires:	tpm2-tss-devel
ad10f4
# for tests
ad10f4
BuildRequires:	libcmocka-devel
ad10f4
BuildRequires:	dbus-daemon
ad10f4
# for tools
ad10f4
BuildRequires:	python3-devel
ad10f4
BuildRequires:	python3-setuptools
ad10f4
BuildRequires:	python3-pyasn1-modules
ad10f4
BuildRequires:	python3-pyyaml
ad10f4
BuildRequires:	python3-cryptography
ad10f4
# for tarball signature verification
ad10f4
BuildRequires:	gnupg2
ad10f4
ad10f4
%description
ad10f4
PKCS #11 is a Public-Key Cryptography Standard that defines a standard method
ad10f4
to access cryptographic services from tokens/ devices such as hardware security
ad10f4
modules (HSM), smart cards, etc. In this project we intend to use a TPM2 device
ad10f4
as the cryptographic token.
ad10f4
ad10f4
%package tools
ad10f4
Summary: The tools required to setup and configure TPM2 for PKCS#11
ad10f4
# Automatic generator does not work for me even though the requires.txt is in place
ad10f4
Requires:	tpm2-tools
ad10f4
Requires:	python3-cryptography
ad10f4
Requires:	python3-pyyaml
ad10f4
Requires:	python3-pyasn1-modules
ad10f4
Requires:	sqlite
ad10f4
ad10f4
%description tools
ad10f4
The tools required to setup and configure TPM2 for PKCS#11.
ad10f4
ad10f4
%prep
ad10f4
gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
ad10f4
%autosetup -p1 -n %{name}-%{version}%{?candidate:-%{candidate}}
ad10f4
ad10f4
ad10f4
%build
ad10f4
%configure --enable-unit
ad10f4
%{make_build}
ad10f4
cd tools
ad10f4
%py3_build
ad10f4
ad10f4
ad10f4
%install
ad10f4
%make_install
ad10f4
rm $RPM_BUILD_ROOT%{_libdir}/pkgconfig/tpm2-pkcs11.pc
ad10f4
[ -f $RPM_BUILD_ROOT%{_libdir}/pkcs11/libtpm2_pkcs11.la ] && \
ad10f4
  rm $RPM_BUILD_ROOT%{_libdir}/pkcs11/libtpm2_pkcs11.la
ad10f4
[ -f $RPM_BUILD_ROOT%{_libdir}/pkcs11/libtpm2_pkcs11.a ] && \
ad10f4
  rm $RPM_BUILD_ROOT%{_libdir}/pkcs11/libtpm2_pkcs11.a
ad10f4
cd tools
ad10f4
%py3_install
ad10f4
install -Dpm 755 tpm2_ptool $RPM_BUILD_ROOT%{_bindir}/tpm2_ptool
ad10f4
ad10f4
ad10f4
%check
ad10f4
make check
ad10f4
cd tools
ad10f4
%{__python3} setup.py test
ad10f4
ad10f4
ad10f4
%files
ad10f4
%license LICENSE
ad10f4
%{_datadir}/p11-kit/modules/tpm2_pkcs11.module
ad10f4
%%dir %{_libdir}/pkcs11
ad10f4
%{_libdir}/pkcs11/libtpm2_pkcs11.so
ad10f4
%{_libdir}/pkcs11/libtpm2_pkcs11.so.0*
ad10f4
ad10f4
%files tools
ad10f4
%{_bindir}/tpm2_ptool
ad10f4
%{python3_sitelib}/tpm2_pkcs11/*
ad10f4
%{python3_sitelib}/tpm2_pkcs11_tools-*/*
ad10f4
ad10f4
ad10f4
%changelog
ad10f4
* Wed Nov 16 2022 Štěpán Horáček <shoracek@redhat.com> - 1.6.0-1
ad10f4
- Update to 1.6.0 for RHEL 8
ad10f4
  Resolves: rhbz#1896871
ad10f4
ad10f4
* Tue Mar 23 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 1.3.2-2
ad10f4
- Revert python 3.7 requirement commit to allow building on EPEL 8
ad10f4
ad10f4
* Mon Aug 10 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 1.3.2-1
ad10f4
- Update to 1.3.2
ad10f4
ad10f4
* Mon Jul 27 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 1.3.1-1
ad10f4
- Update to 1.3.1
ad10f4
ad10f4
* Tue Jul 07 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 1.3.0-1
ad10f4
- Update to 1.3.0
ad10f4
ad10f4
* Thu Jul 02 2020 Jakub Jelen <jjelen@redhat.com> - 1.3.0-0.1-RC0
ad10f4
- Update to 1.3.0-RC0
ad10f4
ad10f4
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.2.0-2
ad10f4
- Rebuilt for Python 3.9
ad10f4
ad10f4
* Mon Mar 30 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 1.2.0-1
ad10f4
- Update to 1.2.0
ad10f4
ad10f4
* Mon Mar 09 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 1.1.0-1
ad10f4
- Update to 1.1.0
ad10f4
ad10f4
* Mon Mar  2 2020 Peter Robinson <pbrobinson@fedoraproject.org> 1.1.0-0.1-RC1
ad10f4
- Update to 1.1.0 RC1 candidate
ad10f4
ad10f4
* Mon Feb 10 2020 Jakub Jelen <jjelen@redhat.com> - 1.0.1-3
ad10f4
- Unbreak build with gcc10 (#1796383)
ad10f4
ad10f4
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-2
ad10f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
ad10f4
ad10f4
* Tue Jan 07 2020 Jakub Jelen <jjelen@redhat.com> - 1.0.1-1
ad10f4
- New upstream release (#1784580)
ad10f4
ad10f4
* Tue Dec 31 2019 Peter Robinson <pbrobinson@fedoraproject.org> 1.0-1
ad10f4
- Update to 1.0 stable release
ad10f4
ad10f4
* Thu Dec 26 2019 Peter Robinson <pbrobinson@fedoraproject.org> 1.0-0.1-RC1
ad10f4
- Update to 1.0 RC1 candidate
ad10f4
ad10f4
* Fri Oct 11 2019 Jakub Jelen <jjelen@redhat.com> - 0-0.3.20191011git0b7ceff
ad10f4
- Update to current git version
ad10f4
- Fix missing requires (#1757179)
ad10f4
ad10f4
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0-0.7.20190813git2f3058c
ad10f4
- Rebuilt for Python 3.8.0rc1 (#1748018)
ad10f4
ad10f4
* Wed Aug 21 2019 Miro Hrončok <mhroncok@redhat.com> - 0-0.6.20190813git2f3058c
ad10f4
- Rebuilt for Python 3.8
ad10f4
ad10f4
* Tue Aug 20 2019 Peter Robinson <pbrobinson@fedoraproject.org> 0-0.5.20190813git2f3058c
ad10f4
- Update to new git snapshot for better use of tss2-tools 4.0 features
ad10f4
ad10f4
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0-0.4.20190219git1e84553
ad10f4
- Rebuilt for Python 3.8
ad10f4
ad10f4
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.3.20190219git1e84553
ad10f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
ad10f4
ad10f4
* Tue Apr 23 2019 Jakub Jelen <jjelen@redhat.com> - 0-0.2.20190219git1e84553
ad10f4
- Package missing python tool for TPM2 initialization
ad10f4
- Update to current version from github
ad10f4
ad10f4
* Tue Feb 19 2019 Jakub Jelen <jjelen@redhat.com> - 0-0.1.20190219git836d715
ad10f4
- Initial release for Fedora