%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: python2-fedmsg-core
Requires: python2-pika
Requires: python2-six
Requires: python2-twisted
Requires: %{name}-common = %{version}-%{release}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: python2-fedmsg-core
BuildRequires: python2-devel
BuildRequires: python2-flake8
BuildRequires: python2-mock
BuildRequires: python2-pika
BuildRequires: python2-setuptools
BuildRequires: python2-six
BuildRequires: python2-twisted
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.
%package -n python3-%{pkgname}
Summary: %{summary}
Requires: python3-fedmsg-core
Requires: python3-pika
Requires: python3-six
Requires: python3-twisted
Requires: %{name}-common = %{version}-%{release}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: python3-fedmsg-core
BuildRequires: python3-devel
BuildRequires: python3-flake8
BuildRequires: python3-mock
BuildRequires: python3-pika
BuildRequires: python3-setuptools
BuildRequires: python3-six
BuildRequires: python3-twisted
BuildRequires: systemd
BuildRequires: systemd-devel
%description -n python3-%{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
%py3_build
%install
%py2_install
%py3_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}/
install -pm644 systemd/fmn-sse-python3@.service %{buildroot}%{_unitdir}/
%check
PYTHONPATH=$(pwd) %{__python2} -m unittest discover
PYTHONPATH=$(pwd) %{__python3} -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
%files -n python3-%{pkgname}
%license LICENSE
%doc README.md CHANGELOG.rst
%{python3_sitelib}/*
%{_unitdir}/fmn-sse-python3@.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.