Blob Blame History Raw
# what it's called on pypi
%global srcname daphne
# what it's imported as
%global libname %{srcname}
# name of egg info directory
%global eggname %{srcname}
# package name fragment
%global pkgname %{srcname}

%global common_description %{expand:
Daphne is a HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP,
developed to power Django Channels.  It supports automatic negotiation of
protocols; there’s no need for URL prefixing to determine WebSocket endpoints
versus HTTP endpoints.}

%bcond_without  tests


Name:           python-%{pkgname}
Version:        3.0.1
Release:        1%{?dist}
Summary:        Django ASGI (HTTP/WebSocket) server
License:        BSD
URL:            https://github.com/django/daphne
# PyPI tarball doesn't have tests
Source0:        %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
BuildArch:      noarch


%description %{common_description}


%package -n python3-%{pkgname}
Summary:        %{summary}
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist setuptools pytest-runner}
%if %{with tests}
BuildRequires:  %{py3_dist pytest pytest-asyncio hypothesis}
BuildRequires:  %{py3_dist twisted autobahn asgiref}
%endif
%{?python_provide:%python_provide python3-%{pkgname}}


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


%prep
%autosetup -n %{srcname}-%{version}
rm -rf %{eggname}.egg-info


%build
%py3_build


%install
%py3_install


%if %{with tests}
%check
%pytest --verbose
%endif


%files -n python3-%{pkgname}
%license LICENSE
%doc README.rst
%{_bindir}/daphne
%{python3_sitelib}/%{libname}
%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/twisted/plugins/*


%changelog
* Fri Mar 19 2021 Charalampos Stratakis <cstratak@redhat.com> - 3.0.1-1
- Update to 3.0.1 (rhbz#1892469)

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Jun 05 2020 Carl George <carl@george.computer> - 2.5.0-1
- Initial package