aboutsummaryrefslogtreecommitdiffstats
path: root/testing/emby
diff options
context:
space:
mode:
Diffstat (limited to 'testing/emby')
-rw-r--r--testing/emby/APKBUILD103
-rw-r--r--testing/emby/emby-migrate56
-rw-r--r--testing/emby/emby-server6
-rw-r--r--testing/emby/emby.confd8
-rw-r--r--testing/emby/emby.initd14
-rw-r--r--testing/emby/emby.pre-install5
6 files changed, 192 insertions, 0 deletions
diff --git a/testing/emby/APKBUILD b/testing/emby/APKBUILD
new file mode 100644
index 0000000000..0fe7668bec
--- /dev/null
+++ b/testing/emby/APKBUILD
@@ -0,0 +1,103 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
+pkgname=emby
+pkgver=3.0.5724.6
+pkgrel=0
+pkgdesc="Bring together your videos, music, photos, and live television"
+url="http://emby.media"
+arch="noarch"
+license="GPL2"
+depends="ffmpeg mono sqlite-libs imagemagick libmediainfo"
+pkgusers=$pkgname
+pkggroups=$pkgname
+depends_dev=""
+makedepends="$depends_dev"
+install="$pkgname.pre-install"
+subpackages="$pkgname-migrate"
+source="Emby-$pkgver.tar.gz::https://github.com/MediaBrowser/Emby/archive/$pkgver.tar.gz
+ emby-server
+ $pkgname.initd
+ $pkgname.confd
+ emby-migrate"
+
+_builddir="$srcdir"/Emby-$pkgver
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ mkdir -p "$_builddir"/build
+ # check libs and update.
+ if [ -e "/usr/lib/libmediainfo.so.0" ]; then
+ sed -i s/libmediainfo.so/libmediainfo.so.0/g \
+ "$_builddir"/MediaBrowser.Server.Mono/MediaBrowser.MediaInfo.dll.config \
+ || return 1
+ else
+ die "libmediainfo library not found!"
+ fi
+ if [ -e "/usr/lib/libMagickWand-6.Q16.so.2" ]; then
+ sed -i s/libMagickWand-6.Q8.so/libMagickWand-6.Q16.so.2/g \
+ "$_builddir"/MediaBrowser.Server.Mono/ImageMagickSharp.dll.config \
+ || return 1
+ else
+ die "libMagickWand not found!"
+ fi
+ if [ -e "/usr/lib/libsqlite3.so.0" ]; then
+ sed -i s/libsqlite3.so/libsqlite3.so.0/g \
+ "$_builddir"/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config \
+ || return 1
+ else
+ die "libsqlite3 not found!"
+ fi
+}
+
+build() {
+ cd "$_builddir"
+ xbuild \
+ /p:Configuration='Release Mono' \
+ /p:Platform='Any CPU' \
+ /p:OutputPath="$_builddir"/build \
+ /t:build MediaBrowser.Mono.sln || return 1
+}
+
+package() {
+ cd "$_builddir"
+ mkdir -p "$pkgdir"/usr/lib/emby || return 1
+ install -d -o $pkgusers -g $pkggroups \
+ "$pkgdir"/var/lib/emby || return 1
+ cp -r "$_builddir"/build/* \
+ "$pkgdir"/usr/lib/emby/
+ install -Dm755 "$srcdir"/emby-server \
+ "$pkgdir"/usr/bin/emby-server || return 1
+ install -Dm755 "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/emby || return 1
+ install -Dm644 "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/emby || return 1
+}
+
+migrate() {
+ pkgdesc="$pkgname database migration script"
+ depends="sqlite"
+ install -Dm755 "$srcdir"/emby-migrate \
+ "$subpkgdir"/usr/bin/emby-migrate || return 1
+}
+
+md5sums="7ddeae6667ccca9037f78a0e1d1604d8 Emby-3.0.5724.6.tar.gz
+1fb8f122e9659da42be092fd054debf3 emby-server
+1dd4899fb086d8a9549ed8259d130024 emby.initd
+780b7fddf63030437fd398eb679bfb42 emby.confd
+e176391105b6c4793ada2b9745cf82c7 emby-migrate"
+sha256sums="295791cfffb76572eb20d0ba9c065f9db7ec765b0775613aab82ebeebb0868c5 Emby-3.0.5724.6.tar.gz
+e287a2d6b88c0d6b17b29c0be7463e489eab4ea5153d52e3e00e47119384e130 emby-server
+82e30752bfe43ac66adaca88651b839d396897cc85c3a45fa3c3c2d473cd779c emby.initd
+eadf0c8c2cee2ccc6761aa731cd58dd70086f1dc207acdd71ac1be9fa9f94ed4 emby.confd
+0e3f6b7fe700a3bbdf97bdae8655453b34b1bd08fa8ae339e0fd130fe8670b0b emby-migrate"
+sha512sums="e85f8d8d6e06c6a58c08827f5ddcc320ff29c2c753386c1a144a36f98bf6b44c0bc064cf93811987d2f856fbbdaaa6d2ee3fd068365004d0d216fd1d82c071c7 Emby-3.0.5724.6.tar.gz
+f161fbf2d83d91e5436578f1998410dba991c8d2de4fb8852ec106b13ce3e7119fec7432998dfffa2c488425e2a5eacaf34b0c4e6fc93ad370c1ba94b3eaa2e4 emby-server
+2a520ee646b0489bbacd79679e75828194cbcd41845948816d1ae4d129f7cd582561f7357fa0c6d7f3f1970cc7900ae34338d54a4e54d5b21284c020a911e284 emby.initd
+ebdb39d3e17277ecc51709fc6862265295892d6aa1b5f1b9da537a80552b81c845863cd058ab468f7cf20c22f8f56954b7cce4d149f8fa233ea19ae7aa0bc001 emby.confd
+d4275622b26228c352ee9150441995c2062f6afdda46ccca176ad13a17d5ce432f6cf80b7c7d3029763d3e6fb79cf9a7a07bdbf4fef1dfaee2811c56ec0ec7b9 emby-migrate"
diff --git a/testing/emby/emby-migrate b/testing/emby/emby-migrate
new file mode 100644
index 0000000000..a74429f23e
--- /dev/null
+++ b/testing/emby/emby-migrate
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+USER='emby'
+GROUP='emby'
+
+usage() {
+ echo 'Usage: emby-migrate-database {-u user} {-g group} old_path_full new_path_full'
+ echo 'Default user: emby'
+ echo 'Default group: emby'
+}
+
+migrate() {
+ if [[ $1 && $2 ]]; then
+ if [[ -f $1/data/library.db ]]; then
+ if [[ ! -e $2 ]]; then
+ mkdir -p $2
+ fi
+ if [[ -d $2 ]]; then
+ if [[ -z $(ls $2) ]]; then
+ cp -r $1/* $2/
+ sqlite3 $2/data/library.db "UPDATE TypedBaseItems SET data = CAST(REPLACE(CAST(data AS TEXT), '$1', '$2') AS BLOB);"
+ chown $USER:$GROUP -R $2
+ echo "Migration complete. You can now delete $1."
+ else
+ echo "$2 is not empty. Aborting."
+ fi
+ else
+ echo "$2 is not a directory. Aborting."
+ fi
+ else
+ echo "$1 does not contain an emby database. Aborting."
+ fi
+ else
+ usage
+ fi
+}
+
+if [[ $1 == '--help' ]]; then
+ usage
+else
+ while getopts 'u:g:' opt; do
+ case $opt in
+ u)
+ USER=$OPTARG
+ ;;
+ g)
+ GROUP=$OPTARG
+ ;;
+ \?)
+ usage
+ ;;
+ esac
+ done
+ shift $((OPTIND-1))
+ migrate
+fi
diff --git a/testing/emby/emby-server b/testing/emby/emby-server
new file mode 100644
index 0000000000..f6f84eecbf
--- /dev/null
+++ b/testing/emby/emby-server
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+exec /usr/bin/mono /usr/lib/emby/MediaBrowser.Server.Mono.exe \
+ -programdata /var/lib/emby \
+ -ffmpeg /usr/bin/ffmpeg \
+ -ffprobe /usr/bin/ffprobe
diff --git a/testing/emby/emby.confd b/testing/emby/emby.confd
new file mode 100644
index 0000000000..ba1ccb2d6b
--- /dev/null
+++ b/testing/emby/emby.confd
@@ -0,0 +1,8 @@
+# emby settings
+emby_server="/usr/lib/emby/MediaBrowser.Server.Mono.exe"
+emby_user="emby"
+emby_group="emby"
+emby_pid="/var/run/emby.pid"
+datadir="/var/lib/emby"
+ffmpeg="/usr/bin/ffmpeg"
+ffprobe="/usr/bin/ffprobe"
diff --git a/testing/emby/emby.initd b/testing/emby/emby.initd
new file mode 100644
index 0000000000..e0e2dbb33f
--- /dev/null
+++ b/testing/emby/emby.initd
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+
+name=emby
+command=/usr/bin/mono
+command_args="$emby_server -programdata $datadir -ffmpeg $ffmpeg -ffprobe $ffprobe"
+command_background=true
+pidfile=$emby_pid
+start_stop_daemon_args="--user $emby_user --group $emby_group"
+
+depend() {
+ use logger dns
+ need net
+ after firewall
+}
diff --git a/testing/emby/emby.pre-install b/testing/emby/emby.pre-install
new file mode 100644
index 0000000000..b3431b2604
--- /dev/null
+++ b/testing/emby/emby.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+addgroup emby 2>/dev/null
+adduser -D -h /var/lib/emby -s /sbin/nologin -g "Emby media server" \
+ -G emby emby 2>/dev/null
+exit 0