[packages/python-django-auth-ldap] - updated to 1.7.0, added -apidocs

qboosh qboosh at pld-linux.org
Sun Dec 10 21:08:47 CET 2023


commit 163ebed58e21e09292a90cef6a4f8f955c934a08
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Dec 10 20:56:04 2023 +0100

    - updated to 1.7.0, added -apidocs

 django-auth-ldap-mock.patch  | 24 +++++++++++++++++
 python-django-auth-ldap.spec | 62 ++++++++++++++++++++++++++++++++------------
 2 files changed, 69 insertions(+), 17 deletions(-)
---
diff --git a/python-django-auth-ldap.spec b/python-django-auth-ldap.spec
index 1a1b476..a1bddda 100644
--- a/python-django-auth-ldap.spec
+++ b/python-django-auth-ldap.spec
@@ -1,9 +1,9 @@
 #
 # Conditional build:
-%bcond_with	doc	# Sphinx documentation (TODO)
-%bcond_with	tests	# unit tests (TODO)
+%bcond_without	doc	# Sphinx documentation
+%bcond_with	tests	# unit tests (require slapd and some configuration)
 %bcond_without	python2 # CPython 2.x module
-%bcond_with	python3 # CPython 3.x module
+%bcond_without	python3 # CPython 3.x module
 
 %define 	module		django_auth_ldap
 %define 	egg_name	django_auth_ldap
@@ -11,33 +11,42 @@
 Summary:	Django LDAP authentication backend
 Summary(pl.UTF-8):	Backend uwierzytelniający LDAP dla Django
 Name:		python-%{pypi_name}
-Version:	1.2.8
-Release:	2
+# keep 1.x here for python2 support
+Version:	1.7.0
+Release:	1
 License:	BSD
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/django-auth-ldap/
 Source0:	https://files.pythonhosted.org/packages/source/d/django-auth-ldap/%{pypi_name}-%{version}.tar.gz
-# Source0-md5:	88db539ca8492c91a8adaca68d70129b
+# Source0-md5:	bb85e5e50ea179781244df580ee5b0f0
+Patch0:		django-auth-ldap-mock.patch
 URL:		http://bitbucket.org/psagers/django-auth-ldap/
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 %if %{with python2}
-BuildRequires:	python-modules
-BuildRequires:	python-setuptools
-BuildRequires:	sphinx-pdg
+BuildRequires:	python-modules >= 1:2.7
+BuildRequires:	python-setuptools >= 1:0.6-0.c11
 %endif
 %if %{with tests}
-BuildRequires:	python-mockldap >= 0.2.7
-BuildRequires:	python-setuptools >= 1:0.6-0.c11
+BuildRequires:	openldap-servers
+BuildRequires:	python-django >= 1.11
+BuildRequires:	python-ldap >= 3.1
+BuildRequires:	python-mock >= 2.0.0
+BuildRequires:	python-slapdtest
 %endif
 %if %{with python3}
-BuildRequires:	python3-modules
-BuildRequires:	python3-setuptools
-%if %{with tests}
-BuildRequires:	python3-mockldap >= 0.2.7
+BuildRequires:	python3-modules >= 1:3.4
 BuildRequires:	python3-setuptools >= 1:0.6-0.c11
+%if %{with tests}
+BuildRequires:	openldap-servers
+BuildRequires:	python3-django >= 1.11
+BuildRequires:	python3-ldap >= 3.1
+BuildRequires:	python3-slapdtest
 %endif
 %endif
+%if %{with doc}
+BuildRequires:	sphinx-pdg-2
+%endif
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -62,8 +71,20 @@ LDAP service.
 Ten pakiet to backend uwierzytelniający Django uwierzytelniający
 względem usługi LDAP.
 
+%package apidocs
+Summary:	API documentation for django-auth-ldap module
+Summary(pl.UTF-8):	Dokumentacja API modułu django-auth-ldap
+Group:		Documentation
+
+%description apidocs
+API documentation for django-auth-ldap module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu django-auth-ldap.
+
 %prep
 %setup -q -n %{pypi_name}-%{version}
+%patch0 -p1
 
 %{__rm} -r %{egg_name}.egg-info
 
@@ -77,8 +98,7 @@ względem usługi LDAP.
 %endif
 
 %if %{with doc}
-sphinx-build-2 docs/source html
-%{__rm} -r html/.{doctrees,buildinfo}
+sphinx-build-2 -b html docs docs/_build/html
 %endif
 
 %install
@@ -100,6 +120,7 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
+%doc CHANGES LICENSE README.rst
 %{py_sitescriptdir}/%{module}
 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
 %endif
@@ -107,6 +128,13 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python3}
 %files -n python3-%{pypi_name}
 %defattr(644,root,root,755)
+%doc CHANGES LICENSE README.rst
 %{py3_sitescriptdir}/%{module}
 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
 %endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
+%endif
diff --git a/django-auth-ldap-mock.patch b/django-auth-ldap-mock.patch
new file mode 100644
index 0000000..ed26976
--- /dev/null
+++ b/django-auth-ldap-mock.patch
@@ -0,0 +1,24 @@
+--- django-auth-ldap-1.7.0/setup.py.orig	2018-07-12 12:17:22.000000000 +0200
++++ django-auth-ldap-1.7.0/setup.py	2023-12-10 19:41:30.704536889 +0100
+@@ -54,6 +54,6 @@ setup(
+         "setuptools >= 0.6c11",
+     ],
+     tests_require=[
+-        "mock >= 2.0.0",
++        "mock >= 2.0.0; python_version<'3.0'",
+     ]
+ )
+--- django-auth-ldap-1.7.0/tests/tests.py.orig	2018-07-12 12:29:06.000000000 +0200
++++ django-auth-ldap-1.7.0/tests/tests.py	2023-12-10 19:42:11.224317374 +0100
+@@ -36,7 +36,10 @@ import pickle
+ import warnings
+ 
+ import ldap
+-import mock
++try:
++    from unittest import mock
++except ImportError:
++    import mock
+ import slapdtest
+ 
+ from django.contrib.auth import authenticate, get_backends
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-django-auth-ldap.git/commitdiff/163ebed58e21e09292a90cef6a4f8f955c934a08



More information about the pld-cvs-commit mailing list