796c1b
%bcond_without python3
796c1b
796c1b
%global distname PySocks
796c1b
%global flatname pysocks
796c1b
%global sum     A Python SOCKS client module
796c1b
796c1b
Name:               python-pysocks
796c1b
Version:            1.6.8
796c1b
Release:            6%{?dist}
796c1b
Summary:            %{sum}
796c1b
796c1b
License:            BSD
796c1b
URL:                https://github.com/Anorov/PySocks
796c1b
Source0:            https://files.pythonhosted.org/packages/source/P/PySocks/PySocks-%{version}.tar.gz
796c1b
BuildArch:          noarch
796c1b
796c1b
796c1b
%description
796c1b
A fork of SocksiPy with bug fixes and extra features.
796c1b
796c1b
Acts as a drop-in replacement to the socket module. Featuring:
796c1b
796c1b
- SOCKS proxy client for Python 2.6 - 3.x
796c1b
- TCP and UDP both supported
796c1b
- HTTP proxy client included but not supported or recommended (you should use
796c1b
  urllib2's or requests' own HTTP proxy interface)
796c1b
- urllib2 handler included.
796c1b
796c1b
796c1b
%package -n python2-%{flatname}
796c1b
Summary:            %{sum}
796c1b
BuildRequires:      python2-devel
796c1b
BuildRequires:      python2-setuptools
796c1b
%{?python_provide:%python_provide python2-%{flatname}}
796c1b
796c1b
# https://bugzilla.redhat.com/show_bug.cgi?id=1334407
796c1b
Obsoletes:  python-SocksiPy
796c1b
Obsoletes:  python2-SocksiPy
796c1b
Provides:   python2-SocksiPy
796c1b
796c1b
796c1b
%description -n python2-%{flatname}
796c1b
A fork of SocksiPy with bug fixes and extra features.
796c1b
796c1b
Acts as a drop-in replacement to the socket module. Featuring:
796c1b
796c1b
- SOCKS proxy client for Python 2.6 - 3.x
796c1b
- TCP and UDP both supported
796c1b
- HTTP proxy client included but not supported or recommended (you should use
796c1b
  urllib2's or requests' own HTTP proxy interface)
796c1b
- urllib2 handler included.
796c1b
796c1b
796c1b
%if %{with python3}
796c1b
%package -n python%{python3_pkgversion}-%{flatname}
796c1b
Summary:            %{sum}
796c1b
BuildRequires:      python%{python3_pkgversion}-devel
796c1b
BuildRequires:      python%{python3_pkgversion}-setuptools
796c1b
%{?python_provide:%python_provide python%{python3_pkgversion}-%{flatname}}
796c1b
796c1b
# This package doesn't actually exist... but if it did, we would conflict with
796c1b
# it.
796c1b
Conflicts:  python%{python3_pkgversion}-SocksiPy
796c1b
796c1b
796c1b
%description -n python%{python3_pkgversion}-%{flatname}
796c1b
A fork of SocksiPy with bug fixes and extra features.
796c1b
796c1b
Acts as a drop-in replacement to the socket module. Featuring:
796c1b
796c1b
- SOCKS proxy client for Python 2.6 - 3.x
796c1b
- TCP and UDP both supported
796c1b
- HTTP proxy client included but not supported or recommended (you should use
796c1b
  urllib2's or requests' own HTTP proxy interface)
796c1b
- urllib2 handler included.
796c1b
796c1b
%endif
796c1b
796c1b
%prep
796c1b
%autosetup -n %{distname}-%{version}
796c1b
796c1b
%build
796c1b
%py2_build
796c1b
%if %{with python3}
796c1b
%py3_build
796c1b
%endif
796c1b
796c1b
796c1b
%install
796c1b
%py2_install
796c1b
%if %{with python3}
796c1b
%py3_install
796c1b
%endif
796c1b
796c1b
796c1b
#%%check
796c1b
## No tests included in the tarball...
796c1b
## https://github.com/Anorov/PySocks/issues/37
796c1b
#%%{__python2} setup.py test
796c1b
#%%if 0%%{?with_python3}
796c1b
#%%{__python3} setup.py test
796c1b
#%%endif
796c1b
796c1b
796c1b
%files -n python2-%{flatname}
796c1b
%doc README.md
796c1b
%license LICENSE
796c1b
%{python2_sitelib}/socks.py*
796c1b
%{python2_sitelib}/sockshandler.py*
796c1b
%{python2_sitelib}/%{distname}-%{version}*
796c1b
796c1b
%if %{with python3}
796c1b
%files -n python%{python3_pkgversion}-%{flatname}
796c1b
%doc README.md
796c1b
%license LICENSE
796c1b
%{python3_sitelib}/socks.py*
796c1b
%{python3_sitelib}/sockshandler.py*
796c1b
%{python3_sitelib}/__pycache__/*socks*
796c1b
%{python3_sitelib}/%{distname}-%{version}-*
796c1b
%endif
796c1b
796c1b
796c1b
%changelog
796c1b
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 1.6.8-6
796c1b
- Bumping due to problems with modular RPM upgrade path
796c1b
- Resolves: rhbz#1695587
796c1b
796c1b
* Mon Sep 17 2018 Tomas Orsava <torsava@redhat.com> - 1.6.8-5
796c1b
- Stop providing the unversioned name python-SocksiPy
796c1b
- Resolves: rhbz#1628242
796c1b
796c1b
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 1.6.8-4
796c1b
- Make possible to disable python3 subpackage
796c1b
796c1b
* Mon Jul 16 2018 Lumír Balhar <lbalhar@redhat.com> - 1.6.8-3
796c1b
- First version for python27 module