44b22bc
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
44b22bc
# All rights reserved.
44b22bc
#
44b22bc
# This code is licensed under the MIT License.
44b22bc
#
44b22bc
# Permission is hereby granted, free of charge, to any person obtaining a copy
44b22bc
# of this software and associated documentation files(the "Software"), to deal
44b22bc
# in the Software without restriction, including without limitation the rights
44b22bc
# to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
44b22bc
# copies of the Software, and to permit persons to whom the Software is
44b22bc
# furnished to do so, subject to the following conditions :
44b22bc
#
44b22bc
# The above copyright notice and this permission notice shall be included in
44b22bc
# all copies or substantial portions of the Software.
44b22bc
#
44b22bc
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44b22bc
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44b22bc
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
44b22bc
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44b22bc
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
44b22bc
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
44b22bc
# THE SOFTWARE.
44b22bc
###############################################################################
44b22bc
%global with_python2 1
44b22bc
%global with_python3 1
44b22bc
44b22bc
%if 0%{?fedora} || 0%{?rhel} >= 8
44b22bc
# Python v2 Support dropped
44b22bc
%global with_python2 0
44b22bc
%endif # fedora and/or rhel7
44b22bc
44b22bc
%if 0%{?_module_build}
44b22bc
%bcond_with tests
44b22bc
%else
44b22bc
# When bootstrapping Python, we cannot test this yet
44b22bc
%bcond_without tests
44b22bc
%endif # module_build
44b22bc
44b22bc
%if 0%{?rhel} && 0%{?rhel} <= 7
44b22bc
%global with_python3 0
44b22bc
%endif # using rhel7
44b22bc
44b22bc
Name:           python-apprise
c8f94b4
Version:        0.7.5
44b22bc
Release:        1%{?dist}
44b22bc
Summary:        A simple wrapper to many popular notification services used today
44b22bc
License:        MIT
44b22bc
URL:            https://github.com/caronc/apprise
44b22bc
Source0:        %{url}/archive/v%{version}/apprise-%{version}.tar.gz
44b22bc
# this patch allows version of requests that ships with RHEL v7 to
44b22bc
# correctly handle test coverage.  It also removes reference to a
44b22bc
# extra check not supported in py.test in EPEL7 builds
44b22bc
Patch0:         apprise-rhel7-support.patch
44b22bc
BuildArch:      noarch
44b22bc
44b22bc
%description
44b22bc
Apprise is a Python package for simplifying access to all of the different
44b22bc
notification services that are out there. Apprise opens the door and makes
44b22bc
it easy to access:
44b22bc
c8f94b4
Boxcar, Discord, E-Mail, Emby, Faast, Flock, Gitter, Gotify, Growl, IFTTT,
c8f94b4
Join, KODI, MatterMost, Matrix, Microsoft Windows Notifications,
c8f94b4
Microsoft Teams, Notify My Android, Prowl, Pushalot, PushBullet, Pushjet,
c8f94b4
Pushover, Rocket.Chat, Slack, Super Toasty, Stride, Telegram, Twitter, XBMC,
c8f94b4
XMPP, Webex Teams
44b22bc
44b22bc
%if 0%{?with_python2}
44b22bc
%package -n python2-apprise
44b22bc
Summary: A simple wrapper to many popular notification services used today
44b22bc
%{?python_provide:%python_provide python2-apprise}
44b22bc
44b22bc
BuildRequires: python2-devel
44b22bc
BuildRequires: python-decorator
44b22bc
BuildRequires: python-requests
44b22bc
BuildRequires: python2-requests-oauthlib
44b22bc
BuildRequires: python2-oauthlib
44b22bc
BuildRequires: python-six
44b22bc
BuildRequires: python2-click >= 5.0
44b22bc
BuildRequires: python-markdown
44b22bc
%if 0%{?rhel} && 0%{?rhel} <= 7
44b22bc
BuildRequires: python-yaml
44b22bc
%else
44b22bc
BuildRequires: python2-yaml
44b22bc
%endif # using rhel7
44b22bc
44b22bc
Requires: python-decorator
44b22bc
Requires: python-requests
44b22bc
Requires: python2-requests-oauthlib
44b22bc
Requires: python2-oauthlib
44b22bc
Requires: python-six
44b22bc
Requires: python-markdown
44b22bc
%if 0%{?rhel} && 0%{?rhel} <= 7
44b22bc
BuildRequires: python-yaml
44b22bc
%else
44b22bc
Requires: python2-yaml
44b22bc
%endif # using rhel7
44b22bc
44b22bc
%if %{with tests}
44b22bc
BuildRequires: python-mock
44b22bc
BuildRequires: python2-pytest-runner
44b22bc
BuildRequires: python2-pytest
44b22bc
44b22bc
%endif # with_tests
44b22bc
44b22bc
%description -n python2-apprise
44b22bc
Apprise is a Python package for simplifying access to all of the different
44b22bc
notification services that are out there. Apprise opens the door and makes
44b22bc
it easy to access:
44b22bc
c8f94b4
Boxcar, Discord, E-Mail, Emby, Faast, Flock, Gitter, Gotify, Growl, IFTTT,
c8f94b4
Join, KODI, MatterMost, Matrix, Microsoft Windows Notifications,
c8f94b4
Microsoft Teams, Notify My Android, Prowl, Pushalot, PushBullet, Pushjet,
c8f94b4
Pushover, Rocket.Chat, Slack, Super Toasty, Stride, Telegram, Twitter, XBMC,
c8f94b4
XMPP, Webex Teams
44b22bc
%endif # with_python2
44b22bc
44b22bc
%package -n apprise
44b22bc
Summary: Apprise CLI Tool
44b22bc
44b22bc
%if 0%{?with_python3}
44b22bc
Requires: python%{python3_pkgversion}-click >= 5.0
44b22bc
Requires: python%{python3_pkgversion}-apprise = %{version}-%{release}
44b22bc
%endif # with_python3
44b22bc
44b22bc
%if 0%{?with_python2}
44b22bc
Requires: python2-click >= 5.0
44b22bc
Requires: python2-apprise = %{version}-%{release}
44b22bc
%endif # with_python2
44b22bc
44b22bc
%description -n apprise
44b22bc
An accompanied CLI tool that can be used as part of Apprise
44b22bc
to issue notifications from the command line to you favorite
44b22bc
services.
44b22bc
44b22bc
%if 0%{?with_python3}
44b22bc
%package -n python%{python3_pkgversion}-apprise
44b22bc
Summary: A simple wrapper to many popular notification services used today
44b22bc
%{?python_provide:%python_provide python%{python3_pkgversion}-apprise}
44b22bc
44b22bc
BuildRequires: python%{python3_pkgversion}-devel
44b22bc
BuildRequires: python%{python3_pkgversion}-decorator
44b22bc
BuildRequires: python%{python3_pkgversion}-requests
44b22bc
BuildRequires: python%{python3_pkgversion}-requests-oauthlib
44b22bc
BuildRequires: python%{python3_pkgversion}-oauthlib
44b22bc
BuildRequires: python%{python3_pkgversion}-six
44b22bc
BuildRequires: python%{python3_pkgversion}-click >= 5.0
44b22bc
BuildRequires: python%{python3_pkgversion}-markdown
44b22bc
BuildRequires: python%{python3_pkgversion}-yaml
44b22bc
Requires: python%{python3_pkgversion}-decorator
44b22bc
Requires: python%{python3_pkgversion}-requests
44b22bc
Requires: python%{python3_pkgversion}-requests-oauthlib
44b22bc
Requires: python%{python3_pkgversion}-oauthlib
44b22bc
Requires: python%{python3_pkgversion}-six
44b22bc
Requires: python%{python3_pkgversion}-markdown
44b22bc
Requires: python%{python3_pkgversion}-yaml
44b22bc
44b22bc
%if %{with tests}
44b22bc
BuildRequires: python%{python3_pkgversion}-mock
44b22bc
BuildRequires: python%{python3_pkgversion}-pytest
44b22bc
BuildRequires: python%{python3_pkgversion}-pytest-runner
44b22bc
%endif # with_tests
44b22bc
44b22bc
%description -n python%{python3_pkgversion}-apprise
44b22bc
Apprise is a Python package for simplifying access to all of the different
44b22bc
notification services that are out there. Apprise opens the door and makes
44b22bc
it easy to access:
44b22bc
44b22bc
Boxcar, Discord, E-Mail, Emby, Faast, Growl, IFTTT, Join, KODI, MatterMost,
44b22bc
Matrix, Notify My Android, Prowl, Pushalot, PushBullet, Pushjet, Pushover,
44b22bc
Rocket.Chat, Slack, Super Toasty, Stride, Telegram, Twitter, XBMC
44b22bc
%endif # with_python3
44b22bc
44b22bc
%prep
44b22bc
%setup -q -n apprise-%{version}
44b22bc
%if 0%{?rhel} && 0%{?rhel} <= 7
44b22bc
# rhel7 older package work-arounds
44b22bc
%patch0 -p1
44b22bc
%endif # using rhel7
44b22bc
44b22bc
%build
44b22bc
%if 0%{?with_python2}
44b22bc
%py2_build
44b22bc
%endif # with_python2
44b22bc
%if 0%{?with_python3}
44b22bc
%py3_build
44b22bc
%endif # with_python3
44b22bc
44b22bc
%install
44b22bc
%if 0%{?with_python2}
44b22bc
%py2_install
44b22bc
%endif # with_python2
44b22bc
%if 0%{?with_python3}
44b22bc
%py3_install
44b22bc
%endif # with_python3
44b22bc
c8f94b4
install -p -D -T -m 0644 packaging/man/apprise.1 \
44b22bc
	%{buildroot}%{_mandir}/man1/apprise.1
44b22bc
44b22bc
%if %{with tests}
44b22bc
%check
44b22bc
%if 0%{?with_python2}
44b22bc
LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{python2_sitelib} py.test
44b22bc
%endif # with_python2
44b22bc
%if 0%{?with_python3}
44b22bc
LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version}
44b22bc
%endif # with_python3
44b22bc
%endif # with_tests
44b22bc
44b22bc
%if 0%{?with_python2}
44b22bc
%files -n python2-apprise
44b22bc
%license LICENSE
44b22bc
%doc README.md
44b22bc
%{python2_sitelib}/apprise
44b22bc
%exclude %{python2_sitelib}/apprise/cli.*
44b22bc
%{python2_sitelib}/*.egg-info
44b22bc
%endif # with_python2
44b22bc
44b22bc
%if 0%{?with_python3}
44b22bc
%files -n python%{python3_pkgversion}-apprise
44b22bc
%license LICENSE
44b22bc
%doc README.md
44b22bc
%{python3_sitelib}/apprise
44b22bc
%exclude %{python3_sitelib}/apprise/cli.*
44b22bc
%{python3_sitelib}/*.egg-info
44b22bc
%endif # with_python3
44b22bc
44b22bc
%files -n apprise
44b22bc
%{_bindir}/apprise
44b22bc
%{_mandir}/man1/apprise.1*
44b22bc
44b22bc
%if 0%{?with_python3}
44b22bc
%{python3_sitelib}/apprise/cli.*
44b22bc
%endif # with_python3
44b22bc
44b22bc
%if 0%{?with_python2}
44b22bc
%{python2_sitelib}/apprise/cli.*
44b22bc
%endif # with_python2
44b22bc
44b22bc
%changelog
c8f94b4
* Sun Apr  7 2019 Chris Caron <lead2gold@gmail.com> - 0.7.5-1
c8f94b4
- Updated to v0.7.5
c8f94b4
44b22bc
* Sun Mar 10 2019 Chris Caron <lead2gold@gmail.com> - 0.7.4-1
44b22bc
- Updated to v0.7.4
44b22bc
- Fedora review process added a man page, spec restructuring and 2 patch files
44b22bc
  to accomodate some valid points brought forth. These have already been pused
44b22bc
  upstream and will be removed on the next version.
44b22bc
44b22bc
* Fri Feb 22 2019 Chris Caron <lead2gold@gmail.com> - 0.7.3-1
44b22bc
- Updated to v0.7.3
44b22bc
- Added Python 3 build support
44b22bc
44b22bc
* Sun Sep  9 2018 Chris Caron <lead2gold@gmail.com> - 0.5.0-1
44b22bc
- Updated to v0.5.0
44b22bc
44b22bc
* Sun Mar 11 2018 Chris Caron <lead2gold@gmail.com> - 0.0.8-1
44b22bc
- Initial Release