%global srcname ntlm3
%global pypi_name python-%{srcname}
%global gh_owner trustrachel
Name: python-%{srcname}
Version: 1.0.2
Release: 1%{?dist}
Summary: Python 3 compatible NTLM library
License: LGPLv3+
URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://github.com/%{gh_owner}/%{pypi_name}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python-setuptools
BuildRequires: python2-devel
BuildRequires: python3-setuptools
BuildRequires: python3-devel
# For tests
BuildRequires: python2-pytest
BuildRequires: python3-pytest
BuildRequires: python2-six
BuildRequires: python3-six
BuildRequires: python-httpretty
BuildRequires: python3-httpretty
%description
This package allows Python clients running on any operating system to provide
NTLM authentication to a supporting server.
%package -n python2-%{srcname}
Summary: Python 3 compatible NTLM library
%{?python_provide:%python_provide python2-%{srcname}}
Requires: python-six
%description -n python2-%{srcname}
This package allows Python clients running on any operating system to provide
NTLM authentication to a supporting server.
%package -n python3-%{srcname}
Summary: Python 3 compatible NTLM library
%{?python_provide:%python_provide python3-%{srcname}}
Requires: python3-six
%description -n python3-%{srcname}
This package allows Python clients running on any operating system to provide
NTLM authentication to a supporting server.
%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py2_build
%py3_build
%install
# Must do the subpackages' install first because the scripts in /usr/bin are
# overwritten with every setup.py install.
%py3_install
%py2_install
%check
%{__python} -m pytest test
%{__python3} -m pytest test
%files -n python2-%{srcname}
%doc CHANGES.md README.md
%license LICENSE.md
%{python2_sitelib}/%{srcname}
%{python2_sitelib}/python_%{srcname}-%{version}-py?.?.egg-info
%files -n python3-%{srcname}
%doc CHANGES.md README.md
%license LICENSE.md
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/python_%{srcname}-%{version}-py?.?.egg-info
%changelog
* Mon Oct 10 2016 James Hogarth <james.hogarth@gmail.com> - 1.0.2-1
- Initial package.