Blob Blame History Raw
%global srcname flask-socketio

Name:           python-%{srcname}
Version:        5.1.0
Release:        %autorelease
Summary:        Socket.IO integration for Flask applications

License:        MIT
URL:            https://github.com/miguelgrinberg/Flask-SocketIO/
Source0:        %{url}/archive/v%{version}/Flask-SocketIO-%{version}.tar.gz

BuildArch:      noarch
 
BuildRequires:  python3-devel
BuildRequires:  pyproject-rpm-macros

# Documentation
BuildRequires:  make
BuildRequires:  python3dist(sphinx)

# Extra testing dependencies
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(coverage)

%global common_description %{expand:
Flask-SocketIO gives Flask applications access to low latency bi-directional
communications between the clients and the server. The client-side application
can use any of the SocketIO official clients libraries in Javascript, C++, Java
and Swift, or any compatible client to establish a permanent connection to the
server.}

%description %{common_description}


%package -n     python3-%{srcname}
Summary:        %{summary}

%description -n python3-%{srcname} %{common_description}


%package        doc
Summary:        Documentation for %{name}

%description    doc %{common_description}


%prep
%autosetup -n Flask-SocketIO-%{version}

# Find executable files without shebang lines, and fix their permissions.
# https://github.com/miguelgrinberg/Flask-SocketIO/pull/1621
find . -type f -perm /0111 |
  while read -r fn
  do
    if ! head "${fn}" | grep -E '^#!' >/dev/null
    then
      chmod -v a-x "${fn}"
    fi
  done
# Fix “/usr/bin/env python” shebangs in the example
%py3_shebang_fix example


%generate_buildrequires
%pyproject_buildrequires -r


%build
%pyproject_wheel
PYTHONPATH="${PWD}" %make_build -C docs html SPHINXOPTS='%{?_smp_mflags}'
rm -vf docs/_build/html/.buildinfo


%install
%pyproject_install
%pyproject_save_files flask_socketio


%check
%pytest


%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE


%files doc
%license LICENSE
%doc CHANGES.md
%doc README.md
%doc docs/_build/html
%doc example


%changelog
%autochangelog