summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Ruijl2015-06-13 15:20:09 +0200
committerBen Ruijl2015-06-13 15:20:09 +0200
commit31973ab722504a0e36bfd6a1ed35945282105802 (patch)
treead1f685bfd4628b26f5366c3984e3c2ef1157c6f
downloadaur-31973ab722504a0e36bfd6a1ed35945282105802.tar.gz
Initial import
-rw-r--r--.AURINFO43
-rw-r--r--.SRCINFO43
-rw-r--r--PKGBUILD48
-rw-r--r--addnzb.sh4
-rw-r--r--nzb-2.pngbin0 -> 2913 bytes
-rw-r--r--sab2_64.pngbin0 -> 2745 bytes
-rw-r--r--sabnzbd3
-rw-r--r--sabnzbd.confd8
-rw-r--r--sabnzbd.desktop10
-rw-r--r--sabnzbd.install69
-rw-r--r--sabnzbd.service11
-rw-r--r--x-nzb.xml10
12 files changed, 249 insertions, 0 deletions
diff --git a/.AURINFO b/.AURINFO
new file mode 100644
index 000000000000..6ccbf583a48d
--- /dev/null
+++ b/.AURINFO
@@ -0,0 +1,43 @@
+pkgbase = sabnzbd
+ pkgdesc = A web-interface based binary newsgrabber with NZB file support
+ pkgver = 0.7.20
+ pkgrel = 1
+ url = http://www.sabnzbd.org
+ install = sabnzbd.install
+ arch = any
+ license = GPL
+ depends = curl
+ depends = par2cmdline
+ depends = python2
+ depends = python2-cheetah
+ depends = python2-yenc
+ depends = sqlite
+ depends = unrar
+ depends = unzip
+ optdepends = xdg-utils: registration of .nzb files
+ optdepends = python2-feedparser: rss support
+ optdepends = python2-pyopenssl: ssl support
+ optdepends = par2cmdline-tbb: par2 multi-threading
+ backup = etc/conf.d/sabnzbd
+ backup = opt/sabnzbd/sabnzbd.ini
+ source = http://downloads.sourceforge.net/sabnzbdplus/SABnzbd-0.7.20-src.tar.gz
+ source = sabnzbd
+ source = sabnzbd.desktop
+ source = addnzb.sh
+ source = nzb-2.png
+ source = sab2_64.png
+ source = x-nzb.xml
+ source = sabnzbd.service
+ source = sabnzbd.confd
+ md5sums = 7972b2cdad0a3431262611c271ce5747
+ md5sums = 48d60a1c626503c7fef1bc5374390513
+ md5sums = f9bd5485072714b11f8c30a28024dc4d
+ md5sums = 69b9bcbcf67ff3e7a4cdd9f26e001341
+ md5sums = 2a49c07b1e3e6448eabe92644315f983
+ md5sums = fdc878dd0f6f25617e627b04409abbbd
+ md5sums = 11fb2cd1451e3725b08bfc2bd045be54
+ md5sums = 7da9222f3b86abfed590950f48dc2e77
+ md5sums = 8fc2607a7961fc643ef4f6640166322a
+
+pkgname = sabnzbd
+
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6ccbf583a48d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,43 @@
+pkgbase = sabnzbd
+ pkgdesc = A web-interface based binary newsgrabber with NZB file support
+ pkgver = 0.7.20
+ pkgrel = 1
+ url = http://www.sabnzbd.org
+ install = sabnzbd.install
+ arch = any
+ license = GPL
+ depends = curl
+ depends = par2cmdline
+ depends = python2
+ depends = python2-cheetah
+ depends = python2-yenc
+ depends = sqlite
+ depends = unrar
+ depends = unzip
+ optdepends = xdg-utils: registration of .nzb files
+ optdepends = python2-feedparser: rss support
+ optdepends = python2-pyopenssl: ssl support
+ optdepends = par2cmdline-tbb: par2 multi-threading
+ backup = etc/conf.d/sabnzbd
+ backup = opt/sabnzbd/sabnzbd.ini
+ source = http://downloads.sourceforge.net/sabnzbdplus/SABnzbd-0.7.20-src.tar.gz
+ source = sabnzbd
+ source = sabnzbd.desktop
+ source = addnzb.sh
+ source = nzb-2.png
+ source = sab2_64.png
+ source = x-nzb.xml
+ source = sabnzbd.service
+ source = sabnzbd.confd
+ md5sums = 7972b2cdad0a3431262611c271ce5747
+ md5sums = 48d60a1c626503c7fef1bc5374390513
+ md5sums = f9bd5485072714b11f8c30a28024dc4d
+ md5sums = 69b9bcbcf67ff3e7a4cdd9f26e001341
+ md5sums = 2a49c07b1e3e6448eabe92644315f983
+ md5sums = fdc878dd0f6f25617e627b04409abbbd
+ md5sums = 11fb2cd1451e3725b08bfc2bd045be54
+ md5sums = 7da9222f3b86abfed590950f48dc2e77
+ md5sums = 8fc2607a7961fc643ef4f6640166322a
+
+pkgname = sabnzbd
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..284af2bce882
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+pkgname=sabnzbd
+_pkgname=SABnzbd
+pkgver=0.7.20
+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-yenc"
+ "sqlite" "unrar" "unzip")
+optdepends=("xdg-utils: registration of .nzb files" "python2-feedparser: rss support" "python2-pyopenssl: ssl support" "par2cmdline-tbb: par2 multi-threading")
+install="${pkgname}.install"
+backup=("etc/conf.d/sabnzbd" "opt/${pkgname}/${pkgname}.ini")
+source=("http://downloads.sourceforge.net/sabnzbdplus/${_pkgname}-${pkgver}-src.tar.gz"
+ "${pkgname}" "${pkgname}.desktop" "addnzb.sh" "nzb-2.png" "sab2_64.png" "x-nzb.xml" "${pkgname}.service" "${pkgname}.confd")
+md5sums=('7972b2cdad0a3431262611c271ce5747'
+ '48d60a1c626503c7fef1bc5374390513'
+ 'f9bd5485072714b11f8c30a28024dc4d'
+ '69b9bcbcf67ff3e7a4cdd9f26e001341'
+ '2a49c07b1e3e6448eabe92644315f983'
+ 'fdc878dd0f6f25617e627b04409abbbd'
+ '11fb2cd1451e3725b08bfc2bd045be54'
+ '7da9222f3b86abfed590950f48dc2e77'
+ '8fc2607a7961fc643ef4f6640166322a')
+
+package() {
+ mkdir -p "${pkgdir}/opt/${pkgname}"
+ touch "${pkgdir}/opt/${pkgname}/${pkgname}.ini"
+ cp -rv "${srcdir}/${_pkgname}-${pkgver}/"* "${pkgdir}/opt/${pkgname}"
+
+ # Fix for issues with Python 3
+ find "${pkgdir}/opt/${pkgname}" -type f -exec sed -i 's/python/python2/g' {} \;
+ find "${pkgdir}/opt/${pkgname}" -type d -exec chmod 755 {} \;
+ find "${pkgdir}/opt/${pkgname}" -type f -exec chmod 644 {} \;
+ chmod 755 "${pkgdir}/opt/${pkgname}/${_pkgname}.py"
+ chmod 755 "${pkgdir}/opt/${pkgname}/Sample-PostProc.sh"
+
+ install -Dm755 "${srcdir}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm644 "${srcdir}/${pkgname}.confd" "${pkgdir}/etc/conf.d/${pkgname}"
+ install -Dm644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+ install -Dm755 "${srcdir}/${pkgname}.desktop" \
+ "${pkgdir}/usr/share/applications/${pkgname}.desktop"
+ install -Dm755 "${srcdir}/addnzb.sh" "${pkgdir}/opt/${pkgname}/addnzb.sh"
+ install -Dm644 "${srcdir}/nzb-2.png" "${pkgdir}/opt/${pkgname}/nzb-2.png"
+ install -Dm644 "${srcdir}/sab2_64.png" "${pkgdir}/opt/${pkgname}/sab2_64.png"
+ install -Dm770 "${srcdir}/x-nzb.xml" "${pkgdir}/opt/${pkgname}/x-nzb.xml"
+}
diff --git a/addnzb.sh b/addnzb.sh
new file mode 100644
index 000000000000..e3b60513382c
--- /dev/null
+++ b/addnzb.sh
@@ -0,0 +1,4 @@
+#!/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-2.png b/nzb-2.png
new file mode 100644
index 000000000000..53adbf66f9f6
--- /dev/null
+++ b/nzb-2.png
Binary files differ
diff --git a/sab2_64.png b/sab2_64.png
new file mode 100644
index 000000000000..2c6290006300
--- /dev/null
+++ b/sab2_64.png
Binary files differ
diff --git a/sabnzbd b/sabnzbd
new file mode 100644
index 000000000000..0fa0d41ddddd
--- /dev/null
+++ b/sabnzbd
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+python2 /opt/sabnzbd/SABnzbd.py -f ${HOME}/.sabnzbd.ini "${@}"
diff --git a/sabnzbd.confd b/sabnzbd.confd
new file mode 100644
index 000000000000..389676c6196d
--- /dev/null
+++ b/sabnzbd.confd
@@ -0,0 +1,8 @@
+# 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
new file mode 100644
index 000000000000..a040f368d608
--- /dev/null
+++ b/sabnzbd.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Application
+Version=1.0
+Name=SABnzbd+
+GenericName=Binary Newsreader
+Icon=/opt/sabnzbd/sab2_64.png
+Exec=sh /opt/sabnzbd/addnzb.sh %u
+Terminal=false
+Categories=Network
+MimeType=application/x-nzb
diff --git a/sabnzbd.install b/sabnzbd.install
new file mode 100644
index 000000000000..d2a16ea965d4
--- /dev/null
+++ b/sabnzbd.install
@@ -0,0 +1,69 @@
+# 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 64 "${SABNZBD_DIR}/nzb-2.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 64 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.service b/sabnzbd.service
new file mode 100644
index 000000000000..436bbd216d9a
--- /dev/null
+++ b/sabnzbd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=SABnzbd binary newsreader
+After=network.target
+
+[Service]
+ExecStart=/opt/sabnzbd/SABnzbd.py -l0
+User=sabnzbd
+Group=sabnzbd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/x-nzb.xml b/x-nzb.xml
new file mode 100644
index 000000000000..e77d2841031d
--- /dev/null
+++ b/x-nzb.xml
@@ -0,0 +1,10 @@
+<?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>