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.2.0
Release:        1%{?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:           python-arrow
Requires:           python-beautifulsoup4
Requires:           python-bleach
Requires:           python-docutils
Requires:           python-dogpile-cache
Requires:           python-fedmsg-meta-fedora-infrastructure
Requires:           python-markupsafe
Requires:           python-moksha-hub
Requires:           python-pika
Requires:           python-fedora
Requires:           python-redis
Requires:           python-requests
Requires:           python-six
Requires:           python-sqlalchemy >= 0.8
Requires(post):     systemd
Requires(preun):    systemd
Requires(postun):   systemd
BuildRequires:      fedmsg
BuildRequires:      python-arrow
BuildRequires:      python-beautifulsoup4
BuildRequires:      python-bleach
BuildRequires:      python-devel
BuildRequires:      python-docutils
BuildRequires:      python-dogpile-cache
BuildRequires:      python-fedmsg-meta-fedora-infrastructure
BuildRequires:      python-fedora
BuildRequires:      python-flake8
BuildRequires:      python-html5lib
BuildRequires:      python-markupsafe
BuildRequires:      python-moksha-hub
BuildRequires:      python-mock
BuildRequires:      python-pika
BuildRequires:      python-redis
BuildRequires:      python-requests
BuildRequires:      python-setuptools
BuildRequires:      python-six
BuildRequires:      python-sqlalchemy >= 0.8
BuildRequires:      python-vcrpy
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}

%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 -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}/


%check
PYTHONPATH=$(pwd) python -m unittest discover


%files -n python2-%{srcname}
%license COPYING COPYING.LESSER
%doc README.rst CHANGELOG.rst
%{python2_sitelib}/*
%{_datadir}/%{srcname}
%{_bindir}/fmn-createdb
%{_unitdir}/*


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


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

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* 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.