0 1 4
tip default
Michalis Adamidis (gsnerf) - 1 month ago 2018-11-11 15:08:42
gsnerf@gsnerf.de
added ebuild for emby-server-3.4.1.0 and introduced systemd support
5 files changed with 161 insertions and 0 deletions:
↑ Collapse Diff ↑
1
 
AUX 3.4/emby-server.service 321 BLAKE2B 97a042bf5e75bf439722dda59adff3536ec42155e2228993f6fa3fd5540b7e00633c37e1b84b21f2f5da9359d8611495e7e3eb27f7b26381841f4542a369186a SHA512 6aaa37535148c72e5f9b873871d029a22fd6f65655c5e60164e7b927d183f812bcdbe0e10c86ffcad99eaca3b4dd83df1450e00294b27f3fb111d1c4f90dce60
2
 
AUX 3.4/emby-server.service.conf 170 BLAKE2B 49bf0f3fd4751c1f590ce59a74d17a1dc2ab1489dad8e245a83179c8fa5b954b366d35bbda1a859e2615c707af5983a8230e67a93c5f1724d4d6b71efcd953ea SHA512 a0088a958c9378dc821ff8bd967f86a33c759803825634dd799646629f2b8401afeb8b1bf55e61885826410210babd10e2e397382748641ddb8a431f6bd6f800
3
 
AUX emby-server 258 BLAKE2B fec978e642fa281820b66ff5f990cb2c41f607b8404bf7c0c095b9a2144a16b76ab3dc101bef9a9019287114f348a2a5e07d8badd2599a77b15b50dc49c2c606 SHA512 cbffb7ca80f187532ee54f2e1a698f942d5bfb3c9ac49cb4212a8b7664e2ca37e1f3e6a02274a2817630cab2455fe7167275818b0d30aa2812157fda0bd1e09f
1 4
 
AUX emby-server.conf 322 BLAKE2B 865cd0d9dbd6b82a8efadfd9ac5931ce58ea188dc6d0077ff389e0a7342354a7cfd6c2b9d11498bdc58c4756f93f6513d050f16e0abbc8246188b2bb491202d5 SHA512 d260f1f6de4af9110e94831b84d756f042ac140fc96640fff06cdaebf4974685f712380afd0cb819f60bcc02bb38c664afcbd6989b65e487494f99bb9a225ac8
2 5
 
AUX emby-server.init_2 1033 BLAKE2B 57ef2245a0b38dca95c641383378e460f416f59a068b6cf17b19bf3311b6bda014549f34b844d32e011afb5f3b46fd341779824a9b42d35d1d3a2bddb3b854e1 SHA512 52ec07f40109e574818f2417e5e9593c5e8890a94aab5e88c4cb8d0c599d4825d167cc5adb57a6dfe657050dffee2e8f329c7cbef1aa653d84bfbada8080be16
3 6
 
AUX emby-server.init_3 1034 BLAKE2B a1d757d604d7222e645ee861e82460ed9ff578784ae7cb51ccdc70427e18d994c02989268557c4a31ddbb9aeddb478e99f94203b5b47fdc8901fb38519c0c6c0 SHA512 094f6cb7a8f90e5aefecc62ab6826173ae1ab8e280fe38d047fd80e946cb6f47ff1bf505f340bfba54d77aa551be17682676a80c9a61d6947931e476fd533b24
...
 
@@ -5,7 +8,10 @@ AUX initd_1 1085 BLAKE2B e56b2700fcf09bb
5 8
 
DIST 3.0.8500.tar.gz 53827125 BLAKE2B 33fd237a1c12b8afa1e9a194cfa218cf4df1da3e22208e32d25f5ce2eb9bc3b00ec2b7250d8a36b1969fa15262e66bd4a3c1e4e4b4ff0955e37e9228f828eefa SHA512 90689e27628c7d7748022e67de23bb7b45bd8465a18096450a7b17d01764f3fb1a6d22d291a5e7fd5c905f0081bc45f6e1ade1dadd1131e4d36a756ca1fa9541
6 9
 
DIST 3.1.5.tar.gz 41451142 BLAKE2B 8cf3640036e3de0072bb6ceb0bf78ad4585602ef696fe7376a266274722445c4a964d742086b30eb25c8fbd91651b4a75e742925ff61d32552dab7c8f9759d85 SHA512 7506c01db74fa81dfea3fe15ab8e32fe974c38a570df1e87468e097606814677ee09fe607707ad5cc00f484b7d35a2ea823fda8c7f98443a90c753c150be6ca4
7 10
 
DIST 3.2.70.0.tar.gz 69456965 BLAKE2B 5a177db3c0ebcb340e7fea276e277506f14dba4d0b28921a6ad1f7874de4e7d69d2ab9fb5e37f27043f26f7d382d2be7d402655517068e64612107c803db3c87 SHA512 ed7f6fd15a648575b110c76aa04ef1cb62144a5a0b4884f9f12d0e4382900159392a727efaa3d1275eb6b98f15f186efc169b878321ae328794f0b77f38b1073
11
 
DIST 3.4.1.0.tar.gz 70748346 BLAKE2B 1f2ec738d339f485cc6cadc91ce7a18b72cc1722e133b89848c8eaba524d74b49a23c19da0b6041adf5c6606c1550a9d0e5b3ec8151057bd9927d4e32e0cffde SHA512 a50120b5268fff248e430af6f2c5fdc4145a520f3838841479c7f2e02a93abeda50d7338b1ed2a610a7df63a2d236af2ec9cf8efd829c184796cf67981efa955
8 12
 
EBUILD emby-server-3.0.8500.ebuild 3930 BLAKE2B a0f11601c99235d26203ac20c10045cb6eabd7f641b26f768ee192beffda5d013b6f303f3632a17bf4ec2235924b7c7251484fa0b394d7e79e78405bcc29ccdd SHA512 a70675b9944f382efe78a868c9bbb1bf761d6b05daf22d38373f3c294a37ada0fd7b2a0285c3e06a880abf7c807a195dea61fa4d0f7661aa3ce92d9ab00082af
9 13
 
EBUILD emby-server-3.1.5.ebuild 3966 BLAKE2B ed4c71642dd168d1e1215115a2e32bef38c9dd549c60cdf86c67115e9ef0dae912c85564df4b74aa652e32bf1e05ce4d0395e8a97395406129a45f5f185411bd SHA512 61c4c14d1f0cd5732ae14d3162bacf60510560ae678fc956b1eb8684ff5b9366ffe95f03d258f64e54b0af883a97aa59649b9be91dde08dcd8ec1654a78bad3f
10 14
 
EBUILD emby-server-3.2.70.0-r1.ebuild 4216 BLAKE2B bd714c808750642ce6f06295f929415b9725f6e873449755f95cd1077dc781a0011705a1ae071f83ca4a540a53a011e4e36865020e1c088ed85743f0daf2424d SHA512 aca53e5f77686807f2d7bef66a3fbcaddebb0a6c7d003ff243944b154d536f23446c1aba85273d4a071ba7db64bb1f664325fa73c7e0509acf392369bc66a0cf
15
 
EBUILD emby-server-3.4.1.0.ebuild 4676 BLAKE2B 6e948498f8b5e283a48e52e777427164b6877d79442da5e2368f5383542965c268180b8131b2b8770701a42f1bc10d5e8b81afc4d7cb22ddb195d662a60588da SHA512 1b9db6c22f15378beeea3ab0cf648f2967c8cd04ac5a3687a6ecd818b146a957a5de38d9637366aa5ebbc0244c4688a207432623951e961593eb5e21221a6a8b
11 16
 
EBUILD emby-server-9999.ebuild 3079 BLAKE2B b15ba2a9bcfbd0eb10640f89106eb931820b98d42ea2b7746d057d6bf06ef55e04dfc5cd721aab3965e3235076eb2a6c28d659d363d94166cdf383b978c71746 SHA512 1febd22bfe38090668cc391fbebee8cd5a71f9ec678a224a9ed0bf29f76a9940c3016b7d20b5209d9e8d871cdd185c0ab0f2642ce4653407497233f1e3b9207e
17
 
MISC emby-server-3.5.2.0.ebuild.broken 4363 BLAKE2B 7e1cb9e6cd1bd88a9184e26c90e0e958fe7dc3d5ef3bf8d4888085bae4f3f1d747c3a2d76cc751f849da627ffce51c4d1f0e44a85651ffc8441fe9b2ecd5930c SHA512 716de594f905d4e9237e7406c22b9ec90966d9048984dc73b68e9184de73ef8bd5766a3b38187446cc62ca718030fb025ee6f7d78f5d86b470d233f684c9f506
 
new file 100644
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 dotnet systemd
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
 
RESTRICT="mirror test"
16
 

	
17
 
RDEPEND=">=dev-lang/mono-5.4.0
18
 
	>=media-video/ffmpeg-2[vpx]
19
 
	media-gfx/imagemagick[jpeg,jpeg2k,webp,png]
20
 
	!media-tv/mediabrowser-server
21
 
	>=dev-db/sqlite-3.0.0
22
 
	dev-dotnet/referenceassemblies-pcl
23
 
	app-misc/ca-certificates"
24
 
DEPEND="app-arch/unzip
25
 
	${RDEPEND}"
26
 

	
27
 
INSTALL_DIR="/opt/emby-server"
28
 
DATA_DIR="/var/lib/emby-server"
29
 
STARTUP_LOG="/var/log/emby-server_start.log"
30
 
INIT_SCRIPT="${ROOT}/etc/init.d/emby-server"
31
 

	
32
 
# INSTALL
33
 
# #######################################################################################################
34
 

	
35
 
pkg_setup() {
36
 
	einfo "creating user for Emby"
37
 
	enewgroup emby
38
 
	enewuser emby -1 /bin/bash ${INSTALL_DIR} "emby"
39
 

	
40
 
	einfo "updating root certificates for mono certificate store"
41
 
        addwrite "/usr/share/.mono/keypairs"
42
 
	dotnet_pkg_setup
43
 
        cert-sync /etc/ssl/certs/ca-certificates.crt
44
 
}
45
 

	
46
 
# gentoo expects a specific subfolder in the working directory for the extracted source, so simply extracting won't work here
47
 
src_unpack() {
48
 
        unpack ${A}
49
 
        mv Emby-${PV} emby-server-${PV}
50
 
}
51
 

	
52
 
src_prepare() {
53
 
	# the user can define the quality of the imagemagic himself, here we try to figure out the correct files to use in our configuration
54
 
	MAGICKWAND=$(ldconfig -p | grep MagickWand.*.so$ | cut -d" " -f4)
55
 
	MAGICKWAND=${MAGICKWAND##*/}
56
 
	einfo "adapting to imagemagick library to: ${MAGICKWAND}"
57
 
	sed -i -e "s/\"libMagickWand-6.Q8.so\"/\"${MAGICKWAND}\"/" MediaBrowser.Server.Mono/ImageMagickSharp.dll.config || die "could not update libMagickWand reference!"
58
 
}
59
 

	
60
 

	
61
 
src_compile() {
62
 
	addpredict "/etc/mono/registry"
63
 
	xbuild /p:Configuration="Release Mono" /p:Platform="Any CPU" MediaBrowser.sln || die "building failed"
64
 
}
65
 

	
66
 
src_install() {
67
 
	einfo "installing compiled files"
68
 
	diropts -oemby -gemby
69
 
	dodir ${INSTALL_DIR}
70
 
	cp -R ${S}/MediaBrowser.Server.Mono/bin/Release/* ${D}${INSTALL_DIR}/ || die "install failed, possibly compile did not succeed earlier?"
71
 
	cp "${FILESDIR}"/emby-server ${D}${INSTALL_DIR}/
72
 
	chown emby:emby -R ${D}${INSTALL_DIR}
73
 

	
74
 
	einfo "prepare data directory"
75
 
	dodir ${DATA_DIR}
76
 

	
77
 
	einfo "preparing basic configuration"
78
 
	newconfd "${FILESDIR}"/emby-server.conf ${PN}
79
 

	
80
 
	einfo "preparing init scripts"
81
 
	newinitd "${FILESDIR}"/emby-server.init_3  ${PN}
82
 
	systemd_dounit "${FILESDIR}/3.4/emby-server.service"
83
 
	systemd_install_serviced "${FILESDIR}/3.4/emby-server.service.conf"
84
 

	
85
 
	einfo "preparing startup log file"
86
 
	dodir /var/log/
87
 
	touch ${D}${STARTUP_LOG}
88
 
	chown emby:emby ${D}${STARTUP_LOG}
89
 
}
90
 

	
91
 
pkg_postinst() {
92
 
	einfo "emby-server was installed to ${INSTALL_DIR}, to start please use the init script provided."
93
 
	einfo "All data generated and used by Emby can be found at ${DATA_DIR} after the first start."
94
 
	einfo ""
95
 

	
96
 
	if systemd_is_booted; then
97
 
		ewarn "You seem to be running on systemd, to configure the service please refer to \"/etc/systemd/system/emby-server.service.d/00gentoo.conf\"."
98
 
		ewarn "Changing /etc/conf.d/emby-server.conf will have no effect!"
99
 
	fi
100
 

	
101
 
	if [[ -d "/usr/lib/mediabrowser-server" || -h "/usr/lib/mediabrowser-server" ]]; then
102
 
		ewarn "ATTENTION: You seem to have moved from the former mediabrowser-server package:"
103
 
		ewarn "don't forget to migrate your original data directory before the first start!"
104
 
		ewarn "To do that move"
105
 
		ewarn "     /usr/lib/mediabrowser-server"
106
 
		ewarn "to"
107
 
		ewarn "     ${DATA_DIR}"
108
 
		ewarn "and change owner status from mediabrowser:mediabrowser to emby:emby!"
109
 
		ewarn "     chown -R emby:emby ${DATA_DIR}"
110
 
	fi
111
 

	
112
 
	if [[ -d "/usr/lib/emby-server" || -h "/usr/lib/emby-server"  ]]; then
113
 
		ewarn "ATTENTION: You seem to have existing program data at /usr/lib/emby-server!"
114
 
		ewarn "Please move that folder to ${DATA_DIR} before the first start and make sure the folder is owned by emby:emby"
115
 
		ewarn "The folder /usr/lib/emby-server will be repurposed in one of the next releases, so make sure to clean that directory up!"
116
 
	fi
117
 
}
118
 

	
119
 
# UNINSTALL
120
 
# #######################################################################################################
121
 

	
122
 
pkg_prerm() {
123
 
	einfo "Stopping running instances of Emby Server"
124
 
	if [ -e "${INIT_SCRIPT}" ]; then
125
 
		${INIT_SCRIPT} stop
126
 
	fi
127
 
}
 
new file 100644
1
 
[Unit]
2
 
Description=Emby Server is a personal media server with apps on just about every device.
3
 
After=network.target
4
 

	
5
 
[Service]
6
 
Environment="PROGRAMDATA=/var/lib/emby-server"
7
 
WorkingDirectory=/opt/emby-server
8
 
ExecStart=/opt/emby-server/emby-server
9
 
RestartForceExitStatus=3
10
 
User=emby
11
 

	
12
 
[Install]
13
 
WantedBy=multi-user.target
 
new file 100644
1
 
# use these configuration options to override the data directory (PROGRAMDATA) or the user to run as
2
 
[Service]
3
 
#Environment="PROGRAMDATA=/var/lib/emby-server"
4
 
#User=emby
 
new file 100755
1
 
#!/bin/sh
2
 

	
3
 
if [ -z $PROGRAMDATA ]; then
4
 
    export PROGRAMDATA=/var/lib/emby-server
5
 
fi
6
 

	
7
 
mono /opt/emby-server/MediaBrowser.Server.Mono.exe \
8
 
    -programdata $PROGRAMDATA \
9
 
    -ffmpeg /usr/bin/ffmpeg \
10
 
    -ffprobe /usr/bin/ffprobe \
11
 
    -restartexitcode 3
0 comments (0 inline, 0 general)