summaryrefslogtreecommitdiff
path: root/audio/coverhunter
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2004-10-13 23:41:25 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2004-10-13 23:41:25 +0000
commitfbcc2f642af5075f3735202b7fd21c1352167054 (patch)
tree6c8596426966a862a9aa084a700efdd1ad204b90 /audio/coverhunter
parentNew port: audio/icegenerator Direct streaming generator for Icecast/Shoutcast (diff)
New port: audio/coverhunter, a program fetching the covers of your digital music albums
CoverHunter will scan your digital music albums and try to get the cover image for each one. After that, if more than one cover was found, you can choose wich one will be set as the cover for that album. These covers may be used by XMMS, KDE, GNOME, etc. PR: ports/69053 Submitted by: Jean-Yves Lefort <jylefort@brutele.be>
Notes
Notes: svn path=/head/; revision=119337
Diffstat (limited to 'audio/coverhunter')
-rw-r--r--audio/coverhunter/Makefile64
-rw-r--r--audio/coverhunter/distinfo2
-rw-r--r--audio/coverhunter/files/patch-bin::coverhunter35
-rw-r--r--audio/coverhunter/pkg-descr9
-rw-r--r--audio/coverhunter/pkg-message7
-rw-r--r--audio/coverhunter/pkg-plist29
-rw-r--r--audio/coverhunter/scripts/py-compile92
7 files changed, 238 insertions, 0 deletions
diff --git a/audio/coverhunter/Makefile b/audio/coverhunter/Makefile
new file mode 100644
index 000000000000..f29a91a45d18
--- /dev/null
+++ b/audio/coverhunter/Makefile
@@ -0,0 +1,64 @@
+# New ports collection makefile for: coverhunter
+# Date created: 14 Jul 2004
+# Whom: Jean-Yves Lefort <jylefort@brutele.be>
+#
+# $FreeBSD$
+#
+
+PORTNAME= coverhunter
+PORTVERSION= 0.3
+CATEGORIES= audio graphics
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+
+MAINTAINER= jylefort@brutele.be
+COMMENT= A program fetching the covers of your digital music albums
+
+RUN_DEPENDS= ${PYTHON_SITELIBDIR}/PIL/__init__.py:${PORTSDIR}/graphics/py-imaging
+
+USE_X_PREFIX= yes
+USE_GNOME= pygtk2
+USE_PYTHON= 2.3+
+USE_REINPLACE= yes
+NO_BUILD= yes
+
+PYC= PYTHON="${PYTHON_CMD}" ${SH} ${SCRIPTDIR}/py-compile
+
+BINDIR= ${PREFIX}/bin
+PKGLIBDIR= ${PREFIX}/lib/coverhunter
+
+MODULES= __init__.py \
+ album.py \
+ amazon.py \
+ config.py \
+ libhunter.py \
+ musicfile.py \
+ source.py
+
+post-patch:
+ @${REINPLACE_CMD} -e \
+ 's|@PYTHON_CMD@|${PYTHON_CMD}|; \
+ s|@PKGLIBDIR@|${PKGLIBDIR}|; \
+ s|@DATADIR@|${DATADIR}|' ${WRKSRC}/bin/coverhunter
+
+do-install:
+ ${MKDIR} ${BINDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/bin/coverhunter ${BINDIR}
+ ${MKDIR} ${PKGLIBDIR}
+.for module in ${MODULES}
+ ${INSTALL_DATA} ${WRKSRC}/lib/${module} ${PKGLIBDIR}
+ ${PYC} --basedir ${PKGLIBDIR} ${PKGLIBDIR}/${module}
+.endfor
+ ${MKDIR} ${DATADIR}
+ ${INSTALL_DATA} \
+ ${WRKSRC}/data/CoverHunter.glade \
+ ${WRKSRC}/data/fetch_all.png \
+ ${WRKSRC}/data/nocover.gif \
+ ${WRKSRC}/data/picture.png \
+ ${WRKSRC}/data/searching.png \
+ ${DATADIR}
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/audio/coverhunter/distinfo b/audio/coverhunter/distinfo
new file mode 100644
index 000000000000..4206b59854a0
--- /dev/null
+++ b/audio/coverhunter/distinfo
@@ -0,0 +1,2 @@
+MD5 (coverhunter-0.3.tar.gz) = 005077d047b903b1dafa3f7943c85a40
+SIZE (coverhunter-0.3.tar.gz) = 27496
diff --git a/audio/coverhunter/files/patch-bin::coverhunter b/audio/coverhunter/files/patch-bin::coverhunter
new file mode 100644
index 000000000000..92b127b85ad7
--- /dev/null
+++ b/audio/coverhunter/files/patch-bin::coverhunter
@@ -0,0 +1,35 @@
+--- bin/coverhunter.orig Wed Jul 14 14:57:49 2004
++++ bin/coverhunter Wed Jul 14 15:01:58 2004
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#! @PYTHON_CMD@
+ # Copyright (c) 2003,2004 Guilherme Salgado
+ # All rights reserved.
+ #
+@@ -22,15 +22,8 @@
+ #
+
+ import os, sys, tempfile, threading, traceback, urllib2
+-if os.path.exists('CVS'):
+- # developer mode, coverhunter hasn't been installed
+- prefix = '.'
+- DEBUG = True
+-else:
+- base_dir = os.path.split(os.path.dirname(sys.argv[0]))[0]
+- prefix = os.path.join(base_dir, 'lib', 'coverhunter')
+- DEBUG = False
+-sys.path.append(os.path.join(prefix, 'lib'))
++DEBUG = False
++sys.path.append('@PKGLIBDIR@')
+
+ import Image
+ import pygtk ; pygtk.require('2.0')
+@@ -440,7 +433,7 @@
+
+
+ def find_datafile(filename):
+- return os.path.join(prefix, 'data', filename)
++ return os.path.join('@DATADIR@', filename)
+
+
+ if __name__ == "__main__":
diff --git a/audio/coverhunter/pkg-descr b/audio/coverhunter/pkg-descr
new file mode 100644
index 000000000000..660760e10ec5
--- /dev/null
+++ b/audio/coverhunter/pkg-descr
@@ -0,0 +1,9 @@
+CoverHunter will scan your digital music albums and try to get the
+cover image for each one. After that, if more than one cover was
+found, you can choose wich one will be set as the cover for that
+album. These covers may be used by XMMS, KDE, GNOME, etc.
+
+WWW: http://sourceforge.net/projects/coverhunter/
+
+- Jean-Yves Lefort
+jylefort@brutele.be
diff --git a/audio/coverhunter/pkg-message b/audio/coverhunter/pkg-message
new file mode 100644
index 000000000000..263cd2459ad1
--- /dev/null
+++ b/audio/coverhunter/pkg-message
@@ -0,0 +1,7 @@
+-------------------------------------------------------------------------------
+To use coverhunter, you need an Amazon Developer's Token (freely
+available at https://associates.amazon.com/exec/panama/associates/join/developer/application.html).
+
+Once you got your token, set it using the "Settings -> Set Amazon
+Token" menu item.
+-------------------------------------------------------------------------------
diff --git a/audio/coverhunter/pkg-plist b/audio/coverhunter/pkg-plist
new file mode 100644
index 000000000000..787515718bf8
--- /dev/null
+++ b/audio/coverhunter/pkg-plist
@@ -0,0 +1,29 @@
+bin/coverhunter
+lib/coverhunter/__init__.py
+lib/coverhunter/__init__.pyc
+lib/coverhunter/__init__.pyo
+lib/coverhunter/album.py
+lib/coverhunter/album.pyc
+lib/coverhunter/album.pyo
+lib/coverhunter/amazon.py
+lib/coverhunter/amazon.pyc
+lib/coverhunter/amazon.pyo
+lib/coverhunter/config.py
+lib/coverhunter/config.pyc
+lib/coverhunter/config.pyo
+lib/coverhunter/libhunter.py
+lib/coverhunter/libhunter.pyc
+lib/coverhunter/libhunter.pyo
+lib/coverhunter/musicfile.py
+lib/coverhunter/musicfile.pyc
+lib/coverhunter/musicfile.pyo
+lib/coverhunter/source.py
+lib/coverhunter/source.pyc
+lib/coverhunter/source.pyo
+%%DATADIR%%/CoverHunter.glade
+%%DATADIR%%/fetch_all.png
+%%DATADIR%%/nocover.gif
+%%DATADIR%%/picture.png
+%%DATADIR%%/searching.png
+@dirrm lib/coverhunter
+@dirrm %%DATADIR%%
diff --git a/audio/coverhunter/scripts/py-compile b/audio/coverhunter/scripts/py-compile
new file mode 100644
index 000000000000..a055fae4f527
--- /dev/null
+++ b/audio/coverhunter/scripts/py-compile
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+# py-compile - Compile a Python program
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# called as "py-compile [--basedir DIR] PY_FILES ...
+
+if [ -z "$PYTHON" ]; then
+ PYTHON=python
+fi
+
+basedir=
+
+case "$1" in
+ --basedir)
+ basedir=$2
+ shift 2
+ ;;
+ --help)
+ echo "Usage: py-compile [--basedir DIR] PY_FILES ..."
+ echo "Byte compile some python scripts. This should be performed"
+ echo "after they have been moved to the final installation location"
+ exit 0
+ ;;
+ --version)
+ echo "py-compile version 0.0"
+ exit 0
+ ;;
+esac
+
+if [ $# = 0 ]; then
+ echo "No files given to $0" 1>&2
+ exit 1
+fi
+
+# if basedir was given, then it should be prepended to filenames before
+# byte compilation.
+if [ -z "$basedir" ]; then
+ trans="path = file"
+else
+ trans="path = os.path.join('$basedir', file)"
+fi
+
+$PYTHON -c "
+import sys, os, string, py_compile
+
+files = '''$*'''
+print 'Byte-compiling python modules...'
+for file in string.split(files):
+ $trans
+ if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
+ continue
+ print file,
+ sys.stdout.flush()
+ py_compile.compile(path)
+print" || exit $?
+
+# this will fail for python < 1.5, but that doesn't matter ...
+$PYTHON -O -c "
+import sys, os, string, py_compile
+
+files = '''$*'''
+print 'Byte-compiling python modules (optimised versions) ...'
+for file in string.split(files):
+ $trans
+ if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
+ continue
+ print file,
+ sys.stdout.flush()
+ py_compile.compile(path)
+print" 2>/dev/null || :
+