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.ebuild @ 91:17a5eaaa191c

moved yet unreleased new stable revision to current hotfix and fixed some things in the renamed package
author gsnerf <gsnerf@gsnerf.de>
date Sun, 05 Apr 2015 18:11:40 +0200
parents
children
comparison
equal deleted inserted replaced
90:e0f97106108d 91:17a5eaaa191c
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
37 src_compile() {
38 einfo "updating root certificates for mono certificate store"
39 mozroots --import --sync
40 einfo "now actually compile"
41 xbuild /p:Configuration="Release Mono" /p:Platform="Any CPU" MediaBrowser.Mono.sln || die "building failed"
42 }
43
44 src_install() {
45 einfo "preparing startup scripts"
46 newinitd "${FILESDIR}"/initd_1 ${PN}
47 dodir /var/log/
48 touch ${D}${STARTUP_LOG}
49 chown emby:emby ${D}${STARTUP_LOG}
50
51 einfo "installing compiled files"
52 diropts -oemby -gemby
53 dodir ${INSTALL_DIR}
54 cp -R ${S}/MediaBrowser.Server.Mono/bin/Release\ Mono/* ${D}${INSTALL_DIR}/ || die "install failed, possibly compile did not succeed earlier?"
55 chown emby:emby -R ${D}${INSTALL_DIR}
56
57 # as we use the system libraries, we delete the local ones now as we couldn't do it before
58 rm -R ${D}${INSTALL_DIR}/MediaInfo
59
60 einfo "prepare data directory"
61 dodir ${DATA_DIR}
62 }
63
64 pkg_setup() {
65 einfo "creating user for Emby"
66 enewgroup emby
67 enewuser emby -1 /bin/bash ${INSTALL_DIR} "emby" --system
68 }
69
70 pkg_prerm() {
71 einfo "Stopping running instances of Emby Server"
72 if [ -e "${INIT_SCRIPT}" ]; then
73 ${INIT_SCRIPT} stop
74 fi
75 }
76
77 pkg_postinst() {
78 einfo "emby-server was installed to ${INSTALL_DIR}, to start please use the init script provided."
79 einfo "All data generated and used by Emby can be found at ${DATA_DIR} after the first start."
80 einfo ""
81 ewarn "ATTENTION: If you moved from the former mediabrowser-server package don't forget to migrate"
82 ewarn "your original data directory before the first start! To do that move"
83 ewarn " /usr/lib/mediabrowser-server"
84 ewarn "to"
85 ewarn " /usr/lib/emby-server"
86 ewarn "and change owner status from mediabrowser:mediabrowser to emby:emby!"
87 ewarn " chown -R emby:emby /usr/lib/emby-server"
88 }