python-websockets/python-websockets.spec
2024-01-27 21:27:59 +00:00

94 lines
2.6 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

%define pypi_name websockets
# gi-find-deps.sh is very slow but is not needed here, it may be installed locally
%define __typelib_path %{nil}
Name: python-%{pypi_name}
Version: 7.0
Release: 1
Summary: An implementation of the WebSocket Protocol for python with asyncio
License: BSD
Group: Development/Python
URL: https://github.com/aaugustin/websockets
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
BuildRequires: gcc
%global _description \
websockets is a library for developing WebSocket servers and clients in\
Python. It implements RFC 6455 with a focus on correctness and simplicity. It\
passes the Autobahn Testsuite.\
\
Built on top of Pythons asynchronous I/O support introduced in PEP 3156, it\
provides an API based on coroutines, making it easy to write highly concurrent\
applications.
%description %{_description}
#-------------------------------------------------------------------------
%package -n python3-%{pypi_name}
Summary: %{summary}
BuildRequires: pkgconfig(python3)
BuildRequires: python3egg(setuptools)
# the 10.1 pops up always.
Obsoletes: python3-%{pypi_name} < %{EVRD}
%description -n python3-%{pypi_name}
%{_description}
%files -n python3-%{pypi_name}
%doc README.rst LICENSE
%{py3_platsitedir}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%{py3_platsitedir}/%{pypi_name}
#-------------------------------------------------------------------------
%package -n python38-%{pypi_name}
Summary: %{summary}
BuildRequires: python38-devel
BuildRequires: python38-setuptools
# the 10.1 pops up always.
Obsoletes: python38-%{pypi_name} < %{EVRD}
%description -n python38-%{pypi_name}
%{_description}
%files -n python38-%{pypi_name}
%doc README.rst LICENSE
%{py38_platsitedir}/%{pypi_name}-%{version}-py%{python38_version}.egg-info
%{py38_platsitedir}/%{pypi_name}
#-------------------------------------------------------------------------
%prep
%setup -qn %{pypi_name}-%{version}
# Remove upstream's egg-info
rm -vrf %{pypi_name}.egg-info
cp -a . %{py38dir}
%build
%py3_build
pushd %{py38dir}
%py38_build
popd
%install
%py3_install
pushd %{py38dir}
%py38_install
popd
# Remove installed C file
rm -vf %{buildroot}%{py3_platsitedir}/%{pypi_name}/speedups.c %{buildroot}%{py38_platsitedir}/%{pypi_name}/speedups.c
# zerolenght
find %{buildroot} -type f -empty -delete
%check
# Skip tests because they fail on Python 3.8. See: https://github.com/aaugustin/websockets/issues/648
# WEBSOCKETS_TESTS_TIMEOUT_FACTOR=100 %%{__python3} setup.py test
# test needs internet connections
# %%py3_test