Build on EPEL 8 (#1942129)

This commit is contained in:
Davide Cavalca 2021-03-23 15:48:35 -07:00
parent 2a8463e378
commit 5da8ddeb3f
2 changed files with 79 additions and 1 deletions

73
revert-require-py37.patch Normal file
View File

@ -0,0 +1,73 @@
diff -Naur tpm2-pkcs11-1.3.2/ea5f1c078aff7fb09fb5fc78403d4f8c868c4ea6.patch tpm2-pkcs11-1.3.2a/ea5f1c078aff7fb09fb5fc78403d4f8c868c4ea6.patch
--- tpm2-pkcs11-1.3.2/ea5f1c078aff7fb09fb5fc78403d4f8c868c4ea6.patch 1969-12-31 16:00:00.000000000 -0800
+++ tpm2-pkcs11-1.3.2a/ea5f1c078aff7fb09fb5fc78403d4f8c868c4ea6.patch 2021-03-23 15:26:46.043878215 -0700
@@ -0,0 +1,43 @@
+From ea5f1c078aff7fb09fb5fc78403d4f8c868c4ea6 Mon Sep 17 00:00:00 2001
+From: William Roberts <william.c.roberts@intel.com>
+Date: Mon, 30 Dec 2019 14:10:14 -0600
+Subject: [PATCH] tpm2_ptool: require python3.7 for db upgrade
+
+SQLite3 bindings for python don't have the backup API implemented until
+Python 3.7. Make this the new minimum requirement for tpm2_ptool so
+we can use this feature.
+
+Signed-off-by: William Roberts <william.c.roberts@intel.com>
+---
+ tools/setup.py | 1 +
+ tools/tpm2_pkcs11/__init__.py | 6 +++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/tools/setup.py b/tools/setup.py
+index 494f9edd..4490dc61 100644
+--- a/tools/setup.py
++++ b/tools/setup.py
+@@ -9,6 +9,7 @@
+
+ setup(
+ name='tpm2-pkcs11-tools',
++ python_requires='>=3.7',
+ long_description=long_description,
+ long_description_content_type='text/markdown',
+ version='1.33.7',
+diff --git a/tools/tpm2_pkcs11/__init__.py b/tools/tpm2_pkcs11/__init__.py
+index ed83ef52..1ed8b3af 100644
+--- a/tools/tpm2_pkcs11/__init__.py
++++ b/tools/tpm2_pkcs11/__init__.py
+@@ -2,6 +2,6 @@
+
+ import sys
+
+-# Sunset python < 3 support
+-if sys.version_info[0] < 3:
+- sys.exit("Python 3 or a more recent version is required.")
+\ No newline at end of file
++# Requires python 3.7 or greater
++if (sys.version_info[0], sys.version_info[1]) < (3, 7):
++ sys.exit("Python 3.7 or a more recent version is required.")
+\ No newline at end of file
diff -Naur tpm2-pkcs11-1.3.2/tools/setup.py tpm2-pkcs11-1.3.2a/tools/setup.py
--- tpm2-pkcs11-1.3.2/tools/setup.py 2020-08-10 07:31:22.000000000 -0700
+++ tpm2-pkcs11-1.3.2a/tools/setup.py 2021-03-23 15:27:01.160008742 -0700
@@ -9,7 +9,6 @@
setup(
name='tpm2-pkcs11-tools',
- python_requires='>=3.7',
long_description=long_description,
long_description_content_type='text/markdown',
version='1.33.7',
diff -Naur tpm2-pkcs11-1.3.2/tools/tpm2_pkcs11/__init__.py tpm2-pkcs11-1.3.2a/tools/tpm2_pkcs11/__init__.py
--- tpm2-pkcs11-1.3.2/tools/tpm2_pkcs11/__init__.py 2020-08-09 06:46:13.000000000 -0700
+++ tpm2-pkcs11-1.3.2a/tools/tpm2_pkcs11/__init__.py 2021-03-23 15:27:01.161008751 -0700
@@ -2,6 +2,6 @@
import sys
-# Requires python 3.7 or greater
-if (sys.version_info[0], sys.version_info[1]) < (3, 7):
- sys.exit("Python 3.7 or a more recent version is required.")
\ No newline at end of file
+# Sunset python < 3 support
+if sys.version_info[0] < 3:
+ sys.exit("Python 3 or a more recent version is required.")
\ No newline at end of file

View File

@ -7,7 +7,7 @@
Name: tpm2-pkcs11
Version: 1.3.2
Release: 1%{?candidate:.%{candidate}}%{?dist}
Release: 2%{?candidate:.%{candidate}}%{?dist}
Summary: PKCS#11 interface for TPM 2.0 hardware
License: BSD
@ -16,6 +16,8 @@ Source0: https://github.com/tpm2-software/%{name}/releases/download/%{version}%{
Source1: https://github.com/tpm2-software/%{name}/releases/download/%{version}%{?candidate:-%{candidate}}/%{name}-%{version}%{?candidate:-%{candidate}}.tar.gz.asc
# William Roberts (Bill Roberts) key from pgp.mit.edu
Source2: gpgkey-8E1F50C1.gpg
# Revert of ea5f1c078aff7fb09fb5fc78403d4f8c868c4ea6 to build on EPEL 8
Patch0: revert-require-py37.patch
BuildRequires: gcc
BuildRequires: make
@ -99,6 +101,9 @@ cd tools
%changelog
* Tue Mar 23 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 1.3.2-2
- Revert python 3.7 requirement commit to allow building on EPEL 8
* Mon Aug 10 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 1.3.2-1
- Update to 1.3.2