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