Blame python-flask-socketio.spec

26a0ac8
%global srcname flask-socketio
26a0ac8
26a0ac8
Name:           python-%{srcname}
2b40cff
Version:        5.1.0
42291d1
Release:        %autorelease
5a87922
Summary:        Socket.IO integration for Flask applications
5a87922
5a87922
License:        MIT
26a0ac8
URL:            https://github.com/miguelgrinberg/Flask-SocketIO/
26a0ac8
Source0:        %{url}/archive/v%{version}/Flask-SocketIO-%{version}.tar.gz
5a87922
5a87922
BuildArch:      noarch
5a87922
 
5a87922
BuildRequires:  python3-devel
26a0ac8
BuildRequires:  pyproject-rpm-macros
26a0ac8
26a0ac8
# Documentation
26a0ac8
BuildRequires:  make
26a0ac8
BuildRequires:  python3dist(sphinx)
26a0ac8
26a0ac8
# Extra testing dependencies
26a0ac8
BuildRequires:  python3dist(pytest)
5a87922
BuildRequires:  python3dist(coverage)
5a87922
26a0ac8
%global common_description %{expand:
26a0ac8
Flask-SocketIO gives Flask applications access to low latency bi-directional
26a0ac8
communications between the clients and the server. The client-side application
26a0ac8
can use any of the SocketIO official clients libraries in Javascript, C++, Java
26a0ac8
and Swift, or any compatible client to establish a permanent connection to the
26a0ac8
server.}
26a0ac8
26a0ac8
%description %{common_description}
26a0ac8
26a0ac8
26a0ac8
%generate_buildrequires
26a0ac8
%pyproject_buildrequires -r
5a87922
26a0ac8
26a0ac8
%package -n     python3-%{srcname}
5a87922
Summary:        %{summary}
26a0ac8
26a0ac8
%description -n python3-%{srcname} %{common_description}
26a0ac8
5a87922
26a0ac8
%package        doc
26a0ac8
Summary:        Documentation for %{name}
26a0ac8
26a0ac8
%description    doc %{common_description}
5a87922
5a87922
5a87922
%prep
5a87922
%autosetup -n Flask-SocketIO-%{version}
26a0ac8
26a0ac8
# Find executable files without shebang lines, and fix their permissions.
26a0ac8
# https://github.com/miguelgrinberg/Flask-SocketIO/pull/1621
26a0ac8
find . -type f -perm /0111 |
26a0ac8
  while read -r fn
26a0ac8
  do
26a0ac8
    if ! head "${fn}" | grep -E '^#!' >/dev/null
26a0ac8
    then
26a0ac8
      chmod -v a-x "${fn}"
26a0ac8
    fi
26a0ac8
  done
26a0ac8
# Fix “/usr/bin/env python” shebangs in the example
26a0ac8
%py3_shebang_fix example
26a0ac8
5a87922
5a87922
%build
26a0ac8
%pyproject_wheel
26a0ac8
PYTHONPATH="${PWD}" %make_build -C docs html SPHINXOPTS='%{?_smp_mflags}'
26a0ac8
rm -vf docs/_build/html/.buildinfo
26a0ac8
5a87922
5a87922
%install
26a0ac8
%pyproject_install
26a0ac8
%pyproject_save_files flask_socketio
26a0ac8
5a87922
5a87922
%check
26a0ac8
%pytest
26a0ac8
5a87922
26a0ac8
%files -n python3-%{srcname} -f %{pyproject_files}
5a87922
%license LICENSE
26a0ac8
26a0ac8
26a0ac8
%files doc
26a0ac8
%license LICENSE
26a0ac8
%doc CHANGES.md
5a87922
%doc README.md
26a0ac8
%doc docs/_build/html
26a0ac8
%doc example
26a0ac8
5a87922
5a87922
%changelog
42291d1
%autochangelog