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

(-)icecast/Makefile (-55 lines)
Lines 1-55 Link Here
1
# Created by: Chip Marshall <chip@eboai.org>
2
# $FreeBSD$
3
4
PORTNAME=	icecast
5
PORTVERSION=	1.3.12
6
PORTREVISION=	2
7
CATEGORIES=	audio net
8
MASTER_SITES=	http://downloads.xiph.org/releases/icecast/
9
10
MAINTAINER=	c.petrik.sosa@gmail.com
11
COMMENT=	Streaming mp3 audio server
12
13
LICENSE=	GPLv2 # (or later)
14
15
OPTIONS_DEFINE=	DOCS
16
17
USE_READLINE=	yes
18
GNU_CONFIGURE=	yes
19
CONFIGURE_ARGS=	--with-libwrap
20
MAKE_JOBS_SAFE=	yes
21
22
CPPFLAGS+=	${PTHREAD_CFLAGS}
23
LDFLAGS+=	${PTHREAD_LIBS}
24
25
SUB_FILES=	pkg-message
26
27
.include <bsd.port.options.mk>
28
29
pre-patch:
30
	@${REINPLACE_CMD} -e \
31
		's|<readline.h>|<readline/readline.h>| ; \
32
		 s|<history.h>|<readline/history.h>|' ${WRKSRC}/src/admin.c
33
	@${REINPLACE_CMD} -e \
34
		's|HAVE_HISTORY_H|HAVE_READLINE_HISTORY_H|g' ${WRKSRC}/config.h.in
35
36
do-install:
37
	${INSTALL_PROGRAM} ${WRKSRC}/src/icecast ${PREFIX}/sbin
38
	@${MKDIR} ${ETCDIR}/conf
39
.for CONF in groups.aut.dist icecast.conf.dist mounts.aut.dist users.aut.dist
40
	${INSTALL_DATA} ${WRKSRC}/conf/${CONF} ${ETCDIR}/conf
41
.endfor
42
	@${MKDIR} ${ETCDIR}/templates
43
.for TEMPL in 306.html 400.html 403.html 404.html 504.html bodytag.html \
44
	info.html list_directory.html mountlist.html statistics.html \
45
	admin_describe.html admin.html alias_add.html manual.html \
46
	alias_del.html header.html footer.html admin_change.html
47
	${INSTALL_DATA} ${WRKSRC}/templates/${TEMPL} ${ETCDIR}/templates
48
.endfor
49
.if ${PORT_OPTIONS:MDOCS}
50
	@${MKDIR} ${DOCSDIR}
51
	${INSTALL_DATA} ${WRKSRC}/doc/manual.html ${DOCSDIR}
52
.endif
53
	@${CAT} ${PKGMESSAGE}
54
55
.include <bsd.port.mk>
(-)icecast/distinfo (-2 lines)
Lines 1-2 Link Here
1
SHA256 (icecast-1.3.12.tar.gz) = 1fdbf39a8828e71c6a89e18e3472bd5f8d27b25de820e6fde1faf1d9b54285a7
2
SIZE (icecast-1.3.12.tar.gz) = 269822
(-)icecast/files/patch-configure (-29 lines)
Lines 1-29 Link Here
1
--- configure.orig	Thu Apr 11 00:50:20 2002
2
+++ configure	Sun Dec 17 13:14:47 2006
3
@@ -2113,7 +2113,7 @@
4
   fi
5
 fi
6
 
7
-opt_readline="no"
8
+opt_readline="unset"
9
 
10
 if test "$opt_readline" = "unset"; then
11
 	if test -f "$withval/include/readline/readline.h"; then
12
@@ -3118,7 +3118,7 @@
13
 
14
 fi
15
 
16
-for ac_hdr in fcntl.h sys/time.h unistd.h sys/soundcard.h machine/soundcard.h pthread.h assert.h sys/resource.h math.h signal.h sys/signal.h mcheck.h malloc.h history.h Python.h
17
+for ac_hdr in fcntl.h sys/time.h unistd.h sys/soundcard.h machine/soundcard.h pthread.h assert.h sys/resource.h math.h signal.h sys/signal.h mcheck.h malloc.h readline/history.h Python.h
18
 do
19
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
21
@@ -3473,7 +3473,7 @@
22
   cat conftest.$ac_ext >&5
23
   rm -rf conftest*
24
   echo "$ac_t""nah" 1>&6
25
-	HAVE_SOCKLEN_T=no
26
+	HAVE_SOCKLEN_T=yes
27
 fi
28
 rm -f conftest*
29
 
(-)icecast/files/patch-src::avl_functions.c (-11 lines)
Lines 1-11 Link Here
1
--- src/avl_functions.c
2
+++ src/avl_functions.c
3
@@ -307,7 +307,7 @@
4
 	}
5
 
6
 	snprintf(s1, BUFSIZE, "%s:%d", dir1->host, dir1->port);
7
-	snprintf(s2, "%s:%d", dir2->host, dir2->port);
8
+	snprintf(s2, BUFSIZE, "%s:%d", dir2->host, dir2->port);
9
 
10
 	return compare_strings (s1, s2, param);
11
 }
(-)icecast/files/patch-src::client.c (-11 lines)
Lines 1-11 Link Here
1
--- src/client.c
2
+++ src/client.c
3
@@ -90,8 +90,6 @@
4
 
5
 extern server_info_t info;
6
 
7
-static void client_send_fake_file (connection_t *con);
8
-
9
 /* Brand new client. Check what he wants, and either add him to
10
    the correct tree of clients (inside a source), or kill him off */
11
 void client_login(connection_t *con, char *expr)
(-)icecast/files/patch-src::commands.c (-25 lines)
Lines 1-25 Link Here
1
--- src/commands.c
2
+++ src/commands.c
3
@@ -84,8 +84,8 @@
4
 #include "interpreter.h"
5
 
6
 #include <time.h>
7
+#include <errno.h>
8
 
9
-extern int errno;
10
 extern int running;
11
 extern server_info_t info;
12
 extern mutex_t library_mutex;
13
@@ -2884,8 +2884,11 @@
14
 	time_t before = 0;
15
 
16
 	if (!arg || !arg[0])
17
+	{
18
 		admin_write_line (req, ADMIN_SHOW_PING_INVALID_SYNTAX, PING_SYNTAX);
19
-	
20
+		return 0;
21
+	}
22
+		
23
 	host[0] = '\0';
24
 
25
 	if (splitc (host, arg, ':') != NULL)
(-)icecast/files/patch-src::connection.c (-18 lines)
Lines 1-18 Link Here
1
--- src/connection.c.orig	Mon Aug  5 20:39:21 2002
2
+++ src/connection.c	Mon Aug  5 20:40:08 2002
3
@@ -18,6 +18,7 @@
4
  *
5
  */
6
 
7
+#include <sys/types.h>
8
 #ifdef HAVE_CONFIG_H
9
 #ifdef _WIN32
10
 #include <win32config.h>
11
@@ -42,7 +43,6 @@
12
 #include <unistd.h>
13
 #endif
14
 
15
-#include <sys/types.h>
16
 #include <ctype.h>
17
 #include <errno.h>
18
 #include <time.h>
(-)icecast/files/patch-src::http.c (-81 lines)
Lines 1-81 Link Here
1
--- src/http.c
2
+++ src/http.c
3
@@ -327,7 +327,60 @@
4
 }
5
 
6
 char * 
7
-url_encode (const char *str, char **result_p)
8
+html_escape (const char *str)
9
+{
10
+  const char *p;
11
+  char *q;
12
+  char *result;
13
+  int toescape= 0;
14
+
15
+  if (!str) {
16
+	  xa_debug (1, "WARNING: html_escape() called with NULL string");
17
+	  return NULL;
18
+  }
19
+
20
+  for (p = str; *p; p++) {
21
+    if ((unsigned char) (*p) == '&') toescape+=4;
22
+    if ((unsigned char) (*p) == '"') toescape+=5;
23
+    if ((unsigned char) (*p) == '<') toescape+=3;
24
+    if ((unsigned char) (*p) == '>') toescape+=3;
25
+  }
26
+  
27
+  result = (char  *) nmalloc (p - str + toescape + 1);
28
+
29
+  for (q = result, p = str; *p; p++) {
30
+      unsigned char a = *p;
31
+      if (a == '&') {
32
+      	  *q++ = '&';
33
+      	  *q++ = 'a';
34
+      	  *q++ = 'm';
35
+      	  *q++ = 'p';
36
+      	  *q++ = ';';
37
+      } else if (a == '"') {
38
+      	  *q++ = '&';
39
+      	  *q++ = 'q';
40
+      	  *q++ = 'u';
41
+      	  *q++ = 'o';
42
+      	  *q++ = 't';
43
+      	  *q++ = ';';
44
+      } else if (a == '<') {
45
+      	  *q++ = '&';
46
+      	  *q++ = 'l';
47
+      	  *q++ = 't';
48
+      	  *q++ = ';';
49
+      } else if (a == '>') {
50
+      	  *q++ = '&';
51
+      	  *q++ = 'g';
52
+      	  *q++ = 't';
53
+      	  *q++ = ';';
54
+      } else *q++ = *p;
55
+    }
56
+  *q++ = 0; 
57
+  return result;
58
+}
59
+
60
+char * 
61
+url_encode (const char *str, char** result_p)
62
 {
63
   const char *p;
64
   char *q;
65
@@ -345,7 +398,6 @@
66
       unacceptable++;
67
 
68
   result = (char  *) nmalloc (p - str + unacceptable + unacceptable + 1);
69
-
70
   *result_p = result;
71
 
72
   for (q = result, p = str; *p; p++) 
73
@@ -1336,7 +1388,7 @@
74
 	  add_varpair2 (variables, nstrdup (ident), ice_itoa (i));
75
 	  add_varpair2 (variables, ice_cat (ident, ".id"), ice_itoa (travclients->id));
76
 	  add_varpair2 (variables, ice_cat (ident, ".host"), nstrdup (con_host (travclients)));
77
-	  add_varpair2 (variables, ice_cat (ident, ".user_agent"), nstrdup (get_user_agent (travclients)));
78
+	  add_varpair2 (variables, ice_cat (ident, ".user_agent"), nstrdup (html_escape(get_user_agent (travclients))));
79
 	  add_varpair2 (variables, ice_cat (ident, ".writebytes"), ice_utoa (travclients->food.client->write_bytes));
80
 	  add_varpair2 (variables, ice_cat (ident, ".connecttime"), nstrdup (nice_time (get_time() - travclients->connect_time, buf)));
81
 	  endptr = parse_template_file (clicon, NULL, runptr, fd, variables);
(-)icecast/files/patch-src::http.h (-10 lines)
Lines 1-10 Link Here
1
--- src/http.h
2
+++ src/http.h
3
@@ -44,6 +44,7 @@
4
 int print_http_variable (vartree_t *request_vars, const char *name, connection_t *clicon, int fd);
5
 char *url_encode(const char *string, char **result_p);
6
 char *url_decode (const char *string);
7
+char *html_escape(const char *string);
8
 const char *parse_template_file (connection_t *clicon, connection_t *sourcecon, const char *ptr, int fd, vartree_t *variables);
9
 int write_template_parsed_html_page (connection_t *clicon, connection_t *sourcecon, const char *template_file, int fd, vartree_t *variables);
10
 const char *http_loop_sources (char *ident, connection_t *clicon, const char *ptr, int fd, vartree_t *variables);
(-)icecast/files/patch-src::ice_string.c (-11 lines)
Lines 1-11 Link Here
1
--- src/ice_string.c
2
+++ src/ice_string.c
3
@@ -334,8 +334,6 @@
4
 
5
 char *safe_strcat(char *dest, const char *src, unsigned int maxsize)
6
 {
7
-	int size = 0;
8
-
9
 	if (!dest || !src) return dest;
10
 
11
 	if (ice_strlen(dest) + ice_strlen(src)  + 1 >= maxsize) {
(-)icecast/files/patch-src::main.c (-11 lines)
Lines 1-11 Link Here
1
--- src/main.c
2
+++ src/main.c
3
@@ -544,7 +544,7 @@
4
 	directory_server_t *ds;
5
 	int i;
6
 	avl_traverser trav = {0};
7
-	static main_shutting_down = 0;
8
+	static int main_shutting_down = 0;
9
 	
10
 	thread_library_lock ();
11
 		if (!main_shutting_down)
(-)icecast/files/patch-src::sock.c (-18 lines)
Lines 1-18 Link Here
1
--- src/sock.c.orig	Mon Aug  5 20:57:27 2002
2
+++ src/sock.c	Mon Aug  5 20:57:48 2002
3
@@ -19,6 +19,7 @@
4
  *
5
  */
6
 
7
+#include <sys/types.h>
8
 #ifdef HAVE_CONFIG_H
9
 #ifdef _WIN32
10
 #include <win32config.h>
11
@@ -35,7 +36,6 @@
12
 
13
 #include "definitions.h"
14
 
15
-#include <sys/types.h>
16
 #include <ctype.h>
17
 
18
 #ifdef HAVE_UNISTD_H
(-)icecast/files/patch-src::static.c (-12 lines)
Lines 1-12 Link Here
1
--- src/static.c
2
+++ src/static.c
3
@@ -232,9 +232,7 @@
4
 void 
5
 send_file_to_socket (connection_t *con, char *filename)
6
 {
7
-	struct stat buf;
8
 	int mp3file;
9
-	char *suffix;
10
 	long length;
11
 	char buff[BUFSIZE];
12
 	
(-)icecast/files/patch-src::threads.c (-13 lines)
Lines 1-13 Link Here
1
--- src/threads.c.old	Mon Jul 31 14:52:19 2000
2
+++ src/threads.c	Mon Nov 18 12:19:41 2002
3
@@ -39,7 +39,10 @@
4
 #include <errno.h>
5
 #include <sys/types.h>
6
 #include <time.h>
7
+
8
+#define __XSI_VISIBLE 1
9
 #include <signal.h>
10
+#undef __XSI_VISIBLE
11
 
12
 #ifdef HAVE_UNISTD_H
13
 #include <unistd.h>
(-)icecast/files/pkg-message.in (-15 lines)
Lines 1-15 Link Here
1
-----------------------------------------------------------------
2
3
Icecast's various components have been installed in the following
4
directories:
5
6
  - The icecast server:
7
    %%PREFIX%%/sbin/icecast
8
9
  - Icecast configuration files have been installed in:
10
    %%PREFIX%%/etc/icecast/
11
12
  - Icecast documentation is located in:
13
    %%PREFIX%%/share/doc/icecast/
14
15
-----------------------------------------------------------------
(-)icecast/pkg-descr (-8 lines)
Lines 1-8 Link Here
1
Icecast is a streaming mp3 audio server.
2
3
Icecast provides nearly all the functionality of the Shoutcast server.
4
It will accept encoding streams from encoders like winamp, shout and ices.
5
It can also add itself to a directory server such as our own
6
icecast.linuxpower.org or Nullsoft's yp.shoutcast.com.
7
8
WWW: http://www.icecast.org/
(-)icecast/pkg-plist (-28 lines)
Lines 1-28 Link Here
1
%%ETCDIR%%/conf/groups.aut.dist
2
%%ETCDIR%%/conf/icecast.conf.dist
3
%%ETCDIR%%/conf/mounts.aut.dist
4
%%ETCDIR%%/conf/users.aut.dist
5
%%ETCDIR%%/templates/306.html
6
%%ETCDIR%%/templates/400.html
7
%%ETCDIR%%/templates/403.html
8
%%ETCDIR%%/templates/404.html
9
%%ETCDIR%%/templates/504.html
10
%%ETCDIR%%/templates/admin.html
11
%%ETCDIR%%/templates/admin_change.html
12
%%ETCDIR%%/templates/admin_describe.html
13
%%ETCDIR%%/templates/alias_add.html
14
%%ETCDIR%%/templates/alias_del.html
15
%%ETCDIR%%/templates/bodytag.html
16
%%ETCDIR%%/templates/footer.html
17
%%ETCDIR%%/templates/header.html
18
%%ETCDIR%%/templates/info.html
19
%%ETCDIR%%/templates/list_directory.html
20
%%ETCDIR%%/templates/manual.html
21
%%ETCDIR%%/templates/mountlist.html
22
%%ETCDIR%%/templates/statistics.html
23
sbin/icecast
24
%%PORTDOCS%%%%DOCSDIR%%/manual.html
25
%%PORTDOCS%%@dirrm %%DOCSDIR%%
26
@dirrm %%ETCDIR%%/templates
27
@dirrm %%ETCDIR%%/conf
28
@dirrm %%ETCDIR%%

Return to bug 177028