View | Details | Raw Unified | Return to bug 129634
Collapse All | Expand All

(-)shell-fm/Makefile (-20 / +22 lines)
Lines 6-15 Link Here
6
#
6
#
7
7
8
PORTNAME=	shell-fm
8
PORTNAME=	shell-fm
9
PORTVERSION=	0.4
9
PORTVERSION=	0.6
10
PORTEPOCH=	1
10
PORTEPOCH=	1
11
CATEGORIES=	multimedia
11
CATEGORIES=	multimedia
12
MASTER_SITES=	http://ntarmos.dyndns.org/Software/FreeBSD/
12
MASTER_SITES=	http://nex.scrapping.cc/code/shell-fm/downloads/
13
13
14
MAINTAINER=	ntarmos@ceid.upatras.gr
14
MAINTAINER=	ntarmos@ceid.upatras.gr
15
COMMENT=	A command-line client for Last.FM
15
COMMENT=	A command-line client for Last.FM
Lines 17-51 Link Here
17
LIB_DEPENDS=	ao:${PORTSDIR}/audio/libao \
17
LIB_DEPENDS=	ao:${PORTSDIR}/audio/libao \
18
		mad:${PORTSDIR}/audio/libmad
18
		mad:${PORTSDIR}/audio/libmad
19
19
20
USE_AUTOTOOLS=	aclocal:19 automake:19 autoheader:262 autoconf:262
20
USE_BZIP2=	true
21
AUTOMAKE_ARGS=	--add-missing --copy
21
USE_GMAKE=	true
22
ACLOCAL_ARGS=	-I m4
23
LDFLAGS+=	-L${LOCALBASE}/lib
22
LDFLAGS+=	-L${LOCALBASE}/lib
24
CFLAGS+=	-I${LOCALBASE}/include
23
CFLAGS+=	-I${LOCALBASE}/include
25
CONFIGURE_ENV=	CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
26
24
27
pre-configure:
25
MAN1=		shell-fm.1
28
	@(cd ${CONFIGURE_WRKSRC} && \
26
MANCOMPRESSED=	yes
29
	${SETENV} ${AUTOTOOLS_ENV} ${ACLOCAL})
27
PLIST_FILES=	bin/shell-fm
28
PORTDOCS=	AUTHORS CHANGES RELEASE INSTALL
29
PORTEXAMPLES=	shell-colors.sh shell-fm-tune.sh \
30
		unix.pl zcontrol
31
32
pre-build:
33
	@${REINPLACE_CMD} \
34
		-e 's/^DESTDIR.*$$/\DESTDIR := $$(LOCALBASE)/g' \
35
		${WRKSRC}/Makefile
30
36
31
post-install:
37
post-install:
32
.if !defined(NOPORTDOCS)
38
.if !defined(NOPORTDOCS)
33
	@${ECHO_MSG} "installing additional documentation to ${DOCSDIR}"
39
	@${ECHO_MSG} "installing additional documentation to ${DOCSDIR}"
34
	@${MKDIR} ${DOCSDIR}
40
	@${MKDIR} ${DOCSDIR}
35
	@${INSTALL_MAN} ${WRKSRC}/AUTHORS ${DOCSDIR}
41
. for doc in ${PORTDOCS}
36
	@${INSTALL_MAN} ${WRKSRC}/COPYING ${DOCSDIR}
42
	@${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
37
	@${INSTALL_MAN} ${WRKSRC}/README ${DOCSDIR}
43
. endfor
38
.endif
44
.endif
39
.if !defined(NOPORTEXAMPLES)
45
.if !defined(NOPORTEXAMPLES)
40
	@${ECHO_MSG} "installing example config file to ${EXAMPLESDIR}"
41
	@${MKDIR} ${EXAMPLESDIR}
46
	@${MKDIR} ${EXAMPLESDIR}
42
	@${INSTALL_MAN} ${WRKSRC}/shell-fm.rc-example ${EXAMPLESDIR}
47
	@${ECHO_MSG} "installing examples to ${EXAMPLESDIR}"
48
. for example in ${PORTEXAMPLES}
49
	@${INSTALL_DATA} ${WRKSRC}/scripts/${example} ${EXAMPLESDIR}
50
. endfor
43
.endif
51
.endif
44
52
45
MAN1=		shell-fm.1
46
MANCOMPRESSED=	no
47
PLIST_FILES=	bin/shell-fm
48
PORTDOCS=	AUTHORS COPYING README
49
PORTEXAMPLES=	shell-fm.rc-example
50
51
.include <bsd.port.mk>
53
.include <bsd.port.mk>
(-)shell-fm/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (shell-fm-0.4.tar.gz) = 8042dca006ebc8c29bce0ef4e3c964a8
1
MD5 (shell-fm-0.6.tar.bz2) = dc8b1ffedf93df565f426f26943842ab
2
SHA256 (shell-fm-0.4.tar.gz) = 03fd3ea13a1ecd97355aa9a504480b3b407c46bc6893477d3d1b61f300c3425b
2
SHA256 (shell-fm-0.6.tar.bz2) = b66dc51b95b323b30198c8e95af136b232bd3e2aae8b3ec40c07cae0073ad7c7
3
SIZE (shell-fm-0.4.tar.gz) = 56641
3
SIZE (shell-fm-0.6.tar.bz2) = 35422
(-)shell-fm/files/patch-shell-fm.1 (-237 lines)
Lines 1-237 Link Here
1
--- /dev/null	2007-11-19 22:27:41.000000000 +0200
2
+++ src/shell-fm.1	2007-11-19 22:27:20.000000000 +0200
3
@@ -0,0 +1,223 @@
4
+.\"
5
+.\" $Id$
6
+.\"
7
+.Dd December 15, 2006
8
+.Dt SHELL-FM 1
9
+.Os
10
+.Sh NAME
11
+.Nm shell-fm
12
+.Nd command-line Last.FM client
13
+.Sh SYNOPSIS
14
+.Nm shell-fm
15
+.Op Fl d
16
+.Op Fl i Ar address to listen on
17
+.Op Fl p Ar port to listen on
18
+.Op Fl D Ar device to play on
19
+.Op Fl y Ar http://proxy-server
20
+.Op Fl h
21
+.Op lastfm://...
22
+.Sh DESCRIPTION
23
+.Nm shell-fm
24
+is a console based player for the streams provided by Last.FM. It's
25
+lightweight, easy to use and under heavy development. New features might
26
+be added every day.
27
+.Nm shell-fm
28
+is Open Source and published under the terms of the GNU General Public
29
+License, so feel free to modify and/or redistribute it.
30
+.Sh RUNNINF SHELL-FM
31
+Usage of
32
+.Nm shell-fm
33
+is pretty simple. To tell
34
+.Nm shell-fm
35
+what to play, you simply give it the direct link to a Last.FM stream (a
36
+URL starting with lastfm://). The URLs are very clear and easy to
37
+understand. Here are some examples:
38
+.Pp
39
+.nf
40
+    lastfm://user/shell-monkey/personal     - my personal radio
41
+    lastfm://user/shell-monkey/loved        - my loved tracks radio
42
+    lastfm://artist/Blood For Blood/similar - bands similar to Blood For
43
+                                              Blood
44
+    lastfm://artist/The Distillers/fans     - The Distillers fan radio
45
+    lastfm://globaltags/punk rock           - songs that have been
46
+                                              tagged as "punk rock"
47
+.fi
48
+.Pp
49
+Radios can be specified in three ways. First you can give a stream URL
50
+as command line argument to
51
+.Nm shell-fm
52
+:
53
+.Pp
54
+[~]$ shell-fm "lastfm://artist/The Distillers/fans"
55
+.Pp
56
+Note that you need to quote the URL, if it contains white spaces.
57
+.br
58
+Next you can enter a new URL while
59
+.Nm shell-fm
60
+is already running by pressing the r key.
61
+.Nm shell-fm
62
+then will prompt you for a new URL. Note that you don't need / may not
63
+quote the URL here like in the command line.
64
+.Nm shell-fm
65
+will take care of whitespaces for you.  Finally, you can name a default
66
+stream in your configuration file, which is started by default if you
67
+run
68
+.Nm shell-fm
69
+without an URL as command line argument.
70
+.Sh CONFIGURATION
71
+Your configuration should be placed in the file ~/.shell-fm/shell-fm.rc.
72
+It consists of simple associations in the format key = value. Following
73
+keys are known at the moment (may/will be more in future).
74
+.br
75
+.nf
76
+  username = YourLogin        - your Last.FM username.
77
+  password = YourPass         - your Last.FM password.
78
+  np-file = /path/to/np-file  - the (absolute) path to a file in which
79
+                                you want shell-fm to save information
80
+                                about the currently played track in.
81
+  np-file-format = format     - the format in which shell-fm will write
82
+                                the song information to your np-file.
83
+                                Note that both, np-file and
84
+                                np-file-format need to be specified to
85
+                                make shell-fm write to the np-file. The
86
+                                format may contain any character plus
87
+                                some placeholders shell-fm will replace.
88
+                                They are:
89
+                                   %a - artist
90
+                                   %t - track
91
+                                   %A - album
92
+                                   %d - track duration
93
+                                   %s - station name
94
+                                   %u - station URL
95
+                                   %U - artist URL
96
+                                   %X - album URL
97
+                                   %T - track URL
98
+                                   %R - remaining seconds of the played
99
+                                        track
100
+  np-cmd = command            - if defined, this command will be
101
+                                executed every time a new track is
102
+                                played. Accepts the sape format flast as
103
+                                np-file-format.
104
+  default-radio = lastfm://.. - the default radio which shell-fm will
105
+                                play on startup if you called it without
106
+                                an command line argument.
107
+  key0x?? = command           - bind an external command to the key with
108
+                                the hexadecimal, UPPERCASE (!),
109
+                                zero-padded ASCII code "??". Keys that
110
+                                are already bound to an action (as
111
+                                listed here) can't be overwritten.
112
+                                Again, you can use all the variables as
113
+                                in "np-file-format" and "np-cmp". Please
114
+                                note that future versions may use
115
+                                further keys, so you might need to
116
+                                change your configuration then.
117
+  ?-color = color-code        - (where ? is one of the meta tag
118
+                                variables (see list above). This allows
119
+                                you to color every kind of tag with a
120
+                                different color (e.g. paint track titles
121
+                                red, artists green and so on). This is
122
+                                the list of valid color codes:
123
+                                   0;30 = black (not very useful)
124
+                                   1;30 = dark gray
125
+                                   0;31 = red
126
+                                   1;31 = light red
127
+                                   0;32 = green
128
+                                   1;32 = light green
129
+                                   0;33 = dark yellow/brown
130
+                                   1;33 = yellow
131
+                                   0;34 = blue
132
+                                   1;34 = light blue
133
+                                   0;35 = violet
134
+                                   1;35 = pink
135
+                                   0;36 = turquoise
136
+                                   1;36 = cyan
137
+                                   0;37 = gray
138
+                                   1;37 = white
139
+  bind = ip/host              - binds a socket to the given host so you
140
+                                can send simple commands to Shell.FM
141
+                                over a network to control it. For now,
142
+                                only the most common commands are
143
+                                supported: "skip", "love", "ban",
144
+                                "quit", "play" and "info". "play" takes
145
+                                a radio statio URI as paramater. "info"
146
+                                takes a format string as parameter (same
147
+                                as for np-file-format) and returns the
148
+                                string (formatted).
149
+  port = 123                  - if defined, the socket interface will be
150
+                                bound to this port instead of the
151
+                                default, 54311.
152
+  extern = command            - on some platforms, Shell.FM is still
153
+                                unable to play streams properly. This
154
+                                option enables you to use Shell.FM for
155
+                                stream control, but use another player
156
+                                for the playback. The stream will be
157
+                                written to STDIN of the external player.
158
+                                For example, extern = /usr/bin/madplay
159
+                                -Q - should work find on Mac OS X (if
160
+                                you have madplay installed).
161
+  extern-restart = anything   - if defined (no matter what value),
162
+                                Shell.FM will stop and restart the
163
+                                external player whenever the track
164
+                                changes.
165
+  proxy = http://proxy-server - use proxy server for HTTP requests.
166
+  expiry = 86400              - TTL of cached files in seconds.
167
+.fi
168
+.Pp
169
+This is what your configuration file for
170
+.Nm shell-fm
171
+could look like:
172
+.nf
173
+    [~]$ cat ~/.shell-fm/shell-fm.rc
174
+    username = shell-monkey
175
+    password = secret
176
+    default-radio = lastfm://user/shell-monkey/loved
177
+    np-file = /tmp/np.txt
178
+    np-file-format = %a - %t
179
+    key0x6F = /usr/bin/elinks "%u"
180
+    t-color = 1;32
181
+    a-color = 0;32
182
+    s-color = 1;37
183
+    [~]$
184
+.fi
185
+.Sh CONTROLS
186
+These keys are available from within
187
+.Nm shell-fm
188
+to control it's behaviour:
189
+.br
190
+.nf
191
+        l - love the currently played track.
192
+        B - (uppercase!) ban the currently played track.
193
+        n - skip the currently played track.
194
+        Q - (uppercase!) quit.
195
+        r - prompt for a new station URL.
196
+        i - display some information about the currently played track.
197
+        d - enable/disable discovery mode.
198
+        A - ban the artist of the currently played track (whenever another
199
+            track of this artist is streamed again, it will be banned
200
+            automatically).
201
+        R - recommend currently played track/artist/album to someone.
202
+        f - jump to the currently played tracks artists fan radio.
203
+        s - jump to the currently played tracks artists similar artists
204
+            radio.
205
+        H - bookmark the currently played stream.
206
+        h - list bookmarks.
207
+    [0-9] - jump to a previously bookmarked stream.
208
+        p - pause (experimental - after a while the stream will be
209
+            closed)
210
+        S - stop playing
211
+        T - tag the currently played track/artist/album.
212
+        ? - show a list of available keys.
213
+.fi
214
+.br
215
+Note that the radio URL prompt provides a simple history (use up/down
216
+arrow keys to browse it). By default,
217
+.Nm Shell.FM
218
+will remember only the URLs you entered in the current session. If you
219
+want the history to survive, you need to create an empty file name
220
+~/.shell-fm/radio-history. Simply touch(1) it and you're done.
221
+.Sh SEE ALSO
222
+http://nex.scrapping.cc/shell-fm/
223
+.Sh CREDITS
224
+Read the AUTHORS file in the port's doc directory.
225
+.Sh AUTHOR
226
+Nikos Ntarmos <ntarmos@ceid.upatras.gr>
227
--- src/Makefile.am.orig	Sat Dec 16 04:37:00 2006
228
+++ src/Makefile.am	Sat Dec 16 04:37:59 2006
229
@@ -26,5 +26,7 @@
230
 tag.c \
231
 utility.c
232
 
233
+man_MANS = shell-fm.1
234
+EXTRA_DIST = ${man_MANS}
235
 
236
 ## vim: noet ts=8 sw=8
237
(-)shell-fm/files/patch-strndup.c (-74 lines)
Lines 1-74 Link Here
1
--- src/strndup.c.orig	Sat Dec 16 04:21:22 2006
2
+++ src/strndup.c	Sat Dec 16 04:20:48 2006
3
@@ -0,0 +1,17 @@
4
+#include "strndup.h"
5
+#include <string.h>
6
+#include <stdlib.h>
7
+
8
+#ifdef __STRNDUP__
9
+
10
+char* strndup(const char*  src, size_t len) {
11
+	char* _tmpStr = (char*)malloc(len + 1);
12
+	if (_tmpStr) {
13
+		strncpy(_tmpStr, src, len);
14
+		_tmpStr[len] = 0;
15
+	}
16
+	return _tmpStr;
17
+}
18
+
19
+#endif
20
+
21
--- src/include/strndup.h.orig	Sat Dec 16 04:21:27 2006
22
+++ src/include/strndup.h	Sat Dec 16 04:20:28 2006
23
@@ -0,0 +1,11 @@
24
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
25
+#include <sys/param.h>
26
+#endif
27
+
28
+#if ((defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__STRNDUP__))
29
+#define __STRNDUP__
30
+
31
+extern char* strndup(const char*  src, size_t len);
32
+
33
+#endif
34
+
35
--- src/Makefile.am.orig	Sat Dec 16 04:18:32 2006
36
+++ src/Makefile.am	Sat Dec 16 04:18:41 2006
37
@@ -169,6 +169,7 @@
38
 SUBDIRS = include
39
 INCLUDES = -I$(srcdir)/include
40
 shell_fm_SOURCES = \
41
+strndup.c \
42
 autoban.c \
43
 bookmark.c \
44
 getln.c \
45
--- src/tag.c.orig	Sat Dec 16 04:25:15 2006
46
+++ src/tag.c	Sat Dec 16 02:07:49 2006
47
@@ -22,6 +22,7 @@
48
 #include "split.h"
49
 #include "interface.h"
50
 #include "completion.h"
51
+#include "strndup.h"
52
 #include "md5.h"
53
 #include "feeds.h"
54
55
--- src/feeds.c.o	2007-11-19 18:31:19.000000000 +0200
56
+++ src/feeds.c	2007-11-19 18:31:43.000000000 +0200
57
@@ -8,6 +8,7 @@
58
 #include "http.h"
59
 #include "feeds.h"
60
 #include "tag.h"
61
+#include "strndup.h"
62
63
 char ** neighbors(const char * user) {
64
	char * encoded = NULL, feed[128], ** names = NULL;
65
--- src/playlist.c.o	2007-11-19 18:31:15.000000000 +0200
66
+++ src/playlist.c	2007-11-19 18:31:31.000000000 +0200
67
@@ -18,6 +18,7 @@
68
 #include "http.h"
69
 #include "settings.h"
70
 #include "service.h"
71
+#include "strndup.h"
72
 
73
 #include "playlist.h"
74
 #include "globals.h"

Return to bug 129634