Blob Blame History Raw
%global srcname fmn

# python-sqlalchemy_schemadisplay is not yet in Fedora
# https://bugzilla.redhat.com/show_bug.cgi?id=1409929
%global with_docs 0

Name:           python-%{srcname}
Version:        1.3.1
Release:        3%{?dist}
Summary:        A system for generic fedmsg-driven notifications for end users

License:        LGPLv2+
URL:            https://github.com/fedora-infra/%{srcname}
Source0:        %{url}/archive/%{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. fmn provides a single place for all
applications using fedmsg to notify users of events. Notifications can be
delivered by email, IRC, and server-sent events. Users can configure their
notifications for all the applications they use in one place.

%package -n python2-%{srcname}
Summary:        %{summary}
Requires:           fedmsg
Requires:           httpd
Requires:           mod_wsgi
Requires:           python-arrow
Requires:           python-beautifulsoup4
Requires:           python-bleach
Requires:           python-bunch
Requires:           python-datanommer-models
Requires:           python-docutils
Requires:           python-dogpile-cache
Requires:           python-fedmsg-meta-fedora-infrastructure >= 0.18
Requires:           python-flask
Requires:           python-flask-openid
Requires:           python-markupsafe
Requires:           python-moksha-hub
Requires:           python-openid
Requires:           python-openid-cla
Requires:           python-openid-teams
Requires:           python-pika
Requires:           python-pydns
Requires:           python-pylibravatar
Requires:           python-fedora
Requires:           python-redis
Requires:           python-requests
Requires:           python-six
Requires:           python-sqlalchemy >= 0.8
Requires:           python-twisted
Requires:           python-wtforms
Requires(post):     systemd
Requires(preun):    systemd
Requires(postun):   systemd

BuildRequires:      fedmsg
BuildRequires:      python-arrow
BuildRequires:      python-beautifulsoup4
BuildRequires:      python-bleach
BuildRequires:      python-bunch
BuildRequires:      python-datanommer-models
BuildRequires:      python-devel
BuildRequires:      python-docutils
BuildRequires:      python-dogpile-cache
BuildRequires:      python-fedmsg-meta-fedora-infrastructure
BuildRequires:      python-fedora
BuildRequires:      python-flake8
BuildRequires:      python-flask
BuildRequires:      python-flask-openid
BuildRequires:      python-html5lib
BuildRequires:      python-markupsafe
BuildRequires:      python-moksha-hub
BuildRequires:      python-mock
BuildRequires:      python-openid
BuildRequires:      python-openid-cla
BuildRequires:      python-openid-teams
BuildRequires:      python-pika
BuildRequires:      python-pydns
BuildRequires:      python-pylibravatar
BuildRequires:      python-pytest
BuildRequires:      python-redis
BuildRequires:      python-requests
BuildRequires:      python-setuptools
BuildRequires:      python-six
BuildRequires:      python-sqlalchemy >= 0.8
BuildRequires:      python-twisted
BuildRequires:      python-wtforms
BuildRequires:      python2-devel
BuildRequires:      systemd
%{?python_provide:%python_provide python2-%{srcname}}

Provides: python-fmn-rules = %{version}-%{release}
Obsoletes: python-fmn-rules < 0.9.1-2%{?dist}
Provides: python-fmn-lib = %{version}-%{release}
Obsoletes: python-fmn-lib < 0.8.2-3%{?dist}
Provides: python-fmn-consumer = %{version}-%{release}
Obsoletes: python-fmn-consumer < 1.0.3-2%{?dist}
Provides: python-fmn-web = %{version}-%{release}
Obsoletes: python-fmn-web < 0.8.1-4%{?dist}
Provides: python-fmn-sse = %{version}-%{release}
Obsoletes: python-fmn-sse < 0.2.1-4%{?dist}

%description -n python2-%{srcname}
fmn is a family of systems to manage end-user notifications triggered by
fedmsg, the FEDerated MESsage bus. fmn provides a single place for all
applications using fedmsg to notify users of events. Notifications can be
delivered by email, IRC, and server-sent events. Users can configure their
notifications for all the applications they use in one place.


%if 0%{?with_docs} > 0
%package doc
Summary:        HTML documentation for python-fmn
BuildRequires:  make
BuildRequires:  python2-sphinx
BuildRequires:  python2-sqlalchemy_schemadisplay

%description -n python-%{srcname}-doc
HTML documentation for python-fmn.
%endif


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


%build
%py2_build


%if 0%{?with_docs} > 0
pushd docs
PYTHONPATH=$(dirname $(pwd)) make html
popd
%endif


%install
%py2_install


install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_unitdir}
install -d %{buildroot}%{_datadir}/%{srcname}
install -pm644 alembic.ini %{buildroot}/%{_datadir}/%{srcname}/alembic.ini
install -pm644 systemd/* %{buildroot}/%{_unitdir}/
cp -a alembic %{buildroot}/%{_datadir}/%{srcname}/

%{__mkdir_p} %{buildroot}/%{_datadir}/%{srcname}
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/httpd/conf.d
cp -p apache/%{srcname}.web.wsgi %{buildroot}%{_datadir}/%{srcname}/%{srcname}.web.wsgi
cp -p apache/%{srcname}.web.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/%{srcname}.web.conf
cp -r fmn/web/static/ %{buildroot}%{_datadir}/%{srcname}/static

rm -rf %{buildroot}%{_datadir}/%{srcname}/static/bootstrap


# The old version of flake8 on EPEL7 has weird rules that aren't problems
# in newer versions. https://github.com/fedora-infra/fmn/issues/163
# %check
# PYTHONPATH=$(pwd) py.test


%files -n python2-%{srcname}
%license COPYING COPYING.LESSER
%doc README.rst CHANGELOG.rst
%{python2_sitelib}/*
%{_datadir}/%{srcname}
%{_bindir}/fmn-createdb
%{_unitdir}/*
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{srcname}.web.conf
%{_datadir}/%{srcname}


%if 0%{?with_docs} > 0
%files doc
%license COPYING COPYING.LESSER
%doc README.rst CHANGELOG.rst docs/_build/html/
%endif


%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu Jun 15 2017 Jeremy Cline <jeremy@jcline.org> - 1.3.1-2
- Add a missing dependency (python-bunch)

* Mon Jun 12 2017 Jeremy Cline <jeremy@jcline.org> - 1.3.1-1
- Update to latest upstream

* Wed May 31 2017 Jeremy Cline <jeremy@jcline.org> - 1.3.0-1
- Update to 1.3.0
- Provide fmn-sse and fmn-web

* Mon Apr 10 2017 Jeremy Cline <jeremy@jcline.org> - 1.2.0-1
- Update to upstream 1.2.0

* Fri Jan 20 2017 Jeremy Cline <jeremy@jcline.org> - 1.1.0-1
- Update to latest upstream
- Address package review comments

* Thu Jan 05 2017 Jeremy Cline <jeremy@jcline.org> - 1.0.0-1
- Initial package.