From: Jakub Bogusz Date: Sat, 26 May 2018 08:32:31 +0000 (+0200) Subject: - updated to 3.1.0 X-Git-Tag: auto/th/python-ldap-3.1.0-1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=03be15951be5dd0da67a7458552b510fffe13107;p=packages%2Fpython-ldap.git - updated to 3.1.0 - added python3- package --- diff --git a/python-ldap.spec b/python-ldap.spec index ab320bd..6db81fb 100644 --- a/python-ldap.spec +++ b/python-ldap.spec @@ -1,27 +1,46 @@ # # Conditional build: -%bcond_with tests # do not perform "make test" +%bcond_without python2 # CPython 2.x module +%bcond_without python3 # CPython 3.x module +%bcond_with tests # unit tests (require LDAP server) -%define module ldap -Summary: LDAP client API for Python -Summary(pl.UTF-8): API klienckie LDAP dla Pythona -Name: python-%{module} -Version: 2.4.32 +Summary: LDAP client API for Python 2 +Summary(pl.UTF-8): API klienckie LDAP dla Pythona 2 +Name: python-ldap +Version: 3.1.0 Release: 1 Epoch: 1 License: Python-like Group: Libraries/Python -Source0: https://pypi.python.org/packages/67/d9/fa0ea70d1792875745116ad62ac8d4bcb07550b15cded591bb57df6a6d9a/%{name}-%{version}.tar.gz -# Source0-md5: 7c46c8a04acc227a778c7900c87cdfc7 -Patch0: %{name}-sasl2.patch +#Source0Download: https://pypi.org/simple/python-ldap/ +Source0: https://files.pythonhosted.org/packages/source/p/python-ldap/%{name}-%{version}.tar.gz +# Source0-md5: 35d9a3ba265137646b2a9fd3d56d675d URL: http://python-ldap.sourceforge.net/ -BuildRequires: rpmbuild(macros) >= 1.710 BuildRequires: cyrus-sasl >= 2.1.0 BuildRequires: openldap-devel >= 2.4.6 -BuildRequires: python-devel >= 1:2.5 -BuildRequires: python-modules >= 1:2.5 +%if %{with tests} +BuildRequires: openldap >= 2.4.6 +BuildRequires: openldap-servers >= 2.4.6 +%endif +%if %{with python2} +BuildRequires: python-devel >= 1:2.7 +BuildRequires: python-modules >= 1:2.7 +%if %{with tests} +BuildRequires: python-pyasn1 >= 0.3.7 +BuildRequires: python-pyasn1_modules >= 0.1.5 +%endif +%endif +%if %{with python2} +BuildRequires: python3-devel >= 1:3.4 +BuildRequires: python3-modules >= 1:3.4 +%if %{with tests} +BuildRequires: python3-pyasn1 >= 0.3.7 +BuildRequires: python3-pyasn1_modules >= 0.1.5 +%endif +%endif BuildRequires: rpm-pythonprov -Requires: python-modules +BuildRequires: rpmbuild(macros) >= 1.710 +Requires: python-modules >= 1:2.7 Provides: ldapmodule Obsoletes: ldapmodule Obsoletes: python-ldapmodule @@ -43,37 +62,91 @@ Głównie obudowuje w tym celu biblioteki klienckie OpenLDAP. Dodatkowo pakiet zawiera moduły do innych zadań związanych z LDAP (jak przetwarzanie LDIF, LDAPURL, podschematy LDAPv3 itp.). +%package -n python3-ldap +Summary: LDAP client API for Python 3 +Summary(pl.UTF-8): API klienckie LDAP dla Pythona 3 +Group: Libraries/Python +Requires: python3-modules >= 1:3.4 + +%description -n python3-ldap +python-ldap provides an object-oriented API to access LDAP directory +servers from Python programs. Mainly it wraps the OpenLDAP client libs +for that purpose. + +Additionally the package contains modules for other LDAP-related stuff +(e.g. processing LDIF, LDAPURLs, LDAPv3 sub-schema, etc.). + +%description -n python3-ldap -l pl.UTF-8 +Moduł python-ldap dostarcza zorientowane obiektowo API pozwalające na +dostęp do usług katalogowych LDAP z poziomu programów w Pythonie. +Głównie obudowuje w tym celu biblioteki klienckie OpenLDAP. + +Dodatkowo pakiet zawiera moduły do innych zadań związanych z LDAP (jak +przetwarzanie LDIF, LDAPURL, podschematy LDAPv3 itp.). + %prep %setup -q -%patch0 -p1 %build -%py_build +%if %{with python2} +%py_build %{?with_tests:test} %if %{with tests} -%{__python} setup.py test - LDAPNOINIT=1 \ PYTHONPATH=$(echo build-2/lib.linux-*/) \ %{__python} -c "import ldap; print ldap.__version__; ldapo = ldap.initialize('ldap://localhost')" %endif +%endif + +%if %{with python3} +%py3_build %{?with_tests:test} + +%if %{with tests} +LDAPNOINIT=1 \ +PYTHONPATH=$(echo build-3/lib.linux-*/) \ +%{__python3} -c "import ldap; print ldap.__version__; ldapo = ldap.initialize('ldap://localhost')" +%endif +%endif %install rm -rf $RPM_BUILD_ROOT -#PYTHONPATH=$RPM_BUILD_ROOT%{py_sitedir} + +%if %{with python2} %py_install +%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/slapdtest %py_postclean +%endif + +%if %{with python3} +%py3_install + +%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/slapdtest +%endif %clean rm -rf $RPM_BUILD_ROOT +%if %{with python2} %files %defattr(644,root,root,755) %doc CHANGES LICENCE README TODO %attr(755,root,root) %{py_sitedir}/_ldap.so -%{py_sitedir}/dsml.py[co] %{py_sitedir}/ldapurl.py[co] %{py_sitedir}/ldif.py[co] %{py_sitedir}/ldap %{py_sitedir}/python_ldap-%{version}-py*.egg-info +%endif + +%if %{with python3} +%files -n python3-ldap +%defattr(644,root,root,755) +%doc CHANGES LICENCE README TODO +%attr(755,root,root) %{py3_sitedir}/_ldap.cpython-*.so +%{py3_sitedir}/ldap +%{py3_sitedir}/ldapurl.py +%{py3_sitedir}/ldif.py +%{py3_sitedir}/__pycache__/ldapurl.cpython-*.py[co] +%{py3_sitedir}/__pycache__/ldif.cpython-*.py[co] +%{py3_sitedir}/python_ldap-%{version}-py*.egg-info +%endif