From naddy@mips.inka.de  Sun Oct  7 19:30:38 2001
Return-Path: <naddy@mips.inka.de>
Received: from mail.inka.de (quechua.inka.de [212.227.14.2])
	by hub.freebsd.org (Postfix) with ESMTP id 75E2137B403
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Oct 2001 19:30:37 -0700 (PDT)
Received: from kemoauc.mips.inka.de (uucp@)
	by mail.inka.de with local-bsmtp 
	id 15qQBg-0002RE-00; Mon, 8 Oct 2001 04:30:36 +0200
Received: (from naddy@localhost)
	by kemoauc.mips.inka.de (8.11.6/8.11.6) id f981cjm68236;
	Mon, 8 Oct 2001 03:38:46 +0200 (CEST)
	(envelope-from naddy)
Message-Id: <200110080138.f981cjm68236@kemoauc.mips.inka.de>
Date: Mon, 8 Oct 2001 03:38:46 +0200 (CEST)
From: Christian Weisgerber <naddy@mips.inka.de>
Reply-To: Christian Weisgerber <naddy@mips.inka.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: audio/mpg321: update to 0.2.0 and unbreak
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         31121
>Category:       ports
>Synopsis:       audio/mpg321: update to 0.2.0 and unbreak
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 07 19:40:00 PDT 2001
>Closed-Date:    Thu Oct 11 05:35:29 PDT 2001
>Last-Modified:  Thu Oct 11 05:35:37 PDT 2001
>Originator:     Christian Weisgerber
>Release:        FreeBSD 5.0-CURRENT alpha
>Organization:
>Environment:
System: FreeBSD kemoauc.mips.inka.de 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Sun Sep 30 20:32:19 CEST 2001 naddy@kemoauc.mips.inka.de:/home/obj/usr/src/sys/KEMOAUC alpha

>Description:

audio/mpg321:
Update to 0.2.0, builds now against libao 0.8.0.

>How-To-Repeat:

>Fix:

diff -uNr /usr/ports/audio/mpg321/Makefile mpg321/Makefile
--- /usr/ports/audio/mpg321/Makefile	Mon Aug 27 13:13:00 2001
+++ mpg321/Makefile	Mon Sep 24 14:04:57 2001
@@ -6,17 +6,15 @@
 #
 
 PORTNAME=	mpg321
-PORTVERSION=	0.1.5
+PORTVERSION=	0.2.0
 CATEGORIES=	audio
 MASTER_SITES=	http://people.debian.org/~drew/
 DISTNAME=	${PORTNAME}_${PORTVERSION}
 
 MAINTAINER=	naddy@mips.inka.de
 
-LIB_DEPENDS=	ao.1:${PORTSDIR}/audio/libao
-BUILD_DEPENDS=	${LOCALBASE}/lib/libmad.a:${PORTSDIR}/audio/mad
-
-BROKEN=		"not yet updated for libao.so.2"
+LIB_DEPENDS=	ao.2:${PORTSDIR}/audio/libao \
+		mad.0:${PORTSDIR}/audio/mad
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--disable-mpg123-symlink
diff -uNr /usr/ports/audio/mpg321/distinfo mpg321/distinfo
--- /usr/ports/audio/mpg321/distinfo	Thu Aug 16 12:01:28 2001
+++ mpg321/distinfo	Mon Sep 24 14:05:32 2001
@@ -1 +1 @@
-MD5 (mpg321_0.1.5.tar.gz) = 8632ea26959ae3057a6a6414e47fb486
+MD5 (mpg321_0.2.0.tar.gz) = 9bf6a0b049c492381819b53e7449455a
diff -uNr /usr/ports/audio/mpg321/files/patch-mad.c mpg321/files/patch-mad.c
--- /usr/ports/audio/mpg321/files/patch-mad.c	Thu Jan  1 01:00:00 1970
+++ mpg321/files/patch-mad.c	Mon Sep 24 15:56:30 2001
@@ -0,0 +1,90 @@
+
+$FreeBSD$
+
+--- mad.c.orig	Sun Sep 23 08:17:55 2001
++++ mad.c	Mon Sep 24 15:56:20 2001
+@@ -554,44 +554,47 @@
+     
+ int calc_length(char *file, buffer *buf)
+ {
+-    FILE * f;
++    int f;
+     struct stat filestat;
+     void *fdm;
+     char buffer[3];
+ 
+-    if (stat(file, &filestat) == -1)
++    f = open(file, O_RDONLY);
++
++    if (f < 0)
+     {
+         mpg321_error(file);
+         return -1;
+     }
+ 
+-    f = fopen(file, "r");
+-
+-    if (f == NULL)
++    if (fstat(f, &filestat) < 0)
+     {
+         mpg321_error(file);
++        close(f);
+         return -1;
+     }
+ 
+     if (!S_ISREG(filestat.st_mode))
+     {
+         fprintf(stderr, "%s: Not a regular file\n", file);
+-        fclose(f);
++        close(f);
+         return -1;
+     }
+ 
+     /* TAG checking is adapted from XMMS */
+     buf->length = filestat.st_size;
+ 
+-    if (fseek(f, -128, SEEK_END) < 0)
++    if (lseek(f, -128, SEEK_END) < 0)
+     {
+         mpg321_error(file);
++        close(f);
+         return -1;
+     }    
+ 
+-    if (read(fileno(f), buffer, 3) != 3)
++    if (read(f, buffer, 3) != 3)
+     {
+         fprintf(stderr, "Couldnt read 3 bytes from %s\n", file);
++        close(f);
+         return -1;
+     }
+     
+@@ -600,12 +603,11 @@
+         buf->length -= 128; /* Correct for id3 tags */
+     }
+     
+-    rewind(f);
+-
+-    fdm = mmap(0, buf->length, PROT_READ, MAP_SHARED, fileno(f), 0);
++    fdm = mmap(0, buf->length, PROT_READ, MAP_SHARED, f, 0);
+     if (fdm == MAP_FAILED)
+     {
+         mpg321_error(file);
++        close(f);
+         return -1;
+     }
+ 
+@@ -616,11 +618,11 @@
+     if (munmap(fdm, buf->length) == -1)
+     {
+         mpg321_error(file);
+-        fclose(f);
++        close(f);
+         return -1;
+     }
+ 
+-    if (fclose(f) == EOF)
++    if (close(f) < 0)
+     {
+         mpg321_error(file);
+         return -1;
diff -uNr /usr/ports/audio/mpg321/files/patch-mpg321.h mpg321/files/patch-mpg321.h
--- /usr/ports/audio/mpg321/files/patch-mpg321.h	Thu Jan  1 01:00:00 1970
+++ mpg321/files/patch-mpg321.h	Mon Sep 24 16:07:07 2001
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- mpg321.h.orig	Sat Sep 22 22:39:04 2001
++++ mpg321.h	Mon Sep 24 16:06:19 2001
+@@ -32,6 +32,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <sys/types.h>
+ #include <stdio.h>
+ #include <limits.h>
+ #include <ao/ao.h>
diff -uNr /usr/ports/audio/mpg321/files/patch-network.c mpg321/files/patch-network.c
--- /usr/ports/audio/mpg321/files/patch-network.c	Thu Jan  1 01:00:00 1970
+++ mpg321/files/patch-network.c	Mon Sep 24 16:01:43 2001
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- network.c.orig	Mon Sep 24 16:01:09 2001
++++ network.c	Mon Sep 24 16:01:27 2001
+@@ -237,7 +237,7 @@
+   int data_sock;
+   char ftp_request[1024];
+   struct sockaddr_in stLclAddr;
+-  size_t namelen;
++  socklen_t namelen;
+   int i;
+ 
+   /* Check for URL syntax */
diff -uNr /usr/ports/audio/mpg321/files/patch-options.c mpg321/files/patch-options.c
--- /usr/ports/audio/mpg321/files/patch-options.c	Thu Jan  1 01:00:00 1970
+++ mpg321/files/patch-options.c	Mon Sep 24 16:14:54 2001
@@ -0,0 +1,17 @@
+
+$FreeBSD$
+
+--- options.c.orig	Mon Sep 24 16:12:31 2001
++++ options.c	Mon Sep 24 16:12:47 2001
+@@ -28,9 +28,9 @@
+ #include "mpg321.h"
+ #include "getopt.h"
+ 
+-#include <sys/types.h>
+-#include <unistd.h>
++#include <sys/time.h>
+ #include <sys/resource.h>
++#include <unistd.h>
+ #include <string.h>
+ 
+ void parse_options(int argc, char *argv[], playlist *pl)
diff -uNr /usr/ports/audio/mpg321/files/patch-playlist.c mpg321/files/patch-playlist.c
--- /usr/ports/audio/mpg321/files/patch-playlist.c	Thu Jan  1 01:00:00 1970
+++ mpg321/files/patch-playlist.c	Mon Sep 24 21:09:47 2001
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- playlist.c.orig	Mon Sep 24 21:09:15 2001
++++ playlist.c	Mon Sep 24 21:09:34 2001
+@@ -48,6 +48,7 @@
+     pl->files_size = DEFAULT_PLAYLIST_SIZE;
+     pl->numfiles = 0;
+     pl->random_play = 0;
++    strcpy(pl->remote_file, "");
+     
+     return pl;
+ }
diff -uNr /usr/ports/audio/mpg321/files/patch-remote.c mpg321/files/patch-remote.c
--- /usr/ports/audio/mpg321/files/patch-remote.c	Thu Jan  1 01:00:00 1970
+++ mpg321/files/patch-remote.c	Mon Sep 24 16:07:07 2001
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- remote.c.orig	Mon Sep 24 16:06:46 2001
++++ remote.c	Mon Sep 24 16:06:48 2001
+@@ -27,6 +27,7 @@
+ 
+ #include "mpg321.h"
+ 
++#include <sys/time.h>
+ #include <string.h>
+ #include <unistd.h>
+ 
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ijliao 
State-Changed-When: Thu Oct 11 05:35:29 PDT 2001 
State-Changed-Why:  
committed, thanks 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31121 
>Unformatted:
