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-9999.ebuild @ 66:bcbb5c3d4a99

initial commit of dev ebuild
author gsnerf <gsnerf@gsnerf.de>
date Sat, 30 Aug 2014 19:07:20 +0200
parents
children 77b8a9a5604d
comparison
equal deleted inserted replaced
65:0a45323c4511 66:bcbb5c3d4a99
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="-* ~x86 ~amd64"
12 #SRC_URI="https://github.com/MediaBrowser/MediaBrowser/archive/master.zip"
13 SRC_URI="https://github.com/gsnerf/MediaBrowser/archive/master.zip"
14 SLOT="0"
15 LICENSE="GPL-2"
16 IUSE=""
17 RESTRICT="mirror test"
18
19 RDEPEND=">=dev-lang/mono-3.2.0 >=dev-dotnet/libgdiplus-2.10"
20 DEPEND="app-arch/unzip ${RDEPEND}"
21
22 INIT_SCRIPT="${ROOT}/etc/init.d/mediabrowser-server"
23
24 # gentoo expects a specific subfolder in the working directory for the extracted source, so simply extracting won't work here
25 src_unpack() {
26 unpack ${A}
27 mv MediaBrowser-master mediabrowser-server-9999
28 }
29
30 src_compile() {
31 einfo "updating root certificates for mono certificate store"
32 mozroots --import --sync
33 einfo "now actually compile"
34 xbuild /p:Configuration="Release Mono" /p:Platform="Any CPU" MediaBrowser.Mono.sln || die "building failed"
35 }
36
37 #src_install() {
38 # dodir /opt/mediabrowser-server
39 # cp -R "${S}/MediaBrowser.Server.Mono/bin/Release Mono" "${D}/opt/mediabrowser-server" || die "install failed"
40 #}
41
42 pkg_setup() {
43 einfo "creating user for MediaBrowser"
44 enewgroup mediabrowser
45 enewuser mediabrowser -1 /bin/bash /opt/mediabrowser "mediabrowser" --system
46 }
47
48 pkg_preinst() {
49 cd ${D}
50 einfo "preparing compiled package for install"
51 mkdir -p opt/mediabrowser-server
52 cp -R ${WORKDIR}/${P}/MediaBrowser.Server.Mono/bin/Release\ Mono/* opt/mediabrowser-server/ || die
53 cp ${FILESDIR}/start.sh opt/mediabrowser-server/start.sh
54 chown mediabrowser:mediabrowser -R opt/mediabrowser-server
55 chmod 755 opt/mediabrowser-server/start.sh
56
57 einfo "adding init script"
58 mkdir -p etc/init.d
59 cp "${FILESDIR}"/initd_1 etc/init.d/mediabrowser-server
60 chmod 755 etc/init.d/mediabrowser-server
61 mkdir -p var/log
62 touch var/log/mediabrowser_start.log
63 chown mediabrowser:mediabrowser var/log/mediabrowser_start.log
64
65 einfo "preparing data directory"
66 mkdir -p usr/lib/mediabrowser-server
67 chown mediabrowser:mediabrowser usr/lib/mediabrowser-server
68
69 einfo "Stopping running instances of MediaBrowser Server for actuall install"
70 if [ -e "${INIT_SCRIPT}" ]; then
71 ${INIT_SCRIPT} stop
72 fi
73 }
74
75 pkg_prerm() {
76 einfo "Stopping running instances of Media Server"
77 if [ -e "${INIT_SCRIPT}" ]; then
78 ${INIT_SCRIPT} stop
79 fi
80 }
81
82 pkg_postinst() {
83 einfo "MediaBrowser-server was installed to /opt/mediabrowser, to start please use the init script provided."
84 einfo "All data generated and used by MediaBrowser can be found at /var/opt/mediabrowser after the first start."
85 }