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-beta/emby-server-beta-3.1.144.ebuild @ 179:0e11f0586bd5

updated emby-server-beta
author gsnerf <gsnerf@gsnerf.de>
date Sat, 10 Sep 2016 15:34:52 +0200
parents
children
comparison
equal deleted inserted replaced
178:508eeadb7069 179:0e11f0586bd5
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 >=dev-db/sqlite-3.0.0"
22 DEPEND="app-arch/unzip ${RDEPEND}"
23
24 INSTALL_DIR="/opt/emby-server-beta"
25 DATA_DIR="/var/lib/emby-server-beta"
26 STARTUP_LOG="/var/log/emby-server-beta_start.log"
27 INIT_SCRIPT="${ROOT}/etc/init.d/emby-server-beta"
28
29 # INSTALL
30 # #######################################################################################################
31
32 pkg_setup() {
33 einfo "creating user for Emby"
34 enewgroup emby
35 enewuser emby -1 /bin/bash ${INSTALL_DIR} "emby" --system
36 }
37
38 # gentoo expects a specific subfolder in the working directory for the extracted source, so simply extracting won't work here
39 src_unpack() {
40 unpack ${A}
41 mv Emby-${PV} emby-server-beta-${PV}
42 }
43
44 src_prepare() {
45 MAGICKWAND=$(ldconfig -p | grep MagickWand.*.so$ | cut -d" " -f4)
46 MAGICKWAND=${MAGICKWAND##*/}
47 einfo "adapting to imagemagick library to: ${MAGICKWAND}"
48 sed -i -e "s/\"libMagickWand-6.Q8.so\"/\"${MAGICKWAND}\"/" MediaBrowser.Server.Mono/ImageMagickSharp.dll.config || die "could not update libMagickWand reference!"
49 }
50
51
52 src_compile() {
53 einfo "updating root certificates for mono certificate store"
54 mozroots --import --sync
55 einfo "now actually compile"
56 xbuild /p:Configuration="Release Mono" /p:Platform="Any CPU" MediaBrowser.Mono.sln || die "building failed"
57 }
58
59 src_install() {
60 einfo "preparing startup scripts"
61 newinitd "${FILESDIR}"/emby-server-beta.init_2 ${PN}
62 newconfd "${FILESDIR}"/emby-server-beta.conf ${PN}
63
64 einfo "preparing startup log file"
65 dodir /var/log/
66 touch ${D}${STARTUP_LOG}
67 chown emby:emby ${D}${STARTUP_LOG}
68
69 einfo "installing compiled files"
70 diropts -oemby -gemby
71 dodir ${INSTALL_DIR}
72 cp -R ${S}/MediaBrowser.Server.Mono/bin/Release\ Mono/* ${D}${INSTALL_DIR}/ || die "install failed, possibly compile did not succeed earlier?"
73 chown emby:emby -R ${D}${INSTALL_DIR}
74
75 einfo "prepare data directory"
76 dodir ${DATA_DIR}
77 }
78
79 pkg_postinst() {
80 einfo "emby-server was installed to ${INSTALL_DIR}, to start please use the init script provided."
81 einfo "All data generated and used by Emby can be found at ${DATA_DIR} after the first start."
82 einfo ""
83
84 if [[ -d "/usr/lib/mediabrowser-server" || -h "/usr/lib/mediabrowser-server" ]]; then
85 ewarn "ATTENTION: You seem to have moved from the former mediabrowser-server package:"
86 ewarn "don't forget to migrate your original data directory before the first start!"
87 ewarn "To do that move"
88 ewarn " /usr/lib/mediabrowser-server"
89 ewarn "to"
90 ewarn " ${DATA_DIR}"
91 ewarn "and change owner status from mediabrowser:mediabrowser to emby:emby!"
92 ewarn " chown -R emby:emby ${DATA_DIR}"
93 fi
94
95 if [[ -d "/usr/lib/emby-server" || -h "/usr/lib/emby-server" ]]; then
96 ewarn "ATTENTION: You seem to have existing program data at /usr/lib/emby-server!"
97 ewarn "Please move that folder to ${DATA_DIR} before the first start and make sure the folder is owned by emby:emby"
98 ewarn "The folder /usr/lib/emby-server will be repurposed in one of the next releases, so make sure to clean that directory up!"
99 fi
100 }
101
102 # UNINSTALL
103 # #######################################################################################################
104
105 pkg_prerm() {
106 einfo "Stopping running instances of Emby Server"
107 if [ -e "${INIT_SCRIPT}" ]; then
108 ${INIT_SCRIPT} stop
109 fi
110 }