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.5490.2.ebuild @ 81:b3f9b645703d

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