%global pypi_name python-ldap %global package_name %(echo "%{pypi_name}" | tr '-' '_' | tr '[:upper:]' '[:lower:]') %{?scl:%global python3_pkgversion %{nil}} %{?scl:%scl_package python-%{pypi_name}} %{!?scl:%global pkg_name %{name}} Name: %{?scl_prefix}python%{python3_pkgversion}-ldap Version: 3.1.0 Release: 1%{?dist} Summary: An object-oriented API to access LDAP directory servers Group: Development/Libraries License: MIT URL: https://pypi.io/project/%{pypi_name} Source0: https://pypi.io/packages/source/%(echo "%{pypi_name}" | cut -c 1)/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: openldap-devel BuildRequires: openssl-devel BuildRequires: cyrus-sasl-devel BuildRequires: %{?scl_prefix_python}python%{python3_pkgversion}-devel BuildRequires: %{?scl_prefix_python}python%{python3_pkgversion}-setuptools %{?scl:BuildRequires: %{scl}-build %{scl}-runtime} Requires: %{?scl_prefix}python%{python3_pkgversion}-pyasn1 >= 0.3.7 Requires: %{?scl_prefix}python%{python3_pkgversion}-pyasn1-modules >= 0.1.5 %{?scl:Requires: %{scl}-runtime} %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 OpenLDAP 2.x libraries, and contains modules for other LDAP-related tasks (including processing LDIF, LDAPURLs, LDAPv3 schema, etc.). %prep %setup -q -n %{pypi_name}-%{version} rm -rf %{pypi_name}.egg-info %build %{?scl:scl enable %{scl} "} %{__python3} setup.py build %{?scl:"} %install %{?scl:scl enable %{scl} "} %{__python3} \ setup.py \ install \ -O1 \ --skip-build \ --root %{buildroot} \ --install-platlib %{python3_sitearch} %{?scl:"} %files %license LICENCE %doc CHANGES %doc README %doc TODO %doc Demo %{python3_sitearch}/%{package_name}-%{version}-py?.?.egg-info %{python3_sitearch}/__pycache__/* %{python3_sitearch}/ldap/ %{python3_sitearch}/_ldap.cpython-*.so %{python3_sitearch}/ldapurl.py* %{python3_sitearch}/ldif.py* %{python3_sitearch}/slapdtest/ %changelog * Tue Dec 18 2018 Daniel Uvehag - 3.1.0 - Initial package.