summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorMichael Scheidell <scheidell@FreeBSD.org>2012-04-25 22:08:28 +0000
committerMichael Scheidell <scheidell@FreeBSD.org>2012-04-25 22:08:28 +0000
commit43ad5a6b5fe4e2c0c6c21f5d89d31fdef77999db (patch)
tree50edfbbc0e5c59598266bf570d0059da6be4f56e /audio
parent- Add missing BUILD_DEPENDS (diff)
- Fix crash on amd64 when rplayd parses the rplay.hosts file (extra-patch for amd64 only) [1]
- Channel dougb and re-write the rc script [2] - Bump PORTREVISION PR: ports/166658 [1] Submitted by: Callum Gibson <callumgibson@optusnet.com.au> [1] Reviewed by: scheidell@ [2]
Notes
Notes: svn path=/head/; revision=295526
Diffstat (limited to 'audio')
-rw-r--r--audio/rplay/Makefile19
-rw-r--r--audio/rplay/files/extra-patch-ao268
-rw-r--r--audio/rplay/files/rplay.in28
-rw-r--r--audio/rplay/files/rplayd.sh21
-rw-r--r--audio/rplay/pkg-plist2
5 files changed, 311 insertions, 27 deletions
diff --git a/audio/rplay/Makefile b/audio/rplay/Makefile
index 926ef506c6cd..95724f59904b 100644
--- a/audio/rplay/Makefile
+++ b/audio/rplay/Makefile
@@ -7,7 +7,7 @@
PORTNAME= rplay
PORTVERSION= 3.3.2
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= audio
MASTER_SITES= http://rplay.doit.org/dist/
@@ -27,13 +27,22 @@ MAN8= rplayd.8
INFO= RPLAY RPTP librplay rplayd
+.include <bsd.port.pre.mk>
+
+USE_RC_SUBR= rplay
+
+.if ${ARCH} == "amd64"
+# pr ports/166658 mentions a problem with amd64. if it happens on i386, you can delete this conditional
+# and rename to patch-ao
+EXTRA_PATCHES= ${FILESDIR}/extra-patch-ao
+.endif
+
post-extract:
@${CP} ${WRKSRC}/doc/rplay.texi ${WRKSRC}/doc/rplayd.texi
post-install:
- @${ECHO_MSG} "===> Installing ${PREFIX}/etc/rc.d/rplayd.sh"
- @${ECHO_MSG} "===> startup file as ${PREFIX}/etc/rc.d/rplayd.sh.sample"
- @${INSTALL_SCRIPT} -m 751 ${FILESDIR}/rplayd.sh ${PREFIX}/etc/rc.d/rplayd.sh.sample
+ @${ECHO_MSG} "===> startup file as ${PREFIX}/etc/rc.d/rplayd"
+ @${MKDIR} ${PREFIX}/etc/
for na in rplay.conf rplay.helpers rplay.servers rplay.hosts; do \
${CP} ${WRKSRC}/etc/$$na ${PREFIX}/etc/$$na.sample; \
if [ ! -f ${PREFIX}/etc/$$na ]; then \
@@ -45,4 +54,4 @@ post-install:
.endif
@${ECHO_CMD} localhost > ${PREFIX}/etc/rplay.hosts.sample
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/audio/rplay/files/extra-patch-ao b/audio/rplay/files/extra-patch-ao
new file mode 100644
index 000000000000..748e6e0c8715
--- /dev/null
+++ b/audio/rplay/files/extra-patch-ao
@@ -0,0 +1,268 @@
+bllslkjl
+slkj;
+
+lkjsl slk
+
+
+diff -rwu /export/ports_work/usr/ports/audio/rplay/work/rplay-3.3.2/lib/Makefile.in rplay/lib/Makefile.in
+--- lib/Makefile.in 1998-07-15 08:35:23.000000000 +1000
++++ rplay/lib/Makefile.in 2012-04-05 12:54:44.000000000 +1000
+@@ -25,8 +13,8 @@
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
+
+ TARGET= librp.a
+-SRCS= getopt.c getopt1.c hash.c strdup.c tilde.c xmalloc.c
+-OBJS= getopt.o getopt1.o hash.o strdup.o tilde.o xmalloc.o
++SRCS= hash.c tilde.c xmalloc.c
++OBJS= hash.o tilde.o xmalloc.o
+
+ all: $(TARGET)
+
+diff -rwu /export/ports_work/usr/ports/audio/rplay/work/rplay-3.3.2/rplayd/Makefile.in rplay/rplayd/Makefile.in
+--- rplayd/Makefile.in 2012-04-05 15:19:53.000000000 +1000
++++ rplay/rplayd/Makefile.in 2012-04-05 15:21:58.000000000 +1000
+@@ -25,7 +25,7 @@
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
+
+ LDFLAGS= $(LD_OPTIONS) -L../librplay -lrplay -L../lib -lrp \
+- -L../adpcm -ladpcm @GSM_LIBS@ -L../rx -lrx @LDFLAGS@ @LIBS@ -lm
++ -L../adpcm -ladpcm @GSM_LIBS@ @LDFLAGS@ @LIBS@ -lm
+
+ TARGET= rplayd
+
+diff -rwu /export/ports_work/usr/ports/audio/rplay/work/rplay-3.3.2/rplayd/helper.c rplay/rplayd/helper.c
+--- rplayd/helper.c 1999-03-10 18:58:03.000000000 +1100
++++ rplay/rplayd/helper.c 2012-04-05 14:31:10.000000000 +1000
+@@ -110,7 +110,7 @@
+ done(1);
+ }
+ //memset ((char *) &hp->pattern, 0, sizeof (hp->pattern));
+- error = regncomp(&hp->pattern, pat, strlen(pat), REG_ICASE | REG_NOSUB);
++ error = regcomp(&hp->pattern, pat, REG_EXTENDED | REG_ICASE | REG_NOSUB);
+ if (error)
+ {
+ report(REPORT_ERROR, "helper_read: %d line %d\n", error, line);
+@@ -188,7 +188,7 @@
+
+ for (hp = helpers; hp; hp = hp->next)
+ {
+- if (regnexec(&hp->pattern, sound, strlen(sound), 0, 0, 0) == 0)
++ if (regexec(&hp->pattern, sound, 0, 0, 0) == 0)
+ {
+ return hp;
+ }
+diff -rwu /export/ports_work/usr/ports/audio/rplay/work/rplay-3.3.2/rplayd/host.c rplay/rplayd/host.c
+--- rplayd/host.c 1999-06-09 16:27:44.000000000 +1000
++++ rplay/rplayd/host.c 2012-04-05 14:14:12.000000000 +1000
+@@ -95,10 +95,10 @@
+ //memset ((char *) &access_write, 0, sizeof (access_write));
+ //memset ((char *) &access_execute, 0, sizeof (access_execute));
+
+- strcpy(expr_read, "^\\(");
+- strcpy(expr_write, "^\\(");
+- strcpy(expr_execute, "^\\(");
+- strcpy(expr_monitor, "^\\(");
++ strcpy(expr_read, "^(");
++ strcpy(expr_write, "^(");
++ strcpy(expr_execute, "^(");
++ strcpy(expr_monitor, "^(");
+
+ do
+ {
+@@ -162,7 +162,7 @@
+
+ if (strlen(expr_read) == 3)
+ {
+- strcat(expr_read, "\\)");
++ strcat(expr_read, ")");
+ }
+ else
+ {
+@@ -171,7 +171,7 @@
+ strcat(expr_read, "$");
+ if (strlen(expr_write) == 3)
+ {
+- strcat(expr_write, "\\)");
++ strcat(expr_write, ")");
+ }
+ else
+ {
+@@ -180,7 +180,7 @@
+ strcat(expr_write, "$");
+ if (strlen(expr_execute) == 3)
+ {
+- strcat(expr_execute, "\\)");
++ strcat(expr_execute, ")");
+ }
+ else
+ {
+@@ -189,7 +189,7 @@
+ strcat(expr_execute, "$");
+ if (strlen(expr_monitor) == 3)
+ {
+- strcat(expr_monitor, "\\)");
++ strcat(expr_monitor, ")");
+ }
+ else
+ {
+@@ -197,35 +197,35 @@
+ }
+ strcat(expr_monitor, "$");
+
+- error = regncomp(&access_read, expr_read, strlen(expr_read),
+- REG_ICASE | REG_NOSUB);
++ error = regcomp(&access_read, expr_read,
++ REG_EXTENDED | REG_ICASE | REG_NOSUB);
+ if (error)
+ {
+- report(REPORT_ERROR, "host_read: regncomp: %d\n", error);
++ report(REPORT_ERROR, "host_read: regcomp: %d\n", error);
+ done(1);
+ }
+
+- error = regncomp(&access_write, expr_write, strlen(expr_write),
+- REG_ICASE | REG_NOSUB);
++ error = regcomp(&access_write, expr_write,
++ REG_EXTENDED | REG_ICASE | REG_NOSUB);
+ if (error)
+ {
+- report(REPORT_ERROR, "host_read: regncomp: %d\n", error);
++ report(REPORT_ERROR, "host_read: regcomp: %d\n", error);
+ done(1);
+ }
+
+- error = regncomp(&access_execute, expr_execute, strlen(expr_execute),
+- REG_ICASE | REG_NOSUB);
++ error = regcomp(&access_execute, expr_execute,
++ REG_EXTENDED | REG_ICASE | REG_NOSUB);
+ if (error)
+ {
+- report(REPORT_ERROR, "host_read: regncomp: %d\n", error);
++ report(REPORT_ERROR, "host_read: regcomp: %d\n", error);
+ done(1);
+ }
+
+- error = regncomp(&access_monitor, expr_monitor, strlen(expr_monitor),
+- REG_ICASE | REG_NOSUB);
++ error = regcomp(&access_monitor, expr_monitor,
++ REG_EXTENDED | REG_ICASE | REG_NOSUB);
+ if (error)
+ {
+- report(REPORT_ERROR, "host_read: regncomp: %d\n", error);
++ report(REPORT_ERROR, "host_read: regcomp: %d\n", error);
+ done(1);
+ }
+ }
+@@ -354,22 +354,22 @@
+ {
+ case HOST_READ:
+ strcat(expr_read, re_name);
+- strcat(expr_read, "\\|");
++ strcat(expr_read, "|");
+ break;
+
+ case HOST_WRITE:
+ strcat(expr_write, re_name);
+- strcat(expr_write, "\\|");
++ strcat(expr_write, "|");
+ break;
+
+ case HOST_EXECUTE:
+ strcat(expr_execute, re_name);
+- strcat(expr_execute, "\\|");
++ strcat(expr_execute, "|");
+ break;
+
+ case HOST_MONITOR:
+ strcat(expr_monitor, re_name);
+- strcat(expr_monitor, "\\|");
++ strcat(expr_monitor, "|");
+ break;
+
+ default:
+@@ -432,7 +432,7 @@
+ done(1);
+ }
+
+- n = regnexec(re, p, strlen(p), 0, 0, 0);
++ n = regexec(re, p, 0, 0, 0);
+
+ return !n;
+ }
+diff -rwu /export/ports_work/usr/ports/audio/rplay/work/rplay-3.3.2/rplayd/native.c rplay/rplayd/native.c
+--- rplayd/native.c 1999-03-10 18:58:03.000000000 +1100
++++ rplay/rplayd/native.c 2012-04-05 12:58:20.000000000 +1000
+@@ -32,6 +32,7 @@
+ #include "rplayd.h"
+ #include "native.h"
+ #include "ulaw.h"
++#include <string.h>
+
+ /* Native means 16-bit signed. */
+
+diff -rwu /export/ports_work/usr/ports/audio/rplay/work/rplay-3.3.2/rplayd/sound.c rplay/rplayd/sound.c
+--- rplayd/sound.c 1999-06-09 16:27:44.000000000 +1000
++++ rplay/rplayd/sound.c 2012-04-05 14:31:19.000000000 +1000
+@@ -96,14 +96,14 @@
+
+ dirs = strdup(BAD_DIRS); /* XXX */
+
+- length = strlen("^\\(") + strlen("\\)") + strlen(dirs) + 1;
++ length = strlen("^(") + strlen(")") + strlen(dirs) + 1;
+
+ //length += strlen ("^");
+ for (p = dirs; *p; p++)
+ {
+ if (*p == ':')
+ {
+- length += strlen("\\|") - strlen(":");
++ length += strlen("|") - strlen(":");
+ }
+ }
+
+@@ -119,7 +119,7 @@
+ }
+
+ first = 1;
+- strcpy(buf, "^\\(");
++ strcpy(buf, "^(");
+ while (p = (char *) strtok(first ? dirs : 0, ":"))
+ {
+ if (first)
+@@ -129,12 +129,12 @@
+ }
+ else
+ {
+- //strcat (buf, "\\|^");
+- strcat(buf, "\\|");
++ //strcat (buf, "|^");
++ strcat(buf, "|");
+ }
+ strcat(buf, p);
+ }
+- strcat(buf, "\\)");
++ strcat(buf, ")");
+
+ #if 0
+ report(REPORT_DEBUG, "bad_dirs=%s, strlen=%d, length=%d\n",
+@@ -143,9 +143,9 @@
+
+ //memset ((char *) &bad_dirs, 0, sizeof (bad_dirs));
+
+- if (regncomp(&bad_dirs, buf, strlen(buf), REG_ICASE | REG_NOSUB))
++ if (regcomp(&bad_dirs, buf, REG_EXTENDED | REG_ICASE | REG_NOSUB))
+ {
+- report(REPORT_ERROR, "bad_dirs: regncomp failed\n");
++ report(REPORT_ERROR, "bad_dirs: regcomp failed\n");
+ done(1);
+ }
+
+@@ -162,7 +162,7 @@
+ #endif
+ {
+ /* return 1 if bad */
+- return regnexec(&bad_dirs, dir, strlen(dir), 0, 0, 0) ? 0 : 1;
++ return regexec(&bad_dirs, dir, 0, 0, 0) ? 0 : 1;
+ }
+
+ #endif /* BAD_DIRS */
diff --git a/audio/rplay/files/rplay.in b/audio/rplay/files/rplay.in
new file mode 100644
index 000000000000..ead8508d4049
--- /dev/null
+++ b/audio/rplay/files/rplay.in
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: rplayd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable rplayd
+#
+#rplayd_enable="YES"
+#
+
+. /etc/rc.subr
+
+name=rplayd
+rcvar=rplayd_enable
+
+load_rc_config $name
+
+# set defaults:
+: ${rplayd_enable:="NO"}
+
+command=%%PREFIX%%/sbin/${name}
+
+run_rc_command "$1"
diff --git a/audio/rplay/files/rplayd.sh b/audio/rplay/files/rplayd.sh
deleted file mode 100644
index b9fbae452225..000000000000
--- a/audio/rplay/files/rplayd.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- [ -x ${PREFIX}/sbin/rplayd ] && ${PREFIX}/sbin/rplayd && echo -n ' rplayd'
- ;;
-stop)
- killall rplayd && echo -n ' rplayd'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- exit 64
- ;;
-esac
-
-exit 0
diff --git a/audio/rplay/pkg-plist b/audio/rplay/pkg-plist
index 9b9ab30faa27..a82707c36a3b 100644
--- a/audio/rplay/pkg-plist
+++ b/audio/rplay/pkg-plist
@@ -1,4 +1,4 @@
-etc/rc.d/rplayd.sh.sample
+@unexec rm -f %D/etc/rc.d/rplay.sh*
@unexec if cmp %D/etc/rplay.hosts.sample %D/etc/rplay.hosts 2>/dev/null; then rm -f %D/etc/rplay.hosts; fi
etc/rplay.hosts.sample
@unexec if cmp %D/etc/rplay.conf.sample %D/etc/rplay.conf 2>/dev/null; then rm -f %D/etc/rplay.conf; fi