diff --git a/backport-Use-setuptools-instead-of-distutils.patch b/backport-Use-setuptools-instead-of-distutils.patch new file mode 100644 index 0000000000000000000000000000000000000000..274e77116a118b90740babdb9915210454fa9c31 --- /dev/null +++ b/backport-Use-setuptools-instead-of-distutils.patch @@ -0,0 +1,59 @@ +From 7b5e0f0097faebdcc6a8b783237bbba7a983147a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Fri, 31 Mar 2023 14:52:19 +0200 +Subject: [PATCH] Use setuptools instead of distutils + +distutils is removed from Python 3.12+: +https://peps.python.org/pep-0632/ +--- + python/Makefile.am | 2 +- + python/Makefile.in | 2 +- + python/setup.py.in | 6 +++--- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/python/Makefile.am b/python/Makefile.am +index 1d00c0c..6e51744 100644 +--- a/python/Makefile.am ++++ b/python/Makefile.am +@@ -14,7 +14,7 @@ all-local: + CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) + + install-exec-local: +- CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${prefix} ++ CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --root ${DESTDIR} --prefix=${prefix} + + clean-local: + rm -rf py$(PYTHONREV) +diff --git a/python/Makefile.in b/python/Makefile.in +index f47ac5e..8e9c7f2 100644 +--- a/python/Makefile.in ++++ b/python/Makefile.in +@@ -483,7 +483,7 @@ all-local: + CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) + + install-exec-local: +- CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${prefix} ++ CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --root=${DESTDIR} --prefix=${prefix} + + clean-local: + rm -rf py$(PYTHONREV) +diff --git a/python/setup.py.in b/python/setup.py.in +index a741b91..f934c50 100755 +--- a/python/setup.py.in ++++ b/python/setup.py.in +@@ -6,9 +6,9 @@ + + import os + +-from distutils.core import setup, Extension +-from distutils.command.build_ext import build_ext as _build_ext +-from distutils.command.sdist import sdist as _sdist ++from setuptools import setup, Extension ++from setuptools.command.build_ext import build_ext as _build_ext ++from setuptools.command.sdist import sdist as _sdist + + def genconstants(headerfile, outputfile): + hf = open(headerfile, 'r') +-- +2.47.3 + diff --git a/libpwquality.spec b/libpwquality.spec index 6ab9f420a9bd5670d3fe433fd12cb55c55efba7f..4b3eac1d23724ef513599e41e1d420184d8b8dcb 100644 --- a/libpwquality.spec +++ b/libpwquality.spec @@ -3,9 +3,9 @@ Name: libpwquality Version: 1.4.5 -Release: 3 +Release: 4 Summary: Library for password quality checking and generating random passwords. -License: BSD or GPLv2+ +License: BSD-3-Clause OR GPL-2.0-or-later URL: https://github.com/libpwquality/libpwquality/ Source0: https://github.com/libpwquality/libpwquality/releases/download/libpwquality-%{version}/libpwquality-%{version}.tar.bz2 @@ -14,9 +14,11 @@ Patch1: fix-password-similarity.patch Patch2: fix-doc-about-difok.patch Patch3: backport-Make-maxclassrepeat-1-behavior-consistent-with-docs.patch Patch4: backport-Remove-redundant-inclusion-of-libintl.h-in-pam_pwqua.patch +Patch5: backport-Use-setuptools-instead-of-distutils.patch BuildRequires: gcc cracklib-devel gettext pam-devel BuildRequires: python3-devel +BuildRequires: python3-setuptools Recommends: cracklib >= 2.8 Requires: pam @@ -28,8 +30,7 @@ The library supports reading and parsing of a configuration file. %package devel Summary: Support for development of applications using the libpwquality library -Requires: libpwquality = %{version}-%{release} -Requires: pkgconfig +Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Files needed for development of applications using the libpwquality library. @@ -37,7 +38,7 @@ See the pwquality.h header file for the API. %package -n python3-pwquality Summary: Python3 bindings for the libpwquality library -Requires: libpwquality = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} %description -n python3-pwquality This package provides Python3 bindings for the libpwquality library. @@ -48,7 +49,6 @@ This package provides Python3 bindings for the libpwquality library. %autosetup -n %{name}-%{version} -p1 %build -#python3 %configure --with-securedir=%{_moduledir} \ --with-pythonsitedir=%{python3_sitearch} \ --with-python-binary=%{__python3} \ @@ -57,24 +57,13 @@ This package provides Python3 bindings for the libpwquality library. %make_build %install -# python-setuptools >= v60.0.0 changes the SETUPTOOLS_USE_DISTUTILS default value to local, -# it does't use Python's standard library distutils default. -# As a result, failed to build libpwquality. -# Now, set SETUPTOOLS_USE_DISTUTILS value to stdlib -export SETUPTOOLS_USE_DISTUTILS=stdlib %make_install - -rm -f %{buildroot}%{_libdir}/*.la -rm -f %{buildroot}%{_moduledir}/*.la +%delete_la mkdir %{buildroot}%{_secconfdir}/pwquality.conf.d %find_lang libpwquality -%check - -%ldconfig_scriptlets - %files -f libpwquality.lang %license COPYING %doc README NEWS AUTHORS @@ -101,6 +90,12 @@ mkdir %{buildroot}%{_secconfdir}/pwquality.conf.d %{_mandir}/man8/* %changelog +* Mon Sep 15 2025 Funda Wang - 1.4.5-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: Use setuptools instead of distutils to build + * Fri May 23 2025 yixiangzhike - 1.4.5-3 - Type:bugfix - ID:NA