File python-ldap0.spec of Package python-ldap0

#
# spec file for package python-ldap0
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global modname ldap0

%define skip_python2 1

Name:           python-%{modname}
Version:        1.4.10
Release:        0
Summary:        LDAP0 module for Python 3.x
License:        Apache-2.0
Group:          Development/Libraries/Python
Url:            https://pypi.python.org/pypi/ldap0
Source0:        https://pypi.io/packages/source/l/%{modname}/%{modname}-%{version}.tar.gz
Source1:        https://pypi.io/packages/source/l/%{modname}/%{modname}-%{version}.tar.gz.asc
Source2:        %{name}.keyring
BuildRequires:  cyrus-sasl-devel >= 2.1
BuildRequires:  cyrus-sasl-crammd5
BuildRequires:  cyrus-sasl-digestmd5
BuildRequires:  cyrus-sasl-plain
BuildRequires:  cyrus-sasl-scram
BuildRequires:  fdupes
BuildRequires:  krb5-devel
BuildRequires:  libopenssl-devel >= 0.9.7
BuildRequires:  openldap2-client
BuildRequires:  openldap2-contrib
BuildRequires:  openldap2-devel
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module pyasn1}
BuildRequires:  %{python_module pyasn1-modules}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pytest}
Requires:       python3-pyasn1 >= 0.3.7
Requires:       python3-pyasn1-modules >= 0.1.5
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%python_subpackages

%description
LDAP module for Python solely used by AE-DIR, OATH-LDAP and web2ldap

%prep
%setup -q -n %{modname}-%{version}

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
mkdir -p %{buildroot}%{_sysconfdir}/sasl2
echo "mech_list: PLAIN DIGEST-MD5 CRAM-MD5 SCRAM-SHA-1 EXTERNAL GSSAPI" > %{buildroot}%{_sysconfdir}/sasl2/slapd.conf
export SASL_CONF_PATH="%{buildroot}%{_sysconfdir}/sasl2/slapd.conf"
%pytest_arch
rm -r %{buildroot}%{_sysconfdir}/sasl2

%files %{python_files}
%defattr(-,root,root,-)
%license LICENSE
%{python_sitearch}/*

%changelog
openSUSE Build Service is sponsored by