We have moved to Git. This repository is only provided for compatibility with old installations. Learn how to migrate your installation here.

comparison media-tv/emby-server/emby-server-3.0.8100.ebuild @ 185:e296dd371a77

updated emby-server
author gsnerf <gsnerf@gsnerf.de>
date Sat, 15 Oct 2016 10:48:32 +0200
parents
children
comparison
equal deleted inserted replaced
184:734821f25078 185:e296dd371a77
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="5"
6
7 inherit eutils user git-r3
8
9 DESCRIPTION="Emby Server (formerly known as MediaBrowser Server) is a software that indexes a lot of different kinds of media and allows for them to be retrieved and played through the DLNA protocol on any device capable of processing them."
10 HOMEPAGE="http://emby.media/"
11 KEYWORDS="-* ~arm ~amd64 ~x86"
12 SRC_URI="https://github.com/MediaBrowser/Emby/archive/${PV}.tar.gz"
13 SLOT="0"
14 LICENSE="GPL-2"
15 IUSE=""
16 RESTRICT="mirror test"
17
18 RDEPEND=">=dev-lang/mono-3.2.7
19 >=media-video/ffmpeg-2[vpx]
20 media-gfx/imagemagick[jpeg,jpeg2k,webp,png]
21 !media-tv/mediabrowser-server
22 >=dev-db/sqlite-3.0.0"
23 DEPEND="app-arch/unzip ${RDEPEND}"
24
25 INSTALL_DIR="/opt/emby-server"
26 DATA_DIR="/var/lib/emby-server"
27 STARTUP_LOG="/var/log/emby-server_start.log"
28 INIT_SCRIPT="${ROOT}/etc/init.d/emby-server"
29
30 # INSTALL
31 # #######################################################################################################
32
33 pkg_setup() {
34 einfo "creating user for Emby"
35 enewgroup emby
36 enewuser emby -1 /bin/bash ${INSTALL_DIR} "emby"
37 }
38
39 # gentoo expects a specific subfolder in the working directory for the extracted source, so simply extracting won't work here
40 src_unpack() {
41 unpack ${A}
42 mv Emby-${PV} emby-server-${PV}
43 }
44
45 src_prepare() {
46 MAGICKWAND=$(ldconfig -p | grep MagickWand.*.so$ | cut -d" " -f4)
47 MAGICKWAND=${MAGICKWAND##*/}
48 einfo "adapting to imagemagick library to: ${MAGICKWAND}"
49 sed -i -e "s/\"libMagickWand-6.Q8.so\"/\"${MAGICKWAND}\"/" MediaBrowser.Server.Mono/ImageMagickSharp.dll.config || die "could not update libMagickWand reference!"
50 }
51
52
53 src_compile() {
54 einfo "updating root certificates for mono certificate store"
55 mozroots --import --sync
56 einfo "now actually compile"
57 xbuild /p:Configuration="Release Mono" /p:Platform="Any CPU" MediaBrowser.Mono.sln || die "building failed"
58 }
59
60 src_install() {
61 einfo "preparing startup scripts"
62 newinitd "${FILESDIR}"/emby-server.init_3 ${PN}
63 newconfd "${FILESDIR}"/emby-server.conf ${PN}
64
65 einfo "preparing startup log file"
66 dodir /var/log/
67 touch ${D}${STARTUP_LOG}
68 chown emby:emby ${D}${STARTUP_LOG}
69
70 einfo "installing compiled files"
71 diropts -oemby -gemby
72 dodir ${INSTALL_DIR}
73 cp -R ${S}/MediaBrowser.Server.Mono/bin/Release\ Mono/* ${D}${INSTALL_DIR}/ || die "install failed, possibly compile did not succeed earlier?"
74 chown emby:emby -R ${D}${INSTALL_DIR}
75
76 einfo "prepare data directory"
77 dodir ${DATA_DIR}
78 }
79
80 pkg_postinst() {
81 einfo "emby-server was installed to ${INSTALL_DIR}, to start please use the init script provided."
82 einfo "All data generated and used by Emby can be found at ${DATA_DIR} after the first start."
83 einfo ""
84
85 if [[ -d "/usr/lib/mediabrowser-server" || -h "/usr/lib/mediabrowser-server" ]]; then
86 ewarn "ATTENTION: You seem to have moved from the former mediabrowser-server package:"
87 ewarn "don't forget to migrate your original data directory before the first start!"
88 ewarn "To do that move"
89 ewarn " /usr/lib/mediabrowser-server"
90 ewarn "to"
91 ewarn " ${DATA_DIR}"
92 ewarn "and change owner status from mediabrowser:mediabrowser to emby:emby!"
93 ewarn " chown -R emby:emby ${DATA_DIR}"
94 fi
95
96 if [[ -d "/usr/lib/emby-server" || -h "/usr/lib/emby-server" ]]; then
97 ewarn "ATTENTION: You seem to have existing program data at /usr/lib/emby-server!"
98 ewarn "Please move that folder to ${DATA_DIR} before the first start and make sure the folder is owned by emby:emby"
99 ewarn "The folder /usr/lib/emby-server will be repurposed in one of the next releases, so make sure to clean that directory up!"
100 fi
101 }
102
103 # UNINSTALL
104 # #######################################################################################################
105
106 pkg_prerm() {
107 einfo "Stopping running instances of Emby Server"
108 if [ -e "${INIT_SCRIPT}" ]; then
109 ${INIT_SCRIPT} stop
110 fi
111 }