]> git.pld-linux.org Git - packages/python-websocket-client.git/blob - python-websocket-client.spec
rebuild with python 3.10
[packages/python-websocket-client.git] / python-websocket-client.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  websocket-client
8 Summary:        WebSocket client for Python
9 Name:           python-%{module}
10 Version:        0.54.0
11 Release:        4
12 License:        BSD
13 Group:          Development/Libraries
14 Source0:        https://pypi.python.org/packages/source/w/websocket-client/websocket_client-%{version}.tar.gz
15 # Source0-md5:  386d62d389cdc811fb85ed571924f0ae
16 URL:            https://pypi.python.org/pypi/websocket-client
17 BuildRequires:  rpm-pythonprov
18 BuildRequires:  rpmbuild(macros) >= 1.710
19 %if %{with python2}
20 BuildRequires:  python
21 BuildRequires:  python-setuptools
22 %if %{with tests}
23 BuildRequires:  python-backports-ssl_match_hostname
24 BuildRequires:  python-six
25 %endif
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3
29 BuildRequires:  python3-setuptools
30 %if %{with tests}
31 BuildRequires:  python3-six
32 %endif
33 %endif
34 Requires:       python-six
35 BuildArch:      noarch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 python-websocket-client module is WebSocket client for Python. This
40 provides the low level APIs for WebSocket. All APIs are the
41 synchronous functions.
42
43 python-websocket-client supports only hybi-13.
44
45 %package -n python3-websocket-client
46 Summary:        WebSocket client for python
47 Group:          Development/Libraries
48 Requires:       python3-six
49
50 %description -n python3-websocket-client
51 python-websocket-client module is WebSocket client for Python. This
52 provides the low level APIs for WebSocket. All APIs are the
53 synchronous functions.
54
55 python-websocket-client supports only hybi-13.
56
57 %prep
58 %setup -q -n websocket_client-%{version}
59
60 %build
61 %if %{with python3}
62 %py3_build %{?with_tests:test}
63 %endif
64
65 %if %{with python2}
66 %py_build %{?with_tests:test}
67 %endif
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71 %if %{with python3}
72 %py3_install
73
74 mv $RPM_BUILD_ROOT%{_bindir}/{wsdump.py,wsdump-%{py3_ver}}
75
76 # remove tests that got installed into the buildroot
77 rm -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/websocket/tests
78 %endif
79
80 %if %{with python2}
81 %py_install
82 %py_postclean
83
84 mv $RPM_BUILD_ROOT%{_bindir}/{wsdump.py,wsdump-%{py_ver}}
85
86 # remove tests that got installed into the buildroot
87 rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/websocket/tests
88 %endif
89
90 %clean
91 rm -rf $RPM_BUILD_ROOT
92
93 %if %{with python2}
94 %files
95 %defattr(644,root,root,755)
96 %doc README.rst LICENSE
97 %attr(755,root,root) %{_bindir}/wsdump-%{py_ver}
98 %dir %{py_sitescriptdir}/websocket
99 %{py_sitescriptdir}/websocket/*.py[co]
100 %{py_sitescriptdir}/websocket_client-%{version}-py*.egg-info
101 %endif
102
103 %if %{with python3}
104 %files -n python3-websocket-client
105 %defattr(644,root,root,755)
106 %doc README.rst LICENSE
107 %attr(755,root,root) %{_bindir}/wsdump-%{py3_ver}
108 %dir %{py3_sitescriptdir}/websocket
109 %{py3_sitescriptdir}/websocket/*.py
110 %{py3_sitescriptdir}/websocket/__pycache__
111 %{py3_sitescriptdir}/websocket_client-%{version}-py*.egg-info
112 %endif
This page took 0.062886 seconds and 3 git commands to generate.