diff --git a/python-ldap-2.0.0.404.tar.gz b/python-ldap-2.0.0.404.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python-ldap-3.4.5.tar.gz b/python-ldap-3.4.5.tar.gz deleted file mode 100644 index 18e5bf2dc0296597c85c7ca9fea9e1c59b84288b..0000000000000000000000000000000000000000 Binary files a/python-ldap-3.4.5.tar.gz and /dev/null differ diff --git a/python-ldap.spec b/python-ldap.spec index 44044a7645d535ab0ae431bd90a8f0588ece3a1b..e790c8ba0067a435a38c2ebbe3ad3f0f96ef3fcd 100644 --- a/python-ldap.spec +++ b/python-ldap.spec @@ -1,14 +1,22 @@ +%global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-ldap -Version: 3.4.5 +Version: 2.0.0.404 Release: 1 Summary: An object-oriented API to access LDAP directory servers License: Python-2.0 URL: http://python-ldap.org/ -Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/p/python-ldap/python-ldap-%{version}.tar.gz BuildRequires: gcc openldap-devel BuildRequires: python3-devel python3-setuptools +BuildRequires: python3-devel +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-hatchling + %description python-ldap provides an object-oriented API for working with LDAP within\ Python programs. It allows access to LDAP directory servers by wrapping the\ @@ -35,12 +43,30 @@ OpenLDAP 2.x libraries, and contains modules for other LDAP-related tasks\ %prep %autosetup -p1 -n %{name}-%{version} + +# Fix setuptools_scm version issue +if [ -f pyproject.toml ]; then + sed -i '/^version *=/d' pyproject.toml + sed -i '/^\[project\]/a version = "%{version}"' pyproject.toml + sed -i '/dynamic *= *\[.*version.*\]/d' pyproject.toml + if grep -q '^\[tool\.setuptools_scm\]' pyproject.toml; then + sed -i '/^\[tool\.setuptools_scm\]/,/^\[/ {/^write_to *=/d}' pyproject.toml + sed -i '/^\[tool\.setuptools_scm\]/a fallback_version = "%{version}"' pyproject.toml + fi +fi find . -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|' sed -i 's,-Werror,-Wignore,g' tox.ini %build -%py3_build +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" +%pyproject_build %install +export PYTHONDONTWRITEBYTECODE=1 + +# Clean __pycache__ directories and .pyc/.pyo files +find %{buildroot} -name '*.py[co]' -delete +find %{buildroot} -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" %_bindir/python3 setup.py install -O1 --skip-build --root %buildroot %check @@ -55,6 +81,9 @@ sed -i 's,-Werror,-Wignore,g' tox.ini %doc CHANGES README TODO Demo %changelog +* Mon Dec 01 2025 zhangzeyang0718 - 2.0.0.404-1 +- Update package to version 2.0.0.404 + * Mon Oct 13 2025 lizhipeng - 3.4.5-1 - update to 3.4.5