Gentoo Archives: gentoo-commits

From: Ian Whyman <thev00d00@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/gerbera/, net-misc/gerbera/files/
Date: Mon, 29 May 2017 16:20:34
Message-Id: 1496074817.771f83cd68910fc092dcbf9c41b87dc4bd4fd18f.thev00d00@gentoo
1 commit: 771f83cd68910fc092dcbf9c41b87dc4bd4fd18f
2 Author: Ian Whyman <thev00d00 <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 29 16:19:35 2017 +0000
4 Commit: Ian Whyman <thev00d00 <AT> gentoo <DOT> org>
5 CommitDate: Mon May 29 16:20:17 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=771f83cd
7
8 net-misc/gerbera: UPnP Media Server for 2017 (Based on MediaTomb)
9
10 Ebuild by me, files borrowed from net-misc/mediatomb.
11
12 Package-Manager: Portage-2.3.5, Repoman-2.3.2
13
14 net-misc/gerbera/Manifest | 1 +
15 net-misc/gerbera/files/gerbera-1.0.0.confd | 28 ++++++
16 net-misc/gerbera/files/gerbera-1.0.0.config | 144 ++++++++++++++++++++++++++++
17 net-misc/gerbera/files/gerbera-1.0.0.initd | 29 ++++++
18 net-misc/gerbera/gerbera-1.0.0.ebuild | 98 +++++++++++++++++++
19 net-misc/gerbera/gerbera-9999.ebuild | 98 +++++++++++++++++++
20 net-misc/gerbera/metadata.xml | 19 ++++
21 7 files changed, 417 insertions(+)
22
23 diff --git a/net-misc/gerbera/Manifest b/net-misc/gerbera/Manifest
24 new file mode 100644
25 index 00000000000..a0e6539fedc
26 --- /dev/null
27 +++ b/net-misc/gerbera/Manifest
28 @@ -0,0 +1 @@
29 +DIST gerbera-1.0.0.tar.gz 805102 SHA256 297c26e0b4223ea96cc6db403e2a2e8f81c51b64284535f3bc644abf24f66975 SHA512 ddc269ce65ba6cd4778c3a7d7dd7f368d659e2813cee962ed167e1ab5a887d8dae32c0197e95733a799c2bb4835904c94f11e1411d4dfab4ed05f39519d4f42d WHIRLPOOL fc568d3e0c58b415b4cfe45a36418c821afcd3909dfd08a99c4ace1c8995d51ea8f7a8f90e13858d60605d5c8ab6aa08b1cb2a10cb02133cef45bfdc2d320ec0
30
31 diff --git a/net-misc/gerbera/files/gerbera-1.0.0.confd b/net-misc/gerbera/files/gerbera-1.0.0.confd
32 new file mode 100644
33 index 00000000000..7f5c0083025
34 --- /dev/null
35 +++ b/net-misc/gerbera/files/gerbera-1.0.0.confd
36 @@ -0,0 +1,28 @@
37 +# /etc/conf.d/mediatomb: config file for /etc/init.d/mediatomb
38 +
39 +# See the mediatomb(1) manpage for more info.
40 +
41 +# MediaTomb Web UI port.
42 +# NOTE: The minimum value allowed is 49152
43 +MEDIATOMB_PORT=49152
44 +
45 +# Run MediaTomb as this user.
46 +# NOTE: For security reasons do not run MediaTomb as root.
47 +MEDIATOMB_USER="mediatomb"
48 +
49 +# Run MediaTomb as this group.
50 +# NOTE: For security reasons do not run MediaTomb as root.
51 +MEDIATOMB_GROUP="mediatomb"
52 +
53 +# Path to MediaTomb config file.
54 +MEDIATOMB_CONFIG="/etc/mediatomb/config.xml"
55 +
56 +# Path to MediaTomb log file.
57 +MEDIATOMB_LOGFILE="/var/log/mediatomb.log"
58 +
59 +# Path to MediaTomb pid file.
60 +MEDIATOMB_PIDFILE="/var/run/mediatomb.pid"
61 +
62 +# Other options you want to pass to MediaTomb.
63 +# Add "--interface ${MEDIATOMB_INTERFACE}" to bind to a named interface.
64 +MEDIATOMB_OPTIONS=""
65
66 diff --git a/net-misc/gerbera/files/gerbera-1.0.0.config b/net-misc/gerbera/files/gerbera-1.0.0.config
67 new file mode 100644
68 index 00000000000..94bdb936e14
69 --- /dev/null
70 +++ b/net-misc/gerbera/files/gerbera-1.0.0.config
71 @@ -0,0 +1,144 @@
72 +<?xml version="1.0" encoding="UTF-8"?>
73 +<config version="2" xmlns="http://mediatomb.cc/config/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd">
74 + <server>
75 + <ui enabled="yes" show-tooltips="yes">
76 + <accounts enabled="no" session-timeout="30">
77 + <account user="gerbera" password="mediatomb"/>
78 + </accounts>
79 + </ui>
80 + <name>Gerbera</name>
81 + <udn></udn>
82 + <home>/var/lib/gerbera</home>
83 + <webroot>/usr/share/gerbera/web</webroot>
84 + <storage>
85 + <sqlite3 enabled="yes">
86 + <database-file>gerbera.db</database-file>
87 + </sqlite3>
88 + <mysql enabled="no">
89 + <host>host</host>
90 + <database>database</database>
91 + <username>username</username>
92 + <password>password</password>
93 + </mysql>
94 + </storage>
95 + <protocolInfo extend="yes"/>
96 + <pc-directory upnp-hide="no"/>
97 + <extended-runtime-options>
98 + <ffmpegthumbnailer enabled="no">
99 + <thumbnail-size>160</thumbnail-size>
100 + <seek-percentage>10</seek-percentage>
101 + <filmstrip-overlay>no</filmstrip-overlay>
102 + <workaround-bugs>no</workaround-bugs>
103 + <image-quality>8</image-quality>
104 + </ffmpegthumbnailer>
105 + <mark-played-items enabled="no" suppress-cds-updates="yes">
106 + <string mode="prepend">*</string>
107 + <mark>
108 + <content>video</content>
109 + </mark>
110 + </mark-played-items>
111 + <lastfm enabled="no">
112 + <username>username</username>
113 + <password>password</password>
114 + </lastfm>
115 + </extended-runtime-options>
116 + </server>
117 + <import hidden-files="no">
118 + <scripting script-charset="UTF-8">
119 + <common-script>/usr/share/gerbera/js/common.js</common-script>
120 + <playlist-script>/usr/share/gerbera/js/playlists.js</playlist-script>
121 + <virtual-layout type="builtin">
122 + <import-script>/usr/share/gerbera/js/import.js</import-script>
123 + </virtual-layout>
124 + </scripting>
125 + <mappings>
126 + <extension-mimetype ignore-unknown="no">
127 + <map from="mp3" to="audio/mpeg"/>
128 + <map from="ogx" to="application/ogg"/>
129 + <map from="ogv" to="video/ogg"/>
130 + <map from="oga" to="audio/ogg"/>
131 + <map from="ogg" to="audio/ogg"/>
132 + <map from="ogm" to="video/ogg"/>
133 + <map from="asf" to="video/x-ms-asf"/>
134 + <map from="asx" to="video/x-ms-asf"/>
135 + <map from="wma" to="audio/x-ms-wma"/>
136 + <map from="wax" to="audio/x-ms-wax"/>
137 + <map from="wmv" to="video/x-ms-wmv"/>
138 + <map from="wvx" to="video/x-ms-wvx"/>
139 + <map from="wm" to="video/x-ms-wm"/>
140 + <map from="wmx" to="video/x-ms-wmx"/>
141 + <map from="m3u" to="audio/x-mpegurl"/>
142 + <map from="pls" to="audio/x-scpls"/>
143 + <map from="flv" to="video/x-flv"/>
144 + <map from="mkv" to="video/x-matroska"/>
145 + <map from="mka" to="audio/x-matroska"/>
146 + <map from="avi" to="video/divx"/>
147 + <map from="m2ts" to="video/avc"/>
148 + <map from="cr2" to="image/raw"/>
149 + <map from="nef" to="image/raw"/>
150 + </extension-mimetype>
151 + <mimetype-upnpclass>
152 + <map from="audio/*" to="object.item.audioItem.musicTrack"/>
153 + <map from="video/*" to="object.item.videoItem"/>
154 + <map from="image/*" to="object.item.imageItem"/>
155 + </mimetype-upnpclass>
156 + <mimetype-contenttype>
157 + <treat mimetype="audio/mpeg" as="mp3"/>
158 + <treat mimetype="application/ogg" as="ogg"/>
159 + <treat mimetype="video/ogg" as="ogg"/>
160 + <treat mimetype="audio/ogg" as="ogg"/>
161 + <treat mimetype="audio/x-flac" as="flac"/>
162 + <treat mimetype="image/jpeg" as="jpg"/>
163 + <treat mimetype="audio/x-mpegurl" as="playlist"/>
164 + <treat mimetype="audio/x-scpls" as="playlist"/>
165 + <treat mimetype="audio/x-wav" as="pcm"/>
166 + <treat mimetype="audio/L16" as="pcm"/>
167 + <treat mimetype="video/x-msvideo" as="avi"/>
168 + <treat mimetype="video/mp4" as="mp4"/>
169 + <treat mimetype="audio/mp4" as="mp4"/>
170 + <treat mimetype="video/divx" as="avi"/>
171 + </mimetype-contenttype>
172 + </mappings>
173 + <online-content>
174 + <YouTube enabled="no" refresh="28800" update-at-start="yes" purge-after="604800" racy-content="exclude" format="mp4" hd="no">
175 + <favorites user="NationalGeographic"/>
176 + <playlists user="PlayStation"/>
177 + <uploads user="Google"/>
178 + <standardfeed feed="most_viewed" time-range="today"/>
179 + <standardfeed feed="recently_featured" time-range="today"/>
180 + </YouTube>
181 + </online-content>
182 + </import>
183 + <transcoding enabled="no">
184 + <mimetype-profile-mappings>
185 + <transcode mimetype="audio/ogg" using="audio2pcm"/>
186 + <transcode mimetype="audio/x-flac" using="audio2pcm"/>
187 + <transcode mimetype="video/ogg" using="video2mpeg"/>
188 + <transcode mimetype="video/x-flv" using="video2mpeg"/>
189 + </mimetype-profile-mappings>
190 + <profiles>
191 + <profile name="audio2pcm" enabled="yes" type="external">
192 + <mimetype>audio/L16</mimetype>
193 + <accept-url>no</accept-url>
194 + <first-resource>yes</first-resource>
195 + <hide-original-resource>yes</hide-original-resource>
196 + <accept-ogg-theora>no</accept-ogg-theora>
197 + <sample-frequency>44100</sample-frequency>
198 + <audio-channels>2</audio-channels>
199 + <agent command="ffmpeg" arguments="-i %in -acodec pcm_s16be -ab 192k -ar 44100 -ac 2 -f s16be -y %out"/>
200 + <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
201 + </profile>
202 + <profile name="video2mpeg" enabled="yes" type="external">
203 + <mimetype>video/mpeg</mimetype>
204 + <accept-url>no</accept-url>
205 + <first-resource>yes</first-resource>
206 + <hide-original-resource>yes</hide-original-resource>
207 + <accept-ogg-theora>yes</accept-ogg-theora>
208 + <sample-frequency>48000</sample-frequency>
209 + <audio-channels>2</audio-channels>
210 + <agent command="ffmpeg" arguments="-i %in -vcodec mpeg2video -b 4096k -r 25 -acodec mp2 -ab 192k -ar 48000 -ac 2 -async 1 -f dvd -threads 2 -y %out"/>
211 + <buffer size="10485760" chunk-size="262144" fill-size="524288"/>
212 + </profile>
213 + </profiles>
214 + </transcoding>
215 +</config>
216
217 diff --git a/net-misc/gerbera/files/gerbera-1.0.0.initd b/net-misc/gerbera/files/gerbera-1.0.0.initd
218 new file mode 100644
219 index 00000000000..2e410891897
220 --- /dev/null
221 +++ b/net-misc/gerbera/files/gerbera-1.0.0.initd
222 @@ -0,0 +1,29 @@
223 +#!/sbin/openrc-run
224 +# Copyright 1999-2017 Gentoo Foundation
225 +# Distributed under the terms of the GNU General Public License v2
226 +# $Id$
227 +
228 +depend() {
229 + need net
230 + # In order to properly support this (need vs use), we would have to
231 + # parse ${MEDIATOMB_CONFIG} and see if mysql is enabled and if it is
232 + # pointing to the local system. #368409
233 + use mysql
234 +}
235 +
236 +start() {
237 + ebegin "Starting MediaTomb"
238 + start-stop-daemon --start --quiet --exec /usr/bin/mediatomb \
239 + --pidfile ${MEDIATOMB_PIDFILE} -- --daemon \
240 + --pidfile ${MEDIATOMB_PIDFILE} --user ${MEDIATOMB_USER} \
241 + --group ${MEDIATOMB_GROUP} --logfile ${MEDIATOMB_LOGFILE} \
242 + --config ${MEDIATOMB_CONFIG} --port ${MEDIATOMB_PORT} \
243 + ${MEDIATOMB_OPTIONS}
244 + eend $?
245 +}
246 +
247 +stop () {
248 + ebegin "Stopping MediaTomb"
249 + start-stop-daemon --stop --retry 10 --quiet --pidfile ${MEDIATOMB_PIDFILE}
250 + eend $?
251 +}
252
253 diff --git a/net-misc/gerbera/gerbera-1.0.0.ebuild b/net-misc/gerbera/gerbera-1.0.0.ebuild
254 new file mode 100644
255 index 00000000000..aff60159844
256 --- /dev/null
257 +++ b/net-misc/gerbera/gerbera-1.0.0.ebuild
258 @@ -0,0 +1,98 @@
259 +# Copyright 1999-2017 Gentoo Foundation
260 +# Distributed under the terms of the GNU General Public License v2
261 +
262 +EAPI=6
263 +
264 +inherit cmake-utils eutils linux-info systemd user
265 +
266 +if [[ ${PV} == 9999 ]]; then
267 + EGIT_REPO_URI="https://github.com/v00d00/${PN}.git"
268 + KEYWORDS=""
269 + SRC_URI=""
270 + inherit git-r3
271 +else
272 + SRC_URI="https://github.com/v00d00/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
273 + KEYWORDS="~amd64 ~x86"
274 + S="${WORKDIR}/${P}"
275 +fi
276 +
277 +DESCRIPTION="UPnP Media Server (Based on MediaTomb)"
278 +HOMEPAGE="https://github.com/v00d00/gerbera"
279 +
280 +LICENSE="GPL-2"
281 +SLOT="0"
282 +IUSE="curl debug +exif +ffmpeg +javascript lastfm libav +magic mysql +taglib"
283 +
284 +DEPEND="
285 + !!net-misc/mediatomb
286 + net-libs/libupnp:1.8[reuseaddr]
287 + >=dev-db/sqlite-3
288 + dev-libs/expat
289 + mysql? ( virtual/mysql )
290 + javascript? ( dev-lang/duktape )
291 + taglib? ( >=media-libs/taglib-1.11 )
292 + lastfm? ( >=media-libs/lastfmlib-0.4 )
293 + exif? ( media-libs/libexif )
294 + ffmpeg? (
295 + libav? ( >=media-video/libav-10:0= )
296 + !libav? ( >=media-video/ffmpeg-2.2:0= )
297 + )
298 + curl? ( net-misc/curl net-misc/youtube-dl )
299 + magic? ( sys-apps/file )
300 + sys-apps/util-linux
301 + sys-libs/zlib
302 + virtual/libiconv
303 +"
304 +RDEPEND="${DEPEND}"
305 +
306 +CONFIG_CHECK="~INOTIFY_USER"
307 +
308 +pkg_setup() {
309 + linux-info_pkg_setup
310 +
311 + enewgroup ${PN}
312 + enewuser ${PN} -1 -1 /dev/null ${PN}
313 +}
314 +
315 +src_configure() {
316 + local mycmakeargs=(
317 + -DWITH_CURL="$(usex curl)" \
318 + -DWITH_LOGGING=1 \
319 + -DWITH_DEBUG_LOGGING="$(usex debug)" \
320 + -DWITH_EXIF="$(usex exif)" \
321 + -DWITH_AVCODEC="$(usex ffmpeg)" \
322 + -DWITH_JS="$(usex javascript)" \
323 + -DWITH_LASTFM="$(usex lastfm)" \
324 + -DWITH_MAGIC="$(usex magic)" \
325 + -DWITH_MYSQL="$(usex mysql)"
326 + )
327 +
328 + cmake-utils_src_configure
329 +}
330 +
331 +src_install() {
332 + cmake-utils_src_install
333 +
334 + systemd_dounit "${S}/scripts/systemd/${PN}.service"
335 + use mysql && systemd_dounit "${S}/scripts/systemd/${PN}-mysql.service"
336 +
337 + newinitd "${FILESDIR}/${PN}-1.0.0.initd" "${PN}"
338 + use mysql || sed -i -e "/use mysql/d" "${ED}/etc/init.d/${PN}"
339 + newconfd "${FILESDIR}/${PN}-1.0.0.confd" "${PN}"
340 +
341 + insinto /etc/${PN}
342 + newins "${FILESDIR}/${PN}-1.0.0.config" config.xml
343 + fperms 0600 /etc/${PN}/config.xml
344 + fowners gerbera:gerbera /etc/${PN}/config.xml
345 +
346 + keepdir /var/lib/${PN}
347 + fowners ${PN}:${PN} /var/lib/${PN}
348 +}
349 +
350 +pkg_postinst() {
351 + if use mysql ; then
352 + elog "Gerbera has been built with MySQL support and needs"
353 + elog "to be configured before being started. By default"
354 + elog "SQLite will be used."
355 + fi
356 +}
357
358 diff --git a/net-misc/gerbera/gerbera-9999.ebuild b/net-misc/gerbera/gerbera-9999.ebuild
359 new file mode 100644
360 index 00000000000..aff60159844
361 --- /dev/null
362 +++ b/net-misc/gerbera/gerbera-9999.ebuild
363 @@ -0,0 +1,98 @@
364 +# Copyright 1999-2017 Gentoo Foundation
365 +# Distributed under the terms of the GNU General Public License v2
366 +
367 +EAPI=6
368 +
369 +inherit cmake-utils eutils linux-info systemd user
370 +
371 +if [[ ${PV} == 9999 ]]; then
372 + EGIT_REPO_URI="https://github.com/v00d00/${PN}.git"
373 + KEYWORDS=""
374 + SRC_URI=""
375 + inherit git-r3
376 +else
377 + SRC_URI="https://github.com/v00d00/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
378 + KEYWORDS="~amd64 ~x86"
379 + S="${WORKDIR}/${P}"
380 +fi
381 +
382 +DESCRIPTION="UPnP Media Server (Based on MediaTomb)"
383 +HOMEPAGE="https://github.com/v00d00/gerbera"
384 +
385 +LICENSE="GPL-2"
386 +SLOT="0"
387 +IUSE="curl debug +exif +ffmpeg +javascript lastfm libav +magic mysql +taglib"
388 +
389 +DEPEND="
390 + !!net-misc/mediatomb
391 + net-libs/libupnp:1.8[reuseaddr]
392 + >=dev-db/sqlite-3
393 + dev-libs/expat
394 + mysql? ( virtual/mysql )
395 + javascript? ( dev-lang/duktape )
396 + taglib? ( >=media-libs/taglib-1.11 )
397 + lastfm? ( >=media-libs/lastfmlib-0.4 )
398 + exif? ( media-libs/libexif )
399 + ffmpeg? (
400 + libav? ( >=media-video/libav-10:0= )
401 + !libav? ( >=media-video/ffmpeg-2.2:0= )
402 + )
403 + curl? ( net-misc/curl net-misc/youtube-dl )
404 + magic? ( sys-apps/file )
405 + sys-apps/util-linux
406 + sys-libs/zlib
407 + virtual/libiconv
408 +"
409 +RDEPEND="${DEPEND}"
410 +
411 +CONFIG_CHECK="~INOTIFY_USER"
412 +
413 +pkg_setup() {
414 + linux-info_pkg_setup
415 +
416 + enewgroup ${PN}
417 + enewuser ${PN} -1 -1 /dev/null ${PN}
418 +}
419 +
420 +src_configure() {
421 + local mycmakeargs=(
422 + -DWITH_CURL="$(usex curl)" \
423 + -DWITH_LOGGING=1 \
424 + -DWITH_DEBUG_LOGGING="$(usex debug)" \
425 + -DWITH_EXIF="$(usex exif)" \
426 + -DWITH_AVCODEC="$(usex ffmpeg)" \
427 + -DWITH_JS="$(usex javascript)" \
428 + -DWITH_LASTFM="$(usex lastfm)" \
429 + -DWITH_MAGIC="$(usex magic)" \
430 + -DWITH_MYSQL="$(usex mysql)"
431 + )
432 +
433 + cmake-utils_src_configure
434 +}
435 +
436 +src_install() {
437 + cmake-utils_src_install
438 +
439 + systemd_dounit "${S}/scripts/systemd/${PN}.service"
440 + use mysql && systemd_dounit "${S}/scripts/systemd/${PN}-mysql.service"
441 +
442 + newinitd "${FILESDIR}/${PN}-1.0.0.initd" "${PN}"
443 + use mysql || sed -i -e "/use mysql/d" "${ED}/etc/init.d/${PN}"
444 + newconfd "${FILESDIR}/${PN}-1.0.0.confd" "${PN}"
445 +
446 + insinto /etc/${PN}
447 + newins "${FILESDIR}/${PN}-1.0.0.config" config.xml
448 + fperms 0600 /etc/${PN}/config.xml
449 + fowners gerbera:gerbera /etc/${PN}/config.xml
450 +
451 + keepdir /var/lib/${PN}
452 + fowners ${PN}:${PN} /var/lib/${PN}
453 +}
454 +
455 +pkg_postinst() {
456 + if use mysql ; then
457 + elog "Gerbera has been built with MySQL support and needs"
458 + elog "to be configured before being started. By default"
459 + elog "SQLite will be used."
460 + fi
461 +}
462
463 diff --git a/net-misc/gerbera/metadata.xml b/net-misc/gerbera/metadata.xml
464 new file mode 100644
465 index 00000000000..e244367f765
466 --- /dev/null
467 +++ b/net-misc/gerbera/metadata.xml
468 @@ -0,0 +1,19 @@
469 +<?xml version="1.0" encoding="UTF-8"?>
470 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
471 +<pkgmetadata>
472 + <maintainer type="person">
473 + <email>thev00d00@g.o</email>
474 + <name>Ian Whyman</name>
475 + </maintainer>
476 + <longdescription>Gerbera is a UPnP media server which allows you to stream your digital media through your home network and consume it on a variety of UPnP compatible devices.</longdescription>
477 + <use>
478 + <flag name="curl">Support YouTube and external media sources (e.g. internet radio)</flag>
479 + <flag name="lastfm">Enable last.fm support</flag>
480 + <flag name="magic">Use libmagic to determine file types</flag>
481 + <flag name="mysql">Use <pkg>dev-db/mysql</pkg> as backend rather than SQLite3</flag>
482 + <flag name="taglib">Use <pkg>media-libs/taglib</pkg> for reading files' metadata rather than id3lib</flag>
483 + </use>
484 + <upstream>
485 + <remote-id type="github">v00d00/gerbera</remote-id>
486 + </upstream>
487 +</pkgmetadata>