From ea78018111679b706c3595ab6c7b8cc66ffb4a14 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 7 May 2026 08:31:56 +0300 Subject: [PATCH] Rebuild with python 3.14 --- pkg.info | 21 +++++-- source-files/use-python-setuptools.patch | 75 ++++++++++++++++++++++++ source.sh | 22 ++----- 3 files changed, 97 insertions(+), 21 deletions(-) create mode 100644 source-files/use-python-setuptools.patch diff --git a/pkg.info b/pkg.info index 2b532f9..eeb417b 100644 --- a/pkg.info +++ b/pkg.info @@ -1,11 +1,24 @@ name: libpwquality description: Password quality checking library version: 1.4.5 -revision: 2 +revision: 3 url: https://github.com/libpwquality/libpwquality license: BSD-3-Clause or GPL2-or-later -depends: ["cracklib","glibc","pam"] -optional_depends: ["python3"] -make_depends: ["python-setuptools"] +maintainers: + - enumdev@enumerated.dev architecture: any type: source +depends: + - cracklib + - glibc + - pam +optional_depends: + - python3 +make_depends: + - bzip2 + - python-setuptools +downloads: + - url: https://github.com/libpwquality/libpwquality/releases/download/libpwquality-${BPM_PKG_VERSION}/libpwquality-${BPM_PKG_VERSION}.tar.bz2 + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 6fcf18b75d305d99d04d2e42982ed5b787a081af2842220ed63287a2d6a10988 diff --git a/source-files/use-python-setuptools.patch b/source-files/use-python-setuptools.patch new file mode 100644 index 0000000..8822c9f --- /dev/null +++ b/source-files/use-python-setuptools.patch @@ -0,0 +1,75 @@ +From 509b0a744adf533b524daaa65f25dda144a6ff40 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/ +--- + libpwquality.spec.in | 11 ++--------- + python/Makefile.am | 2 +- + python/setup.py.in | 6 +++--- + 3 files changed, 6 insertions(+), 13 deletions(-) + +diff --git a/libpwquality.spec.in b/libpwquality.spec.in +index 70a6f53..0809126 100644 +--- a/libpwquality.spec.in ++++ b/libpwquality.spec.in +@@ -33,9 +33,11 @@ BuildRequires: gettext + BuildRequires: pam-devel + %if %{with python2} + BuildRequires: python2-devel ++BuildRequires: python2-setuptools + %endif + %if %{with python3} + BuildRequires: python3-devel ++BuildRequires: python3-setuptools + %endif + + URL: https://github.com/libpwquality/libpwquality/ +@@ -103,15 +105,6 @@ cp -a . %{py3dir} + pushd %{py3dir} + %endif + %if %{with python3} +-# setuptools >= 60 changes the environment to use its bundled copy of distutils +-# by default, not the Python-bundled one. To run the Python's standard library +-# distutils, the environment variable must be set. +-# Although technically setuptools is not needed for this package, if it's +-# pulled by another package, it changes the environment and consequently, +-# the build fails. This was reported in: +-# https://github.com/pypa/setuptools/issues/3143 +-export SETUPTOOLS_USE_DISTUTILS=stdlib +- + %configure \ + --with-securedir=%{_moduledir} \ + --with-pythonsitedir=%{python3_sitearch} \ +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/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') diff --git a/source.sh b/source.sh index 5e01c2a..f8b8a80 100644 --- a/source.sh +++ b/source.sh @@ -2,29 +2,17 @@ # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT -DOWNLOAD="https://github.com/libpwquality/libpwquality/releases/download/libpwquality-${BPM_PKG_VERSION}/libpwquality-${BPM_PKG_VERSION}.tar.bz2" -DOWNLOAD_PATCH="https://github.com/libpwquality/libpwquality/commit/509b0a744adf533b524daaa65f25dda144a6ff40.patch" -FILENAME="${DOWNLOAD##*/}" -FILENAME_PATCH="${DOWNLOAD_PATCH##*/}" - # The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location +# This function is used for putting downloaded files to the correct location or applying patches prepare() { - wget "$DOWNLOAD" - # Patch to use setuptools instead of distutils - wget "$DOWNLOAD_PATCH" - - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + cd "$BPM_SOURCE" + patch -Np1 -i "$BPM_WORKDIR"/use-python-setuptools.patch + autoreconf -fi } # The build function is executed in the source directory # This function is used to compile the source code build() { - # Apply patch - patch -p1 < ../"$FILENAME_PATCH" - - autoreconf -fi - ./configure --prefix=/usr \ --disable-static \ --with-securedir=/usr/lib/security @@ -37,5 +25,5 @@ package() { make DESTDIR="$BPM_OUTPUT" install # Install package license - install -Dm644 COPYING "$BPM_OUTPUT"/usr/share/licenses/libpwquality/COPYING + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/libpwquality/COPYING }