summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Webster2020-04-20 10:19:18 -0700
committerDonald Webster2020-04-27 12:44:47 -0700
commitaa50ed8c734ad61a614a1a3b6d9276f027b93612 (patch)
tree0cd44b2f10ab024fa824a857cb3ebfe22335b237
parent1ccb3fc6d2c0fc3872b29d75938cc3a6acfd7c66 (diff)
downloadaur-aa50ed8c734ad61a614a1a3b6d9276f027b93612.tar.gz
Move to python3 version of sabnzbd and switch to /usr/lib and /var/lib.
-rw-r--r--.SRCINFO50
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD97
-rw-r--r--addnzb.sh4
-rw-r--r--nzb.pngbin6298 -> 0 bytes
-rw-r--r--sab2_64.pngbin2745 -> 0 bytes
-rw-r--r--sabnzbd-shell3
-rw-r--r--sabnzbd.confd8
-rwxr-xr-xsabnzbd.desktop11
-rw-r--r--sabnzbd.install69
-rw-r--r--sabnzbd.pngbin5724 -> 0 bytes
-rw-r--r--sabnzbd.service3
-rw-r--r--sabnzbd.sysusers1
-rw-r--r--sabnzbd.tmpfiles4
-rw-r--r--sabnzbd@.service24
-rw-r--r--x-nzb.xml10
16 files changed, 116 insertions, 174 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3696bd9a8c52..ca07c7d0d3c1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,45 +1,43 @@
pkgbase = sabnzbd-git
pkgdesc = A web-interface based binary newsgrabber with NZB file support
- pkgver = 2.3.8RC1.r213.g1671ca5e
+ pkgver = r7169.fba38a88
pkgrel = 1
url = http://www.sabnzbd.org
- install = sabnzbd.install
arch = any
license = GPL
- makedepends = git
depends = curl
depends = par2cmdline
- depends = python2
- depends = python2-cheetah
- depends = python2-sabyenc
+ depends = python
+ depends = python-six
+ depends = python-cryptography
+ depends = python-feedparser
+ depends = python-configobj
+ depends = python-cherrypy
+ depends = python-portend
+ depends = python-chardet
+ depends = python-notify2
+ depends = python-cheetah3
+ depends = python-sabyenc3
depends = sqlite
depends = unrar
depends = unzip
- optdepends = xdg-utils: registration of .nzb files
- optdepends = python2-feedparser: rss support
- optdepends = python2-pyopenssl: ssl support
+ optdepends = python-pygobject: tray icon
+ optdepends = python-pyopenssl: ssl support
optdepends = par2cmdline-tbb: par2 multi-threading
+ optdepends = p7zip: for .7z support
+ provides = sabnzbd
conflicts = sabnzbd
- backup = etc/conf.d/sabnzbd
- backup = opt/sabnzbd/sabnzbd.ini
+ backup = var/lib/sabnzbd/sabnzbd.ini
source = sabnzbd::git://github.com/sabnzbd/sabnzbd.git
- source = sabnzbd-shell
- source = sabnzbd.desktop
- source = addnzb.sh
- source = nzb.png
- source = sabnzbd.png
- source = x-nzb.xml
source = sabnzbd.service
- source = sabnzbd.confd
+ source = sabnzbd@.service
+ source = sabnzbd.sysusers
+ source = sabnzbd.tmpfiles
sha256sums = SKIP
- sha256sums = 82630edfc767a383843ffaae9d716e99010dad9e93bdee08d541faa74e694a65
- sha256sums = 887f93942b78c0475009b1ce84b502c28e273c222451a4736cd4c37ff5454f04
- sha256sums = 30ffff8b9c00e91358cd6c5dca89f9d9f8f12843e7b3c44c6d5b0f09b0ea424a
- sha256sums = ef8f4fb1a3a0750c74b7addd302ab8733187ad370b5d27336afb2677d7154571
- sha256sums = fce3e065d017ce3bc4548a766f25c95f982af4f6085263c72f3000f49d810409
- sha256sums = f53261d7578c67fb9fd6a639df94cd53604bcf37b9b03a926cb03e5214b496fe
- sha256sums = 3de9c07d7731a9756a60691c56897b1cb0c802c5eb510a7bb68b9e1c82d7102c
- sha256sums = 8462203454d488b5d4f7beb85e61da2efa42d3dffa465f3bf16a95abe0bc7c0a
+ sha256sums = 6c7edcce9f93916521a71ae12d787894b97ed22dde371b72eb2618e5fd7ca967
+ sha256sums = c9e7f2de422db5bdb9d6bf9e03300b8ac91d9b117295870bc6124e6733aaf67a
+ sha256sums = 525f294372963fde09db08b0368c80078a16d4cefcb34f8179706336709afdf7
+ sha256sums = 3a3c292020cca0251478c70a6499afa64aeca3dfcb6d5e32f6e21d5d4d94fa81
pkgname = sabnzbd-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..6a689fec44d4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*.xz
+*.gz
+*.log
+/src/
+/pkg/
+/sabnzbd/
diff --git a/PKGBUILD b/PKGBUILD
index 83e159bd1f63..6c47b9aba989 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,55 +1,68 @@
-
-# Maintainer: boosterdev@linuxmail.org
-# Contributer: Ben Ruijl <benruyl@gmail.com> (sabnzbd)
+# Maintainer: Donald Webster <fryfrog@gmail.com>
pkgname=sabnzbd-git
-pkgver=2.3.8RC1.r213.g1671ca5e
+pkgver=r7169.fba38a88
pkgrel=1
-pkgdesc="A web-interface based binary newsgrabber with NZB file support"
-url="http://www.sabnzbd.org"
-arch=("any")
-license=("GPL")
-depends=("curl" "par2cmdline" "python2" "python2-cheetah" "python2-sabyenc" "sqlite" "unrar" "unzip")
-optdepends=("xdg-utils: registration of .nzb files" "python2-feedparser: rss support" "python2-pyopenssl: ssl support" "par2cmdline-tbb: par2 multi-threading")
-makedepends=('git')
+pkgdesc='A web-interface based binary newsgrabber with NZB file support'
+url='http://www.sabnzbd.org'
+arch=('any')
+license=('GPL')
+depends=('curl'
+ 'par2cmdline'
+ 'python'
+ 'python-six'
+ 'python-cryptography'
+ 'python-feedparser'
+ 'python-configobj'
+ 'python-cherrypy'
+ 'python-portend'
+ 'python-chardet'
+ 'python-notify2'
+ 'python-cheetah3'
+ 'python-sabyenc3'
+ 'sqlite'
+ 'unrar'
+ 'unzip')
+
+optdepends=('python-pygobject: tray icon'
+ 'python-pyopenssl: ssl support'
+ 'par2cmdline-tbb: par2 multi-threading'
+ 'p7zip: for .7z support')
+
+provides=('sabnzbd')
conflicts=('sabnzbd')
-install="sabnzbd.install"
-backup=("etc/conf.d/sabnzbd" "opt/sabnzbd/sabnzbd.ini")
+
+backup=('var/lib/sabnzbd/sabnzbd.ini')
source=("${pkgname%-git}::git://github.com/sabnzbd/sabnzbd.git"
- "${pkgname%-git}-shell" "sabnzbd.desktop" "addnzb.sh" "nzb.png" "sabnzbd.png" "x-nzb.xml" "sabnzbd.service" "sabnzbd.confd")
+ 'sabnzbd.service'
+ 'sabnzbd@.service'
+ 'sabnzbd.sysusers'
+ 'sabnzbd.tmpfiles')
+
sha256sums=('SKIP'
- '82630edfc767a383843ffaae9d716e99010dad9e93bdee08d541faa74e694a65'
- '887f93942b78c0475009b1ce84b502c28e273c222451a4736cd4c37ff5454f04'
- '30ffff8b9c00e91358cd6c5dca89f9d9f8f12843e7b3c44c6d5b0f09b0ea424a'
- 'ef8f4fb1a3a0750c74b7addd302ab8733187ad370b5d27336afb2677d7154571'
- 'fce3e065d017ce3bc4548a766f25c95f982af4f6085263c72f3000f49d810409'
- 'f53261d7578c67fb9fd6a639df94cd53604bcf37b9b03a926cb03e5214b496fe'
- '3de9c07d7731a9756a60691c56897b1cb0c802c5eb510a7bb68b9e1c82d7102c'
- '8462203454d488b5d4f7beb85e61da2efa42d3dffa465f3bf16a95abe0bc7c0a')
+ '6c7edcce9f93916521a71ae12d787894b97ed22dde371b72eb2618e5fd7ca967'
+ 'c9e7f2de422db5bdb9d6bf9e03300b8ac91d9b117295870bc6124e6733aaf67a'
+ '525f294372963fde09db08b0368c80078a16d4cefcb34f8179706336709afdf7'
+ '3a3c292020cca0251478c70a6499afa64aeca3dfcb6d5e32f6e21d5d4d94fa81')
pkgver() {
cd "${pkgname%-git}"
- git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+ #git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
- cd "${pkgname%-git}"
- install -d -m755 "${pkgdir}/opt/${pkgname%-git}"
- touch "${pkgdir}/opt/${pkgname%-git}/${pkgname%-git}.ini"
- cp -r "${srcdir}/${pkgname%-git}/"* "${pkgdir}/opt/${pkgname%-git}"
-
- # Fix for issues with Python 3
- find "${pkgdir}/opt/${pkgname%-git}" -type f -exec sed -i 's/python/python2/g' {} \;
- find "${pkgdir}/opt/${pkgname%-git}" -type d -exec chmod 755 {} \;
- find "${pkgdir}/opt/${pkgname%-git}" -type f -exec chmod 644 {} \;
- chmod 755 "${pkgdir}/opt/${pkgname%-git}/SABnzbd.py"
-
- install -Dm755 "${srcdir}/${pkgname%-git}-shell" "${pkgdir}/usr/bin/${pkgname%-git}"
- install -Dm644 "${srcdir}/${pkgname%-git}.confd" "${pkgdir}/etc/conf.d/${pkgname%-git}"
- install -Dm644 "${srcdir}/${pkgname%-git}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname%-git}.service"
- install -Dm755 "${srcdir}/${pkgname%-git}.desktop" "${pkgdir}/usr/share/applications/${pkgname%-git}.desktop"
- install -Dm755 "${srcdir}/addnzb.sh" "${pkgdir}/opt/${pkgname%-git}/addnzb.sh"
- install -Dm644 "${srcdir}/nzb.png" "${pkgdir}/opt/${pkgname%-git}/nzb.png"
- install -Dm644 "${srcdir}/sabnzbd.png" "${pkgdir}/opt/${pkgname%-git}/sabnzbd.png"
- install -Dm644 "${srcdir}/x-nzb.xml" "${pkgdir}/opt/${pkgname%-git}/x-nzb.xml"
+ mkdir -p "${pkgdir}/usr/lib/sabnzbd"
+ mkdir -p "${pkgdir}/var/lib/sabnzbd"
+ touch "${pkgdir}/var/lib/sabnzbd/sabnzbd.ini"
+ cp -r "${srcdir}/sabnzbd/"* "${pkgdir}/usr/lib/sabnzbd"
+
+ find "${pkgdir}/usr/lib/sabnzbd" -type d -exec chmod 755 {} \;
+ find "${pkgdir}/usr/lib/sabnzbd" -type f -exec chmod 644 {} \;
+ chmod 755 "${pkgdir}/usr/lib/sabnzbd/SABnzbd.py"
+
+ install -D -m 644 "${srcdir}/sabnzbd.service" "${pkgdir}/usr/lib/systemd/system/sabnzbd.service"
+ install -D -m 644 "${srcdir}/sabnzbd@.service" "${pkgdir}/usr/lib/systemd/system/sabnzbd@.service"
+ install -D -m 644 "${srcdir}/sabnzbd.sysusers" "${pkgdir}/usr/lib/sysusers.d/sabnzbd.conf"
+ install -D -m 644 "${srcdir}/sabnzbd.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/sabnzbd.conf"
}
diff --git a/addnzb.sh b/addnzb.sh
deleted file mode 100644
index e3b60513382c..000000000000
--- a/addnzb.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-. /etc/conf.d/sabnzbd
-curl -s -F apikey="$API_KEY" -F mode="addfile" -F name=@"$1" $URL/sabnzbd/api &> /dev/null
diff --git a/nzb.png b/nzb.png
deleted file mode 100644
index f443c215e529..000000000000
--- a/nzb.png
+++ /dev/null
Binary files differ
diff --git a/sab2_64.png b/sab2_64.png
deleted file mode 100644
index 2c6290006300..000000000000
--- a/sab2_64.png
+++ /dev/null
Binary files differ
diff --git a/sabnzbd-shell b/sabnzbd-shell
deleted file mode 100644
index 0fa0d41ddddd..000000000000
--- a/sabnzbd-shell
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-python2 /opt/sabnzbd/SABnzbd.py -f ${HOME}/.sabnzbd.ini "${@}"
diff --git a/sabnzbd.confd b/sabnzbd.confd
deleted file mode 100644
index 389676c6196d..000000000000
--- a/sabnzbd.confd
+++ /dev/null
@@ -1,8 +0,0 @@
-# This file is used to make association of .nzb files with SABnzbd possible.
-# If you do not want this feature, you do no have to fill in these settings.
-
-# The SABnzbd url. Make sure to add a username and password if required
-URL="http://127.0.0.1:8080"
-
-# Put the API key from Config > General here
-API_KEY=""
diff --git a/sabnzbd.desktop b/sabnzbd.desktop
deleted file mode 100755
index 4ce54a2a515e..000000000000
--- a/sabnzbd.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env xdg-open
-[Desktop Entry]
-Type=Application
-Version=1.0
-Name=SABnzbd+
-GenericName=Binary Newsreader
-Icon=/opt/sabnzbd/sabnzbd.png
-Exec=sh /opt/sabnzbd/addnzb.sh %u
-Terminal=false
-Categories=Network
-MimeType=application/x-nzb
diff --git a/sabnzbd.install b/sabnzbd.install
deleted file mode 100644
index cf84a4790565..000000000000
--- a/sabnzbd.install
+++ /dev/null
@@ -1,69 +0,0 @@
-# Change these to modify the ownership of sabnzbd
-# If you change this here, you also have to change
-# the user and group in the systemd service file.
-SABNZBD_USER="sabnzbd"
-SABNZBD_GROUP="sabnzbd"
-
-SABNZBD_DIR="/opt/sabnzbd" # should not be changed
-
-## arg 1: the new package version
-post_install() {
- # add x-nzb mimetype
- if [[ -f /usr/bin/xdg-mime ]]; then
- xdg-mime install --mode system "${SABNZBD_DIR}/x-nzb.xml"
- xdg-icon-resource install --context mimetypes --size 256 "${SABNZBD_DIR}/nzb.png" application-x-nzb
- fi
-
- post_upgrade
-
- cat << "EOM"
-==> If you want to associate .nzb-files with SABnzbd, run 'xdg-mime default sabnzbd.desktop applications/x-nzb'
-EOM
-}
-
-## arg 1: the new package version
-## arg 2: the old package version
-pre_upgrade() {
- PID="$(pgrep -f SABnzbd.py)"
-
- if [ -n "${PID}" ];then
- systemctl stop sabnzbd.service
- fi
-}
-
-## arg 1: the new package version
-## arg 2: the old package version
-post_upgrade() {
- # if the group or user already exists, the request will be denied
- # and all original settings will be retained
- if [ "$SABNZBD_GROUP" == "sabnzbd" ]; then
- groupadd -r sabnzbd &> /dev/null
- fi
-
- if [ "$SABNZBD_USER" == "sabnzbd" ]; then
- useradd -s /sbin/nologin -c "SABnzbd user" -d "${SABNZBD_DIR}" \
- -g sabnzbd -r sabnzbd &> /dev/null
- fi
-
- chown -R "${SABNZBD_USER}:${SABNZBD_GROUP}" "${SABNZBD_DIR}"
-}
-
-## arg 1: the old package version
-pre_remove() {
- pre_upgrade
-
- if [[ -f /usr/bin/xdg-mime ]]; then
- xdg-mime uninstall --mode system "${SABNZBD_DIR}/x-nzb.xml"
- xdg-icon-resource uninstall --context mimetypes --size 256 application-x-nzb
- fi
-}
-
-## arg 1: the old package version
-post_remove() {
- # only delete if user is sabnzbd
- userdel sabnzbd &> /dev/null
- groupdel sabnzbd &> /dev/null || /bin/true
- echo "==> There may be some files left in ${SABNZBD_DIR}."
-}
-
-# vim:set ts=2 sw=2 et:
diff --git a/sabnzbd.png b/sabnzbd.png
deleted file mode 100644
index 5770c0a9f96c..000000000000
--- a/sabnzbd.png
+++ /dev/null
Binary files differ
diff --git a/sabnzbd.service b/sabnzbd.service
index 6806b9cef3d7..6f76271510a7 100644
--- a/sabnzbd.service
+++ b/sabnzbd.service
@@ -3,9 +3,10 @@ Description=SABnzbd binary newsreader
After=network.target
[Service]
-ExecStart=/opt/sabnzbd/SABnzbd.py -l0 -f /opt/sabnzbd/sabnzbd.ini
+ExecStart=/user/lib/sabnzbd/SABnzbd.py --logging 0 --config-file /var/lib/sabnzbd/sabnzbd.ini
User=sabnzbd
Group=sabnzbd
+SyslogIdentifier=sabnzbd
[Install]
WantedBy=multi-user.target
diff --git a/sabnzbd.sysusers b/sabnzbd.sysusers
new file mode 100644
index 000000000000..b41895c15467
--- /dev/null
+++ b/sabnzbd.sysusers
@@ -0,0 +1 @@
+u sabnzbd - "SABnzbd daemon" /var/lib/sabnzbd
diff --git a/sabnzbd.tmpfiles b/sabnzbd.tmpfiles
new file mode 100644
index 000000000000..493e976dda08
--- /dev/null
+++ b/sabnzbd.tmpfiles
@@ -0,0 +1,4 @@
+# Override this file with a modified version in /etc/tmpfiles.d/
+d /var/lib/sabnzbd 0755 sabnzbd sabnzbd
+Z /var/lib/sabnzbd - sabnzbd sabnzbd
+L /var/log/sabnzbd - - - - /var/lib/sabnzbd/logs/
diff --git a/sabnzbd@.service b/sabnzbd@.service
new file mode 100644
index 000000000000..3d4780d84885
--- /dev/null
+++ b/sabnzbd@.service
@@ -0,0 +1,24 @@
+# To start SABNzbd once for USER use:
+# systemctl start sabnzbd@USER.service
+#
+# To start SABNzbd on boot for USER use:
+# systemctl enable sabnzbd@USER.service
+#
+# Config will be placed in ~/.sabnzbd/
+
+[Unit]
+Description=SABnzbd binary newsreader
+Documentation=https://sabnzbd.org/wiki/
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+# Default location is ~/.sabnzbd/sabnzbd.ini, but package previously used ~/.sabnzbd.ini so default to that
+ExecStart=/usr/lib/sabnzbd/SABnzbd.py --logging 1 --browser 0 --config-file /home/%I/.sabnzbd.ini
+User=%I
+Group=%I
+Type=simple
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/x-nzb.xml b/x-nzb.xml
deleted file mode 100644
index e77d2841031d..000000000000
--- a/x-nzb.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
- <mime-type type="application/x-nzb">
-
- <comment xml:lang='en'>An XML-based file format for retrieving posts from NNTP (Usenet) servers</comment>
- <sub-class-of type="application/xml"/>
- <glob pattern="*.nzb"/>
-
- </mime-type>
-</mime-info>