pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/audio



Module Name:    pkgsrc
Committed By:   nia
Date:           Tue Mar 30 12:01:04 UTC 2021

Modified Files:
        pkgsrc/audio: Makefile
Added Files:
        pkgsrc/audio/rtunes: DESCR Makefile PLIST distinfo
        pkgsrc/audio/rtunes/patches: patch-rtunes_Makefile
            patch-rtunes_cipher.c patch-rtunes_parse.y patch-rtunes_rtsp.c
            patch-rtunes_rtunes.1 patch-rtunes_rtunes.c

Log Message:
Revive audio/rtunes.

We fixed the undefined behaviour and made it work with openssl-1.1.


To generate a diff of this commit:
cvs rdiff -u -r1.624 -r1.625 pkgsrc/audio/Makefile
cvs rdiff -u -r0 -r1.3 pkgsrc/audio/rtunes/DESCR
cvs rdiff -u -r0 -r1.14 pkgsrc/audio/rtunes/Makefile
cvs rdiff -u -r0 -r1.4 pkgsrc/audio/rtunes/PLIST
cvs rdiff -u -r0 -r1.8 pkgsrc/audio/rtunes/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/audio/rtunes/patches/patch-rtunes_Makefile \
    pkgsrc/audio/rtunes/patches/patch-rtunes_cipher.c \
    pkgsrc/audio/rtunes/patches/patch-rtunes_rtsp.c \
    pkgsrc/audio/rtunes/patches/patch-rtunes_rtunes.1 \
    pkgsrc/audio/rtunes/patches/patch-rtunes_rtunes.c
cvs rdiff -u -r0 -r1.3 pkgsrc/audio/rtunes/patches/patch-rtunes_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/audio/Makefile
diff -u pkgsrc/audio/Makefile:1.624 pkgsrc/audio/Makefile:1.625
--- pkgsrc/audio/Makefile:1.624 Thu Feb 18 16:38:26 2021
+++ pkgsrc/audio/Makefile       Tue Mar 30 12:01:04 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.624 2021/02/18 16:38:26 nia Exp $
+# $NetBSD: Makefile,v 1.625 2021/03/30 12:01:04 nia Exp $
 #
 
 COMMENT=       Audio tools, players, and libraries
@@ -411,6 +411,7 @@ SUBDIR+=    rhythmbox
 SUBDIR+=       rip
 SUBDIR+=       rosegarden
 SUBDIR+=       rsynth
+SUBDIR+=       rtunes
 SUBDIR+=       rubberband
 SUBDIR+=       ruby-mp3info
 SUBDIR+=       ruby-taglib

Added files:

Index: pkgsrc/audio/rtunes/DESCR
diff -u /dev/null pkgsrc/audio/rtunes/DESCR:1.3
--- /dev/null   Tue Mar 30 12:01:04 2021
+++ pkgsrc/audio/rtunes/DESCR   Tue Mar 30 12:01:04 2021
@@ -0,0 +1,4 @@
+rtunes streams audio to an AirTunes compatible receivers.
+
+This is a fork of rtunes 0.8, to fix compilation issues on modern systems
+(e.g. support newer OpenSSL versions)

Index: pkgsrc/audio/rtunes/Makefile
diff -u /dev/null pkgsrc/audio/rtunes/Makefile:1.14
--- /dev/null   Tue Mar 30 12:01:04 2021
+++ pkgsrc/audio/rtunes/Makefile        Tue Mar 30 12:01:04 2021
@@ -0,0 +1,30 @@
+# $NetBSD: Makefile,v 1.14 2021/03/30 12:01:04 nia Exp $
+
+DISTNAME=      rtunes-0.8
+CATEGORIES=    audio
+MASTER_SITES=  http://www.nazgul.ch/dev/
+
+MAINTAINER=    nia%NetBSD.org@localhost
+HOMEPAGE=      http://www.nazgul.ch/dev_rtunes.html
+COMMENT=       Stream audio to an AirTunes device
+LICENSE=       modified-bsd
+
+BUILD_DIRS=    rtunes
+INSTALL_DIRS=  rtunes
+
+MAKE_FLAGS+=   NOGCCERROR=1
+MAKE_FLAGS+=   NOCLANGERROR=1
+
+USE_BSD_MAKEFILE=      yes
+
+INSTALLATION_DIRS+=    bin
+INSTALLATION_DIRS+=    ${PKGMANDIR}/man1
+INSTALLATION_DIRS+=    ${PKGMANDIR}/man5
+
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} != "NetBSD" && ${OPSYS} != "OpenBSD"
+LDFLAGS+=      -lbsd
+.  include "../../devel/libbsd/buildlink3.mk"
+.endif
+.include "../../security/openssl/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"

Index: pkgsrc/audio/rtunes/PLIST
diff -u /dev/null pkgsrc/audio/rtunes/PLIST:1.4
--- /dev/null   Tue Mar 30 12:01:04 2021
+++ pkgsrc/audio/rtunes/PLIST   Tue Mar 30 12:01:04 2021
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.4 2021/03/30 12:01:04 nia Exp $
+bin/rtunes
+man/man1/rtunes.1
+man/man5/rtunes.conf.5

Index: pkgsrc/audio/rtunes/distinfo
diff -u /dev/null pkgsrc/audio/rtunes/distinfo:1.8
--- /dev/null   Tue Mar 30 12:01:04 2021
+++ pkgsrc/audio/rtunes/distinfo        Tue Mar 30 12:01:04 2021
@@ -0,0 +1,12 @@
+$NetBSD: distinfo,v 1.8 2021/03/30 12:01:04 nia Exp $
+
+SHA1 (rtunes-0.8.tar.gz) = 16830fbdceaf2d70943113ee427ad9eeeddaed14
+RMD160 (rtunes-0.8.tar.gz) = 725b454b9c0f7d7b1170d8c89ec70536cd86d0ae
+SHA512 (rtunes-0.8.tar.gz) = 8e540b66c16d4a5f745999ceb6c07853dccf8270b5e5650cf3c21297dd45add3583ee0e866b27fb7082a279375b4be95f301ff1157e455a7d959b60f9a30a924
+Size (rtunes-0.8.tar.gz) = 21636 bytes
+SHA1 (patch-rtunes_Makefile) = f46e906afff59ad0f31817c0a87c622f37fa0597
+SHA1 (patch-rtunes_cipher.c) = 9b55b4f5fd0e48ba9039f52f2925bd1005e9a68b
+SHA1 (patch-rtunes_parse.y) = 76294edfb4d0c56cb08189578d7fe9991c533cb3
+SHA1 (patch-rtunes_rtsp.c) = ab8f8bf845258b9a994e02195fe65ce9ceba2c07
+SHA1 (patch-rtunes_rtunes.1) = c3d64a8c671dac0fdf1cd87ccbc562f2fb0d446e
+SHA1 (patch-rtunes_rtunes.c) = 0a177c985c642b9b1cfa122aa9ff67b5e54f5038

Index: pkgsrc/audio/rtunes/patches/patch-rtunes_Makefile
diff -u /dev/null pkgsrc/audio/rtunes/patches/patch-rtunes_Makefile:1.1
--- /dev/null   Tue Mar 30 12:01:05 2021
+++ pkgsrc/audio/rtunes/patches/patch-rtunes_Makefile   Tue Mar 30 12:01:04 2021
@@ -0,0 +1,29 @@
+$NetBSD: patch-rtunes_Makefile,v 1.1 2021/03/30 12:01:04 nia Exp $
+
+Merge fixes from https://github.com/erincandescent/rtunes
+
+--- rtunes/Makefile.orig       2009-06-27 10:10:32.000000000 +0000
++++ rtunes/Makefile
+@@ -10,22 +10,12 @@ SRCS+= y.tab.h
+ y.tab.h: parse.y
+ .endif
+ 
+-.if ${OS} == "NetBSD"
+-VPATH=        ../libbsd
+-SRCS+=        strtonum.c
+-.endif
+-
+ CFLAGS+=      -Wall -Wstrict-prototypes -ansi
+ LDADD+=               -lcrypto
+ LINTFLAGS+=   -u
+ 
+ CLEANFILES+=  y.tab.h
+ 
+-PIPE=         -pipe
+-
+ MAN=          rtunes.1 rtunes.conf.5
+-MANDIR=               /usr/local/man/cat
+-
+-BINDIR=               /usr/local/bin
+ 
+ .include <bsd.prog.mk>
Index: pkgsrc/audio/rtunes/patches/patch-rtunes_cipher.c
diff -u /dev/null pkgsrc/audio/rtunes/patches/patch-rtunes_cipher.c:1.1
--- /dev/null   Tue Mar 30 12:01:05 2021
+++ pkgsrc/audio/rtunes/patches/patch-rtunes_cipher.c   Tue Mar 30 12:01:04 2021
@@ -0,0 +1,68 @@
+$NetBSD: patch-rtunes_cipher.c,v 1.1 2021/03/30 12:01:04 nia Exp $
+
+Merge fixes from https://github.com/erincandescent/rtunes
+
+--- rtunes/cipher.c.orig       2009-06-27 10:10:32.000000000 +0000
++++ rtunes/cipher.c
+@@ -26,10 +26,6 @@
+ #include "extern.h"
+ #include "proto.h"
+ 
+-#ifdef __linux__
+-#include "../libbsd/arc4random.h"
+-#endif
+-
+ /*
+  * cipher_ aes_sendsample()
+  *    AES encrypt audio sample
+@@ -62,7 +58,7 @@ cipher_aes_sendsample(unsigned char *buf
+               len_encrypt = len;
+ 
+       /* prepend sample header */
+-      memcpy(buf + 16, buf, len_encrypt);
++      memmove(buf + 16, buf, len_encrypt);
+       memcpy(buf, header, 16L);
+       /* write sample size into header */
+       j = len_encrypt + 12;
+@@ -122,15 +118,11 @@ cipher_rsa_encrypt_aeskey(unsigned char 
+ 
+       /* initialize RSA public key */
+       key = RSA_new();
+-      key->n = BN_bin2bn(n_bin, 256, key->n);;
+-      key->e = BN_bin2bn(e_bin, 3, key->e);
+-      key->d = NULL;
+-      key->p = NULL;
+-      key->q = NULL;
+-      key->dmp1 = NULL;
+-      key->dmq1 = NULL;
+-      key->iqmp = NULL;
+-
++      RSA_set0_key(key,
++              BN_bin2bn(n_bin, 256, NULL),
++              BN_bin2bn(e_bin, 3,   NULL),
++              NULL);
++      
+       /* RSA encrypt */
+       to = malloc(256);
+       if (RSA_public_encrypt(16, aeskey, to, key, RSA_PKCS1_OAEP_PADDING) < 1)
+@@ -150,18 +142,11 @@ cipher_rsa_encrypt_aeskey(unsigned char 
+ unsigned char *
+ cipher_aes_generate_key(void)
+ {
+-      int              i, v;
+       unsigned char   *p = NULL;
+-      unsigned char    key[16];
+-
+-      for (i = 0; i <= sizeof(key) - sizeof(v); i += sizeof(v)) {
+-              v = arc4random();
+-              memcpy(&key[i], &v, sizeof(v));
+-      }
+ 
+       p = malloc(16);
+-      memcpy(p, key, 16);
+-
++      RAND_bytes(p, 16);
++      
+       return (p);
+ }
+ 
Index: pkgsrc/audio/rtunes/patches/patch-rtunes_rtsp.c
diff -u /dev/null pkgsrc/audio/rtunes/patches/patch-rtunes_rtsp.c:1.1
--- /dev/null   Tue Mar 30 12:01:05 2021
+++ pkgsrc/audio/rtunes/patches/patch-rtunes_rtsp.c     Tue Mar 30 12:01:04 2021
@@ -0,0 +1,33 @@
+$NetBSD: patch-rtunes_rtsp.c,v 1.1 2021/03/30 12:01:04 nia Exp $
+
+Merge fixes from https://github.com/erincandescent/rtunes
+
+--- rtunes/rtsp.c.orig 2009-06-27 10:10:32.000000000 +0000
++++ rtunes/rtsp.c
+@@ -19,15 +19,14 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <openssl/rand.h>
+ 
+ #include "config.h"
+ #include "extern.h"
+ #include "proto.h"
+ 
+ #ifdef __linux__
+-#include "../libbsd/strlcpy.h"
+-#include "../libbsd/strlcat.h"
+-#include "../libbsd/arc4random.h"
++#include "bsd/string.h"
+ #endif
+ 
+ /* global vars local */
+@@ -48,7 +47,7 @@ rtsp_generate_sid(char *buf, int len)
+       int     i = 0;
+ 
+       while (i < 1000000000)
+-              i = arc4random();
++              RAND_bytes((unsigned char*) &i, sizeof(i));
+ 
+       snprintf(buf, len, "%d", i);
+ 
Index: pkgsrc/audio/rtunes/patches/patch-rtunes_rtunes.1
diff -u /dev/null pkgsrc/audio/rtunes/patches/patch-rtunes_rtunes.1:1.1
--- /dev/null   Tue Mar 30 12:01:05 2021
+++ pkgsrc/audio/rtunes/patches/patch-rtunes_rtunes.1   Tue Mar 30 12:01:04 2021
@@ -0,0 +1,67 @@
+$NetBSD: patch-rtunes_rtunes.1,v 1.1 2021/03/30 12:01:04 nia Exp $
+
+Merge fixes from https://github.com/erincandescent/rtunes
+
+--- rtunes/rtunes.1.orig       2009-06-26 14:43:09.000000000 +0000
++++ rtunes/rtunes.1
+@@ -15,22 +15,23 @@
+ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ .\"
+-.Dd Feb 10, 2008
++.Dd March 24, 2021
+ .Dt RTUNES 1
+ .Os
+ .Sh NAME
+ .Nm rtunes
+-.Nd Stream audio data to an Apple AirPort Express device
++.Nd Stream audio data to an Apple AirPlay device
+ .Sh SYNOPSIS
+ .Nm rtunes
+ .Op Fl 46
+ .Op Fl f Ar configfile
+ .Op Fl h Ar host
++.Op Fl p Ar port
+ .Ar file(s)
+ .Sh DESCRIPTION
+ .Nm
+-streams files containing Apple Lossless audio data to an Apple AirPort
+-Express device.
++streams files containing Apple Lossless audio data to an Apple AirPlay
++device.
+ If a '-' is given as the
+ .Ar file(s)
+ argument,
+@@ -40,7 +41,7 @@ and encodes it to the Apple Lossless for
+ With this method it is possible to stream audio data from any source
+ that can output raw PCM audio data on stdout, e.g.:
+ .Bd -literal -offset indent
+-madplay -S -R44100 -o raw:- benson.mp3 | rtunes -
++mpg123 -o raw -r 44100 benson.mp3 | rtunes -h 10.69.69.147 -p 36666 -
+ .Ed
+ .Pp
+ Here the audio player madplay is used to decode benson.mp3 to raw PCM
+@@ -56,17 +57,20 @@ Use only IPv6 transport.
+ .It Fl f
+ Specify an alternative configuration file.
+ .It Fl h
+-Specify the hostname of device to stream audio to.
++Specify the hostname of the device to stream audio to.
++.It Fl p
++Specify the port of the device to stream audio to.
++.El
+ .Sh FILES
+ .Bl -tag -width "/etc/rtunes.confXX" -compact
+ .It Pa /etc/rtunes.conf
+ Default location of the configuration file.
+ .El
++.Sh SEE ALSO
++.Xr rtunes.conf 5
+ .Sh AUTHORS
+ .Nm
+ was written by
+ .An Marcus Glocker Aq marcus%nazgul.ch@localhost
+ and
+ .An Marc Balmer Aq marc%msys.ch@localhost .
+-.Sh SEE ALSO
+-.Xr rtunes.conf 5
Index: pkgsrc/audio/rtunes/patches/patch-rtunes_rtunes.c
diff -u /dev/null pkgsrc/audio/rtunes/patches/patch-rtunes_rtunes.c:1.1
--- /dev/null   Tue Mar 30 12:01:05 2021
+++ pkgsrc/audio/rtunes/patches/patch-rtunes_rtunes.c   Tue Mar 30 12:01:04 2021
@@ -0,0 +1,88 @@
+$NetBSD: patch-rtunes_rtunes.c,v 1.1 2021/03/30 12:01:04 nia Exp $
+
+Merge fixes from https://github.com/erincandescent/rtunes
+
+--- rtunes/rtunes.c.orig       2008-02-10 11:51:02.000000000 +0000
++++ rtunes/rtunes.c
+@@ -25,8 +25,11 @@
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <endian.h>
++#include <errno.h>
+ 
+ #include "config.h"
+ #include "extern.h"
+@@ -65,7 +68,7 @@ usage(void)
+ {
+       extern char     *__progname;
+ 
+-      fprintf(stderr, "usage: %s [-46] [-f configfile] [-h host] <file(s)>\n",
++      fprintf(stderr, "usage: %s [-46] [-f configfile] [-h host] [-p port] <file(s)>\n",
+           __progname);
+ 
+       exit(1);
+@@ -175,7 +178,9 @@ main(int argc, char *argv[])
+ {
+       size_t           a, e;
+       ssize_t          nread;
+-      int              i, r, s, ch, fd, raw = 0, sample;
++      long             parsedn;
++      int              port = AIRPORT;
++      int              i, r, ch, fd, raw = 0, sample;
+       char             cwd[1024];
+       unsigned char    bufraw[4096 * 2 * 2], bufala[(4096 * 2 * 2) + 3];
+       unsigned char   *buf;
+@@ -184,7 +189,7 @@ main(int argc, char *argv[])
+       struct stsc     *c;
+ 
+       /* get command line options */
+-      while ((ch = getopt(argc, argv, "46f:h:")) != -1) {
++      while ((ch = getopt(argc, argv, "46f:h:p:y")) != -1) {
+               switch (ch) {
+               case '4':
+                       if (ai_family != PF_UNSPEC)
+@@ -202,6 +207,13 @@ main(int argc, char *argv[])
+               case 'h':
+                       host = optarg;
+                       break;
++              case 'p':
++                      errno = 0;
++                      parsedn = strtol(optarg, NULL, 0);
++                      if (parsedn < 0 || parsedn > UINT16_MAX || errno != 0)
++                              errx(1, "Invalid port number");
++                      port = (int)parsedn;
++                      break;
+               default:
+                       usage();
+               }
+@@ -220,7 +232,7 @@ main(int argc, char *argv[])
+               errx(1, "Can't get local hosts IP address");
+ 
+       /* connect airport rtsp port */
+-      if ((sfd_rtsp = sys_connect(host, AIRPORT)) == -1)
++      if ((sfd_rtsp = sys_connect(host, port)) == -1)
+               err(1, "Connect rtsp port");
+ 
+       /* rtsp connection sequence */
+@@ -325,7 +337,7 @@ main(int argc, char *argv[])
+ 
+                       e = cipher_aes_sendsample(buf, nread);
+ 
+-                      s = sys_write(sfd_stream, buf, e);
++                      (void)sys_write(sfd_stream, buf, e);
+ 
+                       free(buf);
+               }
+@@ -354,7 +366,7 @@ main(int argc, char *argv[])
+ 
+               e = cipher_aes_sendsample(buf, a);
+ 
+-              s = sys_write(sfd_stream, buf, e);
++              (void)sys_write(sfd_stream, buf, e);
+ 
+               free(buf);
+       }

Index: pkgsrc/audio/rtunes/patches/patch-rtunes_parse.y
diff -u /dev/null pkgsrc/audio/rtunes/patches/patch-rtunes_parse.y:1.3
--- /dev/null   Tue Mar 30 12:01:05 2021
+++ pkgsrc/audio/rtunes/patches/patch-rtunes_parse.y    Tue Mar 30 12:01:04 2021
@@ -0,0 +1,21 @@
+$NetBSD: patch-rtunes_parse.y,v 1.3 2021/03/30 12:01:04 nia Exp $
+
+Merge fixes from https://github.com/erincandescent/rtunes
+
+--- rtunes/parse.y.orig        2009-06-27 10:10:32.000000000 +0000
++++ rtunes/parse.y
+@@ -27,9 +27,13 @@
+ #include <stdarg.h>
+ #include <stdint.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
+-
++#ifdef __linux__
++#include <bsd/stdlib.h>
++#endif
++      
+ FILE  *fin;
+ int   lineno = 1;
+ int   errors = 0;



Home | Main Index | Thread Index | Old Index