2ddae7
%if 0%{?rhel} && 0%{?rhel} <= 6
2ddae7
%{!?__python2: %global __python2 /usr/bin/python2}
2ddae7
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
2ddae7
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
2ddae7
%endif
2ddae7
2ddae7
%if 0%{?fedora}
2ddae7
%global with_python3 1
2ddae7
%endif
2ddae7
2ddae7
%global modname websocket
2ddae7
%global distname websocket-client
2ddae7
%global eggname websocket_client
2ddae7
20f28b
%global commit 3c25814664fef5b78716ed8841123ed1c0d17824
20f28b
%global shortcommit %(c=%{commit}; echo ${c:0:7})
20f28b
2ddae7
Name: python-websocket-client
20f28b
Version: 0.56.0
20f28b
Release: 1.git%{shortcommit}%{?dist}
2ddae7
Summary: WebSocket client for python
2ddae7
Group: Development/Libraries
2ddae7
License: LGPLv2
2ddae7
URL: http://pypi.python.org/pypi/websocket-client
20f28b
#Source0: http://pypi.python.org/packages/source/w/%%{distname}/%%{eggname}-%%{version}.tar.gz
20f28b
Source0: https://github.com/%{distname}/%{distname}/archive/%{commit}/%{distname}-%{shortcommit}.tar.gz
20f28b
Patch0: 0001-urlparse-import-conditionals-for-rhel7.patch
2ddae7
BuildArch: noarch
2ddae7
BuildRequires: python2-devel
2ddae7
BuildRequires: python-setuptools
2ddae7
BuildRequires: python-six
20f28b
BuildRequires: git
2ddae7
2ddae7
%if 0%{?with_python3}
2ddae7
BuildRequires: python3-devel
2ddae7
BuildRequires: python3-setuptools
2ddae7
BuildRequires: python3-six
2ddae7
%endif
2ddae7
2ddae7
%if 0%{?rhel} && 0%{?rhel} <= 6
2ddae7
BuildRequires: python-unittest2
2ddae7
BuildRequires: python-argparse
2ddae7
Requires: python-argparse
2ddae7
BuildRequires: python-backports-ssl_match_hostname
2ddae7
Requires: python-backports-ssl_match_hostname
2ddae7
%endif
2ddae7
2ddae7
Requires: python-six
2ddae7
2ddae7
%description
2ddae7
python-websocket-client module is WebSocket client for python. This
2ddae7
provides the low level APIs for WebSocket. All APIs are the synchronous
2ddae7
functions.
2ddae7
2ddae7
python-websocket-client supports only hybi-13.
2ddae7
2ddae7
%if 0%{?with_python3}
2ddae7
%package -n python3-websocket-client
2ddae7
Summary: WebSocket client for python
2ddae7
Group: Development/Libraries
2ddae7
Requires: python3-six
2ddae7
2ddae7
%description -n python3-websocket-client
2ddae7
python-websocket-client module is WebSocket client for python. This
2ddae7
provides the low level APIs for WebSocket. All APIs are the synchronous
2ddae7
functions.
2ddae7
2ddae7
python-websocket-client supports only hybi-13.
2ddae7
%endif
2ddae7
2ddae7
%prep
20f28b
%autosetup -Sgit -n %{distname}-%{commit}
2ddae7
2ddae7
# Remove bundled egg-info in case it exists
2ddae7
rm -rf %{distname}.egg-info
2ddae7
2ddae7
%if 0%{?with_python3}
2ddae7
rm -rf %{py3dir}
2ddae7
cp -a . %{py3dir}
2ddae7
%endif
2ddae7
2ddae7
%build
2ddae7
%if 0%{?with_python3}
2ddae7
pushd %{py3dir}
2ddae7
%{__python3} setup.py build
2ddae7
popd
2ddae7
%endif
2ddae7
2ddae7
%{__python2} setup.py build
2ddae7
2ddae7
%install
2ddae7
%if 0%{?with_python3}
2ddae7
pushd %{py3dir}
2ddae7
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
2ddae7
mv %{buildroot}/%{_bindir}/wsdump.py \
2ddae7
    %{buildroot}/%{_bindir}/python3-wsdump
2ddae7
2ddae7
# unbundle cacert
2ddae7
rm %{buildroot}/%{python3_sitelib}/%{modname}/cacert.pem
2ddae7
# And link in the mozilla ca
2ddae7
ln -s /etc/pki/tls/cert.pem \
2ddae7
    %{buildroot}/%{python3_sitelib}/%{modname}/cacert.pem
2ddae7
2ddae7
# remove tests that got installed into the buildroot
2ddae7
rm -rf %{buildroot}/%{python3_sitelib}/tests/
2ddae7
2ddae7
# Remove executable bit from installed files.
2ddae7
find %{buildroot}/%{python3_sitelib} -type f -exec chmod -x {} \;
2ddae7
popd
2ddae7
%endif
2ddae7
2ddae7
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
2ddae7
mv %{buildroot}/%{_bindir}/wsdump.py \
2ddae7
    %{buildroot}/%{_bindir}/wsdump
2ddae7
2ddae7
# unbundle cacert
20f28b
#rm %%{buildroot}/%%{python2_sitelib}/%%{modname}/cacert.pem
2ddae7
# And link in the mozilla ca
2ddae7
ln -s /etc/pki/tls/cert.pem \
2ddae7
    %{buildroot}/%{python2_sitelib}/%{modname}/cacert.pem
2ddae7
2ddae7
# remove tests that got installed into the buildroot
2ddae7
rm -rf %{buildroot}/%{python2_sitelib}/tests/
2ddae7
2ddae7
# Remove executable bit from installed files.
2ddae7
find %{buildroot}/%{python2_sitelib} -type f -exec chmod -x {} \;
2ddae7
2ddae7
%check
2ddae7
%if 0%{?with_python3}
2ddae7
pushd %{py3dir}
2ddae7
%{__python3} setup.py test
2ddae7
popd
2ddae7
%endif
2ddae7
2ddae7
#%%{__python2} setup.py test
2ddae7
2ddae7
%files
2ddae7
%doc README.rst LICENSE
2ddae7
%{python2_sitelib}/%{modname}/
2ddae7
%{python2_sitelib}/%{eggname}*%{version}*
2ddae7
%{_bindir}/wsdump
2ddae7
2ddae7
%if 0%{?with_python3}
2ddae7
%files -n python3-websocket-client
2ddae7
%doc README.rst LICENSE
2ddae7
%{python3_sitelib}/%{modname}/
2ddae7
%{python3_sitelib}/%{eggname}*%{version}*
2ddae7
%{_bindir}/python3-wsdump
2ddae7
%endif
2ddae7
2ddae7
%changelog
20f28b
* Mon May 13 2019 Lokesh Mandvekar <lsm5@redhat.com> - 0.56.0-1.git3c25814
20f28b
- Resolves: #1702715
20f28b
2ddae7
* Mon Aug 31 2015 Lokesh Mandvekar <lsm5@redhat.com> - 0.32.0-116
2ddae7
- Update to 0.32.0
2ddae7
2ddae7
* Tue Jun 16 2015 Lokesh Mandvekar <lsm5@redhat.com> - 0.14.1-98
2ddae7
- Rebuild fedora rawhide specfile for extras-rhel-7.1
2ddae7
- Release number abruptly bumped to obsolete subpackage generated from docker
2ddae7
2ddae7
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14.1-3
2ddae7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2ddae7
2ddae7
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.14.1-2
2ddae7
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
2ddae7
2ddae7
* Thu May 22 2014 Ralph Bean <rbean@redhat.com> - 0.14.1-1
2ddae7
- Latest upstream with python3 support.
2ddae7
2ddae7
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.0-2
2ddae7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2ddae7
2ddae7
* Wed Apr 10 2013 Ralph Bean <rbean@redhat.com> - 0.10.0-1
2ddae7
- Latest upstream release.
2ddae7
- Removed executable bit from installed lib files for rpmlint.
2ddae7
2ddae7
* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 0.9.0-2
2ddae7
- Replaced websocket_client with %%{eggname} as per review by Palle Ravn
2ddae7
  https://bugzilla.redhat.com/show_bug.cgi?id=909644#c4
2ddae7
- Removed a few unnecessary newlines.
2ddae7
2ddae7
* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 0.9.0-1
2ddae7
- Latest upstream.
2ddae7
2ddae7
* Sat Feb 09 2013 Ralph Bean <rbean@redhat.com> - 0.8.0-1
2ddae7
- Initial package for Fedora