summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xPKGBUILD74
-rw-r--r--emby-migrate-database56
-rwxr-xr-xemby-server4
-rwxr-xr-xemby-server.conf4
-rwxr-xr-xemby-server.install57
-rwxr-xr-xemby-server.service4
6 files changed, 123 insertions, 76 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 527ebbafb53..39592a786e3 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,44 +1,58 @@
-# Maintainer: Daniel Seymour <dannyseeless at gmail dot com>
+# Maintainer: Bjorn Nostvold <bjorn.nostvold@gmail.com>
+# Contributor: Maxime Gauduin <alucryd@archlinux.org>
+# Contributor: Daniel Seymour <dannyseeless@gmail.com>
pkgname=emby-server-beta
-pkgver=3.0.5641.4
-_commit=f35263111847d9f8b7679104fd52e34db00f542a
+pkgver=3.1.74
pkgrel=1
-pkgdesc="Emby Server is a home media server built using other popular open source technologies."
-arch=('i686' 'x86_64' 'armv6h')
-url="http://emby.media"
-license=('GPL')
-groups=()
-depends=('mono' 'libmediainfo' 'sqlite' 'ffmpeg' 'imagemagick')
-makedepends=('imagemagick')
-optdepends=()
-conflicts=('emby-server' 'emby-server-git' 'mediabrowser-server'
- 'mediabrowser-server-beta' 'mediabrowser-server-git')
+pkgdesc='Bring together your videos, music, photos, and live television'
+arch=('i686' 'x86_64')
+url='http://emby.media'
+license=('GPL2')
+depends=('ffmpeg' 'imagemagick' 'mono' 'sqlite')
provides=('emby-server')
-install=emby-server.install
-source=("https://github.com/MediaBrowser/MediaBrowser/archive/$_commit.tar.gz"
- "emby-server.service" "emby-server"
- "emby-server.conf")
+conflicts=('emby-server')
+install='emby-server.install'
+source=("emby-server-${pkgver}.tar.gz::https://github.com/MediaBrowser/Emby/archive/${pkgver}.tar.gz"
+ "emby-server"
+ "emby-migrate-database"
+ "emby-server.conf"
+ "emby-server.service")
backup=('etc/conf.d/emby-server')
-md5sums=('bd049dd1d1b965fdc449a7e919c358ea'
- '07948b362480a371c4be50c3b9854eeb'
- '69d0ebc1fff9c8ac2f5ff4a6db20ce42'
- '184f023f2a407be2fdd60b236e9f792e')
+sha256sums=('SKIP'
+ '7b1974f7bba8ac4b76e51ef7fe1257d165c7c4abbd0915e192391336048a3d74'
+ 'b25bf83a0ab371aff3b13b82f7af71b51bfe6d7e51eb8a8a3dd8f0774ffce6a5'
+ 'c9ad78f3e2f0ffcb4ee66bb3e99249fcd283dc9fee17895b9265dc733288b953'
+ '8a91ea49a1699c820c4a180710072cba1d6d5c10e45df97477ff6a898f4e1d70')
prepare() {
- MAGICKWAND=$(ldconfig -p | grep MagickWand.*.so$ | cut -d" " -f4)
- sed -i "s/libMagickWand-6.Q8.so/${MAGICKWAND##*/}/" ${srcdir}/MediaBrowser-$_commit/MediaBrowser.Server.Mono/ImageMagickSharp.dll.config
+ cd Emby-$pkgver
+
+ sed 's/libMagickWand-6.Q8.so/libMagickWand-6.Q16HDRI.so/' -i MediaBrowser.Server.Mono/ImageMagickSharp.dll.config
}
build(){
- cd ${srcdir}/MediaBrowser-$_commit
- xbuild /p:Configuration="Release Mono" /p:Platform="Any CPU" /p:OutputPath="${srcdir}/usr/lib/emby-server" /t:build MediaBrowser.Mono.sln
- rm -rf ${srcdir}/MediaBrowser-$_commit
+ cd Emby-$pkgver
+
+ xbuild \
+ /p:Configuration='Release Mono' \
+ /p:Platform='Any CPU' \
+ /p:OutputPath="${srcdir}/build" \
+ /t:build MediaBrowser.Mono.sln
+ mono --aot='full' -O='all' ../build/MediaBrowser.Server.Mono.exe
}
package() {
- install -Dm644 ${srcdir}/emby-server.conf ${pkgdir}/etc/conf.d/emby-server
- install -Dm755 ${srcdir}/emby-server ${pkgdir}/usr/bin/emby-server
- install -Dm644 ${srcdir}/emby-server.service ${pkgdir}/usr/lib/systemd/system/emby-server.service
- cp -r ${srcdir}/usr/lib/emby-server ${pkgdir}/usr/lib
+ install -dm 755 "${pkgdir}"/{etc/conf.d,usr/{bin,lib/systemd/system}}
+ cp -dr --no-preserve='ownership' build "${pkgdir}"/usr/lib/emby-server
+ find "${pkgdir}" -type f -name *.dylib -delete
+ install -m 755 emby-server "${pkgdir}"/usr/bin/
+ install -m 755 emby-migrate-database "${pkgdir}"/usr/bin/
+ install -m 644 emby-server.service "${pkgdir}"/usr/lib/systemd/system/
+ install -m 644 emby-server.conf "${pkgdir}"/etc/conf.d/emby-server
+
+ install -dm 755 "${pkgdir}"/var/lib/emby
+ chown 422:422 -R "${pkgdir}"/var/lib/emby
}
+
+# vim: ts=2 sw=2 et:
diff --git a/emby-migrate-database b/emby-migrate-database
new file mode 100644
index 00000000000..3e102124a9c
--- /dev/null
+++ b/emby-migrate-database
@@ -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/emby-server b/emby-server
index cba1b431a03..31461d269dc 100755
--- a/emby-server
+++ b/emby-server
@@ -1,3 +1,3 @@
-#! /bin/sh
+#!/bin/sh
-$MONO_EXECUTABLE /usr/lib/emby-server/MediaBrowser.Server.Mono.exe -programdata $PROGRAM_DATA -ffmpeg $FFMPEG -ffprobe $FFPROBE
+exec $MONO /usr/lib/emby-server/MediaBrowser.Server.Mono.exe -programdata $PROGRAM_DATA -ffmpeg $FFMPEG -ffprobe $FFPROBE
diff --git a/emby-server.conf b/emby-server.conf
index 5ca0372af81..cbf376e727c 100755
--- a/emby-server.conf
+++ b/emby-server.conf
@@ -1,4 +1,4 @@
-MONO_EXECUTABLE=/usr/bin/mono
-PROGRAM_DATA=/var/lib/emby-server
+MONO=/usr/bin/mono
FFMPEG=/usr/bin/ffmpeg
FFPROBE=/usr/bin/ffprobe
+PROGRAM_DATA=/var/lib/emby
diff --git a/emby-server.install b/emby-server.install
index 4a47f0e31b4..73c12f3f851 100755
--- a/emby-server.install
+++ b/emby-server.install
@@ -1,54 +1,31 @@
-#! /bin/bash
-
post_install() {
- getent group emby >/dev/null || groupadd emby
- getent passwd emby >/dev/null || useradd -c 'Emby Server' -g emby -d /var/lib/emby-server -r -M emby -s /bin/false
- if [ ! -d /var/lib/emby-server ]; then
- mkdir /var/lib/emby-server;
- chown -R emby:emby /var/lib/emby-server
- fi
- if [ ! $? -eq 0 ]
- then
- echo "WARNING COULDN'T CREATE EMBY USERID, MAKE SURE I HAVE PERMISSON TO DO THAT!"
- exit 1
- fi
-
- systemctl --system daemon-reload
- echo "Fixing file permissions...Please be patient."
- cat <<EOF
+ getent group emby > /dev/null 2>&1 || groupadd -g 422 emby
+ getent passwd emby > /dev/null 2>&1 || useradd -c 'Emby Media Server' -u 422 -g emby -d /var/lib/emby -s /usr/bin/nologin emby
+ passwd -l emby > /dev/null
-Emby Server is a home media server built using other popular open-source technologies.
+ if [[ -d '/var/lib/emby-server' ]]; then
-If you would like to report a bug, please post to the forums at www.emby.media/community.
+cat <<EOF
-Emby uses the system's mono, ffmpeg, and ffprobe binaries. If any of those binaries are in a non-standard location, please create a custom environment file using /etc/conf.d/emby-server as a template. You will then need to edit the systemd service file to point to the custom environment file.
+New installations store the emby database inside '/var/lib/emby' (previously
+'/var/lib/emby-server'). Existing installations are left untouched.
-For more information on how to customize systemd files, please refer to https://wiki.archlinux.org/index.php/Systemd#Editing_provided_unit_files
+You can play safe and keep your existing setup, or you can adopt the new home
+and move your database using the emby-migrate-database script. Make sure to run
+pacdiff afterwards to merge the configuration changes.
-To start the server, run systemctl start emby-server.service.
+ sudo emby-migrate-database /var/lib/emby-server /var/lib/emby
-Enjoy the show!
+The script can also be used for more advanced database migration.
+Try "emby-migrate-database --help" for additional information.
EOF
-}
-post_upgrade() {
- getent group emby >/dev/null || groupadd emby
- getent passwd emby >/dev/null || useradd -c 'Emby Server' -g emby -b /var/lib/emby-server -r -M emby -s /bin/false
- if [ ! -d /var/lib/emby-server ]; then
- mkdir /var/lib/emby-server
- chown -R emby:emby /var/lib/emby-server
- echo "The old installation will be in /var/lib/mediabrowser-server."
fi
- systemctl --system daemon-reload
}
-post_remove() {
- cat <<EOF
- To remove the MediaBrowser Server database, please delete
- /var/lib/emby-server.
-
- Also, you should probably remove the emby user and
- and group from your system.
-EOF
+post_upgrade() {
+ post_install
}
+
+# vim: ts=2 sw=2 et:
diff --git a/emby-server.service b/emby-server.service
index 98f79fad7ca..aaf35b161a4 100755
--- a/emby-server.service
+++ b/emby-server.service
@@ -1,5 +1,5 @@
[Unit]
-Description=Media Browser Server is a home media server built using other popular open source technologies.
+Description=Emby brings together your videos, music, photos, and live television.
[Service]
EnvironmentFile=/etc/conf.d/emby-server
@@ -7,7 +7,7 @@ WorkingDirectory=/usr/lib/emby-server
ExecStart=/usr/bin/emby-server
User=emby
Group=emby
-Restart=on-failure
+Restart=always
[Unit]
After=network.target