Added patch to provide UserAgent while requesting a stream via HTTP. Patch by Frank...
authorDiego Elio Pettenò <flameeyes@gentoo.org>
Mon, 29 Aug 2005 09:48:19 +0000 (09:48 +0000)
committerDiego Elio Pettenò <flameeyes@gentoo.org>
Mon, 29 Aug 2005 09:48:19 +0000 (09:48 +0000)
Package-Manager: portage-2.0.51.22

media-sound/mpg321/ChangeLog
media-sound/mpg321/Manifest
media-sound/mpg321/files/digest-mpg321-0.2.10-r3 [new file with mode: 0644]
media-sound/mpg321/files/mpg321-0.1.5-ao.diff [deleted file]
media-sound/mpg321/files/mpg321-0.2.10-useragent.patch [new file with mode: 0644]
media-sound/mpg321/mpg321-0.2.10-r3.ebuild [new file with mode: 0644]

index 178f3777a058dac33704bddde8098f60a4d232df..5bfe7a2a76807467a9a97e4d0fc25e8103a6cfc1 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for media-sound/mpg321
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/mpg321/ChangeLog,v 1.30 2005/04/15 03:33:17 geoman Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/mpg321/ChangeLog,v 1.31 2005/08/29 09:48:18 flameeyes Exp $
+
+*mpg321-0.2.10-r3 (29 Aug 2005)
+
+  29 Aug 2005; Diego Pettenò <flameeyes@gentoo.org>
+  -files/mpg321-0.1.5-ao.diff, +files/mpg321-0.2.10-useragent.patch,
+  +mpg321-0.2.10-r3.ebuild:
+  Added patch to provide UserAgent while requesting a stream via HTTP. Patch
+  by Frank Ruell, in FreeBSD PR 84898.
 
   15 Apr 2005; Stephen P. Becker <geoman@gentoo.org>
   mpg321-0.2.10-r1.ebuild, mpg321-0.2.10-r2.ebuild:
index f428da3ea9f1e3e48ba8e53273160042a95018d7..2c65161104801e343530446f236dfd9ea26dd92b 100644 (file)
@@ -1,8 +1,20 @@
-MD5 b82e5130b223af28af7bf180b8b4f23c mpg321-0.2.10-r2.ebuild 1497
-MD5 e6524e43eafc383eb32531436555b3fd ChangeLog 3985
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 b49edb22bff35c395a34ae2ccb67ed09 ChangeLog 4288
 MD5 38a8862183828ea7b3e5419d93f40108 mpg321-0.2.10-r1.ebuild 1410
+MD5 b82e5130b223af28af7bf180b8b4f23c mpg321-0.2.10-r2.ebuild 1497
+MD5 2f0c8df9662fc45a2385c3e10999faf6 mpg321-0.2.10-r3.ebuild 1673
 MD5 a1eaeb2ae801daeb712c90c060e922dc metadata.xml 158
+MD5 04fe11f18e972320df81edfc63d7418a files/mpg321-0.2.10-useragent.patch 629
 MD5 330f91ff24a94b674063b6fc2d0e04af files/mpg321-0.2.10.diff 1862
-MD5 f69e111b891dc01d56fb394621897e0d files/mpg321-0.1.5-ao.diff 7909
-MD5 7f4e867ab9a86c4f3618228fdccc48f4 files/digest-mpg321-0.2.10-r1 65
+MD5 7f4e867ab9a86c4f3618228fdccc48f4 files/digest-mpg321-0.2.10-r3 65
 MD5 7f4e867ab9a86c4f3618228fdccc48f4 files/digest-mpg321-0.2.10-r2 65
+MD5 7f4e867ab9a86c4f3618228fdccc48f4 files/digest-mpg321-0.2.10-r1 65
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDEtoKj5H05b2HAEkRAoSVAJ99UEQr178Y6O9AUxlNcUSTTFyBdACgo3X0
+HVYFcLKXd8/lwd7vvIkCzYM=
+=J0mS
+-----END PGP SIGNATURE-----
diff --git a/media-sound/mpg321/files/digest-mpg321-0.2.10-r3 b/media-sound/mpg321/files/digest-mpg321-0.2.10-r3
new file mode 100644 (file)
index 0000000..7332a87
--- /dev/null
@@ -0,0 +1 @@
+MD5 bb403b35c2d25655d55f0f616b8f47bb mpg321-0.2.10.tar.gz 113449
diff --git a/media-sound/mpg321/files/mpg321-0.1.5-ao.diff b/media-sound/mpg321/files/mpg321-0.1.5-ao.diff
deleted file mode 100644 (file)
index 1fcb4db..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-diff -urN mpg321-0.1.5/mad.c mpg321-0.1.5-new/mad.c
---- mpg321-0.1.5/mad.c Wed Jul 18 02:39:34 2001
-+++ mpg321-0.1.5-new/mad.c     Wed Sep 12 15:49:36 2001
-@@ -94,112 +94,35 @@
-     
- void open_ao_playdevice(struct mad_header const *header)
- {
--    int numChannels = MAD_NCHANNELS(header);
--        if(options.opt & MPG321_USE_WAV)
--        {
--            int driver_id = ao_get_driver_id("wav");
--            ao_option_t *ao_options = NULL;
-+      int                     numChannels = MAD_NCHANNELS(header);
-+      int                     driver_id;
-+      ao_sample_format        format;
- 
--            /* Don't have to check options.device here: we only define
--               MPG321_USE_WAV when -w <wavfile> is defined, and <wavfile>
--               is pointd to by options.device */
--            ao_append_option(&ao_options, "file", options.device);
-+        if (options.opt & MPG321_FILE_PLAY) {
-+              fprintf (stderr, "wav output not supported yet\n");
-+              exit (-1);
-+      }
- 
--            if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
--            {
--                fprintf(stderr, "Error opening libao wav file driver.\n");
--                exit(1);
--            }
--        }
-+      if (!options.output || !*options.output) {
-+              driver_id = ao_default_driver_id ();
-+      } else {
-+              driver_id = ao_driver_id (options.output);
-+              if (driver_id == -1) {
-+                      fprintf (stderr, "couldn't find plugin \"%s\"\n", options.output);
-+                      exit (-1);
-+              }
-+      }
- 
--        else if(options.opt & MPG321_USE_NULL)
--        {
--            int driver_id = ao_get_driver_id("null");
--            if((playdevice = ao_open(driver_id, 0, 0, 0, NULL)) == NULL)
--            {
--                fprintf(stderr, "Error opening libao null driver.\n");
--                exit(1);
--            }
--        }
--        
--        else if (options.opt & MPG321_USE_STDOUT)
--        {
--            ao_option_t * ao_options = NULL;
--            int driver_id = ao_get_driver_id("raw");
--        
--            ao_append_option(&ao_options, "file", "-");
--        
--            if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
--            {
--                fprintf(stderr, "Error opening libao raw output driver.\n");
--                exit(1);
--            }
--        }
--        
--        else if(options.opt & MPG321_USE_ESD)
--        {
--            ao_option_t *ao_options = NULL;
--            int driver_id = ao_get_driver_id("esd");
--           
--            if(options.device)
--                ao_append_option(&ao_options, "host", options.device);
--        
--            if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
--            {
--                fprintf(stderr, "Error opening libao esd driver.\n");
--                exit(1);
--            }
--        }
--        
--        else if(options.opt & MPG321_USE_ALSA)
--        {
--            ao_option_t *ao_options = NULL;
--            int driver_id = ao_get_driver_id("alsa");
--            char *c;
--           
--            if (options.device)
--            {
--                if ((c = strchr(options.device, ':')) == NULL || strlen(c+1) < 1)
--                {
--                    fprintf(stderr, "Poorly formed ALSA card:device specification %s", options.device);
--                    exit(1);
--                }
--                
--                *(c++) = '\0'; /* change the : to a null to create two separate strings */
--                
--                ao_append_option(&ao_options, "card", options.device);
--                ao_append_option(&ao_options, "dev", c);
--            }
--        
--            if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
--            {
--                fprintf(stderr, "Error opening libao alsa driver.\n");
--                exit(1);
--            }
--        }
--        
--        else
--        {
--            ao_option_t *ao_options = NULL;
--            int driver_id = ao_get_driver_id(AUDIO_DEFAULT);
--            
--            if (strcmp(AUDIO_DEFAULT, "oss") == 0)
--            {
--                if (options.device)
--                    ao_append_option(&ao_options, "dsp", options.device);
--            }
--            else if (strcmp(AUDIO_DEFAULT, "sun") == 0)
--            {
--                if (options.device)
--                    ao_append_option(&ao_options, "dev", options.device);
--            }
-+      format.rate = header->samplerate;
-+      format.channels = numChannels;
-+      format.bits = 16;
-+      format.byte_format = AO_FMT_LITTLE;
- 
--            if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
--            {
--                fprintf(stderr, "Error opening libao oss driver.\n");
--                exit(1);
--            }
--        }
-+      playdevice = ao_open_live (driver_id, &format, NULL);
-+      if (playdevice == NULL) {
-+              fprintf (stderr, "error opening device \"%s\"\n", options.output);
-+              exit (-1);
-+      }
- }
- 
- char * layerstring(enum mad_layer layer)
-diff -urN mpg321-0.1.5/mpg321.c mpg321-0.1.5-new/mpg321.c
---- mpg321-0.1.5/mpg321.c      Sat Aug 11 04:31:16 2001
-+++ mpg321-0.1.5-new/mpg321.c  Wed Sep 12 15:50:43 2001
-@@ -53,7 +53,7 @@
- int stop_playing_file = 0;
- int quit_now = 0;
- char *playlist_file;
--ao_device_t *playdevice=NULL;
-+ao_device *playdevice=NULL;
- mad_timer_t current_time;
- mpg321_options options = { 0, NULL, 0 };
- 
-@@ -221,7 +221,7 @@
-                 break;
-             
-             case 'q':
--                options.opt |= MPG321_QUIET_PLAY;
-+              options.output = "null";
-                 break;
-             
-             case 'R':
-@@ -238,11 +238,11 @@
-                 break;
-             
-             case 't':
--                options.opt |= MPG321_USE_NULL;
-+              options.output = "null";
-                 break;
-             
-             case 'w':
--                options.opt |= MPG321_USE_WAV;
-+              options.opt |= MPG321_FILE_PLAY;
-                 options.device = strdup(optarg);
-                 break;
-             
-@@ -252,25 +252,13 @@
-                 break;
-             
-             case 's':
--                options.opt |= MPG321_USE_STDOUT;
-+              options.opt |= MPG321_FILE_PLAY;
-+              options.device = "-";
-                 break;
-                 
-             case 'o':
--                if (strcmp(optarg, "alsa") == 0)
--                {
--                    options.opt |= MPG321_USE_ALSA;
--                }
--                
--                else if (strcmp(optarg, "esd") == 0)
--                {
--                    options.opt |= MPG321_USE_ESD;
--                }
--                
--                else
--                {
--                    fprintf(stderr, "Option %s to --output not implemented or not understood.\n", optarg);
--                }
--                
-+              options.output = strdup(optarg);
-+
-                 break;    
-             
-             case 'g':
-@@ -328,6 +316,7 @@
- 
-     /* Get the command line options */
-     options.volume = 100;
-+    options.output = "";
- 
-     /* also adds all playlist files to playlist pl */
-     parse_options(argc, argv, pl);
-diff -urN mpg321-0.1.5/mpg321.h mpg321-0.1.5-new/mpg321.h
---- mpg321-0.1.5/mpg321.h      Sat Aug 11 04:25:08 2001
-+++ mpg321-0.1.5-new/mpg321.h  Wed Sep 12 15:47:26 2001
-@@ -59,13 +59,14 @@
- typedef struct
- {
-     int opt;
-+    char *output;
-     char *device;
-     unsigned long seek;
-     int volume;
- } mpg321_options;    
- 
- extern mpg321_options options;
--extern ao_device_t *playdevice;
-+extern ao_device *playdevice;
- extern mad_timer_t current_time;
- extern int stop_playing_file;
- 
-@@ -74,12 +75,7 @@
-     MPG321_VERBOSE_PLAY  = 0x0001,
-     MPG321_QUIET_PLAY    = 0x0002,
-     MPG321_REMOTE_PLAY   = 0x0004,
--
--    MPG321_USE_STDOUT    = 0x0010,
--    MPG321_USE_ALSA      = 0x0020,
--    MPG321_USE_ESD       = 0x0040,
--    MPG321_USE_NULL      = 0x0080,
--    MPG321_USE_WAV       = 0x0100
-+    MPG321_FILE_PLAY     = 0x0008,
- };
- 
- #define DEFAULT_PLAYLIST_SIZE 1024
diff --git a/media-sound/mpg321/files/mpg321-0.2.10-useragent.patch b/media-sound/mpg321/files/mpg321-0.2.10-useragent.patch
new file mode 100644 (file)
index 0000000..756b1b9
--- /dev/null
@@ -0,0 +1,15 @@
+
+$FreeBSD: /repoman/r/pcvs/ports/audio/mpg321/files/patch-network.c,v 1.3 2005/08/28 20:39:25 naddy Exp $
+
+--- network.c.orig
++++ network.c
+@@ -225,7 +225,8 @@
+      * a html page and not the stream */
+     snprintf(http_request, sizeof(http_request), "GET /%s HTTP/1.0\r\n"
+ /*  "User-Agent: Mozilla/2.0 (Win95; I)\r\n" */
+-             "Pragma: no-cache\r\n" "Host: %s\r\n" "Accept: */*\r\n" "\r\n", filename, host);
++             "User-Agent: mpg321/%s\r\n"
++             "Pragma: no-cache\r\n" "Host: %s\r\n" "Accept: */*\r\n" "\r\n", filename, VERSION, host);
+ 
+     send(tcp_sock, http_request, strlen(http_request), 0);
+ 
diff --git a/media-sound/mpg321/mpg321-0.2.10-r3.ebuild b/media-sound/mpg321/mpg321-0.2.10-r3.ebuild
new file mode 100644 (file)
index 0000000..373d704
--- /dev/null
@@ -0,0 +1,59 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/mpg321/mpg321-0.2.10-r3.ebuild,v 1.1 2005/08/29 09:48:18 flameeyes Exp $
+
+inherit eutils
+
+IUSE=""
+
+DESCRIPTION="Free MP3 player, drop-in replacement for mpg123"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+HOMEPAGE="http://sourceforge.net/projects/mpg321/"
+
+DEPEND="media-libs/libmad
+       media-libs/libid3tag
+       >=media-libs/libao-0.8.0"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 -mips ~ppc ~ppc-macos ~ppc64 ~sparc ~x86"
+
+PROVIDE="virtual/mpg123"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+
+       # fix file descriptors leak (from Debian?)
+       epatch ${FILESDIR}/${P}.diff
+       # provide an User-Agent when requesting via HTTP
+       # By Frank Ruell, in FreeBSD PR 84898
+       epatch ${FILESDIR}/${P}-useragent.patch
+}
+
+src_compile() {
+       # disabling the symlink here and doing it in postinst is better for GRP
+       econf --disable-mpg123-symlink || die
+       emake || die
+}
+
+src_install () {
+       make DESTDIR=${D} install || die
+       dodoc AUTHORS BUGS ChangeLog HACKING NEWS README README.remote THANKS TODO
+}
+
+pkg_postinst() {
+       # We create a symlink for /usr/bin/mpg123 if it doesn't already exist
+       if ! [ -f ${ROOT}/usr/bin/mpg123 ]; then
+               ln -s mpg321 ${ROOT}/usr/bin/mpg123
+       fi
+}
+
+pkg_postrm() {
+       # We delete the symlink if it's nolonger valid.
+       if [ -L "${ROOT}/usr/bin/mpg123" ] && [ ! -x "${ROOT}/usr/bin/mpg123" ]; then
+               einfo "We are removing the ${ROOT}/usr/bin/mpg123 symlink since it is no longer valid."
+               einfo "If you are using another virtual/mpg123 program, you should setup the appropriate symlink."
+               rm ${ROOT}/usr/bin/mpg123
+       fi
+}