summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Webster2020-04-29 08:27:17 -0700
committerDonald Webster2020-04-29 08:27:42 -0700
commitcc9bcf839b20482b8b53eadfc430dc5190fe4712 (patch)
treecca9eb9b100b9f7ac45bf575e64aca378dab1371
downloadaur-cc9bcf839b20482b8b53eadfc430dc5190fe4712.tar.gz
Initial version of an sabnzbd-desktop package.
-rw-r--r--.SRCINFO23
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD36
-rw-r--r--addnzb.sh4
-rw-r--r--nzb.pngbin0 -> 6298 bytes
-rw-r--r--sab2_64.pngbin0 -> 2745 bytes
-rw-r--r--sabnzbd.confd8
-rwxr-xr-xsabnzbd.desktop11
-rw-r--r--sabnzbd.install22
-rw-r--r--sabnzbd.pngbin0 -> 5724 bytes
-rw-r--r--x-nzb.xml10
11 files changed, 119 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..88f746ee890a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = sabnzbd-desktop
+ pkgdesc = Desktop tools for sabnzbd.
+ pkgver = 1.0
+ pkgrel = 1
+ install = sabnzbd.install
+ arch = any
+ license = GPL
+ optdepends = sabnzbd: usenet downloader
+ source = sabnzbd.desktop
+ source = sabnzbd.confd
+ source = addnzb.sh
+ source = nzb.png
+ source = sabnzbd.png
+ source = x-nzb.xml
+ sha256sums = 887f93942b78c0475009b1ce84b502c28e273c222451a4736cd4c37ff5454f04
+ sha256sums = 8462203454d488b5d4f7beb85e61da2efa42d3dffa465f3bf16a95abe0bc7c0a
+ sha256sums = 30ffff8b9c00e91358cd6c5dca89f9d9f8f12843e7b3c44c6d5b0f09b0ea424a
+ sha256sums = ef8f4fb1a3a0750c74b7addd302ab8733187ad370b5d27336afb2677d7154571
+ sha256sums = fce3e065d017ce3bc4548a766f25c95f982af4f6085263c72f3000f49d810409
+ sha256sums = f53261d7578c67fb9fd6a639df94cd53604bcf37b9b03a926cb03e5214b496fe
+
+pkgname = sabnzbd-desktop
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..6e570bc49abe
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*.xz
+*.gz
+*.log
+/src/
+/pkg/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a70520a030e0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,36 @@
+# Maintainer: Donald Webster <fryfrog@gmail.com>
+
+pkgname=sabnzbd-desktop
+pkgver=1.0
+pkgrel=1
+pkgdesc='Desktop tools for sabnzbd.'
+arch=('any')
+license=('GPL')
+
+optdepends=('sabnzbd: usenet downloader')
+
+install='sabnzbd.install'
+
+source=('sabnzbd.desktop'
+ 'sabnzbd.confd'
+ 'addnzb.sh'
+ 'nzb.png'
+ 'sabnzbd.png'
+ 'x-nzb.xml')
+
+sha256sums=('887f93942b78c0475009b1ce84b502c28e273c222451a4736cd4c37ff5454f04'
+ '8462203454d488b5d4f7beb85e61da2efa42d3dffa465f3bf16a95abe0bc7c0a'
+ '30ffff8b9c00e91358cd6c5dca89f9d9f8f12843e7b3c44c6d5b0f09b0ea424a'
+ 'ef8f4fb1a3a0750c74b7addd302ab8733187ad370b5d27336afb2677d7154571'
+ 'fce3e065d017ce3bc4548a766f25c95f982af4f6085263c72f3000f49d810409'
+ 'f53261d7578c67fb9fd6a639df94cd53604bcf37b9b03a926cb03e5214b496fe')
+
+package() {
+ mkdir -p "${pkgdir}/usr/lib/sabnzbd-desktop"
+ install -D -m 644 "${srcdir}/sabnzbd.confd" "${pkgdir}/etc/conf.d/sabnzbd"
+ install -D -m 755 "${srcdir}/sabnzbd.desktop" "${pkgdir}/usr/share/applications/sabnzbd.desktop"
+ install -D -m 755 "${srcdir}/addnzb.sh" "${pkgdir}/usr/lib/sabnzbd-desktop/addnzb.sh"
+ install -D -m 644 "${srcdir}/nzb.png" "${pkgdir}/usr/lib/sabnzbd-desktop/nzb.png"
+ install -D -m 644 "${srcdir}/sabnzbd.png" "${pkgdir}/usr/lib/sabnzbd-desktop/sabnzbd.png"
+ install -D -m 770 "${srcdir}/x-nzb.xml" "${pkgdir}/usr/lib/sabnzbd-desktop/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.png b/nzb.png
new file mode 100644
index 000000000000..f443c215e529
--- /dev/null
+++ b/nzb.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.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 100755
index 000000000000..4ce54a2a515e
--- /dev/null
+++ b/sabnzbd.desktop
@@ -0,0 +1,11 @@
+#!/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
new file mode 100644
index 000000000000..e7b32837f235
--- /dev/null
+++ b/sabnzbd.install
@@ -0,0 +1,22 @@
+## arg 1: the new package version
+post_install() {
+ # add x-nzb mimetype
+ if [[ -f /usr/bin/xdg-mime ]]; then
+ xdg-mime install --mode system "/usr/lib/sabnzbd-desktop/x-nzb.xml"
+ xdg-icon-resource install --context mimetypes --size 256 "/usr/lib/sabnzbd-desktop/nzb.png" application-x-nzb
+ fi
+
+ cat << "EOM"
+==> If you want to associate .nzb-files with SABnzbd, run 'xdg-mime default sabnzbd.desktop applications/x-nzb'
+EOM
+}
+
+## arg 1: the old package version
+pre_remove() {
+ if [[ -f /usr/bin/xdg-mime ]]; then
+ xdg-mime uninstall --mode system "/usr/lib/sabnzbd-desktop/x-nzb.xml"
+ xdg-icon-resource uninstall --context mimetypes --size 256 application-x-nzb
+ fi
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/sabnzbd.png b/sabnzbd.png
new file mode 100644
index 000000000000..5770c0a9f96c
--- /dev/null
+++ b/sabnzbd.png
Binary files differ
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>