summaryrefslogtreecommitdiff
path: root/media-sound/edna
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-sound/edna
reinit the tree, so we can have metadata
Diffstat (limited to 'media-sound/edna')
-rw-r--r--media-sound/edna/Manifest10
-rw-r--r--media-sound/edna/edna-0.6.ebuild68
-rw-r--r--media-sound/edna/files/edna-0.6-SystemExit.patch11
-rw-r--r--media-sound/edna/files/edna-0.6-daemon.patch67
-rw-r--r--media-sound/edna/files/edna-0.6-flac.patch79
-rw-r--r--media-sound/edna/files/edna-0.6-syslog.patch83
-rw-r--r--media-sound/edna/files/edna.gentoo31
-rw-r--r--media-sound/edna/metadata.xml14
8 files changed, 363 insertions, 0 deletions
diff --git a/media-sound/edna/Manifest b/media-sound/edna/Manifest
new file mode 100644
index 000000000000..be3b1c9caddc
--- /dev/null
+++ b/media-sound/edna/Manifest
@@ -0,0 +1,10 @@
+AUX edna-0.6-SystemExit.patch 357 SHA256 530edecafcce36325efa7a68bb44438141639cc2d46bcda6cdf647ae28477cbf SHA512 281557f2a4c90941918bc7b0330b9edceb6f37441bd6726f64f0633e7b5dc0a507a933fe011e0e2eb9eae7639db9c54195ec3374b24cffa7697fbcad855e0bd7 WHIRLPOOL 0ab11df5aec4c3a917dc32c65a437dceb20775b25dbe3f6860639d85dc7f5476894e748cadea797600bebbd93d89b42d04b21e0fb721a993fb161081f58e8aed
+AUX edna-0.6-daemon.patch 2160 SHA256 eda1dc40464a031f816f1023978bb2f7180532cd1e3d134d9bbf52f37cdb7fcd SHA512 ade179d94a2ecdaafc3da58323e4e0cd8a7ede123fad51d6367b23fea235dfd70e5afd6b1562ee8703c4c5478d28358adb6d454893bff70885563e09cc03245e WHIRLPOOL d0f07e608bb459a9f9a24f9e768692fa91b89ca6509049842ceeb9943402353ad2f78500f0f244b7516a5015fa94c53b844ff93eb3cfff4b5067774e2e22af3a
+AUX edna-0.6-flac.patch 1989 SHA256 ff09556d11afa9c3681c71e6223f0fe1de10f7f4e345023ef4f6ebd45f80bea8 SHA512 4b87735c7458893371298d5a2596c74eec467ae75736cd485f5e7713db675784fed924ae744727b187be4cf2b4c60043c3dcd2a7a93ebf07e900a1d5b5b822ac WHIRLPOOL fe4ebf198099344565893185ee50139ff3cc97d74c9c5899021979f9dcff8c16c2b4d04c12272ac3a1dde09a4184943d9a0b0f2ccaa0be43135c7d9680c47d45
+AUX edna-0.6-syslog.patch 2455 SHA256 0f1afbe35cffbb0cd355ef658e2fee142f9e05e7e798a989dd08a0cf850cb453 SHA512 458e3170c7b1dc556474811c6786576e6b6b72ad3a887f96f91a1a7f1563274f72b5e717e1e650f3ddff63a6dee41bd51893a2f5a856401f286f7a9b52af153d WHIRLPOOL 153ee57533dcd46c97bd09ffbe7fdde9ec1f6a5e5ba6ce6fc02c0abf97755f7700056fd0753396f9f84ff634af15cff9be27b3d3d3758265c2e51a001cacc5e4
+AUX edna.gentoo 595 SHA256 25edec63fea541682759e4b2caf7c7c6234d80d13b489666a1bc80b7e2d14819 SHA512 9a005074cb39fa2669405fe60b633d388d47d92c73fb4f6ac1c8b384f62a7681604e62dfab57fcdc491076da7fd03b9d41797bf57fd6c4cb4a073b5a8cdf5b04 WHIRLPOOL e257ca317b6e275172b7763432092a2d1590f7318d99855a81cf804ee8758af0cdeb3ffec64c2c92d342b2f29b2cfa4f88a09e76ef89a8ce3319b3557b022203
+DIST edna-0.6.tar.gz 50303 SHA256 601aea3af9fe37407cd9523978e69c71785e09b5d8d57ca911a74c3ce3740c4c SHA512 d48786829c127b0a1e24116524b8b95a91990c8952882ef00d7761fc6c1dd9b4b0037af2b176dbfd066b6d80670bad7a0c724af984b24c6b4bde93c884c3b76b WHIRLPOOL 3850124bdf07f79f10db2926968a0fde99884781d5afb9a67b9ad5afd014e65723e80fd966f9b91cb5e4aba709a6faadcf494be71421d0e1c3b150541db4dcad
+EBUILD edna-0.6.ebuild 1817 SHA256 53f500003767d34a83988cc53673b768742b2eceab963aa1b61e061c6faf6650 SHA512 55b7d4dd43ead18d580013bd16e9655b7fc0714f0fbec5582f18a71b2a604fbf283034546c8323b2fe6b6859cb4aa8f95e5c47b0d033ba67635e94681f0f8389 WHIRLPOOL b3384477cf625fa5761992abd0f12d69bda034d89f4d19d7ece0c7f01457577350208b23d3bcf4fb838b83f1bc75747d3caaf471d3b3dff3e1dc3bcb326b8898
+MISC ChangeLog 2691 SHA256 fa9d22a180d444f6b7651907accf1dd42c1789934707115fa9d9482c0ecebf86 SHA512 9b6712374d89cd5ae4e3780aa3e0a23bdcf7fe40dd6462c00b32631c2ca64c948b1d7c9331331dbad1a3aa8f3d54fb0f5e67d4c84cdcf9a9d39bb4882e43bf1b WHIRLPOOL 1e041fc7285ef016dfc42d82222ef337f26cc649c57e48f12abd87ea66230371f84babeb6d08a88a39810e0e826696d301001352cd1f422b26978f3466718c51
+MISC ChangeLog-2015 5127 SHA256 db2f01f8626f316e11d603c64fe7fc5087e4e38bf2d615ea62ae4fc524e9ef5d SHA512 36ae0d93c22eb197075be82a4ee0e96a8d3c194ef6001b17f59929362b283829665b78f200e55f650a905efe0d9a2e56d952dec22518099adfd75c94e5c1a382 WHIRLPOOL babaf0259a500e332360d06e8f3c8f5941b0d5a43c75594dae17084bfa8d9d72f537a34611fd82125cbc9ea1f2809f3ba499aa9f004ccb73aa8325d862dfb69f
+MISC metadata.xml 450 SHA256 3160511eedcac605117e75e462194e6ee515c72ad52801c1b39592ae55cc0f22 SHA512 8598429fe8407b3522d408ed0de58310bb3902d6f27f78c980adc9ca43992a7010f43d059bd7b85849465ba60b019f7b858405d7d5f950b86bdb4f0ed3d1dbfd WHIRLPOOL 7301b4a8faa40a88a834187ca9059a43cd8dbccfcf80498b5c628a2e54d5bdd904a9bd56044f24ed21bba2182978765f78a0c4fdfc8faabfcdb8a61a8eba6d1e
diff --git a/media-sound/edna/edna-0.6.ebuild b/media-sound/edna/edna-0.6.ebuild
new file mode 100644
index 000000000000..4e8485623966
--- /dev/null
+++ b/media-sound/edna/edna-0.6.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib user python-r1
+
+DESCRIPTION="Greg Stein's python streaming audio server for desktop or LAN use"
+HOMEPAGE="http://edna.sourceforge.net/"
+SRC_URI="mirror://sourceforge/edna/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ~mips ppc ppc64 sparc x86"
+IUSE="flac ogg"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ flac? ( media-libs/mutagen[${PYTHON_USEDEP}] )
+ ogg? ( dev-python/pyogg[${PYTHON_USEDEP}] )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${P}"-SystemExit.patch \
+ "${FILESDIR}/${P}"-flac.patch \
+ "${FILESDIR}/${P}"-daemon.patch \
+ "${FILESDIR}/${P}"-syslog.patch
+}
+
+src_install() {
+ newinitd "${FILESDIR}"/edna.gentoo edna
+
+ python_foreach_impl python_newscript edna.py edna
+
+ python_scriptinto /usr/$(get_libdir)/edna
+ python_foreach_impl python_domodule ezt.py MP3Info.py
+
+ python_foreach_impl python_optimize
+
+ insinto /usr/$(get_libdir)/edna
+ doins -r templates resources
+
+ insinto /etc/edna
+ doins edna.conf
+
+ dosym /usr/$(get_libdir)/edna/resources /etc/edna/resources
+ dosym /usr/$(get_libdir)/edna/templates /etc/edna/templates
+
+ dodoc README ChangeLog
+ dohtml -r www/*
+}
+
+pkg_postinst() {
+ enewgroup edna
+ enewuser edna -1 -1 -1 edna
+
+ elog "Edit edna.conf to taste before starting (multiple source"
+ elog "directories are allowed). Test edna from a shell prompt"
+ elog "until you have it configured properly, then add edna to"
+ elog "the default runlevel when you're ready. Add the USE flag"
+ elog "vorbis if you want edna to serve ogg files."
+ elog "See edna.conf and the html docs for more info, and set"
+ elog "PYTHONPATH=/usr/lib/edna to run from a shell prompt."
+}
diff --git a/media-sound/edna/files/edna-0.6-SystemExit.patch b/media-sound/edna/files/edna-0.6-SystemExit.patch
new file mode 100644
index 000000000000..78aec6f3176a
--- /dev/null
+++ b/media-sound/edna/files/edna-0.6-SystemExit.patch
@@ -0,0 +1,11 @@
+--- edna.py.orig 2007-01-27 15:31:00.000000000 +0000
++++ edna.py 2007-01-27 16:03:30.000000000 +0000
+@@ -1159,7 +1159,7 @@
+
+ if os.path.isfile(fname) != 1:
+ print "edna: %s:No such file" %fname
+- raise systemExit
++ raise SystemExit
+
+ if daemon_mode:
+ daemonize('/dev/null', '/var/log/edna.log', '/var/log/edna.log', '/var/run/edna.pid')
diff --git a/media-sound/edna/files/edna-0.6-daemon.patch b/media-sound/edna/files/edna-0.6-daemon.patch
new file mode 100644
index 000000000000..e003689956a7
--- /dev/null
+++ b/media-sound/edna/files/edna-0.6-daemon.patch
@@ -0,0 +1,67 @@
+--- edna.py.orig 2007-01-27 18:49:16.000000000 +0000
++++ edna.py 2007-01-27 18:47:19.000000000 +0000
+@@ -36,7 +36,9 @@
+ import string
+ import os
+ import cgi
++import ctypes
+ import urllib
++import pwd
+ import socket
+ import re
+ import stat
+@@ -1149,7 +1151,7 @@
+ print ' if config-file is not specified, then edna.conf is used'
+ sys.exit(0)
+
+-def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null',pname=''):
++def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null', pname='', uid = None):
+ '''This forks the current process into a daemon.
+ The stdin, stdout, and stderr arguments are file names that
+ will be opened and be used to replace the standard file descriptors
+@@ -1159,6 +1161,11 @@
+ if it shares a file with stdout then interleaved output
+ may not appear in the order that you expect.
+ '''
++ # Rename process in /proc/<pid>/stat from python to edna
++ # (helps start-stop-daemon find us)
++ libc = ctypes.CDLL('/lib/libc.so.6')
++ libc.prctl(15, 'edna\0', 0, 0, 0)
++
+ # Do first fork.
+ try:
+ pid = os.fork()
+@@ -1186,6 +1193,8 @@
+ sys.stderr.write("fork #2 failed: (%d) %s\n" % (e.errno, e.strerror) )
+ sys.exit(1)
+ # Now I am a daemon!
++ # If specified change the process owner
++ if uid: os.setuid(uid)
+ # Redirect standard file descriptors.
+ si = open(stdin, 'r')
+ so = open(stdout, 'a+')
+@@ -1198,9 +1207,16 @@
+ if __name__ == '__main__':
+ fname = 'edna.conf'
+ daemon_mode=0
++ uid = os.getuid()
++ pidfile = '/var/run/edna.pid'
+ for a in sys.argv[1:]:
+ if a == "--daemon":
+ daemon_mode=1
++ elif a.startswith("--user"):
++ uname = a.split("=")[1].strip()
++ uid = pwd.getpwnam(uname)[2]
++ elif a.startswith("--pidfile"):
++ pidfile = a.split("=")[1].strip()
+ elif a == "--help" or a == "-h" or string.find(a, '--')==0:
+ usage()
+ else:
+@@ -1211,6 +1227,6 @@
+ raise SystemExit
+
+ if daemon_mode:
+- daemonize('/dev/null', '/var/log/edna.log', '/var/log/edna.log', '/var/run/edna.pid')
++ daemonize(uid = uid, pname = pidfile)
+
+ run_server(fname)
diff --git a/media-sound/edna/files/edna-0.6-flac.patch b/media-sound/edna/files/edna-0.6-flac.patch
new file mode 100644
index 000000000000..b22687d2fb05
--- /dev/null
+++ b/media-sound/edna/files/edna-0.6-flac.patch
@@ -0,0 +1,79 @@
+--- edna.py.orig 2007-01-31 19:25:14.000000000 +0000
++++ edna.py 2007-01-31 20:55:09.000000000 +0000
+@@ -64,6 +64,12 @@
+ oggSupport = 'no'
+
+ try:
++ from mutagen.flac import FLAC
++ flacSupport = True
++except ImportError:
++ flacSupport = False
++
++try:
+ import cStringIO
+ StringIO = cStringIO
+ except ImportError:
+@@ -920,6 +926,9 @@
+ if ext == '.ogg':
+ info = OggInfo(fullpath)
+ self.__dict__.update(info.__dict__)
++ elif ext == '.flac':
++ info = FlacInfo(fullpath)
++ self.__dict__.update(info.__dict__)
+ else:
+ info = MP3Info.MP3Info(open(fullpath, 'rb'))
+ self.__dict__.update(info.__dict__)
+@@ -1001,6 +1010,45 @@
+ self.transcoded = val
+ self.valid = 1
+
++class FlacInfo:
++ def __init__(self, name):
++ # Setup the defaults
++ self.valid = 0
++ self.total_time = 0
++ self.samplerate = 'unknown'
++ self.bitrate = 'unknown'
++ self.mode = ''
++ self.mode_extension = ''
++
++ if not flacSupport: return
++
++ mflac = FLAC(name)
++ streaminfo = mflac.metadata_blocks[0]
++
++ self.samplerate = streaminfo.sample_rate
++ self.total_time = streaminfo.length
++ self.bitrate =int(round((streaminfo.bits_per_sample * streaminfo.total_samples) / streaminfo.length))
++ self.filesize = os.path.getsize(name) / (1024 ** 2)
++
++ for key, val in mflac.tags:
++ if key == 'TITLE':
++ self.title = val
++ elif key == 'ARTIST':
++ self.artist = val
++ elif key == 'ALBUM':
++ self.album = val
++ elif key == 'DATE':
++ self.year = val
++ elif key == 'GENRE':
++ self.genre = val
++ elif key == 'VENDOR':
++ self.vendor = val
++ elif key == 'TRACKNUMBER':
++ self.track = val
++ elif key == 'DESCRIPTION':
++ self.comment = val
++
++ self.valid = 1
+
+ def _usable_file(fname):
+ return fname[0] != '.'
+@@ -1044,6 +1092,7 @@
+ '.avi' : 'video/x-msvideo',
+ '.mpg' : 'video/mpeg',
+ '.ogg' : 'application/x-ogg',
++ '.flac' : 'audio/x-flac',
+ '.m4a' : 'audio/mp4',
+ '.mp4' : 'video/mp4',
+ }
diff --git a/media-sound/edna/files/edna-0.6-syslog.patch b/media-sound/edna/files/edna-0.6-syslog.patch
new file mode 100644
index 000000000000..4ff0bbf8bdb9
--- /dev/null
+++ b/media-sound/edna/files/edna-0.6-syslog.patch
@@ -0,0 +1,83 @@
+--- edna.py.orig 2007-01-27 18:53:24.000000000 +0000
++++ edna.py 2007-01-27 18:58:38.000000000 +0000
+@@ -42,6 +42,7 @@
+ import socket
+ import re
+ import stat
++import syslog
+ import random
+ import time
+ import struct
+@@ -144,6 +145,12 @@
+ self.log = open(log, 'a')
+ except IOError:
+ pass
++ else:
++ try:
++ syslog.openlog('edna')
++ self.log = True
++ except:
++ pass
+
+ template_path = config.get('server', 'template-dir')
+ template_file = config.get('server', 'template')
+@@ -254,7 +261,7 @@
+ (config.get('server', 'binding-hostname'), self.port),
+ EdnaRequestHandler)
+ except socket.error, value:
+- self.log_message( "edna: bind(): %s" % str(value[1]) )
++ self.log_message( "bind(): %s" % str(value[1]) )
+ raise SystemExit
+
+ def server_bind(self):
+@@ -290,12 +297,17 @@
+ return 0
+
+ def log_message(self, msg):
+- if self.log:
+- try:
+- self.log.write(msg + '\n')
+- self.log.flush()
+- except IOError:
+- pass
++ if self.log == True:
++ try:
++ syslog.syslog(msg)
++ except:
++ pass
++ elif self.log:
++ try:
++ self.log.write('edna: ' + msg + '\n')
++ self.log.flush()
++ except IOError:
++ pass
+
+ def debug_message(self, msg):
+ if debug_level<1:
+@@ -1125,21 +1137,21 @@
+
+ svr = Server(fname)
+ if oggSupport == 'yes':
+- svr.log_message('edna: Ogg Vorbis support enabled')
++ svr.log_message('Ogg Vorbis support enabled')
+ else:
+- svr.log_message('edna: Ogg Vorbis support disabled, to enable it you will need to install the "pyogg" and the "pyvorbis" modules')
++ svr.log_message('Ogg Vorbis support disabled, to enable it you will need to install the "pyogg" and the "pyvorbis" modules')
+
+- svr.log_message("edna: serving on port %d..." % svr.port)
++ svr.log_message("serving on port %d..." % svr.port)
+ try:
+ while running:
+ # print 'waiting ... '
+ if config_needed:
+- svr.log_message('edna: Reloading config %s' % fname)
++ svr.log_message('Reloading config %s' % fname)
+ svr.server_close()
+ svr = Server(fname)
+ config_needed = None
+ svr.handle_request()
+- svr.log_message ("edna: exiting")
++ svr.log_message ("exiting")
+ sys.exit(0)
+ except KeyboardInterrupt:
+ print "\nCaught ctr-c, taking down the server"
diff --git a/media-sound/edna/files/edna.gentoo b/media-sound/edna/files/edna.gentoo
new file mode 100644
index 000000000000..add215faca76
--- /dev/null
+++ b/media-sound/edna/files/edna.gentoo
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+#
+# Startup script for the edna mp3 mini server
+#
+# description: edna is a mini mp3 webserver
+# processname: python
+# pidfile: /var/run/ednad.pid
+# config:
+
+PYTHONPATH=/usr/lib/edna
+EDNA=/usr/bin/edna
+EDNACONF=/etc/edna/edna.conf
+PIDFILE=/var/run/edna.pid
+USER=edna
+
+depend() {
+ need local
+}
+
+start() {
+ ebegin "Starting edna mp3 server"
+ start-stop-daemon --env PYTHONPATH=$PYTHONPATH \
+ --start --exec $EDNA -- --daemon --user=$USER --pidfile=$PIDFILE $EDNACONF
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ednad"
+ start-stop-daemon --quiet --stop --pidfile $PIDFILE
+ eend $?
+}
diff --git a/media-sound/edna/metadata.xml b/media-sound/edna/metadata.xml
new file mode 100644
index 000000000000..34878382b07c
--- /dev/null
+++ b/media-sound/edna/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sound@gentoo.org</email>
+ <name>Gentoo Sound project</name>
+ </maintainer>
+ <longdescription>
+ Edna is Greg Stein's http streaming audio server for mp3 and ogg files.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">edna</remote-id>
+ </upstream>
+</pkgmetadata>