File mqttwarn.spec of Package mqttwarn
#
# spec file for package mqttwarn
#
# Copyright (c) 2020, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
Name: mqttwarn
Version: 0.13.8
Release: 0
Summary: Subscribe to MQTT topics and notify pluggable services
License: EPL-2.0
Group: Development/Languages/Python
URL: https://github.com/jpmens/mqttwarn
Source: https://github.com/jpmens/mqttwarn/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-setuptools
# SECTION test requirements
BuildRequires: python3-Jinja2 >= 2.10.3
BuildRequires: python3-attrs >= 19.3.0
BuildRequires: python3-configparser >= 4.0.2
BuildRequires: python3-docopt >= 0.6.2
BuildRequires: python3-future >= 0.18.2
BuildRequires: python3-lovely.testlayers >= 0.7.1
BuildRequires: python3-paho-mqtt >= 1.5.0
BuildRequires: python3-pytest >= 4.6.7
BuildRequires: python3-pytest-cov >= 2.8.1
BuildRequires: python3-requests >= 2.22.0
BuildRequires: python3-six >= 1.12.0
BuildRequires: python3-tox >= 3.14.0
# /SECTION
Requires: python3-attrs >= 19.3.0
Requires: python3-configparser >= 4.0.2
Requires: python3-docopt >= 0.6.2
Requires: python3-future >= 0.18.2
Requires: python3-paho-mqtt >= 1.5.0
Requires: python3-requests >= 2.22.0
Requires: python3-six >= 1.13.0
#
Suggests: python3-Mastodon.py >= 1.2.2
Suggests: python3-Pastebin >= 1.1.2
Suggests: python3-PushbulletPythonLibrary >= 2.3
Suggests: python3-PyNMA >= 1.0
Suggests: python3-apns >= 2.0.1
Suggests: python3-celery
Suggests: python3-dnspython >= 1.15.0
Suggests: python3-fbchat >= 1.3.6
Suggests: python3-gdata >= 2.0.18
Suggests: python3-gspread >= 2.1.1
Suggests: python3-iothub-client >= 1.1.2.0
Suggests: python3-lovely.testlayers >= 0.7.1
Suggests: python3-mysql
Suggests: python3-oauth2client >= 4.1.2
Suggests: python3-paramiko >= 2.4.1
Suggests: python3-prowlpy >= 0.52
Suggests: python3-psycopg2 >= 2.7.4
Suggests: python3-puka >= 0.0.7
Suggests: python3-pync >= 1.6.1
Suggests: python3-pynsca >= 1.6
Suggests: python3-pyserial >= 3.4
Suggests: python3-pyst2 >= 0.5.0
Suggests: python3-pytest >= 4.6.7
Suggests: python3-pytest-cov >= 2.8.1
Suggests: python3-python-twitter >= 3.4.1
Suggests: python3-redis >= 2.10.6
Suggests: python3-rrdtool >= 0.1.12
Suggests: python3-slacker >= 0.9.65
Suggests: python3-tox >= 3.14.0
Suggests: python3-twilio >= 6.11.0
Suggests: python3-websocket-client >= 0.47.0
Suggests: python3-xively-python
Suggests: python3-xmpppy >= 0.5.0rc1
BuildArch: noarch
%description
mqttwarn subscribes to any number of MQTT topics (which may include wildcards)
and publishes received payloads to one or more notification services, including
support for notifying more than one distinct service for the same message.
For example, you may wish to notify via e-mail and to Pushover of an alarm
published as text to the MQTT topic home/monitoring/+.
%prep
%setup -q
# Remove spurious exec permission
chmod -x HANDBOOK.md
# Fix EOL
sed -i 's/\r$//' mqttwarn/services/serial.py
# Drop shebang
sed -i -e '/^#!\//, 1d' mqttwarn/services/*.py
# fix requirements
sed -i 's|==|>=|g' setup.py
sed -i 's|six>=1.13.0|six>=1.12.0|g' setup.py
sed -i 's|tox>=3.14.2|tox>=3.14.0|g' setup.py
%build
%python3_build
%install
%python3_install
rm -rf %{buildroot}%{python3_sitelib}/examples
rm -rf %{buildroot}%{python3_sitelib}/mqttwarn/examples
rm -rf %{buildroot}%{python3_sitelib}/vendor
%fdupes %{buildroot}%python3_sitelib}
%check
pytest -v
rm -rf %{buildroot}%{python3_sitelib}/tests
%files
%license LICENSE
%doc CHANGES.rst README.rst HANDBOOK.md
%{_bindir}/mqttwarn
%{python3_sitelib}/mqttwarn*
%changelog