add python3_other subpkg to epel7; prepare removal of python2 subpkg in Fedora
This commit is contained in:
parent
be868c01e3
commit
937fa68eb3
@ -1,117 +1,179 @@
|
|||||||
%global distname PySocks
|
%if 0%{?rhel}
|
||||||
%global flatname pysocks
|
%global with_python2 1
|
||||||
%global sum A Python SOCKS client module
|
%endif
|
||||||
|
# FIXME maybe Fedora 31+ without python2 subpackage
|
||||||
|
# https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
|
||||||
|
%if 0%{?fedora} && 0%{?fedora} <= 30
|
||||||
|
%global with_python2 1
|
||||||
|
%endif
|
||||||
|
%if 0%{?rhel} >= 7
|
||||||
|
%global with_python3 1
|
||||||
|
%endif
|
||||||
|
%if 0%{?fedora}
|
||||||
|
%global with_python3 1
|
||||||
|
%global with_python3_tests 1
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: python-pysocks
|
|
||||||
|
%global pypi_name PySocks
|
||||||
|
%global modname pysocks
|
||||||
|
%global sum A Python SOCKS client module
|
||||||
|
|
||||||
|
Name: python-%{modname}
|
||||||
Version: 1.6.8
|
Version: 1.6.8
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: %{sum}
|
Summary: %{sum}
|
||||||
|
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: https://github.com/Anorov/PySocks
|
URL: https://github.com/Anorov/%{pypi_name}
|
||||||
Source0: https://files.pythonhosted.org/packages/source/P/PySocks/PySocks-%{version}.tar.gz
|
Source0: %pypi_source
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
|
||||||
%description
|
%global _description \
|
||||||
A fork of SocksiPy with bug fixes and extra features.
|
A fork of SocksiPy with bug fixes and extra features.\
|
||||||
|
\
|
||||||
Acts as a drop-in replacement to the socket module. Featuring:
|
Acts as a drop-in replacement to the socket module. Featuring:\
|
||||||
|
\
|
||||||
- SOCKS proxy client for Python 2.6 - 3.x
|
- SOCKS proxy client for Python 2.6 - 3.x\
|
||||||
- TCP and UDP both supported
|
- TCP and UDP both supported\
|
||||||
- HTTP proxy client included but not supported or recommended (you should use
|
- HTTP proxy client included but not supported or recommended (you should use\
|
||||||
urllib2's or requests' own HTTP proxy interface)
|
urllib2's or requests' own HTTP proxy interface)\
|
||||||
- urllib2 handler included.
|
- urllib2 handler included.
|
||||||
|
|
||||||
|
%description
|
||||||
|
%_description
|
||||||
|
|
||||||
%package -n python2-%{flatname}
|
%if 0%{?with_python2}
|
||||||
|
%package -n python2-%{modname}
|
||||||
Summary: %{sum}
|
Summary: %{sum}
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
BuildRequires: python%{?fedora:2}-setuptools
|
BuildRequires: python2-setuptools
|
||||||
%{?python_provide:%python_provide python2-%{flatname}}
|
# for tests
|
||||||
|
BuildRequires: python2-pytest
|
||||||
|
BuildRequires: python2-psutil
|
||||||
|
#BuildRequires: python2-test_server
|
||||||
|
%{?python_provide:%python_provide python2-%{modname}}
|
||||||
|
|
||||||
|
# SocksiPy is retired in F30, drop when Fedora 29 becomes EOL
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1334407
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1334407
|
||||||
|
%if 0%{?fedora} && 0%{?fedora} < 30
|
||||||
Obsoletes: python-SocksiPy
|
Obsoletes: python-SocksiPy
|
||||||
Obsoletes: python2-SocksiPy
|
Obsoletes: python2-SocksiPy
|
||||||
Provides: python-SocksiPy
|
Provides: python-SocksiPy
|
||||||
Provides: python2-SocksiPy
|
Provides: python2-SocksiPy
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description -n python2-%{modname}
|
||||||
|
%_description
|
||||||
|
This package is for Python2 only.
|
||||||
|
%endif
|
||||||
|
|
||||||
%description -n python2-%{flatname}
|
%if 0%{?with_python3}
|
||||||
A fork of SocksiPy with bug fixes and extra features.
|
%package -n python%{python3_pkgversion}-%{modname}
|
||||||
|
|
||||||
Acts as a drop-in replacement to the socket module. Featuring:
|
|
||||||
|
|
||||||
- SOCKS proxy client for Python 2.6 - 3.x
|
|
||||||
- TCP and UDP both supported
|
|
||||||
- HTTP proxy client included but not supported or recommended (you should use
|
|
||||||
urllib2's or requests' own HTTP proxy interface)
|
|
||||||
- urllib2 handler included.
|
|
||||||
|
|
||||||
|
|
||||||
%package -n python%{python3_pkgversion}-%{flatname}
|
|
||||||
Summary: %{sum}
|
Summary: %{sum}
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||||
%{?python_provide:%python_provide python%{python3_pkgversion}-%{flatname}}
|
# for tests
|
||||||
|
%if 0%{?with_python3_tests}
|
||||||
|
BuildRequires: python%{python3_pkgversion}-pytest
|
||||||
|
BuildRequires: python%{python3_pkgversion}-psutil
|
||||||
|
#BuildRequires: python%%{python3_pkgversion}-test_server
|
||||||
|
%endif
|
||||||
|
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}
|
||||||
|
|
||||||
# This package doesn't actually exist... but if it did, we would conflict with
|
# This package doesn't actually exist...
|
||||||
# it.
|
# but if it did, we would conflict with it.
|
||||||
Conflicts: python%{python3_pkgversion}-SocksiPy
|
Conflicts: python%{python3_pkgversion}-SocksiPy
|
||||||
|
|
||||||
|
%description -n python%{python3_pkgversion}-%{modname}
|
||||||
|
%_description
|
||||||
|
This package is for Python3 version %{python3_version} only.
|
||||||
|
%endif
|
||||||
|
|
||||||
%description -n python%{python3_pkgversion}-%{flatname}
|
%if 0%{?python3_other_pkgversion}
|
||||||
A fork of SocksiPy with bug fixes and extra features.
|
%package -n python%{python3_other_pkgversion}-%{modname}
|
||||||
|
Summary: %{sum}
|
||||||
|
BuildRequires: python%{python3_other_pkgversion}-devel
|
||||||
|
BuildRequires: python%{python3_other_pkgversion}-setuptools
|
||||||
|
# for tests
|
||||||
|
%if 0%{?with_python3_tests}
|
||||||
|
BuildRequires: python%{python3_other_pkgversion}-pytest
|
||||||
|
BuildRequires: python%{python3_other_pkgversion}-psutil
|
||||||
|
#BuildRequires: python%%{python3_other_pkgversion}-test_server
|
||||||
|
%endif
|
||||||
|
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{modname}}
|
||||||
|
|
||||||
Acts as a drop-in replacement to the socket module. Featuring:
|
%description -n python%{python3_other_pkgversion}-%{modname}
|
||||||
|
%_description
|
||||||
- SOCKS proxy client for Python 2.6 - 3.x
|
This package is for Python3 version %{python3_other_version} only.
|
||||||
- TCP and UDP both supported
|
%endif
|
||||||
- HTTP proxy client included but not supported or recommended (you should use
|
|
||||||
urllib2's or requests' own HTTP proxy interface)
|
|
||||||
- urllib2 handler included.
|
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{distname}-%{version}
|
%autosetup -n %{pypi_name}-%{version}
|
||||||
|
# drop useless 3rdparty code
|
||||||
|
rm -rfv test/bin
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py2_build
|
%py2_build
|
||||||
%py3_build
|
%py3_build
|
||||||
|
%{?python3_other_pkgversion: %py3_other_build}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py2_install
|
%py2_install
|
||||||
%py3_install
|
%py3_install
|
||||||
|
%{?python3_other_pkgversion: %py3_other_install}
|
||||||
|
|
||||||
|
%check
|
||||||
|
# https://github.com/Anorov/PySocks/issues/37
|
||||||
|
# FIXME python module named test_server is needed but not packaged
|
||||||
|
%if 0
|
||||||
|
%{?with_python2: %{__python2} setup.py test}
|
||||||
|
%if 0%{?with_python3_tests}
|
||||||
|
%{?with_python3: %{__python3} setup.py test}
|
||||||
|
%{?python3_other_pkgversion: %{__python3_other} setup.py test}
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
#%%check
|
%if 0%{?with_python2}
|
||||||
## No tests included in the tarball...
|
%files -n python2-%{modname}
|
||||||
## https://github.com/Anorov/PySocks/issues/37
|
|
||||||
#%%{__python2} setup.py test
|
|
||||||
#%%if 0%%{?with_python3}
|
|
||||||
#%%{__python3} setup.py test
|
|
||||||
#%%endif
|
|
||||||
|
|
||||||
|
|
||||||
%files -n python2-%{flatname}
|
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python2_sitelib}/socks.py*
|
%{python2_sitelib}/socks.py*
|
||||||
%{python2_sitelib}/sockshandler.py*
|
%{python2_sitelib}/sockshandler.py*
|
||||||
%{python2_sitelib}/%{distname}-%{version}*
|
%{python2_sitelib}/%{pypi_name}-%{version}*
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n python%{python3_pkgversion}-%{flatname}
|
%if 0%{?with_python3}
|
||||||
|
%files -n python%{python3_pkgversion}-%{modname}
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python3_sitelib}/socks.py*
|
%{python3_sitelib}/socks.py*
|
||||||
%{python3_sitelib}/sockshandler.py*
|
%{python3_sitelib}/sockshandler.py*
|
||||||
%{python3_sitelib}/__pycache__/*socks*
|
%{python3_sitelib}/__pycache__/*socks*
|
||||||
%{python3_sitelib}/%{distname}-%{version}-*
|
%{python3_sitelib}/%{pypi_name}-%{version}-*
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?python3_other_pkgversion}
|
||||||
|
%files -n python%{python3_other_pkgversion}-%{modname}
|
||||||
|
%doc README.md
|
||||||
|
%license LICENSE
|
||||||
|
%{python3_other_sitelib}/socks.py*
|
||||||
|
%{python3_other_sitelib}/sockshandler.py*
|
||||||
|
%{python3_other_sitelib}/__pycache__/*socks*
|
||||||
|
%{python3_other_sitelib}/%{pypi_name}-%{version}-*
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun Sep 30 2018 Raphael Groner <projects.rg@smart.ms> - 1.6.8-5
|
||||||
|
- add python3_other subpackage for epel7
|
||||||
|
- prepare removal of python2 subpackage in Fedora
|
||||||
|
- use pypi macros
|
||||||
|
- try to enable tests provided actually from tarball
|
||||||
|
|
||||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.8-4
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.8-4
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user