9ddf210
# Copyright (C) 2021 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
d732271
%endif
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
d732271
%endif
44b22bc
44b22bc
%if 0%{?rhel} && 0%{?rhel} <= 7
44b22bc
%global with_python3 0
d732271
%endif
44b22bc
556379c
%global pypi_name apprise
44b22bc
556379c
%global common_description %{expand: \
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
4cde521
Boxcar, ClickSend, DingTalk, Discord, E-Mail, Emby, Faast, FCM, Flock, Gitter,
4cde521
Google Chat, Gotify, Growl, Home Assistant, IFTTT, Join, Kavenegar, KODI,
4cde521
Kumulos, LaMetric, MacOSX, Mailgun, Mattermost, Matrix, Microsoft Windows,
e09c0c0
Microsoft Teams, MessageBird, MQTT, MSG91, MyAndroid, Nexmo, Nextcloud, Notica,
4cde521
Notifico, Office365, OneSignal, Opsgenie, ParsePlatform, PopcornNotify, Prowl,
4cde521
Pushalot, PushBullet, Pushjet, Pushover, PushSafer, Reddit, Rocket.Chat,
4cde521
SendGrid, SimplePush, Sinch, Slack, SMTP2Go, Spontit, SparkPost, Super Toasty,
e09c0c0
Streamlabs, Stride, Syslog, Techulus Push, Telegram, Twilio, Twitter, Twist, XBMC,
e09c0c0
XMPP, Webex Teams}
556379c
556379c
Name:           python-%{pypi_name}
e09c0c0
Version:        0.9.5.1
4cde521
Release:        1%{?dist}
556379c
Summary:        A simple wrapper to many popular notification services used today
556379c
License:        MIT
556379c
URL:            https://github.com/caronc/%{pypi_name}
556379c
Source0:        %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
556379c
# this patch allows version of requests that ships with RHEL v7 to
556379c
# correctly handle test coverage.  It also removes reference to a
556379c
# extra check not supported in py.test in EPEL7 builds
556379c
Patch0:         %{pypi_name}-rhel7-support.patch
556379c
BuildArch:      noarch
556379c
556379c
%description %{common_description}
44b22bc
44b22bc
%if 0%{?with_python2}
556379c
%package -n python2-%{pypi_name}
44b22bc
Summary: A simple wrapper to many popular notification services used today
556379c
%{?python_provide:%python_provide python2-%{pypi_name}}
44b22bc
44b22bc
BuildRequires: python2-devel
44b22bc
BuildRequires: python-requests
44b22bc
BuildRequires: python2-requests-oauthlib
44b22bc
BuildRequires: python-six
44b22bc
BuildRequires: python2-click >= 5.0
44b22bc
BuildRequires: python-markdown
44b22bc
%if 0%{?rhel} && 0%{?rhel} <= 7
068c9ff
BuildRequires: python-cryptography
5adcaa4
BuildRequires: python-babel
44b22bc
BuildRequires: python-yaml
44b22bc
%else
068c9ff
BuildRequires: python2-cryptography
5adcaa4
BuildRequires: python2-babel
44b22bc
BuildRequires: python2-yaml
d732271
%endif
44b22bc
44b22bc
Requires: python-requests
44b22bc
Requires: python2-requests-oauthlib
44b22bc
Requires: python-six
44b22bc
Requires: python-markdown
44b22bc
%if 0%{?rhel} && 0%{?rhel} <= 7
59c892d
Requires: python-cryptography
5adcaa4
Requires: python-yaml
44b22bc
%else
59c892d
Requires: python2-cryptography
44b22bc
Requires: python2-yaml
d732271
%endif
44b22bc
44b22bc
%if %{with tests}
44b22bc
BuildRequires: python-mock
44b22bc
BuildRequires: python2-pytest-runner
44b22bc
BuildRequires: python2-pytest
44b22bc
d732271
%endif
44b22bc
556379c
%description -n python2-%{pypi_name} %{common_description}
d732271
%endif
44b22bc
556379c
%package -n %{pypi_name}
44b22bc
Summary: Apprise CLI Tool
44b22bc
44b22bc
%if 0%{?with_python3}
44b22bc
Requires: python%{python3_pkgversion}-click >= 5.0
556379c
Requires: python%{python3_pkgversion}-%{pypi_name} = %{version}-%{release}
d732271
%endif
44b22bc
44b22bc
%if 0%{?with_python2}
44b22bc
Requires: python2-click >= 5.0
556379c
Requires: python2-%{pypi_name} = %{version}-%{release}
d732271
%endif
44b22bc
556379c
%description -n %{pypi_name}
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}
556379c
%package -n python%{python3_pkgversion}-%{pypi_name}
44b22bc
Summary: A simple wrapper to many popular notification services used today
556379c
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
44b22bc
44b22bc
BuildRequires: python%{python3_pkgversion}-devel
38ee750
BuildRequires: python%{python3_pkgversion}-setuptools
44b22bc
BuildRequires: python%{python3_pkgversion}-requests
44b22bc
BuildRequires: python%{python3_pkgversion}-requests-oauthlib
44b22bc
BuildRequires: python%{python3_pkgversion}-six
44b22bc
BuildRequires: python%{python3_pkgversion}-click >= 5.0
44b22bc
BuildRequires: python%{python3_pkgversion}-markdown
4cde521
%if (0%{?rhel} && 0%{?rhel} >= 8) || (0%{?fedora} && 0%{?fedora} >= 35)
4cde521
# gntp isn't available from EPEL for RHEL/CentOS 8 or Fedora 35+
ad2ee40
%else
ad2ee40
# For all other distributions, include gntp
ad2ee40
BuildRequires: python%{python3_pkgversion}-gntp
ad2ee40
%endif
44b22bc
BuildRequires: python%{python3_pkgversion}-yaml
5adcaa4
BuildRequires: python%{python3_pkgversion}-babel
068c9ff
BuildRequires: python%{python3_pkgversion}-cryptography
44b22bc
Requires: python%{python3_pkgversion}-requests
44b22bc
Requires: python%{python3_pkgversion}-requests-oauthlib
44b22bc
Requires: python%{python3_pkgversion}-six
44b22bc
Requires: python%{python3_pkgversion}-markdown
59c892d
Requires: python%{python3_pkgversion}-cryptography
4cde521
%if (0%{?rhel} && 0%{?rhel} >= 8) || (0%{?fedora} && 0%{?fedora} >= 35)
4cde521
# gntp isn't available from EPEL for RHEL/CentOS 8 or Fedora 35+
ad2ee40
%else
ad2ee40
# For all other distributions, include gntp
ad2ee40
Requires: python%{python3_pkgversion}-gntp
ad2ee40
%endif
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
d732271
%endif
44b22bc
556379c
%description -n python%{python3_pkgversion}-%{pypi_name} %{common_description}
d732271
%endif
44b22bc
44b22bc
%prep
556379c
%setup -q -n %{pypi_name}-%{version}
44b22bc
%if 0%{?rhel} && 0%{?rhel} <= 7
44b22bc
# rhel7 older package work-arounds
44b22bc
%patch0 -p1
bf3d604
# rhel7 doesn't like the new asyncio syntax
bf3d604
rm -f apprise/py3compat/asyncio.py
9ddf210
# rhel7 doesn't support slixmpp and formatting in place
9ddf210
# within the dev-requirements.txt file to reference it
9ddf210
sed -i -e '/^slixmpp.*/d' dev-requirements.txt
d732271
%endif
44b22bc
44b22bc
%build
44b22bc
%if 0%{?with_python2}
44b22bc
%py2_build
d732271
%endif
44b22bc
%if 0%{?with_python3}
44b22bc
%py3_build
d732271
%endif
44b22bc
44b22bc
%install
44b22bc
%if 0%{?with_python2}
44b22bc
%py2_install
d732271
%endif
44b22bc
%if 0%{?with_python3}
44b22bc
%py3_install
d732271
%endif
44b22bc
556379c
install -p -D -T -m 0644 packaging/man/%{pypi_name}.1 \
ad2ee40
   %{buildroot}%{_mandir}/man1/%{pypi_name}.1
44b22bc
44b22bc
%if %{with tests}
44b22bc
%check
44b22bc
%if 0%{?with_python2}
44b22bc
LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{python2_sitelib} py.test
d732271
%endif
44b22bc
%if 0%{?with_python3}
44b22bc
LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version}
d732271
%endif
d732271
%endif
44b22bc
44b22bc
%if 0%{?with_python2}
556379c
%files -n python2-%{pypi_name}
44b22bc
%license LICENSE
44b22bc
%doc README.md
556379c
%{python2_sitelib}/%{pypi_name}
556379c
%exclude %{python2_sitelib}/%{pypi_name}/cli.*
44b22bc
%{python2_sitelib}/*.egg-info
d732271
%endif
44b22bc
44b22bc
%if 0%{?with_python3}
556379c
%files -n python%{python3_pkgversion}-%{pypi_name}
44b22bc
%license LICENSE
44b22bc
%doc README.md
556379c
%{python3_sitelib}/%{pypi_name}
556379c
%exclude %{python3_sitelib}/%{pypi_name}/cli.*
44b22bc
%{python3_sitelib}/*.egg-info
d732271
%endif
44b22bc
556379c
%files -n %{pypi_name}
556379c
%{_bindir}/%{pypi_name}
556379c
%{_mandir}/man1/%{pypi_name}.1*
44b22bc
44b22bc
%if 0%{?with_python3}
556379c
%{python3_sitelib}/%{pypi_name}/cli.*
d732271
%endif
44b22bc
44b22bc
%if 0%{?with_python2}
556379c
%{python2_sitelib}/%{pypi_name}/cli.*
d732271
%endif
44b22bc
44b22bc
%changelog
e09c0c0
* Sat Sep 18 2021 Chris Caron <lead2gold@gmail.com> - 0.9.5.1-2
e09c0c0
- Updated to v0.9.5.1
e09c0c0
e09c0c0
* Sat Sep 18 2021 Chris Caron <lead2gold@gmail.com> - 0.9.5-1
e09c0c0
- Updated to v0.9.5
e09c0c0
4cde521
* Wed Aug 11 2021 Chris Caron <lead2gold@gmail.com> - 0.9.4-1
4cde521
- Updated to v0.9.4
4cde521
8954f45
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-3
8954f45
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
8954f45
13e1404
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.9.3-2
13e1404
- Rebuilt for Python 3.10
13e1404
460e195
* Sun May 16 2021 Chris Caron <lead2gold@gmail.com> - 0.9.3-1
460e195
- Updated to v0.9.3
460e195
4773daa
* Sun May  2 2021 Chris Caron <lead2gold@gmail.com> - 0.9.2-1
4773daa
- Updated to v0.9.2
4773daa
59c892d
* Tue Feb 23 2021 Chris Caron <lead2gold@gmail.com> - 0.9.1-2
59c892d
- Added missing cryptography dependency
59c892d
9ddf210
* Tue Feb 23 2021 Chris Caron <lead2gold@gmail.com> - 0.9.1-1
9ddf210
- Updated to v0.9.1
9ddf210
9ddf210
-* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-3
9ddf210
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
61abe6f
babf0ac
* Thu Jan 14 2021 Chris Caron <lead2gold@gmail.com> - 0.9.0-2
babf0ac
- Fixed unit tests
babf0ac
bf4304a
* Wed Dec 30 2020 Chris Caron <lead2gold@gmail.com> - 0.9.0-1
bf4304a
- Updated to v0.9.0
bf4304a
421494d
* Sun Oct  4 2020 Chris Caron <lead2gold@gmail.com> - 0.8.9-1
421494d
- Updated to v0.8.9
421494d
bf3d604
* Wed Sep  2 2020 Chris Caron <lead2gold@gmail.com> - 0.8.8-1
bf3d604
- Updated to v0.8.8
bf3d604
ad2ee40
* Thu Aug 13 2020 Chris Caron <lead2gold@gmail.com> - 0.8.7-1
ad2ee40
- Updated to v0.8.7
ad2ee40
068c9ff
* Mon Aug 03 2020 Chris Caron <lead2gold@gmail.com> - 0.8.6-4
068c9ff
- Updated SPEC so Fedora 33 Mass Rebuild would pass
068c9ff
0f43960
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-3
0f43960
- Second attempt - Rebuilt for
0f43960
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
0f43960
a51c3c7
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-2
a51c3c7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
a51c3c7
b18eede
* Sat Jun 13 2020 Chris Caron <lead2gold@gmail.com> - 0.8.6-1
b18eede
- Updated to v0.8.6
b18eede
5cc24ee
* Tue May 26 2020 Miro HronĨok <mhroncok@redhat.com> - 0.8.5-2
5cc24ee
- Rebuilt for Python 3.9
5cc24ee
e10bdf1
* Mon Mar 30 2020 Chris Caron <lead2gold@gmail.com> - 0.8.5-1
e10bdf1
- Updated to v0.8.5
e10bdf1
e520cc6
* Sat Feb  1 2020 Chris Caron <lead2gold@gmail.com> - 0.8.4-1
e520cc6
- Updated to v0.8.4
e520cc6
46e9311
* Sun Jan 12 2020 Chris Caron <lead2gold@gmail.com> - 0.8.3-1
46e9311
- Updated to v0.8.3
46e9311
d732271
* Mon Nov 25 2019 Chris Caron <lead2gold@gmail.com> - 0.8.2-1
d732271
- Updated to v0.8.2
d732271
2998c28
* Sun Oct 13 2019 Chris Caron <lead2gold@gmail.com> - 0.8.1-1
2998c28
- Updated to v0.8.1
2998c28
db4b54a
* Fri Sep 20 2019 Chris Caron <lead2gold@gmail.com> - 0.8.0-1
db4b54a
- Updated to v0.8.0
d65d8bf
369b126
* Fri Jul 19 2019 Chris Caron <lead2gold@gmail.com> - 0.7.9-1
369b126
- Updated to v0.7.9
369b126
a9d99b5
* Thu Jun  6 2019 Chris Caron <lead2gold@gmail.com> - 0.7.8-1
a9d99b5
- Updated to v0.7.8
a9d99b5
5adcaa4
* Fri May 31 2019 Chris Caron <lead2gold@gmail.com> - 0.7.7-1
5adcaa4
- Updated to v0.7.7
5adcaa4
556379c
* Tue Apr 16 2019 Chris Caron <lead2gold@gmail.com> - 0.7.6-1
556379c
- Updated to v0.7.6
556379c
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
556379c
  to accomodate some valid points brought forth. These have already been pushed
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