# Copyright 2020 Chris Caron # # This is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any later # version. # # This file is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along # with this file. If not, see http://www.gnu.org/licenses/. ############################################################################### # Author: Chris Caron # http://nuxref.com/2014/07/15/a-usenet-solution-centos-6/ %global common_description %{expand: \ Provides a wrapper that can be integrated with NZBGet and/or SABnzbd allowing you to notify just about anything using a series of supported services such as KODI (XBMC), Prowl, Growl, PushBullet, NotifyMyAndroid, Toasty, Pushalot, Boxcar, Faast, Twiiter, and PushJet. It supports pushing information as an HTTP POST request to structured as either a JSON or XML (SOAP structure) message. It can also just support sending simple emails notifications too.} Packager: Chris Caron Vendor: http://nuxref.com Summary: A notification plugin for NZBGet and/or SABnzbd Group: Administration/Resources Name: nzb-notify Version: 1.0.0 License: GPLv3 Release: 1%{?dist} Source: https://github.com/caronc/nzb-notify/archive/v%{version}.tar.gz URL: http://nzbget.net/forum/viewtopic.php?f=8&t=1639 BuildArch: noarch %description %{common_description} %package -n nzbget-script-notify Group: Applications/System Summary: Provides notify plugin for NZBGet BuildArch: noarch BuildRequires: findutils %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python2-devel Requires: python-six Requires: python-nzbget Requires: python-apprise Requires: python-ordereddict Requires: python-chardet %else BuildRequires: python%{python3_pkgversion}-devel Requires: python%{python3_pkgversion}-six Requires: python%{python3_pkgversion}-apprise Requires: python%{python3_pkgversion}-chardet %endif Requires: nzbget >= 13 %description -n nzbget-script-notify Notification support for NZBGet %package -n sabnzbd-script-notify Group: Applications/System Summary: Provides notify plugin for SABnzbd BuildArch: noarch %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python2-devel Requires: sabnzbd >= 2.2.0 Requires: python-six Requires: python-nzbget Requires: python-apprise Requires: python-ordereddict # gntp is used for growl notifications Requires: python-gntp Requires: python-chardet %else BuildRequires: python%{python3_pkgversion}-devel Requires: sabnzbd >= 3.0.0 Requires: python%{python3_pkgversion}-six Requires: python%{python3_pkgversion}-apprise Requires: python%{python3_pkgversion}-gntp Requires: python%{python3_pkgversion}-chardet %endif Requires: python-nzbget >= 0.6.1 Requires: python-chardet Requires: python-six Requires: python-apprise Requires: python-markdown # gntp is used for growl notifications Requires: python-gntp Requires: python-ordereddict %description -n sabnzbd-script-notify Notification support for SABnzbd %prep %setup -q -n nzb-notify-%{version} # Tidy %if 0%{?rhel} && 0%{?rhel} <= 7 find -type f -name '*.py' \ -exec sed -i -e 's|#!\(/usr\)\?/bin/python[23]\?|#!/usr/bin/python2|g' {} \; find -type f -name '*.py' \ -exec sed -i -e 's|#!\(/usr\)\?/bin/env python[23]\?|#!/usr/bin/python2|g' {} \; %else find -type f -name '*.py' \ -exec sed -i -e 's|#!\(/usr\)\?/bin/python[23]\?|#!/usr/bin/python3|g' {} \; find -type f -name '*.py' \ -exec sed -i -e 's|#!\(/usr\)\?/bin/env python[23]\?|#!/usr/bin/python3|g' {} \; %endif # Enforce permissions find -type d -exec chmod 755 {} \; %build # patch sabnzbd notify to reference sed -i -e 's|^\(NOTIFY_SCRIPT[ \t]*\)=.*$|\1= "%{_datadir}/sabnzbd/notifications/Notify.py"|g' sabnzbd-notify.py %install %{__rm} -rf %{buildroot} %{__install} -Dp -m 0755 Notify.py \ %{buildroot}%{_datadir}/nzbget/scripts/Notify.py %{__mkdir} -p %{buildroot}%{_datadir}/sabnzbd/notifications %{__mkdir} -p %{buildroot}%{_datadir}/sabnzbd/scripts %{__cp} -af Notify %{buildroot}%{_datadir}/nzbget/scripts %{__rm} -rf %{buildroot}%{_datadir}/nzbget/scripts/Notify/sabnzbd # SABnzbd %{__install} -Dp -m 0755 sabnzbd-notify.py \ %{buildroot}%{_datadir}/sabnzbd/scripts/Notify.py %{__mv} Notify %{buildroot}%{_datadir}/sabnzbd/notifications %{__install} -Dp -m 0755 Notify.py \ %{buildroot}%{_datadir}/sabnzbd/notifications/Notify.py %clean %{__rm} -rf %{buildroot} %files -n nzbget-script-notify %doc LICENSE README.md %{_datadir}/nzbget/scripts/Notify %{_datadir}/nzbget/scripts/Notify.py* %files -n sabnzbd-script-notify %doc LICENSE README.md %{_datadir}/sabnzbd/notifications/Notify %{_datadir}/sabnzbd/notifications/Notify.py* %{_datadir}/sabnzbd/scripts/Notify.py* %changelog * Wed Aug 31 2022 Chris Caron 1.0.0-1 - Updated to v1.0.0 - Dropped gntp requirement * Sat Sep 5 2020 Chris Caron 0.9.4-1 - Updated to v0.9.4 * Tue Mar 13 2018 Chris Caron 0.9.0-1 - Updated to v0.9.0 * Sun Oct 29 2017 Chris Caron 0.7.0-1 - Updated to v0.7.0 * Tue Jul 11 2017 Chris Caron 0.6.1-1 - Updated to v0.6.1 * Wed Jul 5 2017 Chris Caron 0.6.0-1 - Updated to v0.6.0 * Tue Oct 18 2016 Chris Caron 0.5.5-1 - Updated to v0.5.5 - Added SABnzb support * Wed Aug 10 2016 Chris Caron 0.5.0-1 - Updated to v0.5.0 * Thu Jul 30 2015 Chris Caron 0.3.0-1 - Updated to v0.3.0 * Wed Jul 1 2015 Chris Caron 0.2.0-1 - Initial release