2020-10-14 23:43:13 +00:00
|
|
|
Name: python-ldap
|
|
|
|
Version: 3.3.0
|
|
|
|
Release: 0%{?dist}
|
|
|
|
License: Python
|
|
|
|
Summary: An object-oriented API to access LDAP directory servers
|
|
|
|
Source0: %{pypi_source}
|
|
|
|
|
2022-02-22 19:49:52 +00:00
|
|
|
# OpenLDAP 2.5+ is not yet supported by python-ldap
|
|
|
|
# https://github.com/python-ldap/python-ldap/issues/432
|
|
|
|
# Fedora has this patch to make it build, but the tests will fail anyway
|
|
|
|
Patch0: https://src.fedoraproject.org/rpms/python-ldap/raw/a237d9b212bd1581e07f4f1a8f54c26a7190843c/f/python-ldap-always-use-ldap-library.patch
|
|
|
|
|
2021-02-04 13:32:12 +00:00
|
|
|
BuildRequires: python3-devel
|
2020-10-14 23:43:13 +00:00
|
|
|
BuildRequires: pyproject-rpm-macros
|
|
|
|
|
|
|
|
BuildRequires: cyrus-sasl-devel
|
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: openldap-clients
|
|
|
|
BuildRequires: openldap-devel
|
|
|
|
BuildRequires: openldap-servers
|
|
|
|
BuildRequires: openssl-devel
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
This package contains extension modules. Does not contain pyproject.toml.
|
|
|
|
Has multiple files and directories.
|
|
|
|
Building this tests:
|
|
|
|
- the proper files are installed in the proper places
|
|
|
|
- module glob in %%pyproject_save_files (some modules are included, some not)
|
|
|
|
- combined manual and generated Buildrequires
|
2022-06-17 09:03:18 +00:00
|
|
|
- building an extension module via %%pyproject_buildrequires -w
|
2020-10-14 23:43:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
%package -n python3-ldap
|
|
|
|
Summary: %{summary}
|
|
|
|
|
|
|
|
%description -n python3-ldap
|
|
|
|
%{summary}
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup
|
|
|
|
|
2022-08-13 20:58:58 +00:00
|
|
|
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 9
|
2022-02-22 19:49:52 +00:00
|
|
|
# Hack: We remove tests that are broken by OpenLDAP 2.5+
|
|
|
|
# Don't do this in the regular Fedora package, please
|
|
|
|
rm Tests/t_ldapobject.py Tests/t_cext.py Tests/t_edit.py Tests/t_ldap_sasl.py Tests/t_ldap_syncrepl.py Tests/t_slapdobject.py Tests/t_bind.py Tests/t_ldap_options.py Tests/t_ldap_schema_subentry.py
|
|
|
|
%endif
|
|
|
|
|
2020-10-14 23:43:13 +00:00
|
|
|
|
|
|
|
%generate_buildrequires
|
2022-06-17 09:03:18 +00:00
|
|
|
# -w is not required with this package, but we test that we can use it anyway
|
|
|
|
%pyproject_buildrequires -t -w
|
2020-10-14 23:43:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
%build
|
2022-06-17 09:03:18 +00:00
|
|
|
#%%pyproject_wheel -- this is done via %%pyproject_buildrequires -w
|
|
|
|
|
2021-12-08 10:07:48 +00:00
|
|
|
# Internal check that we can import the built extension modules from %%{pyproject_build_lib}
|
2022-04-12 12:58:09 +00:00
|
|
|
%{python3} -c 'import _ldap' && exit 1 || true
|
2021-12-08 10:07:48 +00:00
|
|
|
PYTHONPATH=%{pyproject_build_lib} %{python3} -c 'import _ldap'
|
2020-10-14 23:43:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
%pyproject_install
|
|
|
|
# We can pass multiple globs
|
|
|
|
%pyproject_save_files 'ldap*' '*ldap'
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
%tox
|
|
|
|
|
|
|
|
# Internal check if the instalation outputs expected files
|
|
|
|
test -d %{buildroot}%{python3_sitearch}/__pycache__/
|
|
|
|
test -d %{buildroot}%{python3_sitearch}/python_ldap-%{version}.dist-info/
|
|
|
|
test -d %{buildroot}%{python3_sitearch}/ldap/
|
|
|
|
test -f %{buildroot}%{python3_sitearch}/ldapurl.py
|
|
|
|
test -f %{buildroot}%{python3_sitearch}/ldif.py
|
|
|
|
test -d %{buildroot}%{python3_sitearch}/slapdtest/
|
|
|
|
test -f %{buildroot}%{python3_sitearch}/_ldap.cpython-*.so
|
|
|
|
|
|
|
|
# Internal check: Unmatched modules are not supposed to be listed in %%{pyproject_files}
|
|
|
|
# We'll list them explicitly
|
2022-04-12 12:58:09 +00:00
|
|
|
grep -F %{python3_sitearch}/ldif.py %{pyproject_files} && exit 1 || true
|
|
|
|
grep -F %{python3_sitearch}/__pycache__/ldif.cpython-%{python3_version_nodots}.pyc %{pyproject_files} && exit 1 || true
|
|
|
|
grep -F %{python3_sitearch}/__pycache__/ldif.cpython-%{python3_version_nodots}.opt-1.pyc %{pyproject_files} && exit 1 || true
|
|
|
|
grep -F %{python3_sitearch}/slapdtest %{pyproject_files} && exit 1 || true
|
2020-10-14 23:43:13 +00:00
|
|
|
|
|
|
|
# Internal check: Top level __pycache__ is never owned
|
2022-04-12 12:58:09 +00:00
|
|
|
grep -E '/site-packages/__pycache__$' %{pyproject_files} && exit 1 || true
|
|
|
|
grep -E '/site-packages/__pycache__/$' %{pyproject_files} && exit 1 || true
|
2020-10-14 23:43:13 +00:00
|
|
|
|
2021-12-08 10:07:48 +00:00
|
|
|
# Internal check for the value of %%{pyproject_build_lib} in an archful package
|
|
|
|
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10
|
2022-07-14 21:50:38 +00:00
|
|
|
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
|
|
|
|
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}"
|
|
|
|
%else
|
2021-12-08 10:07:48 +00:00
|
|
|
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version}"
|
2022-07-14 21:50:38 +00:00
|
|
|
%endif
|
2021-12-08 10:07:48 +00:00
|
|
|
%else
|
|
|
|
test "%{pyproject_build_lib}" == "$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib.%{python3_platform}-%{python3_version})"
|
|
|
|
%endif
|
|
|
|
|
2020-10-14 23:43:13 +00:00
|
|
|
|
|
|
|
%files -n python3-ldap -f %{pyproject_files}
|
|
|
|
%license LICENCE
|
|
|
|
%doc CHANGES README TODO Demo
|
|
|
|
# Explicitly listed files can be combined with automation
|
|
|
|
%pycached %{python3_sitearch}/ldif.py
|
|
|
|
%{python3_sitearch}/slapdtest/
|