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