Initial sonarr & radarr ebuilds
authordweezil <bram.aelvoet@gmail.com>
Mon, 17 Jul 2017 14:07:19 +0000 (16:07 +0200)
committerdweezil <bram.aelvoet@gmail.com>
Mon, 17 Jul 2017 14:07:19 +0000 (16:07 +0200)
12 files changed:
net-nntp/radarr/Manifest [new file with mode: 0644]
net-nntp/radarr/files/radarr.conf [new file with mode: 0644]
net-nntp/radarr/files/radarr.init [new file with mode: 0644]
net-nntp/radarr/files/radarr.logrotate [new file with mode: 0644]
net-nntp/radarr/files/radarr.service [new file with mode: 0644]
net-nntp/radarr/radarr-0.2.0.778.ebuild [new file with mode: 0644]
net-nntp/sonarr/Manifest [new file with mode: 0644]
net-nntp/sonarr/files/sonarr.conf [new file with mode: 0644]
net-nntp/sonarr/files/sonarr.init [new file with mode: 0644]
net-nntp/sonarr/files/sonarr.logrotate [new file with mode: 0644]
net-nntp/sonarr/files/sonarr.service [new file with mode: 0644]
net-nntp/sonarr/sonarr-9999.ebuild [new file with mode: 0644]

diff --git a/net-nntp/radarr/Manifest b/net-nntp/radarr/Manifest
new file mode 100644 (file)
index 0000000..eca654f
--- /dev/null
@@ -0,0 +1,6 @@
+AUX radarr.conf 293 SHA256 085209f876fa5b1a734a994b4e137fe5f161d68976db50c0f95b1e6d1cce1304 SHA512 77c41c9da8a861e2c4fd7290308bde1f4d1bf2b44935299047f980630c8a4ebf0273a3e5de61d2cab327156e0bd78c4d4718f314a778a3345b2f6bb200469865 WHIRLPOOL 193616c476a1e3338e1bf053476a94a930a99759b29e074210675d12b121f0362c35c5c729bd1aa5ae0c03464571db29bddd17f430bf28a20a2cf4b26d473ba9
+AUX radarr.init 1178 SHA256 5df8b95e0e52f5aa73be0289c99fe06575c4ec04b00c4ad4f264e7f59e89288c SHA512 e541f8d03da22aa55dcbb83087d517b81053559962b9ddd55db737fccb816107c3868c4fcda67a12f2f9d2178e2fbcd6eff88ff2017fbbb349774d528ff60e41 WHIRLPOOL d0e017dd22b6f5b20fd5011987b0957f24722e1436b85e6b218f1bd26f5814dada4ba647c71ae89621bb4402d8c452b9b388930533d8a0f41195367eec5d6442
+AUX radarr.logrotate 201 SHA256 b273ab6e020e0ae8bb19df073cf3c1c71ecf7c4eaf0224a587c99b2df1b48a84 SHA512 6b09f41f636c28699803b6feb13a2d4c804cd1b904e7c7e9ee591bb8c681d76b0b4924f1b3ae6415bb09015abe89899c644fcf3ad5f47bc9780d01fe84fad26b WHIRLPOOL 93ceffc157e7e2a96392db6efd1dbe125186f1cacf0d7994323c01cae335fe34c23cb7e744203bbb5becc3193eab1dc1263bbd40f6f3b95760bca25324808a2e
+AUX radarr.service 277 SHA256 49524d3a5a16f0c8a3697ccc5d4e9a0445aa32e5eeae72a77cd9f092175b8345 SHA512 14c4bfb17b042f807347bd2d427aa373b4dbcc2887123974e334c8a445f80887d4d16590dbeda9e8168d778a4b8a3da7ccd73397937a838fd82d4a659ee01890 WHIRLPOOL 43f7c3e3cfcad3cc0b3180280731a00086a62194406cfbbd0927b2d25f793ed6e56bfb22c2a5f6ff2f0e0e6f410c0d6a5c86b4ee8a791060fbb4001fbf684ff8
+DIST Radarr.develop.0.2.0.778.linux.tar.gz 7148901 SHA256 2500cd1d42acb216c8c235aaa8c544c24e52a9aa85562bdeb2a369689bb68504 SHA512 29372f8e8fae4577289941c8950d0495a03bb29c5b6f9f65f2b754d726b3eaeaf5322fd11d8ca1075b2e8452d89f3b6876713f4f9b1605d3706eace47784b9b1 WHIRLPOOL bce2fb4c1636f216e76ae7705af8465c8c4cc23748d9ce3de5eb34dc6c9e9f19a634ac8dea25c4b30a22f2453763e86dfc836bb1d4cc361f82b979a5759c836c
+EBUILD radarr-0.2.0.778.ebuild 1233 SHA256 8f724f913bdb99071af8971f5d1583447503a29b44d55838866783d13d018e9e SHA512 fff68e8b80c1d7081899cdbc99ced14cbb803397b45ca78d937635ed7594ff8c67050d78b863dfd71105ccdb3e1c69eb59e92439c7a8f36ee0611b909a8a69e7 WHIRLPOOL bbb6a39acc795411dd119683054da468e16c5676151c577a752075a0ca70a29a142e39523d74076b956c86b0faac6503843cce40035ded4bbc07dd1a7fc8b5ea
diff --git a/net-nntp/radarr/files/radarr.conf b/net-nntp/radarr/files/radarr.conf
new file mode 100644 (file)
index 0000000..bbffed4
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Config file for radarr init script
+
+# User and group to run radarr as
+
+USER="radarr"
+
+GROUP="radarr"
+
+# Directory where Radarr is installed.
+
+APP_DIR="/usr/share/radarr"
diff --git a/net-nntp/radarr/files/radarr.init b/net-nntp/radarr/files/radarr.init
new file mode 100644 (file)
index 0000000..494b25e
--- /dev/null
@@ -0,0 +1,50 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+        need net
+}
+
+run_dir="/var/run/radarr"
+pidfile="$run_dir/radarr.pid"
+etc_dir="/etc/radarr"
+log_dir="/var/log/radarr"
+log_file="radarr.log"
+program="$APP_DIR/Radarr.exe"
+bin=`which mono`
+
+check_config() {
+    
+    if [ ! -d "${run_dir}" ]; then
+            mkdir "${run_dir}"
+    fi
+
+    # Permission stuff. Should ensure that the daemon user always have write permissions.
+    # Quick and ugly but should get the job done.
+
+    chown -R ${USER}:${GROUP} "${run_dir}"
+    chown -R ${USER}.${GROUP} "${etc_dir}"
+    if [ "${WEBUPDATER}" = "YES" ]; then
+                chown -R ${USER}.${GROUP} "${CODE_DIR}"
+        fi
+}
+
+start() {
+    check_config
+
+        ebegin "Starting radarr"
+
+        start-stop-daemon --start --background --make-pidfile --pidfile ${pidfile}\
+        -u ${USER} -g ${GROUP}\
+    --exec ${bin} ${program} -- \
+    --daemon --log=${log_dir}/${log_file} 
+        eend $?
+}
+
+stop() {
+        ebegin "Stopping radarr"
+        start-stop-daemon --stop --pidfile ${pidfile} --retry 15
+        eend $?
+}
diff --git a/net-nntp/radarr/files/radarr.logrotate b/net-nntp/radarr/files/radarr.logrotate
new file mode 100644 (file)
index 0000000..9553fbe
--- /dev/null
@@ -0,0 +1,8 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+/var/lib/radarr/.config/radarr/logs/*.log{
+    missingok
+    su radarr radarr
+}
diff --git a/net-nntp/radarr/files/radarr.service b/net-nntp/radarr/files/radarr.service
new file mode 100644 (file)
index 0000000..0c51487
--- /dev/null
@@ -0,0 +1,16 @@
+[Unit]
+Description=Radarr Daemon
+After=syslog.target network.target
+
+[Service]
+User=radarr
+Group=radarr
+
+Type=simple
+ExecStart=/usr/bin/mono --debug /usr/share/radarr/Radarr.exe -nobrowser
+TimeoutStopSec=20
+KillMode=process
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-nntp/radarr/radarr-0.2.0.778.ebuild b/net-nntp/radarr/radarr-0.2.0.778.ebuild
new file mode 100644 (file)
index 0000000..a29e005
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils user systemd
+#https://github.com/Radarr/Radarr/releases/download/v0.2.0.778/Radarr.develop.0.2.0.778.linux.tar.gz
+SRC_URI="https://github.com/Radarr/Radarr/releases/download/v${PV}/Radarr.develop.${PV}.linux.tar.gz"
+
+DESCRIPTION="A fork of Sonarr to work with movies à la Couchpotato.."
+HOMEPAGE="http://www.radarr.video"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+RDEPEND="
+       >=dev-lang/mono-3.12.1 
+       media-video/mediainfo 
+       dev-db/sqlite"
+MY_PN="Radarr"
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+    unpack ${A}
+    mv ${MY_PN} ${PN}
+}
+
+pkg_setup() {
+       enewgroup ${PN}
+       enewuser ${PN} -1 -1 /var/lib/radarr ${PN}
+}
+
+src_install() {
+       newconfd "${FILESDIR}/${PN}.conf" ${PN}
+       newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+       keepdir /var/lib/${PN}
+       fowners -R ${PN}:${PN} /var/lib/${PN}
+
+       insinto /etc/${PN}
+       insopts -m0660 -o ${PN} -g ${PN}
+
+       insinto /etc/logrotate.d
+       insopts -m0644 -o root -g root
+       newins "${FILESDIR}/${PN}.logrotate" ${PN}
+       
+       insinto "/usr/share/"
+       doins -r "${S}"
+
+       systemd_dounit "${FILESDIR}/radarr.service"
+       systemd_newunit "${FILESDIR}/radarr.service" "${PN}@.service"
+}
diff --git a/net-nntp/sonarr/Manifest b/net-nntp/sonarr/Manifest
new file mode 100644 (file)
index 0000000..db6e43e
--- /dev/null
@@ -0,0 +1,6 @@
+AUX sonarr.conf 293 SHA256 6c13198199e94af387abbc9686e2e87ec989afc5a97ba143035ffdf4d293e9c3 SHA512 5964c4ad66a130dee7b8cea6a7105ed033fb13eb30e3f31815e2d39367ea10eb418e69da5879cf1a721ea8bb7933faa21ce205a0dde8ed825bc1bce38d448d37 WHIRLPOOL 84d0a51e2b69058e7d46f954dd08a2be1e008fbe00fd937593f9849a9ede25fc5696d2bc2410f60a3b706738b242bc78c18ccbdaa95d8de01dad1ac8f4ce9182
+AUX sonarr.init 1180 SHA256 6fa09267c9970c0f4ba47dfcfdf32a64b72eb0923a23cc41934ea7bf8f770b58 SHA512 467baab5924d914718e140c958b0789e327bcffe06f89f37d73d93bbc760ef15fff863f27bcf83170f438aca2abf85a93a4101e6d0c80b9e2c8715ee9d6b4a94 WHIRLPOOL 0cf237728993e865f9ad23b51aecade7ebdbbe8d8a2d51facd4286d127b280c355a4ec79733a2bfb6c8882e14e08d3831870479b310409b544fbb3d6b48dbf6a
+AUX sonarr.logrotate 199 SHA256 7dc4e831b0b441d7a18872fda8771c034b3774817b6195b5535ce9540099cda5 SHA512 649c04f84179b9f64c6312cc92a88e98bacaa1662c49e8d46554ca574113255467c48862b517d7f345a28ab273eda1f525818d74fca73a5e6c07283a56f284dc WHIRLPOOL fea4e39d29f14e4ed0a4e62d27f47b48a8d44d194f32f9c1c1fb6485d628986cd2783486dda2d0fb1793db190e851db7c8902191379a94c62c4e77242e5bf24a
+AUX sonarr.service 332 SHA256 88868fcdadacd483bc88b12445eecf84fe4247da459b4e62ee6bd910ce864b32 SHA512 1db4537868de025d61b8650ea59f5cc14b59a6d1258a65ff2bb2b3fa4c255e3f76cb7d827d929ef06cdaa2f2c2dcd43aa5ffc1691301552e3219b8b00b38e2ab WHIRLPOOL 5765d7a7ead03cbeb3f5b2e2e5464b1788d7198e802db98a78764e207a1e7a7e0735beb210f88285c13d1ee2fe38e05c6f6c4e43424f300a1e4d0008a5f5567a
+DIST NzbDrone.master.tar.gz 6829634 SHA256 4c2c1c55ece465af5f19c3775866dec730ca71882ab099fffe596ca0bf0fb32a SHA512 5ff4292175c7608bcd0adc62a9400f9ff62f504ad41d8a45eead88d31572e8020eba72ca91c0a753681ce13a3e2d7d8c5292e540a6c8d479c5ce7ca2ece63a06 WHIRLPOOL a4b548905a6bf7bd6b4f736eff38a2c3e673a5820a4d5fcb018aba8f3595526378c1919b71e9274bda4e34aeac00b31972ebeea67c73e4a11c02159c386579a9
+EBUILD sonarr-9999.ebuild 1219 SHA256 2842c6682c474512909eb710aa72c38e82ba2660921f2b7a867ac8d6c9212c40 SHA512 48335280a9501c1d96d823c20972629b96408e044f6233d87e4ebebee5958bb4490f316f53c550ec91b391185973929bd290999bb91bc1cc4bfe4e28f2de0455 WHIRLPOOL 22a22ebdb7375e45f0372577bb8d4d0c1d2a7abd5935a8240fde9abceaeb25367525b2de77eeee6e52d0c06e7f5b153b7e05a0f7b0561b066b308c6d6793d1d5
diff --git a/net-nntp/sonarr/files/sonarr.conf b/net-nntp/sonarr/files/sonarr.conf
new file mode 100644 (file)
index 0000000..0e09077
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Config file for sonarr init script
+
+# User and group to run sonarr as
+
+USER="sonarr"
+
+GROUP="sonarr"
+
+# Directory where Sonarr is installed.
+
+APP_DIR="/usr/share/sonarr"
diff --git a/net-nntp/sonarr/files/sonarr.init b/net-nntp/sonarr/files/sonarr.init
new file mode 100644 (file)
index 0000000..a22e6bd
--- /dev/null
@@ -0,0 +1,50 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+        need net
+}
+
+run_dir="/var/run/sonarr"
+pidfile="$run_dir/sonarr.pid"
+etc_dir="/etc/sonarr"
+log_dir="/var/log/sonarr"
+log_file="sonarr.log"
+program="$APP_DIR/NzbDrone.exe"
+bin=`which mono`
+
+check_config() {
+    
+    if [ ! -d "${run_dir}" ]; then
+            mkdir "${run_dir}"
+    fi
+
+    # Permission stuff. Should ensure that the daemon user always have write permissions.
+    # Quick and ugly but should get the job done.
+
+    chown -R ${USER}:${GROUP} "${run_dir}"
+    chown -R ${USER}.${GROUP} "${etc_dir}"
+    if [ "${WEBUPDATER}" = "YES" ]; then
+                chown -R ${USER}.${GROUP} "${CODE_DIR}"
+        fi
+}
+
+start() {
+    check_config
+
+        ebegin "Starting Sonarr"
+
+        start-stop-daemon --start --background --make-pidfile --pidfile ${pidfile}\
+        -u ${USER} -g ${GROUP}\
+    --exec ${bin} ${program} -- \
+    --daemon --log=${log_dir}/${log_file} 
+        eend $?
+}
+
+stop() {
+        ebegin "Stopping Sonarr"
+        start-stop-daemon --stop --pidfile ${pidfile} --retry 15
+        eend $?
+}
diff --git a/net-nntp/sonarr/files/sonarr.logrotate b/net-nntp/sonarr/files/sonarr.logrotate
new file mode 100644 (file)
index 0000000..32066c7
--- /dev/null
@@ -0,0 +1,8 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+/var/sonarr/.config/NzbDrone/logs/*.log{
+    missingok
+    su sonarr sonarr
+}
diff --git a/net-nntp/sonarr/files/sonarr.service b/net-nntp/sonarr/files/sonarr.service
new file mode 100644 (file)
index 0000000..82582a9
--- /dev/null
@@ -0,0 +1,16 @@
+[Unit]
+Description=Sonarr is a PVR for Usenet and BitTorrent users.
+After=syslog.target network.target network-online.target
+
+[Service]
+User=sonarr
+Group=sonarr
+
+Type=simple
+ExecStart=/usr/bin/mono /usr/share/sonarr/NzbDrone.exe -nobrowser
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-nntp/sonarr/sonarr-9999.ebuild b/net-nntp/sonarr/sonarr-9999.ebuild
new file mode 100644 (file)
index 0000000..aa55200
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils user systemd
+
+SRC_URI="http://update.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz"
+
+DESCRIPTION="Sonarr is a PVR for Usenet and BitTorrent users."
+HOMEPAGE="http://www.sonarr.tv"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS=""
+RDEPEND="
+       >=dev-lang/mono-3.12.1 
+       media-video/mediainfo 
+       dev-db/sqlite"
+IUSE="updater"
+MY_PN="NzbDrone"
+S=${WORKDIR}/${PN}
+
+pkg_setup() {
+       enewgroup ${PN}
+       enewuser ${PN} -1 -1 /var/lib/sonarr ${PN}
+}
+
+src_unpack() {
+       unpack ${A}
+       mv ${MY_PN} ${PN}
+}
+
+src_install() {
+       newconfd "${FILESDIR}/${PN}.conf" ${PN}
+       newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+       keepdir /var/lib/${PN}
+       fowners -R ${PN}:${PN} /var/lib/${PN}
+
+       insinto /etc/${PN}
+       insopts -m0660 -o ${PN} -g ${PN}
+
+       insinto /etc/logrotate.d
+       insopts -m0644 -o root -g root
+       newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+       
+       insinto "/usr/share/"
+       doins -r "${S}"
+
+       # Allow auto-updater, make source owned by sonarr user.
+       if use updater; then
+               fowners -R ${PN}:${PN} /usr/share/${PN}
+       fi
+
+       systemd_dounit "${FILESDIR}/sonarr.service"
+       systemd_newunit "${FILESDIR}/sonarr.service" "${PN}@.service"
+}