Compare commits

..

No commits in common. "c8" and "imports/c9-beta/python-ldap-3.3.1-8.el9" have entirely different histories.

View File

@ -1,49 +1,28 @@
### Abstract ###
# global prerelease b4
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1520990
# openldap does not re-register nss shutdown callbacks after nss_Shutdown is
# called.
%if 0%{?fedora} <= 26
%global openldap_version 2.4.45-2
%else # F27+
%global openldap_version 2.4.45-4
%endif
%bcond_with python2
Name: python-ldap
Version: 3.3.1
Release: 2%{?dist}
Release: 8%{?dist}
License: Python
Group: System Environment/Libraries
Summary: An object-oriented API to access LDAP directory servers
URL: http://python-ldap.org/
URL: https://python-ldap.org/
Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}%{?prerelease}.tar.gz
Patch0001: 0001-Fix-SASL-get-set-options-on-big-endian-platforms.patch
### Build Dependencies ###
BuildRequires: gcc
BuildRequires: openldap-devel >= %{openldap_version}
BuildRequires: openssl-devel
BuildRequires: cyrus-sasl-devel
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%endif #{with python2}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
# Test dependencies
%if %{with python2}
BuildRequires: python2-pytest
BuildRequires: python2-coverage
BuildRequires: python2-pyasn1 >= 0.3.7
BuildRequires: python2-pyasn1-modules >= 0.1.5
%endif #{with python2}
BuildRequires: python3-pytest
BuildRequires: openldap-servers >= %{openldap_version}
BuildRequires: openldap-clients >= %{openldap_version}
BuildRequires: python3-coverage
BuildRequires: python3-pyasn1 >= 0.3.7
BuildRequires: python3-pyasn1-modules >= 0.1.5
@ -56,33 +35,13 @@ OpenLDAP 2.x libraries, and contains modules for other LDAP-related tasks\
%description %_description
%if %{with python2}
%package -n python2-ldap
Summary: %summary
Requires: openldap >= %{openldap_version}
Requires: python2-pyasn1 >= 0.3.7
Requires: python2-pyasn1-modules >= 0.1.5
Requires: python2-setuptools
Provides: python2-ldap%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python2-ldap}
%description -n python2-ldap %_description
%endif #{with python2}
%package -n python3-ldap
Summary: %{summary}
Requires: openldap >= %{openldap_version}
Requires: python3-pyasn1 >= 0.3.7
Requires: python3-pyasn1-modules >= 0.1.5
%if 0%{?rhel} && 0%{?rhel} >= 8
Requires: platform-python-setuptools
%else
Requires: python3-setuptools
%endif
%{?python_provide:%python_provide python3-ldap}
Obsoletes: python3-pyldap < 3
Provides: python3-pyldap = %{version}-%{release}
@ -92,109 +51,92 @@ Provides: python3-pyldap%{?_isa} = %{version}-%{release}
%prep
%setup -qc
pushd %{name}-%{version}%{?prerelease}
%patch1 -p1
popd
mv %{name}-%{version}%{?prerelease} python3
cp -a python{3,2}
%autosetup -p1 -n %{name}-%{version}%{?prerelease}
# Fix interpreter
%if %{with python2}
find python2 -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
%endif #{with python2}
find python3 -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|'
# Disable warnings in test to work around "'U' mode is deprecated"
# https://github.com/python-ldap/python-ldap/issues/96
sed -i 's,-Werror,-Wignore,g' python3/tox.ini
find . -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|'
%build
%if %{with python2}
pushd python2
%py2_build
popd
%endif #%{with python2}
pushd python3
%py3_build
popd
%check
%if %{with python2}
pushd python2
LANG=C.UTF-8 LOGLEVEL=10 \
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest
popd
%endif #{with python2}
pushd python3
LANG=C.UTF-8 LOGLEVEL=10 \
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest
popd
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m unittest discover -v -s Tests -p 't_*'
%install
%if %{with python2}
pushd python2
%py2_install
popd
%endif #{with python2}
pushd python3
%py3_install
popd
%if %{with python2}
%files -n python2-ldap
%defattr(-,root,root,-)
%license python2/LICENCE
%doc python2/CHANGES python2/README python2/TODO python2/Demo
%{python_sitearch}/_ldap.so
%{python_sitearch}/ldapurl.py*
%{python_sitearch}/ldif.py*
%{python_sitearch}/slapdtest/
%{python_sitearch}/ldap/
%{python_sitearch}/python_ldap-%{version}%{?prerelease}-py2.7.egg-info
%endif %#with python2}
%files -n python3-ldap
%defattr(-,root,root,-)
%license python3/LICENCE
%doc python3/CHANGES python3/README python3/TODO python3/Demo
%license LICENCE
%doc CHANGES README TODO Demo
%{python3_sitearch}/_ldap.cpython-*.so
%{python3_sitearch}/ldapurl.py*
%{python3_sitearch}/ldif.py*
%{python3_sitearch}/__pycache__/*
%{python3_sitearch}/slapdtest/
%{python3_sitearch}/ldap/
%{python3_sitearch}/python_ldap-%{version}%{?prerelease}-py%{python3_version}.egg-info
%{python3_sitearch}/python_ldap-%{version}%{?prerelease}-py%{python3_version}.egg-info/
%changelog
* Mon Jun 28 2021 Christian Heimes <cheimes@redhat.com> - 3.3.1-2
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 3.3.1-8
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Mon Jun 28 2021 Christian Heimes <cheimes@redhat.com> - 3.3.1-7
- Fix SASL get/set options on big endian platforms
- Resolves: #1931865
- Resolves: rhbz#1976827
* Wed Oct 21 2020 Christian Heimes <cheimes@redhat.com> - 3.3.1-1
- New upstream release 3.1.0
- Resolves: rhbz#1889615
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com> - 3.3.1-6
- Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
* Fri Nov 16 2018 Lumír Balhar <lbalhar@redhat.com> - 3.1.0-5
- Require platform-python-setuptools instead of python3-setuptools
- Resolves: rhbz#1650537
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.3.1-5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Jul 09 2018 Petr Viktorin <pviktori@redhat.com> - 3.1.0-4
- Don't build the python2 subpackage
(fix for the previous commit)
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jun 27 2018 Petr Viktorin <pviktori@redhat.com> - 3.1.0-3
- Conditionalize, and don't build, the python2 subpackage
* Thu Jan 21 17:53:26 CET 2021 Christian Heimes <cheimes@redhat.com> - 3.3.1-3
- Run test suite without tox (#1918913)
* Wed Jun 20 2018 Petr Viktorin <pviktori@redhat.com> - 3.1.0-2
- In %%check, use pytest directly rather than tox
* Fri Nov 13 2020 Miro Hrončok <mhroncok@redhat.com> - 3.3.1-2
- Use https in URL
- Drop build dependency on python3-coverage
* Thu Oct 22 2020 Christian Heimes <cheimes@redhat.com> - 3.3.1-1
- New upstream release 3.3.1
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sun May 24 2020 Miro Hrončok <mhroncok@redhat.com> - 3.1.0-10
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Oct 23 2019 Miro Hrončok <mhroncok@redhat.com> - 3.1.0-8
- Subpackage python2-ldap has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.1.0-7
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 3.1.0-6
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 3.1.0-2
- Rebuilt for Python 3.7
* Fri May 25 2018 Christian Heimes <cheimes@redhat.com> - 3.1.0-1
- New upstream release 3.1.0