summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Johnsen2015-02-19 20:47:41 +0100
committerLars Johnsen2015-02-23 01:46:21 +0100
commit027a91ff1dd2545cfa4cd7a3dddff5abeac26f7d (patch)
treedc6e9d1945f914cf4d1d2056c7f752cb7ea417c0
downloadaur-027a91ff1dd2545cfa4cd7a3dddff5abeac26f7d.tar.gz
Initial
-rw-r--r--.SRCINFO30
-rwxr-xr-xPKGBUILD78
-rwxr-xr-xsonarr.install18
-rwxr-xr-xsonarr.service13
-rwxr-xr-xsonarr.sh2
5 files changed, 141 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e19e9fae818e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+# Generated by makepkg 4.2.1
+# Mon Feb 23 00:46:00 UTC 2015
+pkgbase = sonarr-git
+ pkgdesc = Smart PVR for newsgroup and bittorrent users
+ pkgver = 2.0.0.r6032
+ pkgrel = 1
+ url = https://sonarr.tv
+ install = sonarr.install
+ arch = any
+ license = GPL3
+ makedepends = git
+ makedepends = nodejs
+ depends = mono
+ depends = libmediainfo
+ depends = sqlite
+ provides = sonarr
+ conflicts = sonarr
+ conflicts = sonarr-develop
+ options = !strip
+ source = git://github.com/Sonarr/Sonarr.git#branch=develop
+ source = sonarr.sh
+ source = sonarr.service
+ source = sonarr.install
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+
+pkgname = sonarr-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100755
index 000000000000..3fe1b26d1d48
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,78 @@
+_gitname="Sonarr"
+_gitver="2.0.0"
+_gitbranch="develop"
+pkgname="sonarr-git"
+pkgver=2.0.0.r6032
+pkgrel=1
+pkgdesc="Smart PVR for newsgroup and bittorrent users"
+arch=(any)
+url="https://sonarr.tv"
+license=('GPL3')
+depends=('mono' 'libmediainfo' 'sqlite')
+makedepends=('git' 'nodejs')
+install='sonarr.install'
+provides=('sonarr')
+conflicts=('sonarr' 'sonarr-develop')
+options=('!strip')
+source=("git://github.com/Sonarr/Sonarr.git#branch=${_gitbranch}"
+ "sonarr.sh"
+ "sonarr.service"
+ "sonarr.install")
+md5sums=(SKIP
+ SKIP
+ SKIP
+ SKIP)
+
+pkgver() {
+ cd "${_gitname}"
+
+ # FIXME May deviate from actual version
+ printf "${_gitver}.r%s" "$(git rev-list --count HEAD)"
+}
+
+prepare() {
+ cd "${_gitname}"
+
+ # XXX Git for some reason complains if identity is not already set
+ git config user.email "you@example.com"
+ git config user.name "Your Name"
+
+ msg2 "Rebasing using pull request (https://github.com/Sonarr/Sonarr/pull/202)"
+ git fetch origin pull/202/head:XBuild-support
+ git rebase --onto XBuild-support "origin/${_gitbranch}" --force-rebase --ignore-whitespace
+}
+
+build() {
+ cd "${_gitname}"
+
+ npm install
+ fakeroot mozroots --import --machine --sync
+ MONO_IOMAP=case xbuild src/NzbDrone.sln /t:Configuration=Release /t:Build
+ node node_modules/gulp/bin/gulp.js build
+}
+
+package() {
+ msg2 "Remove native Windows binaries"
+ find "${_gitname}/_output/" \( \
+ -name "ServiceUninstall.*" \
+ -o -name "ServiceInstall.*" \
+ -o -name "sqlite3.*" \
+ -o -name "MediaInfo.*" \
+ -o -name "NzbDrone.Windows.*" \
+ \) -type f -delete
+
+ msg2 "Replacing main executable with console variant"
+ mv -f "${_gitname}/_output/NzbDrone.Console.exe" "${_gitname}/_output/NzbDrone.exe"
+
+ install -d -m 755 "${pkgdir}/var/lib/sonarr"
+
+ msg2 "Install Sonarr in /usr/lib"
+ install -d -m 755 "${pkgdir}/usr/lib"
+ mv -f "${_gitname}/_output/" "${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 100755
index 000000000000..5344af733148
--- /dev/null
+++ b/sonarr.install
@@ -0,0 +1,18 @@
+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
+}
+
+post_upgrade() {
+ post_install $1
+}
diff --git a/sonarr.service b/sonarr.service
new file mode 100755
index 000000000000..3b72565b9416
--- /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
+Type=simple
+TimeoutStopSec=20
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sonarr.sh b/sonarr.sh
new file mode 100755
index 000000000000..9f53b9ceb048
--- /dev/null
+++ b/sonarr.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec -a sonarr -- mono /usr/lib/sonarr/NzbDrone.exe "$@"