summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /media-sound/edna
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'media-sound/edna')
-rw-r--r--media-sound/edna/Manifest1
-rw-r--r--media-sound/edna/edna-0.6.ebuild69
-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.xml11
8 files changed, 352 insertions, 0 deletions
diff --git a/media-sound/edna/Manifest b/media-sound/edna/Manifest
new file mode 100644
index 000000000000..d517b3fe3ea8
--- /dev/null
+++ b/media-sound/edna/Manifest
@@ -0,0 +1 @@
+DIST edna-0.6.tar.gz 50303 SHA256 601aea3af9fe37407cd9523978e69c71785e09b5d8d57ca911a74c3ce3740c4c SHA512 d48786829c127b0a1e24116524b8b95a91990c8952882ef00d7761fc6c1dd9b4b0037af2b176dbfd066b6d80670bad7a0c724af984b24c6b4bde93c884c3b76b WHIRLPOOL 3850124bdf07f79f10db2926968a0fde99884781d5afb9a67b9ad5afd014e65723e80fd966f9b91cb5e4aba709a6faadcf494be71421d0e1c3b150541db4dcad
diff --git a/media-sound/edna/edna-0.6.ebuild b/media-sound/edna/edna-0.6.ebuild
new file mode 100644
index 000000000000..b78066ed71a4
--- /dev/null
+++ b/media-sound/edna/edna-0.6.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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..04660e0ffe3f
--- /dev/null
+++ b/media-sound/edna/files/edna.gentoo
@@ -0,0 +1,31 @@
+#!/sbin/runscript
+#
+# 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..096a93c11ccf
--- /dev/null
+++ b/media-sound/edna/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sound</herd>
+ <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>