]> git.pld-linux.org Git - packages/python-PySocks.git/blob - python-PySocks.spec
rebuild with python 3.10
[packages/python-PySocks.git] / python-PySocks.spec
1 # TODO: finish tests
2 #
3 # Conditional build:
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_with     tests   # unit tests
7
8 Summary:        SOCKS client module for Python 2
9 Summary(pl.UTF-8):      Moduł klienta SOCKS dla Pythona 2
10 Name:           python-PySocks
11 Version:        1.7.1
12 Release:        4
13 License:        BSD
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/pysocks/
16 Source0:        https://files.pythonhosted.org/packages/source/P/PySocks/PySocks-%{version}.tar.gz
17 # Source0-md5:  89b1a6865c61bae67a32417517612ee6
18 URL:            https://pypi.org/project/PySocks/
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.7
23 BuildRequires:  python-setuptools
24 %if %{with tests}
25 BuildRequires:  3proxy
26 BuildRequires:  python-psutil
27 BuildRequires:  python-pytest
28 BuildRequires:  python-test-server
29 %endif
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3-modules >= 1:3.4
33 BuildRequires:  python3-setuptools
34 %if %{with tests}
35 BuildRequires:  3proxy
36 BuildRequires:  python3-psutil
37 BuildRequires:  python3-pytest
38 BuildRequires:  python3-test-server
39 %endif
40 %endif
41 Requires:       python-modules >= 1:2.7
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 This module provides a standard socket-like interface for Python
47 for tunneling connections through SOCKS proxies.
48
49 %description -l pl.UTF-8
50 Ten moduł udostępnia standardowy interfejs linii gniazd dla Pythona
51 służący do tunelowania połączeń poprzez proxy SOCKS.
52
53 %package -n python3-PySocks
54 Summary:        SOCKS client module for Python 3
55 Summary(pl.UTF-8):      Moduł klienta SOCKS dla Pythona 3
56 Group:          Libraries/Python
57 Requires:       python3-modules >= 1:3.4
58
59 %description -n python3-PySocks
60 This module provides a standard socket-like interface for Python
61 for tunneling connections through SOCKS proxies.
62
63 %description -n python3-PySocks -l pl.UTF-8
64 Ten moduł udostępnia standardowy interfejs linii gniazd dla Pythona
65 służący do tunelowania połączeń poprzez proxy SOCKS.
66
67 %prep
68 %setup -q -n PySocks-%{version}
69
70 # precompiled x86_64 binary
71 %{__rm} test/bin/3proxy
72 %if %{with tests}
73 ln -sf /usr/bin/3proxy test/bin/3proxy
74 %endif
75
76 %build
77 %if %{with python2}
78 %py_build
79
80 %if %{with tests}
81 PYTHONPATH=$(pwd) \
82 %{__python} -m unittest discover -s test
83 %endif
84 %endif
85
86 %if %{with python3}
87 %py3_build
88
89 %if %{with tests}
90 PYTHONPATH=$(pwd) \
91 %{__python3} -m unittest discover -s test
92 %endif
93 %endif
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97
98 %if %{with python2}
99 %py_install
100
101 %py_postclean
102 %endif
103
104 %if %{with python3}
105 %py3_install
106 %endif
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111 %if %{with python2}
112 %files
113 %defattr(644,root,root,755)
114 %doc LICENSE README.md
115 %{py_sitescriptdir}/socks.py[co]
116 %{py_sitescriptdir}/sockshandler.py[co]
117 %{py_sitescriptdir}/PySocks-%{version}-py*.egg-info
118 %endif
119
120 %if %{with python3}
121 %files -n python3-PySocks
122 %defattr(644,root,root,755)
123 %doc LICENSE README.md
124 %{py3_sitescriptdir}/socks.py
125 %{py3_sitescriptdir}/sockshandler.py
126 %{py3_sitescriptdir}/__pycache__/socks.cpython-*.py[co]
127 %{py3_sitescriptdir}/__pycache__/sockshandler.cpython-*.py[co]
128 %{py3_sitescriptdir}/PySocks-%{version}-py*.egg-info
129 %endif
This page took 0.105723 seconds and 3 git commands to generate.