Bug 55275 - [NEW PORT] audio/squash: Learning console-based MP3/OGG player
Summary: [NEW PORT] audio/squash: Learning console-based MP3/OGG player
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-05 13:20 UTC by matthias.andree
Modified: 2003-11-22 22:34 UTC (History)
0 users

See Also:


Attachments
squash-0.7.shar (5.79 KB, text/plain)
2003-08-05 13:20 UTC, matthias.andree
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description matthias.andree 2003-08-05 13:20:18 UTC
Squash is a C/Ncurses based music player. It supports mp3 and ogg through
libraries (and planned flac support). Squash uses statistics to determine songs
to play automatically. It garners this information through whether or not a song
is skipped. Squash also avoids picking the same song twice. Thus Squash is like
a radio station that plays the songs you like -- and you don't even have to call
in requests!

WWW: http://savannah.nongnu.org/projects/squash/

- Adam Luter, Matthias Andree

Generated with FreeBSD Port Tools 0.25
Comment 1 barnert 2003-10-26 01:12:34 UTC
This is the first followup I've submitted, so I apologize if I did
anything wrong. Anyway...

The submitted port has a few minor problems. 

FreeBSD 5.1 is 501000, not 501100. I'm not sure whether the OSVERSION <
501100 is correct and the 5.1 is wrong, or vice-versa. I assumed
(without checking) that it works on 5.1, and changed the version to
501000. It 501100 (-CURRENT) is required, change this back and change
the IGNORE message instead.

Squash 0.7 is no longer available from the savannah servers. Since 0.9
has been out for a while nowm, I updated the version to 0.9, and fixed
the patches to work.

The code was PREFIX-ified, but the documentation was not, so it still
contained references to, e.g., "/etc/squash.conf".

The instructions tell the user to read INSTALL, which tells the user to
look at the sample configuration file in 'extra/squash.conf' (which does
not get installed anywhere). So I copied this to the docs directory
(/usr/local/share/doc/squash/extra/squash.conf). Would it be better to
put it in examples instead (and patch the docs accordingly)?

As the docs say, the import_music.rb script needs to be run from the
directory that musicdb_lib.rb is in, or musicdb_lib.rb needs to be in
your RUBYPATH. Probably, it would be better to install it somewhere on
the Ruby path, then, rather than in /usr/local/bin. However, I didn't do
this.

The import_music.rb script doesn't work if your song_path and info_path
are different. Which is particularly bad for users who don't have write
access to the song_path, or don't want to write extra files there (e.g.,
it's a shared mp3 directory over nfs/smb/etc.). However, I think this is
a flaw in squash, not in the port.

Anyway, here's an update with the fixes mentioned above:

--- squash-0.9.shar begins here ---
# 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:
#
#	squash
#	squash/distinfo
#	squash/Makefile
#	squash/files
#	squash/files/patch-Makefile
#	squash/files/patch-include::global.h
#	squash/files/patch-src::display.c
#	squash/pkg-plist
#	squash/pkg-descr
#	squash/pkg-message.in
#
echo c - squash
mkdir -p squash > /dev/null 2>&1
echo x - squash/distinfo
sed 's/^X//' >squash/distinfo << 'END-of-squash/distinfo'
XMD5 (squash-0.9.tar.bz2) = d29fc3230037cff7cebbe996765c1284
END-of-squash/distinfo
echo x - squash/Makefile
sed 's/^X//' >squash/Makefile << 'END-of-squash/Makefile'
X# New ports collection makefile for: squash
X# Date created:		5 August 2003
X# Whom:			Matthias Andree <matthias.andree@gmx.de>
X#
X# $FreeBSD$
X
XPORTNAME=	squash
XPORTVERSION=	0.9
XCATEGORIES=	audio
XMASTER_SITES=	http://savannah.nongnu.org/download/${PORTNAME}/
X
XMAINTAINER=	matthias.andree@gmx.de
XCOMMENT=	Learning console-based MP3/OGG player
X
XRUN_DEPENDS+=	ruby:${PORTSDIR}/lang/ruby
XLIB_DEPENDS+=	fftw.2:${PORTSDIR}/math/fftw
XLIB_DEPENDS+=	mad.1:${PORTSDIR}/audio/mad
XLIB_DEPENDS+=	vorbisfile.3:${PORTSDIR}/audio/libvorbis
XLIB_DEPENDS+=	vorbis.2:${PORTSDIR}/audio/libvorbis
XLIB_DEPENDS+=	ao.3:${PORTSDIR}/audio/libao
X
XUSE_BZIP2=	yes
XUSE_GMAKE=	yes
XUSE_REINPLACE=	yes
X
Xpost-patch:
X	${REINPLACE_CMD} "s,#!/usr/bin/ruby,#!${LOCALBASE}/bin/ruby," \
X		${WRKSRC}/extra/*.rb
X	${REINPLACE_CMD} "s,/etc/squash.conf,${PREFIX}/etc/squash.conf," \
X		${WRKSRC}/src/global.c
X	${REINPLACE_CMD} "s,/etc/squash.conf,${PREFIX}/etc/squash.conf," \
X		${WRKSRC}/doc/INSTALL
X
Xdo-install:
X	${MKDIR} ${PREFIX}/bin
X	${INSTALL_PROGRAM} ${WRKSRC}/squash ${PREFIX}/bin
X	${INSTALL_SCRIPT} ${WRKSRC}/extra/*.rb ${PREFIX}/bin
X.if !defined(NOPORTDOCS)
X	${MKDIR} ${DOCSDIR}
X.for i in README doc/INSTALL doc/FEATURES doc/MEM_USAGE doc/USERS_GUIDE
doc/LOCKS
X	${INSTALL_MAN} ${WRKSRC}/${i} ${DOCSDIR}
X.endfor
X	${MKDIR} ${DOCSDIR}/extra
X	${INSTALL_MAN} ${WRKSRC}/extra/squash.conf ${DOCSDIR}/extra
X.endif
X
Xpost-install:
X	${RM} -f ${PKGMESSAGE}
X	${SED} "s,%%DD%%,${DOCSDIR}," ${PKGMESSAGE}.in >${PKGMESSAGE} || \
X		{ ${RM} -f ${PKGMESSAGE} ; exit 1 ; }
X	${ECHO}
X	${CAT} ${PKGMESSAGE}
X	${ECHO}
X
Xpost-clean:
X	${RM} -f ${PKGMESSAGE}
X
X.include <bsd.port.pre.mk>
X.if ${OSVERSION} < 501000
XIGNORE=	"ignored: FreeBSD before 5.1 lacks the wordexp interface"
X.endif
X.include <bsd.port.post.mk>
END-of-squash/Makefile
echo c - squash/files
mkdir -p squash/files > /dev/null 2>&1
echo x - squash/files/patch-Makefile
sed 's/^X//' >squash/files/patch-Makefile <<
'END-of-squash/files/patch-Makefile'
X--- Makefile	Fri Aug  1 17:30:01 2003
X+++ Makefile	Tue Aug  5 12:53:40 2003
X@@ -8,7 +8,7 @@
X # Complier Flags
X CC		:= gcc
X-CFLAGS	:= -O3 -std=gnu99 -pedantic -Wall
X-INCLUDE	:= -Iinclude
X-LDFLAGS	:= -lmad -lpthread -lm
X+CFLAGS	:= -O3 -std=gnu99 -pedantic -Wall ${CFLAGS}
X+INCLUDE	:= -Iinclude -I/usr/local/include
X+LDFLAGS	:= -L/usr/local/lib -lmad -lm -lthr
X 
X ifdef EMPEG
X 
X--- Makefile	Fri Aug  1 17:30:01 2003
X+++ Makefile	Tue Aug  5 12:53:40 2003
X@@ -39,7 +39,7 @@
X ifdef EMPEG_DSP
X 	CFLAGS := -DEMPEG_DSP $(CFLAGS)
X else
X-	LDFLAGS := $(LDFLAGS) -lao -ldl
X+	LDFLAGS := $(LDFLAGS) -lao
X endif
X 
X ifdef NO_FFTW
END-of-squash/files/patch-Makefile
echo x - squash/files/patch-include::global.h
sed 's/^X//' >squash/files/patch-include::global.h <<
'END-of-squash/files/patch-include::global.h'
X--- include/global.h~ 	Mon Aug  4 16:43:16 2003
X+++ include/global.h	Tue Aug  5 11:54:11 2003
X@@ -40,7 +40,7 @@
X #include <ao/ao.h>
X #include <math.h>
X #include <stdarg.h>
X-#include <wait.h>
X+#include <sys/wait.h>
X #include <sys/mman.h>
X #include <sys/types.h>
X #include <sys/stat.h>
END-of-squash/files/patch-include::global.h
echo x - squash/files/patch-src::display.c
sed 's/^X//' >squash/files/patch-src::display.c <<
'END-of-squash/files/patch-src::display.c'
X--- src/display.c~	Tue Jul 29 06:56:49 2003
X+++ src/display.c	Tue Aug  5 11:59:03 2003
X@@ -30,6 +30,22 @@
X #endif
X #include "display.h"
X 
X+char *mystrndup(const char *s, size_t sz)
X+{
X+    size_t l = strlen(s), i;
X+    char *x;
X+
X+    i = l < sz ? l : sz;
X+
X+    x = malloc(i + 1);
X+
X+    if (x) {
X+	memcpy(x, s, i);
X+	x[i] = '\0';
X+    }
X+    return x;
X+}
X+
X /*
X  * Initialize the ncurses display and window system.
X  */
X@@ -878,7 +894,7 @@
X     }
X 
X     /* Clip filename */
X-    filename = strndup( filename, win_width - 2 );
X+    filename = mystrndup( filename, win_width - 2 );
X 
X     /* Display filename and songs loaded */
X     mvwprintw( win, 1, 1, "Current Selected Song filename:" );
END-of-squash/files/patch-src::display.c
echo x - squash/pkg-plist
sed 's/^X//' >squash/pkg-plist << 'END-of-squash/pkg-plist'
Xbin/squash
Xbin/collect_info.rb
Xbin/edit_tag.rb
Xbin/export_music.rb
Xbin/import_music.rb
Xbin/joystick.rb
Xbin/musicdb_lib.rb
Xbin/uncollect_info.rb
X%%PORTDOCS%%%%DOCSDIR%%/FEATURES
X%%PORTDOCS%%%%DOCSDIR%%/INSTALL
X%%PORTDOCS%%%%DOCSDIR%%/MEM_USAGE
X%%PORTDOCS%%%%DOCSDIR%%/USERS_GUIDE
X%%PORTDOCS%%%%DOCSDIR%%/README
X%%PORTDOCS%%%%DOCSDIR%%/LOCKS
X%%PORTDOCS%%%%DOCSDIR%%/extra/squash.conf
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/extra
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
END-of-squash/pkg-plist
echo x - squash/pkg-descr
sed 's/^X//' >squash/pkg-descr << 'END-of-squash/pkg-descr'
XSquash is a C/Ncurses based music player. It supports mp3 and ogg
through
Xlibraries (and planned flac support). Squash uses statistics to
determine songs
Xto play automatically. It garners this information through whether or
not a song
Xis skipped. Squash also avoids picking the same song twice. Thus Squash
is like
Xa radio station that plays the songs you like -- and you don't even
have to call
Xin requests!
X
XWWW: http://savannah.nongnu.org/projects/squash/
X
X- Adam Luter, Matthias Andree
END-of-squash/pkg-descr
echo x - squash/pkg-message.in
sed 's/^X//' >squash/pkg-message.in << 'END-of-squash/pkg-message.in'
X---------------------------------------------------------------------------
XNOTE: You MUST configure squash and run a script before you can use
squash.
XPlease see %%DD%%/INSTALL for details.
X---------------------------------------------------------------------------
END-of-squash/pkg-message.in
exit
Comment 2 Matthias Andree 2003-11-03 15:42:09 UTC
The suggested SHAR doesn't work for multiple reasons (did you use portlint, try make package)?

I have fixed the package, but the resulting program dies of SIGSEGV when it tries wordexp at start-up.
We'll have to wait for a new upstream version.

Problem report filed at Savannah, Bug #6335.

-- 
Matthias Andree
Comment 3 Trevor Johnson freebsd_committer freebsd_triage 2003-11-21 09:57:47 UTC
Responsible Changed
From-To: freebsd-ports-bugs->trevor

I'll look into this.
Comment 4 Trevor Johnson freebsd_committer freebsd_triage 2003-11-21 10:51:33 UTC
Responsible Changed
From-To: trevor->freebsd-ports-bugs

My FreeBSD installation is too old to run this, so I hesitate to commit it. 
I offer some changes for the port--they are in 
<URL:http://people.freebsd.org/~trevor/ports/squash.shar>.
Comment 5 Pav Lucistnik freebsd_committer freebsd_triage 2003-11-22 22:33:46 UTC
State Changed
From-To: open->closed

Heavily modified and updated to 1.0.pre1 version committed. 
Special thanks goes to trevor who did most of the work.