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/mediabrowser-server/mediabrowser-server-3.0.5518.7.ebuild @ 84:25fe8565dcf0

updated mediabrowser ebuilds
author gsnerf <gsnerf@gsnerf.de>
date Sat, 21 Feb 2015 21:18:14 +0100
parents
children
comparison
equal deleted inserted replaced
83:f3fa1d6be0b5 84:25fe8565dcf0
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
8
9 DESCRIPTION="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://mediabrowser.tv/"
11 KEYWORDS="-* ~arm ~amd64 ~x86"
12 SRC_URI="https://github.com/MediaBrowser/MediaBrowser/archive/${PV}.zip"
13 SLOT="0"
14 LICENSE="GPL-2"
15 IUSE=""
16 RESTRICT="mirror test"
17
18 RDEPEND=">=dev-lang/mono-3.2.7
19 >=dev-dotnet/libgdiplus-2.10
20 >=media-video/ffmpeg-2[vpx]
21 >=media-libs/libmediainfo-0.7
22 >=media-libs/libwebp-0.4.1[jpeg]"
23 DEPEND="app-arch/unzip ${RDEPEND}"
24
25 INSTALL_DIR="/opt/mediabrowser-server"
26 DATA_DIR="/usr/lib/mediabrowser-server"
27 STARTUP_LOG="/var/log/mediabrowser_start.log"
28 INIT_SCRIPT="${ROOT}/etc/init.d/mediabrowser-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} mediabrowser-server-${PV}
34 }
35
36 # we don't want to use the third party drivers, so we patch the config files to use system ones instead
37 # attention: do NOT remove the third party libraries before compiling as the build process might fail!
38 #src_prepare() {
39 # epatch "${FILESDIR}/system_libraries_2.patch"
40 #}
41
42 src_compile() {
43 einfo "updating root certificates for mono certificate store"
44 mozroots --import --sync
45 einfo "now actually compile"
46 xbuild /p:Configuration="Release Mono" /p:Platform="Any CPU" MediaBrowser.Mono.sln || die "building failed"
47 }
48
49 src_install() {
50 einfo "preparing startup scripts"
51 newinitd "${FILESDIR}"/initd_1 ${PN}
52 dodir /var/log/
53 touch ${D}${STARTUP_LOG}
54 chown mediabrowser:mediabrowser ${D}${STARTUP_LOG}
55
56 einfo "installing compiled files"
57 diropts -omediabrowser -gmediabrowser
58 dodir ${INSTALL_DIR}
59 cp -R ${S}/MediaBrowser.Server.Mono/bin/Release\ Mono/* ${D}${INSTALL_DIR}/ || die "install failed, possibly compile did not succeed earlier?"
60 chown mediabrowser:mediabrowser -R ${D}${INSTALL_DIR}
61
62 # as we use the system libraries, we delete the local ones now as we couldn't do it before
63 rm -R ${D}${INSTALL_DIR}/libwebp
64 rm -R ${D}${INSTALL_DIR}/MediaInfo
65
66 einfo "prepare data directory"
67 dodir ${DATA_DIR}
68 }
69
70 pkg_setup() {
71 einfo "creating user for MediaBrowser"
72 enewgroup mediabrowser
73 enewuser mediabrowser -1 /bin/bash ${INSTALL_DIR} "mediabrowser" --system
74 }
75
76 #pkg_preinst() {
77 #cd ${D}
78 #einfo "preparing compiled package for install"
79 #mkdir -p opt/mediabrowser-server
80 #cp -R ${WORKDIR}/${P}/MediaBrowser.Server.Mono/bin/Release\ Mono/* opt/mediabrowser-server/ || die
81 #cp ${FILESDIR}/start.sh opt/mediabrowser-server/start.sh
82 #chown mediabrowser:mediabrowser -R opt/mediabrowser-server
83 #chmod 755 opt/mediabrowser-server/start.sh
84
85 #einfo "adding init script"
86 #mkdir -p etc/init.d
87 #cp "${FILESDIR}"/initd_1 etc/init.d/mediabrowser-server
88 #chmod 755 etc/init.d/mediabrowser-server
89 #mkdir -p var/log
90 #touch var/log/mediabrowser_start.log
91 #chown mediabrowser:mediabrowser var/log/mediabrowser_start.log
92
93 #einfo "preparing data directory"
94 #mkdir -p usr/lib/mediabrowser-server
95 #chown mediabrowser:mediabrowser usr/lib/mediabrowser-server
96
97 #einfo "Stopping running instances of MediaBrowser Server for actual install"
98 #if [ -e "${INIT_SCRIPT}" ]; then
99 # ${INIT_SCRIPT} stop
100 #fi
101 #}
102
103 pkg_prerm() {
104 einfo "Stopping running instances of Media Server"
105 if [ -e "${INIT_SCRIPT}" ]; then
106 ${INIT_SCRIPT} stop
107 fi
108 }
109
110 pkg_postinst() {
111 einfo "MediaBrowser-server was installed to ${INSTALL_DIR}, to start please use the init script provided."
112 einfo "All data generated and used by MediaBrowser can be found at ${DATA_DIR} after the first start."
113 einfo ""
114 einfo "If you just updated from an earlier version make sure to restart the service!"
115 }