# 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/. ############################################################################### # # Visit: http://nuxref.com # Name: sabnzbd Version: 3.1.1 Release: 1%{?dist}.nuxref Summary: Python based Usenet Downloader Group: System Environment/Daemons License: GPLv2+ URL: http://sabnzbd.org Source0: http://github.com/sabnzbd/sabnzbd/releases/download/%{version}/SABnzbd-%{version}-src.tar.gz Source1: sabnzbd.systemd Source2: sabnzbd.conf Source3: sabnzbd.xml Source4: sabnzbd-secure.xml Packager: Chris Caron http://nuxref.com BuildArch: noarch BuildRequires: systemd %if 0%{?fedora} >= 30 BuildRequires: systemd-rpm-macros %endif Requires: python%{python3_pkgversion}-six Requires: python%{python3_pkgversion}-cheetah Requires: python%{python3_pkgversion}-cryptography Requires: python%{python3_pkgversion}-feedparser Requires: python%{python3_pkgversion}-configobj Requires: python%{python3_pkgversion}-cheroot Requires: python%{python3_pkgversion}-cherrypy Requires: python%{python3_pkgversion}-portend Requires: python%{python3_pkgversion}-chardet Requires: python%{python3_pkgversion}-notify2 Requires: python%{python3_pkgversion}-sabyenc >= 4.0.2 Requires: openssl Requires: ca-certificates Requires: systemd Requires: unrar, p7zip, par2cmdline Requires: systemd %description SABnzbd automates the downloads of NZB Files %prep #%setup -q -n SABnzbd-%{version}%{release_candidate} %setup -q -n SABnzbd-%{version} # Update our systemd file sed -i -e 's|{_bindir}|%{_bindir}|g' %{SOURCE1} sed -i -e 's|{_localstatedir}|%{_localstatedir}|g' %{SOURCE1} sed -i -e 's|{_sysconfdir}|%{_sysconfdir}|g' %{SOURCE1} sed -i -e 's|{_sharedstatedir}|%{_sharedstatedir}|g' %{SOURCE1} sed -i -e 's|{_datadir}|%{_datadir}|g' %{SOURCE1} # Update our configuration file sed -i -e 's|{_bindir}|%{_bindir}|g' %{SOURCE2} sed -i -e 's|{_localstatedir}|%{_localstatedir}|g' %{SOURCE2} sed -i -e 's|{_sysconfdir}|%{_sysconfdir}|g' %{SOURCE2} sed -i -e 's|{_sharedstatedir}|%{_sharedstatedir}|g' %{SOURCE2} sed -i -e 's|{_datadir}|%{_datadir}|g' %{SOURCE2} # Tidy 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' {} \; sed -i -e 's|#!/bin/sh|#!/usr/bin/sh|g' scripts/Sample-PostProc.sh # Enforce permissions find -type d -exec chmod 755 {} \; %clean %{__rm} -rf %{buildroot} %install %{__rm} -rf %{buildroot} %{__mkdir} -p %{buildroot}%{_datadir}/%{name} %{__mv} -f sabnzbd %{buildroot}%{_datadir}/%{name} %{__mv} -f po %{buildroot}%{_datadir}/%{name} %{__mv} -f locale %{buildroot}%{_datadir}/%{name} %{__mv} -f interfaces %{buildroot}%{_datadir}/%{name} %{__mv} -f icons %{buildroot}%{_datadir}/%{name} %{__mv} -f tools %{buildroot}%{_datadir}/%{name} %{__mv} -f email %{buildroot}%{_datadir}/%{name}/email # Firewalld Support %{__install} -D -m 644 %{SOURCE3} \ %{buildroot}/%{_sysconfdir}/firewalld/services/sabnzbd.xml %{__install} -D -m 644 %{SOURCE4} \ %{buildroot}/%{_sysconfdir}/firewalld/services/sabnzbd-secure.xml %{__install} -D -m 755 SABnzbd.py \ %{buildroot}/%{_datadir}/%{name}/SABnzbd.py %{__install} -D -m 755 scripts/Sample-PostProc.sh \ %{buildroot}/%{_datadir}/%{name}/scripts/Sample-PostProc.sh %{__install} -D -m 755 scripts/Sample-PostProc.py \ %{buildroot}/%{_datadir}/%{name}/scripts/Sample-PostProc.py %{__install} -D -m 755 scripts/Deobfuscate.py \ %{buildroot}/%{_datadir}/%{name}/scripts/Deobfuscate.py # Create a global configuration file from sample already # tailored from patch1 %{__install} -D -m 644 %{SOURCE1} \ %{buildroot}%{_unitdir}/sabnzbd.service %{__install} -D -m 664 %{SOURCE2} \ %{buildroot}%{_sysconfdir}/%{name}/sabnzbd.conf %{__mkdir} -p %{buildroot}%{_sharedstatedir}/%{name}/incomplete %{__mkdir} -p %{buildroot}%{_sharedstatedir}/%{name}/complete %{__mkdir} -p %{buildroot}%{_sharedstatedir}/%{name}/scan %{__mkdir} -p %{buildroot}%{_localstatedir}/log/%{name} %{__mkdir} -p %{buildroot}%{_sharedstatedir}/%{name}/admin %{__mkdir} -p %{buildroot}%{_sharedstatedir}/%{name}/email %{__mkdir} -p %{buildroot}%{_sharedstatedir}/%{name}/nzb_backups %files %doc COPYRIGHT.txt README.mkd LICENSE.txt ISSUES.txt INSTALL.txt GPL2.txt GPL3.txt %defattr(-, root, root) %attr(0775,root,sabnzbd) %dir %{_sysconfdir}/%{name} %attr(0660,sabnzbd,sabnzbd) %config(noreplace) %{_sysconfdir}/%{name}/sabnzbd.conf %attr(0775,sabnzbd,sabnzbd) %dir %{_sharedstatedir}/%{name}/incomplete %attr(0775,sabnzbd,sabnzbd) %dir %{_sharedstatedir}/%{name}/complete %attr(0755,sabnzbd,sabnzbd) %dir %{_sharedstatedir}/%{name}/scan %attr(0755,sabnzbd,sabnzbd) %dir %{_sharedstatedir}/%{name}/admin %attr(0755,sabnzbd,sabnzbd) %dir %{_sharedstatedir}/%{name}/email %attr(0775,sabnzbd,sabnzbd) %dir %{_sharedstatedir}/%{name}/nzb_backups %attr(0755,sabnzbd,sabnzbd) %dir %{_localstatedir}/log/%{name} %{_sysconfdir}/firewalld/services/sabnzbd.xml %{_sysconfdir}/firewalld/services/sabnzbd-secure.xml %{_unitdir}/sabnzbd.service %{_datadir}/%{name} %pre /usr/bin/id sabnzbd &>/dev/null || \ /usr/sbin/useradd -r \ -d %{_datadir}/%{name} -s /bin/sh -c "SABnzbd" sabnzbd || : %post %systemd_post sabnzbd.service %preun %systemd_preun sabnzbd.service %postun %systemd_postun_with_restart sabnzbd.service %changelog * Wed Dec 9 2020 Chris Caron - 3.1.1-1 - Upgraded to v3.1.1 * Wed Sep 9 2020 Chris Caron - 3.0.2-3 - Dropped dbus-python requirement * Sun Sep 6 2020 Chris Caron - 3.0.2-2 - Include systemd handling and updated secure port info * Thu Sep 3 2020 Chris Caron - 3.0.2-1 - Upgraded to Official release of v3.0.2 * Fri May 24 2019 Chris Caron - 2.3.9-1 - Upgraded to Official release of v2.3.9 * Sat May 11 2019 Chris Caron - 2.3.8-2 - Modified to work with Fedora 30 * Mon Mar 18 2019 Chris Caron - 2.3.8-1 - Upgraded to Official release of v2.3.8 * Sat Jan 26 2019 Chris Caron - 2.3.7-1 - Upgraded to Official release of v2.3.7 * Wed Dec 26 2018 Chris Caron - 2.3.6-1 - Upgraded to Official release of v2.3.6 * Thu Sep 6 2018 Chris Caron - 2.3.5-1 - Upgraded to Official release of v2.3.5 * Sun May 6 2018 Chris Caron - 2.3.3-1 - Upgraded to Official release of v2.3.3 * Fri Dec 22 2017 Chris Caron - 2.3.2-1 - Upgraded to Official release of v2.3.2 * Sun Oct 29 2017 Chris Caron - 2.3.1-1 - Upgraded to Official release of v2.3.1 * Thu Sep 21 2017 Chris Caron - 2.3.0-1 - Upgraded to Official release of v2.3.0 * Sat Aug 26 2017 Chris Caron - 2.2.1-1 - Upgraded to Official release of v2.2.1 - Added firewalld support * Thu Aug 17 2017 Chris Caron - 2.2.0-1 - Upgraded to Official release of v2.2.0 * Wed May 24 2017 Chris Caron - 2.0.1-1 - Upgraded to Official release of v2.0.1 * Sun Apr 9 2017 Chris Caron - 2.0.0-1 - Upgraded to Official release of v2.0.0 * Thu Apr 6 2017 Chris Caron - 2.0.0rc3-1 - Upgraded to v2.0.0rc3 * Wed Mar 29 2017 Chris Caron - 2.0.0rc2-1 - Upgraded to v2.0.0rc2 * Sat Mar 18 2017 Chris Caron - 1.2.3-1 - Upgraded to v1.2.3 * Fri Feb 24 2017 Chris Caron - 1.2.1-1 - Upgraded to v1.2.1 * Fri Jan 13 2017 Chris Caron - 1.2.0-1 - Upgraded to v1.2.0 * Fri Nov 11 2016 Chris Caron - 1.1.1-1 - Upgraded to v1.1.1 * Tue Oct 18 2016 Chris Caron - 1.1.0-1 - Initial Version