summaryrefslogtreecommitdiff
path: root/net-nntp/sabnzbd/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-nntp/sabnzbd/files
reinit the tree, so we can have metadata
Diffstat (limited to 'net-nntp/sabnzbd/files')
-rw-r--r--net-nntp/sabnzbd/files/patches/0001-use-system-configobj.patch28
-rw-r--r--net-nntp/sabnzbd/files/patches/0002-use-system-feedparser.patch34
-rw-r--r--net-nntp/sabnzbd/files/patches/0003-cfg-disable-NtfOSD-by-default.patch25
-rw-r--r--net-nntp/sabnzbd/files/sabnzbd.confd6
-rw-r--r--net-nntp/sabnzbd/files/sabnzbd.ini14
-rwxr-xr-xnet-nntp/sabnzbd/files/sabnzbd.initd71
-rw-r--r--net-nntp/sabnzbd/files/sabnzbd_at.service10
7 files changed, 188 insertions, 0 deletions
diff --git a/net-nntp/sabnzbd/files/patches/0001-use-system-configobj.patch b/net-nntp/sabnzbd/files/patches/0001-use-system-configobj.patch
new file mode 100644
index 000000000000..0f89dcd13414
--- /dev/null
+++ b/net-nntp/sabnzbd/files/patches/0001-use-system-configobj.patch
@@ -0,0 +1,28 @@
+From db9a217dd5a02b5be72d47b7618f877f39cb31bc Mon Sep 17 00:00:00 2001
+From: Justin Bronder <jsbronder@gmail.com>
+Date: Mon, 13 Feb 2017 18:20:39 -0500
+Subject: [PATCH 1/3] use system configobj
+
+---
+ sabnzbd/config.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/sabnzbd/config.py b/sabnzbd/config.py
+index 2f58ffd..04bfaab 100644
+--- a/sabnzbd/config.py
++++ b/sabnzbd/config.py
+@@ -30,9 +30,10 @@ from hashlib import md5
+ from urlparse import urlparse
+ import sabnzbd.misc
+ from sabnzbd.constants import CONFIG_VERSION, NORMAL_PRIORITY, DEFAULT_PRIORITY, MAX_WIN_DFOLDER
+-from sabnzbd.utils import configobj
+ from sabnzbd.decorators import synchronized
+
++import configobj
++
+ CONFIG_LOCK = threading.Lock()
+ SAVE_CONFIG_LOCK = threading.Lock()
+
+--
+2.13.0
+
diff --git a/net-nntp/sabnzbd/files/patches/0002-use-system-feedparser.patch b/net-nntp/sabnzbd/files/patches/0002-use-system-feedparser.patch
new file mode 100644
index 000000000000..68e39a975e7e
--- /dev/null
+++ b/net-nntp/sabnzbd/files/patches/0002-use-system-feedparser.patch
@@ -0,0 +1,34 @@
+From b8540c4c71e917623290f3ca8d4091228fab8903 Mon Sep 17 00:00:00 2001
+From: Justin Bronder <jsbronder@gmail.com>
+Date: Mon, 13 Feb 2017 18:21:28 -0500
+Subject: [PATCH 2/3] use system feedparser
+
+---
+ sabnzbd/rss.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sabnzbd/rss.py b/sabnzbd/rss.py
+index 0315fca..18ac828 100644
+--- a/sabnzbd/rss.py
++++ b/sabnzbd/rss.py
+@@ -25,6 +25,8 @@ import time
+ import datetime
+ import threading
+
++import feedparser
++
+ import sabnzbd
+ from sabnzbd.constants import RSS_FILE_NAME, DEFAULT_PRIORITY, NORMAL_PRIORITY, DUP_PRIORITY
+ from sabnzbd.decorators import synchronized
+@@ -35,8 +37,6 @@ from sabnzbd.misc import cat_convert, wildcard_to_re, cat_to_opts, \
+ import sabnzbd.emailer as emailer
+ from sabnzbd.encoding import unicoder, xml_name
+
+-import sabnzbd.utils.feedparser as feedparser
+-
+ __RSS = None # Global pointer to RSS-scanner instance
+
+
+--
+2.13.0
+
diff --git a/net-nntp/sabnzbd/files/patches/0003-cfg-disable-NtfOSD-by-default.patch b/net-nntp/sabnzbd/files/patches/0003-cfg-disable-NtfOSD-by-default.patch
new file mode 100644
index 000000000000..064d523a1e1e
--- /dev/null
+++ b/net-nntp/sabnzbd/files/patches/0003-cfg-disable-NtfOSD-by-default.patch
@@ -0,0 +1,25 @@
+From 459111cb4f6937d58de480cf06743474f5c1dd3d Mon Sep 17 00:00:00 2001
+From: Justin Bronder <jsbronder@gmail.com>
+Date: Sat, 5 Aug 2017 17:38:03 -0400
+Subject: [PATCH 3/3] cfg: disable NtfOSD by default
+
+---
+ sabnzbd/cfg.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sabnzbd/cfg.py b/sabnzbd/cfg.py
+index d8867db..59a341c 100644
+--- a/sabnzbd/cfg.py
++++ b/sabnzbd/cfg.py
+@@ -322,7 +322,7 @@ acenter_prio_queue_done = OptionBool('acenter', 'acenter_prio_queue_done', True)
+ acenter_prio_other = OptionBool('acenter', 'acenter_prio_other', False)
+
+ # [ntfosd]
+-ntfosd_enable = OptionBool('ntfosd', 'ntfosd_enable', not sabnzbd.WIN32 and not sabnzbd.DARWIN)
++ntfosd_enable = OptionBool('ntfosd', 'ntfosd_enable', False)
+ ntfosd_cats = OptionList('ntfosd', 'ntfosd_cats', ['*'])
+ ntfosd_prio_startup = OptionBool('ntfosd', 'ntfosd_prio_startup', True)
+ ntfosd_prio_download = OptionBool('ntfosd', 'ntfosd_prio_download', False)
+--
+2.13.0
+
diff --git a/net-nntp/sabnzbd/files/sabnzbd.confd b/net-nntp/sabnzbd/files/sabnzbd.confd
new file mode 100644
index 000000000000..c949355ec708
--- /dev/null
+++ b/net-nntp/sabnzbd/files/sabnzbd.confd
@@ -0,0 +1,6 @@
+SABNZBD_CONFIGFILE="/etc/sabnzbd/sabnzbd.ini"
+SABNZBD_USER="sabnzbd"
+SABNZBD_GROUP="sabnzbd"
+
+# 0 - error/warnings, 1 - info, 2 - debug
+SABNZBD_LOGGING="1"
diff --git a/net-nntp/sabnzbd/files/sabnzbd.ini b/net-nntp/sabnzbd/files/sabnzbd.ini
new file mode 100644
index 000000000000..c5ff04854e15
--- /dev/null
+++ b/net-nntp/sabnzbd/files/sabnzbd.ini
@@ -0,0 +1,14 @@
+__version__ = 19
+[misc]
+log_dir = /var/log/sabnzbd
+admin_dir = /var/lib/sabnzbd/admin
+cache_dir = /var/lib/sabnzbd/cache
+complete_dir = /var/lib/sabnzbd/complete
+download_dir = /var/lib/sabnzbd/download
+dirscan_dir = /var/lib/sabnzbd/dirscan
+nzb_backup_dir = /var/lib/sabnzbd/backup
+auto_browser = 0
+host = ::
+port = 8080
+[growl]
+growl_enable = 0
diff --git a/net-nntp/sabnzbd/files/sabnzbd.initd b/net-nntp/sabnzbd/files/sabnzbd.initd
new file mode 100755
index 000000000000..b3dca9797562
--- /dev/null
+++ b/net-nntp/sabnzbd/files/sabnzbd.initd
@@ -0,0 +1,71 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PIDFILE="/run/sabnzbd/sabnzbd.pid"
+
+depend() {
+ need net
+}
+
+get_var() {
+ grep -P -o -m 1 "(?<=^${1} = ).*" "${SABNZBD_CONFIGFILE}" || echo 0
+}
+
+start() {
+ ebegin "Starting SABnzbd"
+
+ checkpath -q -d -o ${SABNZBD_USER}:${SABNZBD_GROUP} -m 0770 "$(dirname "${PIDFILE}")"
+
+ start-stop-daemon \
+ --quiet \
+ --start \
+ --user ${SABNZBD_USER} \
+ --group ${SABNZBD_GROUP} \
+ --pidfile "${PIDFILE}" \
+ --wait 1000 \
+ --exec /usr/share/sabnzbd/SABnzbd.py \
+ -- \
+ --config-file "${SABNZBD_CONFIGFILE}" \
+ --logging "${SABNZBD_LOGGING}" \
+ --daemon \
+ --pidfile "${PIDFILE}"
+
+ eend $?
+}
+
+stop() {
+ local protocol="http"
+ local host="$(get_var "host")"
+ local port="$(get_var "port")"
+
+ if [ $(get_var "enable_https") -eq 1 ]; then
+ protocol="https"
+ port="$(get_var "https_port")"
+ fi
+
+ case "${host}" in
+ *:*) host="[${host}]" ;;
+ esac
+
+ local url="${protocol}://${host}:${port}/sabnzbd/api?mode=shutdown"
+
+ if [ $(get_var "disable_api_key") -eq 0 ]; then
+ url="${url}&apikey=$(get_var "api_key")"
+ fi
+
+ local signals="TERM/1/KILL/1"
+
+ ebegin "Stopping SABnzbd"
+
+ if [ "$(wget -o /dev/null -t 1 -O - -T 10 "${url}")" = "ok" ]; then
+ signals="NULL/5/${signals}"
+ fi
+
+ start-stop-daemon \
+ --stop \
+ --pidfile "${PIDFILE}" \
+ --retry "${signals}"
+
+ eend $?
+}
diff --git a/net-nntp/sabnzbd/files/sabnzbd_at.service b/net-nntp/sabnzbd/files/sabnzbd_at.service
new file mode 100644
index 000000000000..e9fdc4a35de3
--- /dev/null
+++ b/net-nntp/sabnzbd/files/sabnzbd_at.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=SABnzbd binary newsreader
+
+[Service]
+ExecStart=/usr/share/sabnzbd/SABnzbd.py --logging 1 --browser 0
+User=%I
+Group=%I
+
+[Install]
+WantedBy=multi-user.target