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
This commit is contained in:
Yaakov Selkowitz 2023-07-10 01:25:40 -04:00
parent 35219541f3
commit c75c488395

View File

@ -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