1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

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>
This commit is contained in:
Martin Wilke 2006-12-16 22:26:55 +00:00
parent a08308fc32
commit d2ad3fee6b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=179988
8 changed files with 353 additions and 0 deletions

View File

@ -195,6 +195,7 @@
SUBDIR += rox-videothumbnail
SUBDIR += ruby-gst
SUBDIR += sabbu
SUBDIR += shell-fm
SUBDIR += smpeg
SUBDIR += smpeg-xmms
SUBDIR += snd-music-duplicates

View File

@ -0,0 +1,49 @@
# New ports collection makefile for: shell-fm
# Date created: 15 December 2006
# Whom: Nikos Ntarmos <ntarmos@ceid.upatras.gr>
#
# $FreeBSD$
#
PORTNAME= shell-fm
PORTVERSION= 20061215
CATEGORIES= multimedia
MASTER_SITES= http://ntarmos.dyndns.org/Software/FreeBSD/
MAINTAINER= ntarmos@ceid.upatras.gr
COMMENT= A command-line client for Last.FM
LIB_DEPENDS= ao:${PORTSDIR}/audio/libao \
mad:${PORTSDIR}/audio/libmad
USE_AUTOTOOLS= aclocal:19 automake:19 autoheader:259 autoconf:259
AUTOMAKE_ARGS= --add-missing --copy
ACLOCAL_ARGS= -I m4
LDFLAGS+= -L${LOCALBASE}/lib
CFLAGS+= -I${LOCALBASE}/include
CONFIGURE_ENV= CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
USE_GCC= 3.4+
pre-configure:
@(cd ${CONFIGURE_WRKSRC} && \
${SETENV} ${AUTOTOOLS_ENV} ${ACLOCAL})
post-install:
@(${MKDIR} ${PREFIX}/share/examples/shell-fm && \
${INSTALL} -m 444 ${WRKSRC}/src/shell-fm.rc-example \
${PREFIX}/share/examples/shell-fm)
MAN1= shell-fm.1
MANCOMPRESSED= no
PLIST_FILES= bin/shell-fm \
share/examples/shell-fm/shell-fm.rc-example
PLIST_DIRS= share/examples/shell-fm
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 500000
BROKEN= Does not compile on 4.x
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,3 @@
MD5 (shell-fm-20061215.tar.gz) = 81d5cbc87185784e6aa0c0cd1bc8bc7a
SHA256 (shell-fm-20061215.tar.gz) = ba6885c3e827adf605bc0de9c33943907ab94f494cad63e4b36342a0b085bdf4
SIZE (shell-fm-20061215.tar.gz) = 30082

View File

@ -0,0 +1,18 @@
diff -urNbB src/reconfig.orig src/reconfig
--- reconfig.orig Sat Dec 16 01:01:06 2006
+++ reconfig Sat Dec 16 02:57:44 2006
@@ -36,10 +36,10 @@
$clean_only && exit
-do_cmd aclocal -I m4
-do_cmd autoheader
-do_cmd automake --add-missing --copy
-do_cmd autoconf
+do_cmd aclocal19 -I m4
+do_cmd autoheader259
+do_cmd automake19 --add-missing --copy
+do_cmd autoconf259

View File

@ -0,0 +1,11 @@
diff -urNbB src/include/rl_completion.h.orig src/include/rl_completion.h
--- src/include/rl_completion.h.orig Sat Dec 16 01:01:06 2006
+++ src/include/rl_completion.h Sat Dec 16 02:08:02 2006
@@ -6,6 +6,7 @@
#define SHELLFM_COMPLETION
#include <readline/readline.h>
+#include <time.h>
#include "strarray.h"
/* a tree composed of this structure will define the completion logic */

View File

@ -0,0 +1,193 @@
diff -urNbB src/shell-fm.1.orig shell-fm/src/shell-fm.1
--- src/shell-fm.1.orig Thu Jan 1 02:00:00 1970
+++ src/shell-fm.1 Sat Dec 16 00:59:11 2006
@@ -0,0 +1,179 @@
+.\"
+.\" $Id$
+.\"
+.Dd December 15, 2006
+.Dt SHELL-FM 1
+.Os
+.Sh NAME
+.Nm shell-fm
+.Nd command-line Last.FM client
+.Sh SYNOPSIS
+.Nm shell-fm
+.Op Fl d Ar daemon mode
+.Op Fl i Ar address to listen on
+.Op Fl W Ar port to listen on
+.Op Fl D Ar device to play on
+.Op Fl h
+.Sh DESCRIPTION
+.Nm shell-fm
+is a console based player for the streams provided by Last.FM. It's
+lightweight, easy to use and under heavy development. New features might
+be added every day.
+.Nm 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.
+.Sh RUNNINF SHELL-FM
+Usage of
+.Nm shell-fm
+is pretty simple. To tell
+.Nm shell-fm
+what to play, you simply give it the direct link to a Last.FM stream (a
+URL starting with lastfm://). The URLs are very clear and easy to
+understand. Here are some examples:
+.Pp
+.nf
+ lastfm://user/shell-monkey/personal - my personal radio
+ lastfm://user/shell-monkey/loved - my loved tracks radio
+ lastfm://artist/Blood For Blood/similar - bands similar to Blood For
+ Blood
+ lastfm://artist/The Distillers/fans - The Distillers fan radio
+ lastfm://globaltags/punk rock - songs that have been
+ tagged as "punk rock"
+.fi
+.Pp
+Radios can be specified in three ways. First you can give a stream URL
+as command line argument to
+.Nm shell-fm
+:
+.Pp
+[~]$ shell-fm "lastfm://artist/The Distillers/fans"
+.Pp
+Note that you need to quote the URL, if it contains white spaces.
+.br
+Next you can enter a new URL while
+.Nm shell-fm
+is already running by pressing the r key.
+.Nm shell-fm
+then will prompt you for a new URL. Note that you don't need / may not
+quote the URL here like in the command line.
+.Nm shell-fm
+will take care of whitespaces for you. Finally, you can name a default
+stream in your configuration file, which is started by default if you
+run
+.Nm shell-fm
+without an URL as command line argument.
+.Sh CONFIGURATION
+Your configuration should be placed in the file ~/.shell-fm/shell-fm.rc.
+It consists of simple associations in the format key = value. Following
+keys are known at the moment (may/will be more in future).
+.br
+.nf
+ username - your Last.FM nick
+ password - your Last.FM password; if password and username or
+ only the password are missing here, shell-fm will
+ prompt you for it on startup.
+ default-radio - the default radio which shell-fm will play on startup
+ if you called it without an command line argument.
+ np-file - the (absolute) path to a file in which you want
+ shell-fm to save information about the currently
+ played track in.
+ np-file-format - the format in which shell-fm will write the song
+ information to your np-file. Note that both, np-file
+ and np-file-format need to be specified to make
+ shell-fm write to the np-file. The format may contain
+ any character plus some placeholders shell-fm will
+ replace. They are:
+ %a - artist
+ %t - title
+ %A - album
+ %d - duration in seconds
+ %s - station name
+ %u - station URL
+ %U - artist URL
+ %T - track URL
+.fi
+.Pp
+There may and will be more placeholders available in future releases.
+.br
+.nf
+ np-cmd - command that's executed whenever the track changes. Allows
+ the same format placeholders as the "np-file-format"
+ option.
+ key0x?? - bind an external command to the key with the hexadecimal,
+ UPPERCASE (!), zero-padded ASCII code "??". Keys that are
+ already bound to an action (as listed here) can't be
+ overwritten. Again, you can use all the variables as in
+ "np-file-format" and "np-cmp". Please note that future
+ versions may use further keys, so you might need to change
+ your configuration then.
+ ?-color - (where ? is one of the meta tag variables (see list
+ above). This allows you to color every kind of tag with a
+ different color (e.g. paint track titles red, artists
+ green and so on). This is the list of valid color codes:
+ 0;30 = black (not very useful)
+ 1;30 = dark gray
+ 0;31 = red
+ 1;31 = light red
+ 0;32 = green
+ 1;32 = light green
+ 0;33 = dark yellow/brown
+ 1;33 = yellow
+ 0;34 = blue
+ 1;34 = light blue
+ 0;35 = violet
+ 1;35 = pink
+ 0;36 = turquoise
+ 1;36 = cyan
+ 0;37 = gray
+ 1;37 = white
+.fi
+.Pp
+This is what your configuration file for
+.Nm shell-fm
+could look like:
+.nf
+ [~]$ cat ~/.shell-fm/shell-fm.rc
+ username = shell-monkey
+ password = secret
+ default-radio = lastfm://user/shell-monkey/loved
+ np-file = /tmp/np.txt
+ np-file-format = %a - %t
+ key0x6F = /usr/bin/elinks "%u"
+ t-color = 1;32
+ a-color = 0;32
+ s-color = 1;37
+ [~]$
+.fi
+.Sh CONTROLS
+These keys are available from within
+.Nm shell-fm
+to control it's behaviour:
+.br
+.nf
+ r - prompt for a new station URL.
+ l - love the currently played track.
+ B - (uppercase!) ban the currently played track.
+ n - skip the currently played track.
+ Q - (uppercase!) quit.
+ d - enable/disable discovery mode.
+ A - ban the artist of the currently played track (whenever another
+ track of this artist is streamed again, it will be banned
+ automatically).
+ R - toggle RTP on/off (RTP = record tracks to profile)
+ f - listen to the fan radio of the currently played tracks artist
+ s - listen to the similar-artists radio of the currently played
+ tracks artist
+.fi
+.br
+Note that the radio URL prompt provides a simple history (use up/down
+arrow keys to browse it). By default,
+.Nm Shell.FM
+will remember only the URLs you entered in the current session. If you
+want the history to survive, you need to create an empty file name
+~/.shell-fm/radio-history. Simply touch(1) it and you're done.
+.Sh SEE ALSO
+http://lizer.syslinx.org/shell-fm/
+.Sh CREDITS
+Jonas Kramer <jonas.kramer@gmx.net> wrote the actual code.
+.Sh AUTHOR
+Nikos Ntarmos <ntarmos@ceid.upatras.gr>
--- src/Makefile.am.orig Sat Dec 16 04:37:00 2006
+++ src/Makefile.am Sat Dec 16 04:37:59 2006
@@ -26,5 +26,7 @@
tag.c \
utility.c
+man_MANS = shell-fm.1
+EXTRA_DIST = ${man_MANS}
## vim: noet ts=8 sw=8

View File

@ -0,0 +1,70 @@
--- src/strndup.c.orig Sat Dec 16 04:21:22 2006
+++ src/strndup.c Sat Dec 16 04:20:48 2006
@@ -0,0 +1,13 @@
+#include "strndup.h"
+#include <string.h>
+
+#ifdef __STRNDUP__
+
+char* strndup(const char* src, size_t len) {
+ char* _tmpStr = (char*)malloc(len + 1);
+ strncpy(_tmpStr, src, len);
+ return _tmpStr;
+}
+
+#endif
+
--- src/include/strndup.h.orig Sat Dec 16 04:21:27 2006
+++ src/include/strndup.h Sat Dec 16 04:20:28 2006
@@ -0,0 +1,11 @@
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
+#if ((defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__STRNDUP__))
+#define __STRNDUP__
+
+extern char* strndup(const char* src, size_t len);
+
+#endif
+
--- src/Makefile.am.orig Sat Dec 16 04:18:32 2006
+++ src/Makefile.am Sat Dec 16 04:18:41 2006
@@ -6,6 +6,7 @@
INCLUDES = -I$(srcdir)/include
shell_fm_SOURCES = \
+strndup.c \
autoban.c \
bookmark.c \
getln.c \
--- src/radio.c.orig Sat Dec 16 04:25:00 2006
+++ src/radio.c Sat Dec 16 02:07:30 2006
@@ -35,6 +35,7 @@
#include "settings.h"
#include "rl_completion.h"
#include "strarray.h"
+#include "strndup.h"
#define LASTFM_URL_PREFIX "lastfm://"
#define LASTFM_URL_MIN_LENGTH 6 // shortest possible: 'user/a'
--- src/strarray.c.orig Sat Dec 16 04:25:13 2006
+++ src/strarray.c Sat Dec 16 02:07:39 2006
@@ -22,6 +22,7 @@
#include "compatibility.h"
#include "strarray.h"
+#include "strndup.h"
void strarray_init (strarray_t *sa) {
sa->strings = NULL;
--- src/tag.c.orig Sat Dec 16 04:25:15 2006
+++ src/tag.c Sat Dec 16 02:07:49 2006
@@ -23,6 +23,7 @@
#include "split.h"
#include "interface.h"
#include "rl_completion.h"
+#include "strndup.h"
static char ** getPopularTags(char, struct hash);
static char * getExistingTags(char, struct hash);

View File

@ -0,0 +1,8 @@
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/