From c75c488395653ef8f6ecc7254f7ae97d4c56cbc2 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 10 Jul 2023 01:25:40 -0400 Subject: [PATCH] Fix build with Python 3.12 * Install setuptools for distutils (dropped from 3.12) * Remove one compiler warning which is incompatible with Python headers * Drop usage of deprecated unittest methods --- pam_wrapper.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pam_wrapper.spec b/pam_wrapper.spec index e90ffaa..cc72699 100644 --- a/pam_wrapper.spec +++ b/pam_wrapper.spec @@ -17,6 +17,7 @@ BuildRequires: gnupg2 BuildRequires: cmake BuildRequires: libcmocka-devel BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: pam-devel BuildRequires: doxygen BuildRequires: git @@ -83,6 +84,10 @@ the header files for libpamtest %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %autosetup -p1 +# Not compatible with Python 3.12 headers +sed -i -e '/Werror=declaration-after-statement/d' CompilerChecks.cmake +# renamed in Python 3.2, old name dropped in 3.12 +sed -i -e 's/assertRaisesRegexp/assertRaisesRegex/' tests/pypamtest_test.py %build