Blob Blame History Raw
%global srcname fmn.sse
%global pkgname fmn-sse

Name:           python-%{pkgname}
Version:        0.2.1
Release:        2%{?dist}
Summary:        A server-sent events server that integrates with FMN

License:        GPLv2+
URL:            https://github.com/fedora-infra/%{srcname}
Source0:        %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
BuildArch:      noarch

%description
fmn is a family of systems to manage end-user notifications triggered by
fedmsg, the FEDerated MESsage bus. The FMN Server-Sent Events server allows
users to view their fedmsg feed in real-time using server-sent events. It relies
on a service to populate the RabbitMQ message queues for it. Typically, this is
done with the FMN core services.


%package common
Summary: %{summary}

%description common
Common files for the python-fmn-sse package.


%package -n python2-%{pkgname}
Summary: %{summary}
Requires:           python-fedmsg-core
Requires:           python-pika
Requires:           python-six
Requires:           python-twisted-web
Requires:           %{name}-common = %{version}-%{release}
Requires(post):     systemd
Requires(preun):    systemd
Requires(postun):   systemd
BuildRequires:      python-fedmsg-core
BuildRequires:      python-devel
BuildRequires:      python-flake8
BuildRequires:      python-mock
BuildRequires:      python-pika
BuildRequires:      python-setuptools
BuildRequires:      python-six
BuildRequires:      python-twisted-web
BuildRequires:      systemd
BuildRequires:      systemd-devel
%{?python_provide:%python_provide python2-%{pkgname}}

%description -n python2-%{pkgname}
fmn is a family of systems to manage end-user notifications triggered by
fedmsg, the FEDerated MESsage bus. The FMN Server-Sent Events server allows
users to view their fedmsg feed in real-time using server-sent events. It relies
on a service to populate the RabbitMQ message queues for it. Typically, this is
done with the FMN core services.


%prep
%autosetup -n %{srcname}-%{version}


%build
%py2_build


%install
%py2_install


install -d %{buildroot}%{_unitdir}
install -d %{buildroot}%{_datadir}/fmn_sse
install -pm644 usr/share/fmn_sse/sse_server.tac %{buildroot}/%{_datadir}/fmn_sse/sse_server.tac
install -pm644 systemd/fmn-sse-python2@.service %{buildroot}%{_unitdir}/

# https://github.com/fedora-infra/fmn.sse/issues/76
# %check
# PYTHONPATH=$(pwd) %{__python2} -m unittest discover


%files common
%license LICENSE
%doc README.md CHANGELOG.rst
%{_datadir}/fmn_sse


%files -n python2-%{pkgname}
%license LICENSE
%doc README.md CHANGELOG.rst
%{python2_sitelib}/*
%{_unitdir}/fmn-sse-python2@.service


%changelog
* Fri Jan 20 2017 Jeremy Cline <jeremy@jcline.org> - 0.2.1-2
- Fixes based on package review

* Mon Jan 09 2017 Jeremy Cline <jeremy@jcline.org> - 0.2.1-1
- Initial package.