summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2009-03-01 14:07:03 +0000
committerPatrick Lauer <patrick@gentoo.org>2009-03-01 14:07:03 +0000
commit622948b2d1b687505c95a8d7b2a2900d42ddf788 (patch)
tree03b30941be51a8caad74b3411c6443c8c766ca5e /media-sound/edna
parentReally fix bug 232636. export LC_ALL=C (diff)
downloadgentoo-2-622948b2d1b687505c95a8d7b2a2900d42ddf788.tar.gz
gentoo-2-622948b2d1b687505c95a8d7b2a2900d42ddf788.tar.bz2
gentoo-2-622948b2d1b687505c95a8d7b2a2900d42ddf788.zip
Bump to 0.6. Fixes #137569. Patches by Chris Mayo.
(Portage version: 2.2_rc23/cvs/Linux x86_64)
Diffstat (limited to 'media-sound/edna')
-rw-r--r--media-sound/edna/ChangeLog12
-rw-r--r--media-sound/edna/edna-0.6.ebuild71
-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.gentoo19
7 files changed, 331 insertions, 11 deletions
diff --git a/media-sound/edna/ChangeLog b/media-sound/edna/ChangeLog
index 46070c8545fa..0b89739445a5 100644
--- a/media-sound/edna/ChangeLog
+++ b/media-sound/edna/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for media-sound/edna
-# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/edna/ChangeLog,v 1.27 2007/02/22 00:57:12 peper Exp $
+# Copyright 2000-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/edna/ChangeLog,v 1.28 2009/03/01 14:07:03 patrick Exp $
+
+*edna-0.6 (01 Mar 2009)
+
+ 01 Mar 2009; Patrick Lauer <patrick@gentoo.org>
+ +files/edna-0.6-SystemExit.patch, +files/edna-0.6-daemon.patch,
+ +files/edna-0.6-flac.patch, +files/edna-0.6-syslog.patch,
+ files/edna.gentoo, +edna-0.6.ebuild:
+ Bump to 0.6. Fixes #137569. Patches by Chris Mayo.
22 Feb 2007; Piotr Jaroszyński <peper@gentoo.org> ChangeLog:
Transition to Manifest2.
diff --git a/media-sound/edna/edna-0.6.ebuild b/media-sound/edna/edna-0.6.ebuild
new file mode 100644
index 000000000000..ed855fb00934
--- /dev/null
+++ b/media-sound/edna/edna-0.6.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/edna/edna-0.6.ebuild,v 1.1 2009/03/01 14:07:03 patrick Exp $
+
+inherit eutils
+
+IUSE="flac vorbis"
+
+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"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+
+DEPEND="|| ( >=dev-lang/python-2.5 ( >=dev-lang/python-2.3 >=dev-python/ctypes-1.0.0 ) )
+ flac? ( media-libs/mutagen )
+ oggvorbis? ( dev-python/pyogg )"
+RDEPEND=${DEPEND}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${P}"-SystemExit.patch
+ epatch "${FILESDIR}/${P}"-flac.patch
+ epatch "${FILESDIR}/${P}"-daemon.patch
+ epatch "${FILESDIR}/${P}"-syslog.patch
+}
+
+src_install() {
+ einfo "Installing in daemon mode"
+ newinitd "${FILESDIR}"/edna.gentoo edna
+
+ dodir /usr/bin /usr/$(get_libdir)/edna /usr/$(get_libdir)/edna/templates
+ exeinto /usr/bin ; newexe edna.py edna
+ exeinto /usr/$(get_libdir)/edna ; doexe ezt.py
+ exeinto /usr/$(get_libdir)/edna ; doexe MP3Info.py
+ insinto /usr/$(get_libdir)/edna/templates
+ insopts -m 644
+ doins templates/*
+ insinto /usr/$(get_libdir)/edna/resources
+ doins resources/*
+
+ insinto /etc/edna
+ insopts -m 644
+ 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
+
+ einfo
+ einfo "Edit edna.conf to taste before starting (multiple source"
+ einfo "directories are allowed). Test edna from a shell prompt"
+ einfo "until you have it configured properly, then add edna to"
+ einfo "the default runlevel when you're ready. Add the USE flag"
+ einfo "vorbis if you want edna to serve ogg files."
+ einfo
+ einfo "See edna.conf and the html docs for more info, and set"
+ einfo "PYTHONPATH=/usr/lib/edna to run from a shell prompt."
+ einfo
+}
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
index cf46fc45398f..04660e0ffe3f 100644
--- a/media-sound/edna/files/edna.gentoo
+++ b/media-sound/edna/files/edna.gentoo
@@ -7,24 +7,25 @@
# pidfile: /var/run/ednad.pid
# config:
-export PYTHONPATH=/usr/lib/edna
+PYTHONPATH=/usr/lib/edna
EDNA=/usr/bin/edna
EDNACONF=/etc/edna/edna.conf
PIDFILE=/var/run/edna.pid
+USER=edna
depend() {
- need local
+ need local
}
start() {
- ebegin "Starting ednad mp3 server"
- start-stop-daemon -m -b --start --quiet --pidfile $PIDFILE \
- --exec $EDNA -- $EDNACONF
- eend $?
+ 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 -o --quiet --stop --pidfile $PIDFILE
- eend $?
+ ebegin "Stopping ednad"
+ start-stop-daemon --quiet --stop --pidfile $PIDFILE
+ eend $?
}