Skip to content

Commit

Permalink
Merge from vendor branch FIX_VENDOR:
Browse files Browse the repository at this point in the history
Re-import zeya, this time with correct name.

ok ajacoutot@, sthen@, rpointel@
  • Loading branch information
David Coppa committed Jul 20, 2011
2 parents b1c93fa + e03e93a commit 6054bb8
Show file tree
Hide file tree
Showing 12 changed files with 261 additions and 0 deletions.
64 changes: 64 additions & 0 deletions audio/zeya/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# $OpenBSD: Makefile,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $

COMMENT = html5-powered web music server

MODPY_EGG_VERSION = 0.5
DISTNAME = zeya_${MODPY_EGG_VERSION}.orig
PKGNAME = zeya-${MODPY_EGG_VERSION}
REVISION = 0
CATEGORIES = audio www

HOMEPAGE = http://web.psung.name/zeya/

MASTER_SITES = http://archive.ubuntu.com/ubuntu/pool/universe/z/zeya/ \
http://ftp.de.debian.org/debian/pool/main/z/zeya/

MAINTAINER = David Coppa <[email protected]>

# AGPLv3 (GNU Affero Public License)
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes

MODULES = lang/python

RUN_DEPENDS = audio/faad \
audio/flac \
audio/mpg123 \
audio/py-tagpy \
audio/vorbis-tools \
devel/py-simplejson

MODPY_ADJ_FILES = zeya.py \
zeyaclient.py \
zeyatest.py

ZEYA_MODULES = ${WRKBUILD}/backends.py \
${WRKBUILD}/common.py \
${WRKBUILD}/decoders.py \
${WRKBUILD}/directory.py \
${WRKBUILD}/m3u.py \
${WRKBUILD}/options.py \
${WRKBUILD}/pls.py \
${WRKBUILD}/rhythmbox.py

NO_BUILD = Yes
NO_REGRESS = Yes
PKG_ARCH = *
WRKDIST = ${WRKDIR}

do-install:
${SUBST_CMD} ${WRKBUILD}/backends.py \
${WRKBUILD}/decoders.py ${WRKBUILD}/zeya.py \
${WRKBUILD}/zeyaclient.py
${INSTALL_SCRIPT} ${WRKBUILD}/zeya.py ${PREFIX}/sbin/zeya
${INSTALL_SCRIPT} ${WRKBUILD}/zeyaclient.py \
${PREFIX}/bin/zeyaclient
${INSTALL_DATA_DIR} ${PREFIX}/lib/zeya ${PREFIX}/share/zeya
${INSTALL_DATA} ${ZEYA_MODULES} ${PREFIX}/lib/zeya/
${INSTALL_DATA} ${WRKBUILD}/resources/* ${PREFIX}/share/zeya/
${INSTALL_MAN} ${WRKBUILD}/doc/zeyaclient.1 ${PREFIX}/man/man1/
${INSTALL_MAN} ${WRKBUILD}/doc/zeya.1 ${PREFIX}/man/man8/zeya.8

.include <bsd.port.mk>
5 changes: 5 additions & 0 deletions audio/zeya/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MD5 (zeya_0.5.orig.tar.gz) = lXRRzOT2Ofv93y96oSlRKg==
RMD160 (zeya_0.5.orig.tar.gz) = qUUGdMpzG5HutNqn38PPUOgyHEM=
SHA1 (zeya_0.5.orig.tar.gz) = 71U04/Ep7/YCw3z5PYAMfmRjy/Q=
SHA256 (zeya_0.5.orig.tar.gz) = lHdKHECDcK8v8yvIYzyGLpYLlVKvIVutmchEFRtwe5M=
SIZE (zeya_0.5.orig.tar.gz) = 54245
12 changes: 12 additions & 0 deletions audio/zeya/patches/patch-backends_py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$OpenBSD: patch-backends_py,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $
--- backends.py.orig Mon Jul 11 11:38:36 2011
+++ backends.py Mon Jul 11 11:41:08 2011
@@ -70,7 +70,7 @@ def filename_to_stream(filename, out_stream, bitrate,
except KeyError:
raise StreamGenerationError(
"Couldn't play specified format: %r" % (filename,))
- encoder_path = "/usr/bin/oggenc"
+ encoder_path = "${LOCALBASE}/bin/oggenc"
if not os.path.exists(encoder_path):
raise StreamGenerationError(
("No Vorbis encoder found at %s. " % (encoder_path,)) + \
29 changes: 29 additions & 0 deletions audio/zeya/patches/patch-decoders_py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$OpenBSD: patch-decoders_py,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $
--- decoders.py.orig Mon Jul 11 11:38:30 2011
+++ decoders.py Mon Jul 11 11:42:12 2011
@@ -27,17 +27,17 @@ import os

# To use any of the command lines, append a filename as the last argument.
decoders = {
- 'flac': ("/usr/bin/flac", "-d", "-c", "--totally-silent"),
- 'mp3': ("/usr/bin/mpg123", "-s", "-q"),
- 'ogg': ("/usr/bin/oggdec", "-Q", "-o", "-"),
- 'm4a': ("/usr/bin/faad", "-w", "-q"),
+ 'flac': ("${LOCALBASE}/bin/flac", "-d", "-c", "--totally-silent"),
+ 'mp3': ("${LOCALBASE}/bin/mpg123", "-s", "-q"),
+ 'ogg': ("${LOCALBASE}/bin/oggdec", "-Q", "-o", "-"),
+ 'm4a': ("${LOCALBASE}/bin/faad", "-w", "-q"),
}

decoder_messages = {
- 'flac': "/usr/bin/flac not found. Please install 'flac' to play .flac files.",
- 'mp3': "/usr/bin/mpg123 not found. Please install 'mpg123' to play .mp3 files.",
- 'ogg': "/usr/bin/oggdec not found. Please install 'vorbis-tools' to play .ogg files.",
- 'm4a': "/usr/bin/faad not found. Please install 'faad' to play .m4a files.",
+ 'flac': "${LOCALBASE}/bin/flac not found. Please install 'flac' to play .flac files.",
+ 'mp3': "${LOCALBASE}/bin/mpg123 not found. Please install 'mpg123' to play .mp3 files.",
+ 'ogg': "${LOCALBASE}/bin/oggdec not found. Please install 'vorbis-tools' to play .ogg files.",
+ 'm4a': "${LOCALBASE}/bin/faad not found. Please install 'faad' to play .m4a files.",
}

# The set of extensions for which we've warned the user that the decoder is not
23 changes: 23 additions & 0 deletions audio/zeya/patches/patch-directory_py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$OpenBSD: patch-directory_py,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $

Fall back gracefully when 'followlinks' arg is not supported
(upstream git commit e9e8033274102d34541f54d530b8e4dd5096b23e)

--- directory.py.orig Tue Sep 21 08:13:42 2010
+++ directory.py Mon Jul 11 10:58:20 2011
@@ -169,7 +169,14 @@ class DirectoryBackend(LibraryBackend):
raise IOError("Error: directory %r doesn't exist." % (self._media_path,))
print "Scanning for music in %r..." % (os.path.abspath(self._media_path),)
# Iterate over all the files.
- for path, dirs, files in os.walk(self._media_path, followlinks=True):
+ try:
+ all_files_recursively = os.walk(self._media_path, followlinks=True)
+ except TypeError:
+ # os.walk in Python 2.5 and earlier don't support the followlinks
+ # argument. Fall back to not including it (in this case, Zeya will
+ # not index music underneath symlinked directories).
+ all_files_recursively = os.walk(self._media_path)
+ for path, dirs, files in all_files_recursively:
# Sort dirs so that subdirectories will subsequently be visited
# alphabetically (see os.walk).
dirs.sort(key=tokenize_filename)
20 changes: 20 additions & 0 deletions audio/zeya/patches/patch-doc_zeya_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$OpenBSD: patch-doc_zeya_1,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $
--- doc/zeya.1.orig Tue Sep 21 08:13:42 2010
+++ doc/zeya.1 Thu Jul 14 15:46:11 2011
@@ -5,7 +5,7 @@
\\$2 \(la\\$1\(ra\\$3
..
.if \n(.g .mso www.tmac
-.TH zeya 1 2009-10-19 "" ""
+.TH zeya 8 2009-10-19 "" ""
.SH NAME
zeya \- a web music server
.SH SYNOPSIS
@@ -67,7 +67,3 @@ format.
.SH COPYRIGHT
Zeya was written by Phil Sung and Samson Yeung and is licensed
under the terms of the GNU Affero GPL license, version 3 or later.
-.SH "SEE ALSO"
-\*(T<\fI/usr/share/doc/zeya/README\fR\*(T>
-.PP
-\*(T<\fI/usr/share/doc/zeya/TODO\fR\*(T>
11 changes: 11 additions & 0 deletions audio/zeya/patches/patch-doc_zeyaclient_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$OpenBSD: patch-doc_zeyaclient_1,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $
--- doc/zeyaclient.1.orig Mon Jul 11 11:15:58 2011
+++ doc/zeyaclient.1 Mon Jul 11 11:16:29 2011
@@ -35,7 +35,3 @@ to return to the prompt.
\fBzeyaclient\fR was written by Phil Sung and is
licensed under the terms of the GNU Affero GPL license, version 3
or later.
-.SH "SEE ALSO"
-\*(T<\fI/usr/share/doc/zeya/README\fR\*(T>
-.PP
-\*(T<\fI/usr/share/doc/zeya/TODO\fR\*(T>
32 changes: 32 additions & 0 deletions audio/zeya/patches/patch-zeya_py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$OpenBSD: patch-zeya_py,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $
--- zeya.py.orig Tue Sep 21 08:13:42 2010
+++ zeya.py Mon Jul 11 18:59:16 2011
@@ -50,6 +50,10 @@ try:
except (ImportError, AttributeError):
import simplejson as json

+modules_dir = '${TRUEPREFIX}/lib/zeya'
+
+sys.path.append(modules_dir)
+
import backends
import decoders
import options
@@ -347,7 +351,7 @@ def run_server(backend, bind_address, port, bitrate, b
'playlists': playlists }

library_repr = json.dumps(output, ensure_ascii=False)
- basedir = os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0])))
+ basedir = modules_dir

auth_data = None
if basic_auth_file is not None:
@@ -357,7 +361,7 @@ def run_server(backend, bind_address, port, bitrate, b
auth_data[s_user] = s_pass
zeya_handler = ZeyaHandler(backend,
library_repr,
- os.path.join(basedir, 'resources'),
+ '${TRUEPREFIX}/share/zeya',
bitrate,
auth_type=NO_AUTH if basic_auth_file is None else BASIC_AUTH,
auth_data=auth_data,
12 changes: 12 additions & 0 deletions audio/zeya/patches/patch-zeyaclient_py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$OpenBSD: patch-zeyaclient_py,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $
--- zeyaclient.py.orig Mon Jul 11 11:38:24 2011
+++ zeyaclient.py Mon Jul 11 11:42:34 2011
@@ -99,7 +99,7 @@ def run(server_path):
for song in matching_songs:
print "\r%s - %s" % (song['title'], song['artist'])
song_url = "%s/getcontent?key=%d" % (server_path, song['key'])
- p = subprocess.Popen(["/usr/bin/ogg123", "-q", song_url])
+ p = subprocess.Popen(["${LOCALBASE}/bin/ogg123", "-q", song_url])
try:
p.communicate()
except KeyboardInterrupt:
5 changes: 5 additions & 0 deletions audio/zeya/pkg/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Zeya is a media player that lets you bring your music to any computer
with a web browser. The client runs in any browser that supports the
HTML5 draft standard technologies (Mozilla Firefox 4.0+, Google Chrome
or Chromium 4.0.223+, Microsoft Internet Explorer 6, 7, or 8 with the
Google Chrome Frame plugin).
32 changes: 32 additions & 0 deletions audio/zeya/pkg/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $
@pkgpath audio/py-zeya
@newgroup _zeya:680
@newuser _zeya:680:_zeya:daemon:zeya user:/nonexistent:/sbin/nologin
bin/zeyaclient
lib/zeya/
lib/zeya/backends.py
lib/zeya/common.py
lib/zeya/decoders.py
lib/zeya/directory.py
lib/zeya/m3u.py
lib/zeya/options.py
lib/zeya/pls.py
lib/zeya/rhythmbox.py
@man man/man1/zeyaclient.1
@man man/man8/zeya.8
sbin/zeya
share/zeya/
share/zeya/clear_search.png
share/zeya/favicon.png
share/zeya/library.html
share/zeya/next.png
share/zeya/pause.png
share/zeya/play.png
share/zeya/previous.png
share/zeya/repeat.png
share/zeya/search.png
share/zeya/shuffle.png
share/zeya/spinner.gif
share/zeya/zeya.css
share/zeya/zeya.js
@rcscript ${RCDIR}/zeya
16 changes: 16 additions & 0 deletions audio/zeya/pkg/zeya.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
#
# $OpenBSD: zeya.rc,v 1.1.1.1 2011/07/20 07:54:58 dcoppa Exp $

daemon="${TRUEPREFIX}/sbin/zeya"
daemon_flags="--path=/var/tmp"
daemon_user="_zeya"

. /etc/rc.d/rc.subr

pexp="${MODPY_BIN} ${daemon}${daemon_flags:+ ${daemon_flags}}"

rc_bg=YES
rc_reload=NO

rc_cmd $1

0 comments on commit 6054bb8

Please sign in to comment.