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.5572.0-r1.ebuild @ 93:6f4e846cfeb8

fixed reference to imagemagick with different quantum depth settings
author gsnerf <gsnerf@gsnerf.de>
date Sun, 12 Apr 2015 03:27:25 +0200
parents
children
comparison
equal deleted inserted replaced
92:0392b8312f36 93:6f4e846cfeb8
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/MediaBrowser/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-libs/libmediainfo-0.7
21 media-gfx/imagemagick[jpeg,jpeg2k,webp,png]
22 !media-tv/mediabrowser-server"
23 DEPEND="app-arch/unzip ${RDEPEND}"
24
25 INSTALL_DIR="/opt/emby-server"
26 DATA_DIR="/usr/lib/emby-server"
27 STARTUP_LOG="/var/log/emby-server_start.log"
28 INIT_SCRIPT="${ROOT}/etc/init.d/emby-server"
29
30 # gentoo expects a specific subfolder in the working directory for the extracted source, so simply extracting won't work here
31 src_unpack() {
32 unpack ${A}
33 mv MediaBrowser-${PV} emby-server-${PV}
34 }
35
36 src_prepare() {
37 MAGICKWAND=$(ldconfig -p | grep MagickWand.*.so$ | cut -d" " -f4)
38 MAGICKWAND=${MAGICKWAND##*/}
39 einfo "adapting to imagemagick library to: ${MAGICKWAND}"
40 sed -i -e "s/\"libMagickWand-6.Q8.so\"/\"${MAGICKWAND}\"/" MediaBrowser.Server.Mono/ImageMagickSharp.dll.config || die "could not update libMagickWand reference!"
41 }
42
43
44 src_compile() {
45 einfo "updating root certificates for mono certificate store"
46 mozroots --import --sync
47 einfo "now actually compile"
48 xbuild /p:Configuration="Release Mono" /p:Platform="Any CPU" MediaBrowser.Mono.sln || die "building failed"
49 }
50
51 src_install() {
52 einfo "preparing startup scripts"
53 newinitd "${FILESDIR}"/initd_1 ${PN}
54 dodir /var/log/
55 touch ${D}${STARTUP_LOG}
56 chown emby:emby ${D}${STARTUP_LOG}
57
58 einfo "installing compiled files"
59 diropts -oemby -gemby
60 dodir ${INSTALL_DIR}
61 cp -R ${S}/MediaBrowser.Server.Mono/bin/Release\ Mono/* ${D}${INSTALL_DIR}/ || die "install failed, possibly compile did not succeed earlier?"
62 chown emby:emby -R ${D}${INSTALL_DIR}
63
64 # as we use the system libraries, we delete the local ones now as we couldn't do it before
65 rm -R ${D}${INSTALL_DIR}/MediaInfo
66
67 einfo "prepare data directory"
68 dodir ${DATA_DIR}
69 }
70
71 pkg_setup() {
72 einfo "creating user for Emby"
73 enewgroup emby
74 enewuser emby -1 /bin/bash ${INSTALL_DIR} "emby" --system
75 }
76
77 pkg_prerm() {
78 einfo "Stopping running instances of Emby Server"
79 if [ -e "${INIT_SCRIPT}" ]; then
80 ${INIT_SCRIPT} stop
81 fi
82 }
83
84 pkg_postinst() {
85 einfo "emby-server was installed to ${INSTALL_DIR}, to start please use the init script provided."
86 einfo "All data generated and used by Emby can be found at ${DATA_DIR} after the first start."
87 einfo ""
88 ewarn "ATTENTION: If you moved from the former mediabrowser-server package don't forget to migrate"
89 ewarn "your original data directory before the first start! To do that move"
90 ewarn " /usr/lib/mediabrowser-server"
91 ewarn "to"
92 ewarn " /usr/lib/emby-server"
93 ewarn "and change owner status from mediabrowser:mediabrowser to emby:emby!"
94 ewarn " chown -R emby:emby /usr/lib/emby-server"
95 }