summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Dray2015-05-28 13:07:38 +1000
committerJustin Dray2015-05-28 13:07:38 +1000
commit295bc8d6792179b3872ecdd43cd9464e6245610b (patch)
tree32809ff69ea4fdaabf3192b5c9e7703483adee26
downloadaur-295bc8d6792179b3872ecdd43cd9464e6245610b.tar.gz
Cleaned up organization for arch packages in prep for aur4
-rw-r--r--.SRCINFO34
-rw-r--r--PKGBUILD48
-rw-r--r--sonarr.install27
-rw-r--r--sonarr.service13
-rwxr-xr-xsonarr.sh2
5 files changed, 124 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8d940819cd01
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,34 @@
+pkgbase = sonarr-develop
+ pkgdesc = PVR for newsgroup users. Formerly known as NZBDrone, with added torrent support.
+ pkgver = 2.0.0.2597
+ pkgrel = 1
+ url = http://www.sonarr.tv
+ install = sonarr.install
+ arch = any
+ license = GPL3
+ depends = mono
+ depends = libmediainfo
+ depends = sqlite
+ optdepends = sabnzbd: an NZB downloader
+ optdepends = nzbget: an NZB downloader
+ optdepends = transmission: a torrent downloader
+ optdepends = deluge: a torrent downloader
+ provides = nzbdrone
+ provides = nzbdrone-torrents
+ provides = sonarr
+ conflicts = nzbdrone
+ conflicts = nzbdrone-torrents
+ conflicts = sonarr
+ replaces = nzbdrone
+ replaces = nzbdrone-torrents
+ source = http://update.sonarr.tv/v2/develop/mono/NzbDrone.develop.tar.gz
+ source = sonarr.sh
+ source = sonarr.service
+ source = sonarr.install
+ md5sums = SKIP
+ md5sums = a7490c3f8d6c3a314b59f87f71086f1f
+ md5sums = 41d8663e989a8db1fc4c6b81187a4d48
+ md5sums = 6413a3db424de8d85a320c9e60ecac14
+
+pkgname = sonarr-develop
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6a37de3dd74e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Justin Dray <justin@dray.be>
+# Maintainer: Daniel Egeberg <daniel.egeberg@gmail.com>
+pkgname="sonarr-develop"
+pkgver=2.0.0.2597
+pkgrel=1
+pkgdesc="PVR for newsgroup users. Formerly known as NZBDrone, with added torrent support."
+arch=(any)
+url="http://www.sonarr.tv"
+license=('GPL3')
+depends=('mono' 'libmediainfo' 'sqlite')
+optdepends=('sabnzbd: an NZB downloader'
+ 'nzbget: an NZB downloader'
+ 'transmission: a torrent downloader'
+ 'deluge: a torrent downloader')
+install='sonarr.install'
+provides=('nzbdrone' 'nzbdrone-torrents' 'sonarr')
+conflicts=('nzbdrone' 'nzbdrone-torrents' 'sonarr')
+replaces=('nzbdrone' 'nzbdrone-torrents')
+changelog=
+source=("http://update.sonarr.tv/v2/develop/mono/NzbDrone.develop.tar.gz"
+ "sonarr.sh"
+ "sonarr.service"
+ "sonarr.install")
+noextract=()
+md5sums=(SKIP
+ 'a7490c3f8d6c3a314b59f87f71086f1f'
+ '41d8663e989a8db1fc4c6b81187a4d48'
+ '6413a3db424de8d85a320c9e60ecac14')
+
+pkgver() {
+ curl -Ss http://update.sonarr.tv/v2/develop/mono/ | awk 'match($0, "NzbDrone.develop.(2.[0-9.]*)\\.mono", ary) {print ary[1]}' | tail -n1
+}
+
+package() {
+ cd "$srcdir"
+
+ install -d -m 755 "${pkgdir}/var/lib/sonarr"
+
+ msg2 "Install Sonarr in /usr/lib"
+ install -d -m 755 "${pkgdir}/usr/lib/sonarr"
+ cp -dpr --no-preserve=ownership "${srcdir}/NzbDrone/"* "${pkgdir}/usr/lib/sonarr"
+
+ msg2 "Install executable into /usr/bin"
+ install -D -m755 "${srcdir}/sonarr.sh" "${pkgdir}/usr/bin/sonarr"
+
+ msg2 "Install sonarr.service"
+ install -D -m 644 "${srcdir}/sonarr.service" "${pkgdir}/usr/lib/systemd/system/sonarr.service"
+}
diff --git a/sonarr.install b/sonarr.install
new file mode 100644
index 000000000000..1bbd6ea51675
--- /dev/null
+++ b/sonarr.install
@@ -0,0 +1,27 @@
+post_install() {
+ if grep -q "^sonarr" /etc/group &> /dev/null ; then
+ groupmod -n sonarr sonarr &> /dev/null
+ else
+ groupadd -r sonarr &> /dev/null
+ fi
+ if grep -q "^sonarr:" /etc/passwd 2> /dev/null ; then
+ usermod -s /bin/false -c "Sonarr daemon" -d /var/lib/sonarr -g sonarr sonarr &> /dev/null
+ else
+ useradd -s /bin/false -c "Sonarr daemon user" -d /var/lib/sonarr -g sonarr -r sonarr &> /dev/null
+ fi
+
+ chown -R sonarr: /var/lib/sonarr
+ if [[ ! -f /var/lib/sonarr/config.xml ]]
+ then
+ if [[ -f /var/lib/nzbdrone/config.xml ]]
+ then
+ echo "A previous installation of nzbdrone has been detected. Copying previous configuration to Sonarr"
+ cp /var/lib/nzbdrone/* /var/lib/sonarr
+ fi
+ fi
+}
+
+post_upgrade() {
+ post_install $1
+}
+
diff --git a/sonarr.service b/sonarr.service
new file mode 100644
index 000000000000..8783aae48403
--- /dev/null
+++ b/sonarr.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Sonarr Service
+After=network.target
+
+[Service]
+User=sonarr
+Group=sonarr
+ExecStart=/usr/bin/sonarr -nobrowser -data=/var/lib/sonarr
+Type=simple
+TimeoutStopSec=20
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sonarr.sh b/sonarr.sh
new file mode 100755
index 000000000000..1b1e91d58f79
--- /dev/null
+++ b/sonarr.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec mono /usr/lib/sonarr/NzbDrone.exe "$@"