Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jul 2004 15:18:21 +0200 (CEST)
From:      Jean-Yves Lefort <jylefort@brutele.be>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/69053: New port: audio/coverhunter, a program fetching the covers of your digital music albums
Message-ID:  <20040714131821.36C6B22E1E@jsite.lefort.net>
Resent-Message-ID: <200407141320.i6EDKGcw075077@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         69053
>Category:       ports
>Synopsis:       New port: audio/coverhunter, a program fetching the covers of your digital music albums
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 14 13:20:16 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jean-Yves Lefort
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
>Environment:
System: FreeBSD jsite.lefort.net 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Thu Jul 1 14:25:43 CEST 2004 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386
>Description:
>How-To-Repeat:
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	coverhunter
#	coverhunter/pkg-plist
#	coverhunter/pkg-descr
#	coverhunter/files
#	coverhunter/files/patch-bin::coverhunter
#	coverhunter/Makefile
#	coverhunter/distinfo
#	coverhunter/scripts
#	coverhunter/scripts/py-compile
#	coverhunter/pkg-message
#
echo c - coverhunter
mkdir -p coverhunter > /dev/null 2>&1
echo x - coverhunter/pkg-plist
sed 's/^X//' >coverhunter/pkg-plist << 'END-of-coverhunter/pkg-plist'
Xbin/coverhunter
Xlib/coverhunter/__init__.py
Xlib/coverhunter/__init__.pyc
Xlib/coverhunter/__init__.pyo
Xlib/coverhunter/album.py
Xlib/coverhunter/album.pyc
Xlib/coverhunter/album.pyo
Xlib/coverhunter/amazon.py
Xlib/coverhunter/amazon.pyc
Xlib/coverhunter/amazon.pyo
Xlib/coverhunter/config.py
Xlib/coverhunter/config.pyc
Xlib/coverhunter/config.pyo
Xlib/coverhunter/libhunter.py
Xlib/coverhunter/libhunter.pyc
Xlib/coverhunter/libhunter.pyo
Xlib/coverhunter/musicfile.py
Xlib/coverhunter/musicfile.pyc
Xlib/coverhunter/musicfile.pyo
Xlib/coverhunter/source.py
Xlib/coverhunter/source.pyc
Xlib/coverhunter/source.pyo
X%%DATADIR%%/CoverHunter.glade
X%%DATADIR%%/fetch_all.png
X%%DATADIR%%/nocover.gif
X%%DATADIR%%/picture.png
X%%DATADIR%%/searching.png
X@dirrm lib/coverhunter
X@dirrm %%DATADIR%%
END-of-coverhunter/pkg-plist
echo x - coverhunter/pkg-descr
sed 's/^X//' >coverhunter/pkg-descr << 'END-of-coverhunter/pkg-descr'
XCoverHunter will scan your digital music albums and try to get the
Xcover image for each one. After that, if more than one cover was
Xfound, you can choose wich one will be set as the cover for that
Xalbum. These covers may be used by XMMS, KDE, GNOME, etc.
X
XWWW: http://sourceforge.net/projects/coverhunter/
X
X- Jean-Yves Lefort
Xjylefort@brutele.be
END-of-coverhunter/pkg-descr
echo c - coverhunter/files
mkdir -p coverhunter/files > /dev/null 2>&1
echo x - coverhunter/files/patch-bin::coverhunter
sed 's/^X//' >coverhunter/files/patch-bin::coverhunter << 'END-of-coverhunter/files/patch-bin::coverhunter'
X--- bin/coverhunter.orig	Wed Jul 14 14:57:49 2004
X+++ bin/coverhunter	Wed Jul 14 15:01:58 2004
X@@ -1,4 +1,4 @@
X-#! /usr/bin/env python
X+#! @PYTHON_CMD@
X # Copyright (c) 2003,2004 Guilherme Salgado
X # All rights reserved.
X #
X@@ -22,15 +22,8 @@
X #
X 
X import os, sys, tempfile, threading, traceback, urllib2
X-if os.path.exists('CVS'):
X-    # developer mode, coverhunter hasn't been installed
X-    prefix = '.'
X-    DEBUG = True
X-else:
X-    base_dir = os.path.split(os.path.dirname(sys.argv[0]))[0]
X-    prefix = os.path.join(base_dir, 'lib', 'coverhunter')
X-    DEBUG = False
X-sys.path.append(os.path.join(prefix, 'lib'))
X+DEBUG = False
X+sys.path.append('@PKGLIBDIR@')
X 
X import Image
X import pygtk ; pygtk.require('2.0')
X@@ -440,7 +433,7 @@
X 
X 
X def find_datafile(filename):
X-    return os.path.join(prefix, 'data', filename)
X+    return os.path.join('@DATADIR@', filename)
X 
X 
X if __name__ == "__main__":
END-of-coverhunter/files/patch-bin::coverhunter
echo x - coverhunter/Makefile
sed 's/^X//' >coverhunter/Makefile << 'END-of-coverhunter/Makefile'
X# New ports collection makefile for:	coverhunter
X# Date created:			14 Jul 2004
X# Whom:				Jean-Yves Lefort <jylefort@brutele.be>
X#
X# $FreeBSD$
X#
X
XPORTNAME=		coverhunter
XPORTVERSION=		0.3
XCATEGORIES=		audio graphics
XMASTER_SITES=		${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	${PORTNAME}
X
XMAINTAINER=		jylefort@brutele.be
XCOMMENT=		A program fetching the covers of your digital music albums
X
XRUN_DEPENDS=		${PYTHON_SITELIBDIR}/PIL/__init__.py:${PORTSDIR}/graphics/py-imaging
X
XUSE_X_PREFIX=		yes
XUSE_GNOME=		pygtk2
XUSE_PYTHON=		2.3+
XUSE_REINPLACE=		yes
XNO_BUILD=		yes
X
XPYC=			PYTHON="${PYTHON_CMD}" ${SH} ${SCRIPTDIR}/py-compile
X
XBINDIR=			${PREFIX}/bin
XPKGLIBDIR=		${PREFIX}/lib/coverhunter
X
XMODULES=		__init__.py \
X			album.py \
X			amazon.py \
X			config.py \
X			libhunter.py \
X			musicfile.py \
X			source.py
X
Xpost-patch:
X	@${REINPLACE_CMD} -e \
X		's|@PYTHON_CMD@|${PYTHON_CMD}|; \
X		 s|@PKGLIBDIR@|${PKGLIBDIR}|; \
X		 s|@DATADIR@|${DATADIR}|' ${WRKSRC}/bin/coverhunter
X
Xdo-install:
X	${MKDIR} ${BINDIR}
X	${INSTALL_SCRIPT} ${WRKSRC}/bin/coverhunter ${BINDIR}
X	${MKDIR} ${PKGLIBDIR}
X.for module in ${MODULES}
X	${INSTALL_DATA} ${WRKSRC}/lib/${module} ${PKGLIBDIR}
X	${PYC} --basedir ${PKGLIBDIR} ${PKGLIBDIR}/${module}
X.endfor
X	${MKDIR} ${DATADIR}
X	${INSTALL_DATA} \
X		${WRKSRC}/data/CoverHunter.glade \
X		${WRKSRC}/data/fetch_all.png \
X		${WRKSRC}/data/nocover.gif \
X		${WRKSRC}/data/picture.png \
X		${WRKSRC}/data/searching.png \
X		${DATADIR}
X
Xpost-install:
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-coverhunter/Makefile
echo x - coverhunter/distinfo
sed 's/^X//' >coverhunter/distinfo << 'END-of-coverhunter/distinfo'
XMD5 (coverhunter-0.3.tar.gz) = 005077d047b903b1dafa3f7943c85a40
XSIZE (coverhunter-0.3.tar.gz) = 27496
END-of-coverhunter/distinfo
echo c - coverhunter/scripts
mkdir -p coverhunter/scripts > /dev/null 2>&1
echo x - coverhunter/scripts/py-compile
sed 's/^X//' >coverhunter/scripts/py-compile << 'END-of-coverhunter/scripts/py-compile'
X#!/bin/sh
X
X# py-compile - Compile a Python program
X# Copyright 2000, 2001 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of that program.
X
X# called as "py-compile [--basedir DIR] PY_FILES ...
X
Xif [ -z "$PYTHON" ]; then
X  PYTHON=python
Xfi
X
Xbasedir=
X
Xcase "$1" in
X    --basedir)
X	basedir=$2
X	shift 2
X	;;
X    --help)
X	echo "Usage: py-compile [--basedir DIR] PY_FILES ..."
X	echo "Byte compile some python scripts.  This should be performed"
X	echo "after they have been moved to the final installation location"
X	exit 0
X	;;
X    --version)
X	echo "py-compile version 0.0"
X	exit 0
X	;;
Xesac
X
Xif [ $# = 0 ]; then
X    echo "No files given to $0" 1>&2
X    exit 1
Xfi
X
X# if basedir was given, then it should be prepended to filenames before
X# byte compilation.
Xif [ -z "$basedir" ]; then
X    trans="path = file"
Xelse
X    trans="path = os.path.join('$basedir', file)"
Xfi
X
X$PYTHON -c "
Ximport sys, os, string, py_compile
X
Xfiles = '''$*'''
Xprint 'Byte-compiling python modules...'
Xfor file in string.split(files):
X    $trans
X    if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
X	continue
X    print file,
X    sys.stdout.flush()
X    py_compile.compile(path)
Xprint" || exit $?
X
X# this will fail for python < 1.5, but that doesn't matter ...
X$PYTHON -O -c "
Ximport sys, os, string, py_compile
X
Xfiles = '''$*'''
Xprint 'Byte-compiling python modules (optimised versions) ...'
Xfor file in string.split(files):
X    $trans
X    if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
X	continue
X    print file,
X    sys.stdout.flush()
X    py_compile.compile(path)
Xprint" 2>/dev/null || :
X
END-of-coverhunter/scripts/py-compile
echo x - coverhunter/pkg-message
sed 's/^X//' >coverhunter/pkg-message << 'END-of-coverhunter/pkg-message'
X-------------------------------------------------------------------------------
XTo use coverhunter, you need an Amazon Developer's Token (freely
Xavailable at https://associates.amazon.com/exec/panama/associates/join/developer/application.html).
X
XOnce you got your token, set it using the "Settings -> Set Amazon
XToken" menu item.
X-------------------------------------------------------------------------------
END-of-coverhunter/pkg-message
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040714131821.36C6B22E1E>