ed6eb81
%global upstream_name requests-kerberos
ed6eb81
%global module_name requests_kerberos
ed6eb81
ed6eb81
# Upstream doesn't support Python 3 yet, and there is no python3-kerberos.
ed6eb81
%if 0 && 0%{?fedora} || 0%{?rhel} > 6
ed6eb81
%bcond_without python3
ed6eb81
%else
ed6eb81
%bcond_with python3
ed6eb81
%endif
ed6eb81
ed6eb81
Name:           python-%{upstream_name}
ed6eb81
Version:        0.2
ed6eb81
Release:        1%{?dist}
ed6eb81
Summary:        A Kerberos authentication handler for python-requests
ed6eb81
License:        MIT
ed6eb81
URL:            https://github.com/requests/requests-kerberos
ed6eb81
Source0:        http://pypi.python.org/packages/source/r/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
ed6eb81
BuildArch:      noarch
ed6eb81
BuildRequires:  python2-devel
ed6eb81
BuildRequires:  python-setuptools
ed6eb81
%if %{with python3}
ed6eb81
BuildRequires:  python3-devel
ed6eb81
BuildRequires:  python3-setuptools
ed6eb81
%endif
ed6eb81
ed6eb81
Requires:       python-requests
ed6eb81
Requires:       python-kerberos
ed6eb81
ed6eb81
%description
ed6eb81
Requests is an HTTP library, written in Python, for human beings. This library 
ed6eb81
adds optional Kerberos/GSSAPI authentication support and supports mutual 
ed6eb81
authentication.
ed6eb81
ed6eb81
%if %{with python3}
ed6eb81
%package -n python3-%{upstream_name}
ed6eb81
Summary:        A Kerberos authentication handler for python-requests
ed6eb81
Requires:       python3-requests
ed6eb81
Requires:       python3-kerberos
ed6eb81
ed6eb81
%description -n python3-%{upstream_name}
ed6eb81
Requests is an HTTP library, written in Python, for human beings. This library 
ed6eb81
adds optional Kerberos/GSSAPI authentication support and supports mutual 
ed6eb81
authentication.
ed6eb81
%endif
ed6eb81
ed6eb81
%prep
ed6eb81
%setup -q -n %{upstream_name}-%{version}
ed6eb81
rm -r %{module_name}.egg-info
ed6eb81
ed6eb81
%if %{with python3}
ed6eb81
rm -rf %{py3dir}
ed6eb81
cp -a . %{py3dir}
ed6eb81
%endif
ed6eb81
ed6eb81
%build
ed6eb81
%{__python} setup.py build
ed6eb81
ed6eb81
%if %{with python3}
ed6eb81
pushd %{py3dir}
ed6eb81
%{__python3} setup.py build
ed6eb81
popd
ed6eb81
%endif
ed6eb81
ed6eb81
%install
ed6eb81
%if %{with python3}
ed6eb81
pushd %{py3dir}
ed6eb81
%{__python3} setup.py install --skip-build --root %{buildroot}
ed6eb81
popd
ed6eb81
%endif
ed6eb81
ed6eb81
%{__python} setup.py install --skip-build --root %{buildroot}
ed6eb81
ed6eb81
%files
ed6eb81
%doc README.rst LICENSE AUTHORS HISTORY.rst
ed6eb81
%{python_sitelib}/%{module_name}
ed6eb81
%{python_sitelib}/%{module_name}*.egg-info
ed6eb81
ed6eb81
%if %{with python3}
ed6eb81
%files -n python3-%{upstream_name}
ed6eb81
%doc README.rst LICENSE AUTHORS HISTORY.rst
ed6eb81
%{python3_sitelib}/%{module_name}
ed6eb81
%{python3_sitelib}/%{module_name}*.egg-info
ed6eb81
%endif
ed6eb81
ed6eb81
%changelog
ed6eb81
* Tue May 14 2013 Dan Callaghan <dcallagh@redhat.com> - 0.2-1
ed6eb81
- initial version