Bug 106799 - New port multimedia/shell-fm a command-line client for Last.FM
Summary: New port multimedia/shell-fm a command-line client for Last.FM
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: Martin Wilke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-16 03:10 UTC by ntarmos
Modified: 2006-12-16 22:30 UTC (History)
0 users

See Also:


Attachments
file.shar (13.22 KB, text/plain)
2006-12-16 03:10 UTC, ntarmos
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ntarmos 2006-12-16 03:10:03 UTC
	A port of Shell.FM, a console client for Last.FM streams.
Comment 1 Martin Wilke freebsd_committer freebsd_triage 2006-12-16 06:57:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

I'll take it.
Comment 2 Martin Wilke freebsd_committer freebsd_triage 2006-12-16 09:17:34 UTC
State Changed
From-To: open->feedback

Ask for maintainer fix.
Comment 3 ntarmos 2006-12-16 19:33:13 UTC
Hi there.

The following shar should be ok. Disclaimer: I have no 4.x system to
test this on (and very little time to set up a new one) so I went
through cvsweb trying to see what is there in 4.x and what is not.

\n\n

# 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:
#
#	shell-fm
#	shell-fm/files
#	shell-fm/files/patch-reconfig.diff
#	shell-fm/files/patch-strndup.diff
#	shell-fm/files/patch-rl_completion.h.diff
#	shell-fm/files/patch-stdint.diff
#	shell-fm/files/patch-shell-fm.1.diff
#	shell-fm/files/patch-sys-types.diff
#	shell-fm/Makefile
#	shell-fm/pkg-descr
#	shell-fm/distinfo
#
echo c - shell-fm
mkdir -p shell-fm > /dev/null 2>&1
echo c - shell-fm/files
mkdir -p shell-fm/files > /dev/null 2>&1
echo x - shell-fm/files/patch-reconfig.diff
sed 's/^X//' >shell-fm/files/patch-reconfig.diff << 'END-of-shell-fm/files/patch-reconfig.diff'
Xdiff -urNbB src/reconfig.orig src/reconfig
X--- reconfig.orig	Sat Dec 16 01:01:06 2006
X+++ reconfig	Sat Dec 16 02:57:44 2006
X@@ -36,10 +36,10 @@
X 
X $clean_only && exit
X 
X-do_cmd aclocal -I m4
X-do_cmd autoheader
X-do_cmd automake --add-missing --copy
X-do_cmd autoconf
X+do_cmd aclocal19 -I m4
X+do_cmd autoheader259
X+do_cmd automake19 --add-missing --copy
X+do_cmd autoconf259
X 
X 
X 
END-of-shell-fm/files/patch-reconfig.diff
echo x - shell-fm/files/patch-strndup.diff
sed 's/^X//' >shell-fm/files/patch-strndup.diff << 'END-of-shell-fm/files/patch-strndup.diff'
X--- src/strndup.c.orig	Sat Dec 16 04:21:22 2006
X+++ src/strndup.c	Sat Dec 16 04:20:48 2006
X@@ -0,0 +1,14 @@
X+#include "strndup.h"
X+#include <string.h>
X+#include <stdlib.h>
X+
X+#ifdef __STRNDUP__
X+
X+char* strndup(const char*  src, size_t len) {
X+	char* _tmpStr = (char*)malloc(len + 1);
X+	strncpy(_tmpStr, src, len);
X+	return _tmpStr;
X+}
X+
X+#endif
X+
X--- src/include/strndup.h.orig	Sat Dec 16 04:21:27 2006
X+++ src/include/strndup.h	Sat Dec 16 04:20:28 2006
X@@ -0,0 +1,11 @@
X+#if (defined(__unix__) || defined(unix)) && !defined(USG)
X+#include <sys/param.h>
X+#endif
X+
X+#if ((defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__STRNDUP__))
X+#define __STRNDUP__
X+
X+extern char* strndup(const char*  src, size_t len);
X+
X+#endif
X+
X--- src/Makefile.am.orig	Sat Dec 16 04:18:32 2006
X+++ src/Makefile.am	Sat Dec 16 04:18:41 2006
X@@ -6,6 +6,7 @@
X INCLUDES = -I$(srcdir)/include
X 
X shell_fm_SOURCES = \
X+strndup.c \
X autoban.c \
X bookmark.c \
X getln.c \
X--- src/radio.c.orig	Sat Dec 16 04:25:00 2006
X+++ src/radio.c	Sat Dec 16 02:07:30 2006
X@@ -35,6 +35,7 @@
X #include "settings.h"
X #include "rl_completion.h"
X #include "strarray.h"
X+#include "strndup.h"
X 
X #define LASTFM_URL_PREFIX "lastfm://"
X #define LASTFM_URL_MIN_LENGTH 6 // shortest possible: 'user/a'
X--- src/strarray.c.orig	Sat Dec 16 04:25:13 2006
X+++ src/strarray.c	Sat Dec 16 02:07:39 2006
X@@ -22,6 +22,7 @@
X 
X #include "compatibility.h"
X #include "strarray.h"
X+#include "strndup.h"
X 
X void strarray_init (strarray_t *sa) {
X 	sa->strings = NULL;
X--- src/tag.c.orig	Sat Dec 16 04:25:15 2006
X+++ src/tag.c	Sat Dec 16 02:07:49 2006
X@@ -23,6 +23,7 @@
X #include "split.h"
X #include "interface.h"
X #include "rl_completion.h"
X+#include "strndup.h"
X 
X static char ** getPopularTags(char, struct hash);
X static char * getExistingTags(char, struct hash);
END-of-shell-fm/files/patch-strndup.diff
echo x - shell-fm/files/patch-rl_completion.h.diff
sed 's/^X//' >shell-fm/files/patch-rl_completion.h.diff << 'END-of-shell-fm/files/patch-rl_completion.h.diff'
Xdiff -urNbB src/include/rl_completion.h.orig src/include/rl_completion.h
X--- src/include/rl_completion.h.orig	Sat Dec 16 01:01:06 2006
X+++ src/include/rl_completion.h	Sat Dec 16 02:08:02 2006
X@@ -6,6 +6,7 @@
X #define SHELLFM_COMPLETION
X 
X #include <readline/readline.h>
X+#include <time.h>
X #include "strarray.h"
X 
X /* a tree composed of this structure will define the completion logic */
END-of-shell-fm/files/patch-rl_completion.h.diff
echo x - shell-fm/files/patch-stdint.diff
sed 's/^X//' >shell-fm/files/patch-stdint.diff << 'END-of-shell-fm/files/patch-stdint.diff'
X--- src/http.c.orig	Sat Dec 16 21:16:13 2006
X+++ src/http.c	Sat Dec 16 21:17:43 2006
X@@ -15,11 +15,13 @@
X #include <stdlib.h>
X #include <assert.h>
X #include <ctype.h>
X-#include <stdint.h>
X 
X+#include <sys/types.h>
X #include <sys/socket.h>
X 
X #include "hash.h"
X+
X+typedef unsigned char	uint8_t;
X 
X extern FILE * ropen(const char *, unsigned short);
X extern void fshutdown(FILE *);
END-of-shell-fm/files/patch-stdint.diff
echo x - shell-fm/files/patch-shell-fm.1.diff
sed 's/^X//' >shell-fm/files/patch-shell-fm.1.diff << 'END-of-shell-fm/files/patch-shell-fm.1.diff'
Xdiff -urNbB src/shell-fm.1.orig shell-fm/src/shell-fm.1
X--- src/shell-fm.1.orig	Thu Jan  1 02:00:00 1970
X+++ src/shell-fm.1	Sat Dec 16 00:59:11 2006
X@@ -0,0 +1,179 @@
X+.\"
X+.\" $Id$
X+.\"
X+.Dd December 15, 2006
X+.Dt SHELL-FM 1
X+.Os
X+.Sh NAME
X+.Nm shell-fm
X+.Nd command-line Last.FM client
X+.Sh SYNOPSIS
X+.Nm shell-fm
X+.Op Fl d Ar daemon mode
X+.Op Fl i Ar address to listen on
X+.Op Fl W Ar port to listen on
X+.Op Fl D Ar device to play on
X+.Op Fl h
X+.Sh DESCRIPTION
X+.Nm shell-fm
X+is a console based player for the streams provided by Last.FM. It's
X+lightweight, easy to use and under heavy development. New features might
X+be added every day.
X+.Nm shell-fm
X+is Open Source and published under the terms of the GNU General Public
X+License, so feel free to modify and/or redistribute it.
X+.Sh RUNNINF SHELL-FM
X+Usage of 
X+.Nm shell-fm
X+is pretty simple. To tell 
X+.Nm shell-fm
X+what to play, you simply give it the direct link to a Last.FM stream (a
X+URL starting with lastfm://). The URLs are very clear and easy to
X+understand. Here are some examples:
X+.Pp
X+.nf
X+    lastfm://user/shell-monkey/personal     - my personal radio
X+    lastfm://user/shell-monkey/loved        - my loved tracks radio
X+    lastfm://artist/Blood For Blood/similar - bands similar to Blood For
X+                                              Blood
X+    lastfm://artist/The Distillers/fans     - The Distillers fan radio
X+    lastfm://globaltags/punk rock           - songs that have been
X+                                              tagged as "punk rock" 
X+.fi
X+.Pp 
X+Radios can be specified in three ways. First you can give a stream URL
X+as command line argument to 
X+.Nm shell-fm
X+:
X+.Pp
X+[~]$ shell-fm "lastfm://artist/The Distillers/fans"
X+.Pp
X+Note that you need to quote the URL, if it contains white spaces.
X+.br
X+Next you can enter a new URL while 
X+.Nm shell-fm
X+is already running by pressing the r key.
X+.Nm shell-fm
X+then will prompt you for a new URL. Note that you don't need / may not
X+quote the URL here like in the command line. 
X+.Nm shell-fm 
X+will take care of whitespaces for you.  Finally, you can name a default
X+stream in your configuration file, which is started by default if you
X+run
X+.Nm shell-fm
X+without an URL as command line argument.
X+.Sh CONFIGURATION
X+Your configuration should be placed in the file ~/.shell-fm/shell-fm.rc.
X+It consists of simple associations in the format key = value. Following
X+keys are known at the moment (may/will be more in future).
X+.br
X+.nf
X+  username       - your Last.FM nick
X+  password       - your Last.FM password; if password and username or
X+                   only the password are missing here, shell-fm will
X+                   prompt you for it on startup.
X+  default-radio  - the default radio which shell-fm will play on startup
X+                   if you called it without an command line argument.
X+  np-file        - the (absolute) path to a file in which you want
X+                   shell-fm to save information about the currently
X+                   played track in.
X+  np-file-format - the format in which shell-fm will write the song
X+                   information to your np-file. Note that both, np-file
X+                   and np-file-format need to be specified to make
X+                   shell-fm write to the np-file. The format may contain
X+                   any character plus some placeholders shell-fm will
X+                   replace. They are: 
X+                        %a - artist
X+                        %t - title
X+                        %A - album
X+                        %d - duration in seconds
X+                        %s - station name
X+                        %u - station URL
X+                        %U - artist URL
X+                        %T - track URL
X+.fi
X+.Pp
X+There may and will be more placeholders available in future releases. 
X+.br
X+.nf
X+    np-cmd  - command that's executed whenever the track changes. Allows
X+              the same format placeholders as the "np-file-format"
X+              option. 
X+    key0x?? - bind an external command to the key with the hexadecimal,
X+              UPPERCASE (!), zero-padded ASCII code "??". Keys that are
X+              already bound to an action (as listed here) can't be
X+              overwritten. Again, you can use all the variables as in
X+              "np-file-format" and "np-cmp". Please note that future
X+              versions may use further keys, so you might need to change
X+              your configuration then. 
X+    ?-color - (where ? is one of the meta tag variables (see list
X+              above). This allows you to color every kind of tag with a
X+              different color (e.g. paint track titles red, artists
X+              green and so on). This is the list of valid color codes:
X+                   0;30 = black (not very useful)
X+                   1;30 = dark gray
X+                   0;31 = red
X+                   1;31 = light red
X+                   0;32 = green
X+                   1;32 = light green
X+                   0;33 = dark yellow/brown
X+                   1;33 = yellow
X+                   0;34 = blue
X+                   1;34 = light blue
X+                   0;35 = violet
X+                   1;35 = pink
X+                   0;36 = turquoise
X+                   1;36 = cyan
X+                   0;37 = gray
X+                   1;37 = white
X+.fi
X+.Pp
X+This is what your configuration file for 
X+.Nm shell-fm 
X+could look like: 
X+.nf
X+    [~]$ cat ~/.shell-fm/shell-fm.rc
X+    username = shell-monkey
X+    password = secret
X+    default-radio = lastfm://user/shell-monkey/loved
X+    np-file = /tmp/np.txt
X+    np-file-format = %a - %t
X+    key0x6F = /usr/bin/elinks "%u"
X+    t-color = 1;32
X+    a-color = 0;32
X+    s-color = 1;37
X+    [~]$ 
X+.fi
X+.Sh CONTROLS
X+These keys are available from within
X+.Nm shell-fm
X+to control it's behaviour:
X+.br
X+.nf
X+    r - prompt for a new station URL.
X+    l - love the currently played track.
X+    B - (uppercase!) ban the currently played track.
X+    n - skip the currently played track.
X+    Q - (uppercase!) quit.
X+    d - enable/disable discovery mode. 
X+    A - ban the artist of the currently played track (whenever another
X+        track of this artist is streamed again, it will be banned
X+        automatically).
X+    R - toggle RTP on/off (RTP = record tracks to profile)
X+    f - listen to the fan radio of the currently played tracks artist
X+    s - listen to the similar-artists radio of the currently played
X+        tracks artist
X+.fi
X+.br
X+Note that the radio URL prompt provides a simple history (use up/down
X+arrow keys to browse it). By default, 
X+.Nm Shell.FM
X+will remember only the URLs you entered in the current session. If you
X+want the history to survive, you need to create an empty file name
X+~/.shell-fm/radio-history. Simply touch(1) it and you're done.
X+.Sh SEE ALSO
X+http://lizer.syslinx.org/shell-fm/
X+.Sh CREDITS
X+Jonas Kramer <jonas.kramer@gmx.net> wrote the actual code.
X+.Sh AUTHOR
X+Nikos Ntarmos <ntarmos@ceid.upatras.gr>
X--- src/Makefile.am.orig	Sat Dec 16 04:37:00 2006
X+++ src/Makefile.am	Sat Dec 16 04:37:59 2006
X@@ -26,5 +26,7 @@
X tag.c \
X utility.c
X 
X+man_MANS = shell-fm.1
X+EXTRA_DIST = ${man_MANS}
X 
X ## vim: noet ts=8 sw=8
END-of-shell-fm/files/patch-shell-fm.1.diff
echo x - shell-fm/files/patch-sys-types.diff
sed 's/^X//' >shell-fm/files/patch-sys-types.diff << 'END-of-shell-fm/files/patch-sys-types.diff'
X--- src/ropen.c.orig	Sat Dec 16 21:16:49 2006
X+++ src/ropen.c	Sat Dec 16 21:13:23 2006
X@@ -11,6 +11,7 @@
X #include <config.h>
X 
X #include <stdio.h>
X+#include <sys/types.h>
X #include <sys/socket.h>
X #include <netinet/in.h>
X #include <netdb.h>
END-of-shell-fm/files/patch-sys-types.diff
echo x - shell-fm/Makefile
sed 's/^X//' >shell-fm/Makefile << 'END-of-shell-fm/Makefile'
X# New ports collection makefile for: shell-fm
X# Date created:	15 December 2006
X# Whom:		Nikos Ntarmos <ntarmos@ceid.upatras.gr>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	shell-fm
XPORTVERSION=	20061215
XCATEGORIES=	multimedia
XMASTER_SITES=	http://ntarmos.dyndns.org/Software/FreeBSD/
X
XMAINTAINER=	ntarmos@ceid.upatras.gr
XCOMMENT=	A command-line client for Last.FM
X
XLIB_DEPENDS=	ao:${PORTSDIR}/audio/libao \
X		mad:${PORTSDIR}/audio/libmad
X
XUSE_AUTOTOOLS=	aclocal:19 automake:19 autoheader:259 autoconf:259
XAUTOMAKE_ARGS=	--add-missing --copy
XACLOCAL_ARGS=	-I m4
XLDFLAGS+=	-L${LOCALBASE}/lib
XCFLAGS+=	-I${LOCALBASE}/include
XCONFIGURE_ENV=	CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
X
Xpre-configure:
X	@(cd ${CONFIGURE_WRKSRC} && \
X	${SETENV} ${AUTOTOOLS_ENV} ${ACLOCAL})
X
Xpost-install:
X	@(${MKDIR} ${PREFIX}/share/examples/shell-fm && \
X	${INSTALL} -m 444 ${WRKSRC}/src/shell-fm.rc-example \
X		${PREFIX}/share/examples/shell-fm)
X
XMAN1=		shell-fm.1
XMANCOMPRESSED=	no
X
XPLIST_FILES=	bin/shell-fm \
X		share/examples/shell-fm/shell-fm.rc-example
XPLIST_DIRS=	share/examples/shell-fm
X
X.include <bsd.port.mk>
END-of-shell-fm/Makefile
echo x - shell-fm/pkg-descr
sed 's/^X//' >shell-fm/pkg-descr << 'END-of-shell-fm/pkg-descr'
XThis is a port of Shell.FM, a console based player for the streams
Xprovided by Last.FM for the Linux platform. It's lightweight (the binary
Xis only about 16K), easy to use and under heavy development. New
Xfeatures might be added every day. Shell.FM is Open Source and published
Xunder the terms of the GNU General Public License, so feel free to
Xmodify and/or redistribute it.
X
XWWW: http://lizer.syslinx.org/shell-fm/
END-of-shell-fm/pkg-descr
echo x - shell-fm/distinfo
sed 's/^X//' >shell-fm/distinfo << 'END-of-shell-fm/distinfo'
XMD5 (shell-fm-20061215.tar.gz) = 81d5cbc87185784e6aa0c0cd1bc8bc7a
XSHA256 (shell-fm-20061215.tar.gz) = ba6885c3e827adf605bc0de9c33943907ab94f494cad63e4b36342a0b085bdf4
XSIZE (shell-fm-20061215.tar.gz) = 30082
END-of-shell-fm/distinfo
exit
Comment 4 dfilter service freebsd_committer freebsd_triage 2006-12-16 22:27:12 UTC
miwi        2006-12-16 22:26:55 UTC

  FreeBSD ports repository

  Modified files:
    multimedia           Makefile 
  Added files:
    multimedia/shell-fm  Makefile distinfo pkg-descr 
    multimedia/shell-fm/files patch-reconfig patch-rl_completion.h 
                              patch-shell-fm.1 patch-strndup.c 
  Log:
  This is a port of Shell.FM, a console based player for the streams
  provided by Last.FM for the Linux platform. It's lightweight (the binary
  is only about 16K), easy to use and under heavy development. New
  features might be added every day. Shell.FM is Open Source and published
  under the terms of the GNU General Public License, so feel free to
  modify and/or redistribute it.
  
  WWW: http://lizer.syslinx.org/shell-fm/
  
  PR:             ports/106799
  Submitted by:   Nikos Ntarmos <ntarmos at ceid.upatras.gr>
  
  Revision  Changes    Path
  1.192     +1 -0      ports/multimedia/Makefile
  1.1       +49 -0     ports/multimedia/shell-fm/Makefile (new)
  1.1       +3 -0      ports/multimedia/shell-fm/distinfo (new)
  1.1       +18 -0     ports/multimedia/shell-fm/files/patch-reconfig (new)
  1.1       +11 -0     ports/multimedia/shell-fm/files/patch-rl_completion.h (new)
  1.1       +193 -0    ports/multimedia/shell-fm/files/patch-shell-fm.1 (new)
  1.1       +70 -0     ports/multimedia/shell-fm/files/patch-strndup.c (new)
  1.1       +8 -0      ports/multimedia/shell-fm/pkg-descr (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Martin Wilke freebsd_committer freebsd_triage 2006-12-16 22:27:51 UTC
State Changed
From-To: feedback->closed

New port added. Thanks!