From mjl@luckie.org.nz  Thu Aug 18 07:52:22 2005
Return-Path: <mjl@luckie.org.nz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5DA8416A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 18 Aug 2005 07:52:22 +0000 (GMT)
	(envelope-from mjl@luckie.org.nz)
Received: from grunt1.ihug.co.nz (grunt1.ihug.co.nz [203.109.254.41])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9D1D243D45
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 18 Aug 2005 07:52:20 +0000 (GMT)
	(envelope-from mjl@luckie.org.nz)
Received: from 203-173-146-23.bliink.ihug.co.nz (lycra.luckie.org.nz) [203.173.146.23] 
	by grunt1.ihug.co.nz with esmtp (Exim 3.35 #1 (Debian))
	id 1E5fCF-00056g-00; Thu, 18 Aug 2005 19:52:19 +1200
Received: from mjl by lycra.luckie.org.nz with local (Exim 4.52 (FreeBSD))
	id 1E5fCE-000CVR-IV
	for FreeBSD-gnats-submit@freebsd.org; Thu, 18 Aug 2005 19:52:18 +1200
Message-Id: <E1E5fCE-000CVR-IV@lycra.luckie.org.nz>
Date: Thu, 18 Aug 2005 19:52:18 +1200
From: Matthew Luckie <mjl@luckie.org.nz>
Reply-To: Matthew Luckie <mjl@luckie.org.nz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] unbreak net/gaim-openq on 4.X
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         85075
>Category:       ports
>Synopsis:       [patch] unbreak net/gaim-openq on 4.X
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    garga
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 18 08:00:35 GMT 2005
>Closed-Date:    Tue Aug 30 17:10:13 GMT 2005
>Last-Modified:  Tue Aug 30 17:20:16 GMT 2005
>Originator:     Matthew Luckie
>Release:        FreeBSD 4.11-RELEASE-p8 i386
>Organization:
University of Waikato	
>Environment:
System: FreeBSD lycra.luckie.org.nz 4.11-RELEASE-p8 FreeBSD 4.11-RELEASE-p8 #1: Wed May 11 14:02:09 NZST 2005 root@lycra.luckie.org.nz:/files/freebsd_src/sys/compile/lycra i386

>Description:
make gaim-openq compile on 4.X

>How-To-Repeat:
N/A
>Fix:
diff -uNr gaim-openq.orig/Makefile gaim-openq/Makefile
--- gaim-openq.orig/Makefile	Sun Jul 10 07:04:01 2005
+++ gaim-openq/Makefile	Thu Aug 18 19:50:17 2005
@@ -7,7 +7,7 @@
 
 PORTNAME=	openq
 PORTVERSION=	0.3.2
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -27,10 +27,4 @@
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
 		LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
 
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} < 500000
-BROKEN=		"does not compile"
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -uNr gaim-openq.orig/files/patch-src-file_trans.c gaim-openq/files/patch-src-file_trans.c
--- gaim-openq.orig/files/patch-src-file_trans.c	Wed Apr 20 23:18:47 2005
+++ gaim-openq/files/patch-src-file_trans.c	Thu Aug 18 19:35:23 2005
@@ -1,10 +1,96 @@
---- src/file_trans.c.orig	Tue Apr 19 03:52:08 2005
-+++ src/file_trans.c	Tue Apr 19 03:00:39 2005
-@@ -26,6 +26,7 @@
+--- src/file_trans.c.orig	Thu Aug 18 19:21:53 2005
++++ src/file_trans.c	Thu Aug 18 19:33:01 2005
+@@ -26,6 +26,9 @@
  #define random rand
  #endif
  
++#include <sys/types.h>
 +#include <sys/socket.h>
++
  #include "debug.h"		// gaim_debug
  #include "ft.h"			// gaim_xfer
  #include "md5.h"
+@@ -213,8 +216,8 @@
+ int _qq_xfer_open_file(const gchar *filename, const gchar *method, GaimXfer *xfer)
+ {
+ 	ft_info *info = xfer->data;
+-	info->dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method);
+-	if (info->dest_fp == NULL) {
++	info->un.dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method);
++	if (info->un.dest_fp == NULL) {
+ 		return -1;
+ 	}
+ 	return 0;
+@@ -225,26 +228,28 @@
+ {
+ 	ft_info *info = xfer->data;
+ 
+-	fseek(info->dest_fp, index * len, SEEK_SET);
+-	return fread(buffer, 1, len, info->dest_fp);
++	fseek(info->un.dest_fp, index * len, SEEK_SET);
++	return fread(buffer, 1, len, info->un.dest_fp);
+ }
+ 
+ gint
+ _qq_xfer_write_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer)
+ {
+ 	ft_info *info = xfer->data;
+-	fseek(info->dest_fp, index * len, SEEK_SET);
+-	return fwrite(buffer, 1, len, info->dest_fp);
++	fseek(info->un.dest_fp, index * len, SEEK_SET);
++	return fwrite(buffer, 1, len, info->un.dest_fp);
+ }
+ 
+ void qq_xfer_close_file(GaimXfer *xfer)
+ {
+ 	ft_info *info = xfer->data;
+ 
+-	if (info->dest_fp) fclose(info->dest_fp);
++	if (info->un.dest_fp) fclose(info->un.dest_fp);
+ }
+ #endif
+ 
++ssize_t _qq_xfer_write(const char *buf, size_t len, GaimXfer *xfer);
++
+ gint _qq_send_file(GaimConnection *gc, guint8 *data, gint len, guint16 packet_type, guint32 to_uid)
+ {
+ 	gint bytes;
+@@ -270,7 +275,6 @@
+ 	bytes += create_packet_dw(buf, &cursor, _encrypt_qq_uid(to_uid, file_key));
+ 	bytes += create_packet_data(buf, &cursor, data, len);
+ 
+-	ssize_t _qq_xfer_write(const char *buf, size_t len, GaimXfer *xfer);
+ 	if (bytes == len + 12) {
+ 		//gaim_xfer_write(qd->xfer, buf, bytes);
+ 		_qq_xfer_write(buf, bytes, qd->xfer);
+@@ -397,10 +401,11 @@
+ 	gchar file_md5[16], filename_md5[16], *filename;
+ 	gint filename_len, filesize;
+ 	qq_data *qd;
++	ft_info *info;
+ 
+ 	g_return_if_fail(gc != NULL && gc->proto_data != NULL);
+ 	qd = (qq_data *) gc->proto_data;
+-	ft_info *info = (ft_info *) qd->xfer->data;
++	info = (ft_info *) qd->xfer->data;
+ 
+ 	filename = (gchar *) gaim_xfer_get_filename(qd->xfer);
+ 	filesize = gaim_xfer_get_size(qd->xfer);
+@@ -669,6 +674,8 @@
+ 	GaimXfer *xfer = qd->xfer;
+ 	ft_info *info = (ft_info *) xfer->data;
+ 	guint32 mask;
++	guint8 *buffer;
++	gint readbytes;
+ 
+ 	gaim_debug(GAIM_DEBUG_INFO, "QQ", "receiving %dth fragment ack, slide window status %o, max_fragment_index %d\n", 
+ 			fragment_index, info->window, info->max_fragment_index);
+@@ -698,8 +705,6 @@
+ 		{
+ 			//move the slide window
+ 			info->window &= ~mask;
+-			guint8 *buffer;
+-			gint readbytes;
+ 
+ 			buffer = g_newa(guint8, info->fragment_len);
+ 			readbytes = _qq_xfer_read_file(buffer, info->max_fragment_index + sizeof(info->window), 
diff -uNr gaim-openq.orig/files/patch-src-send_file.c gaim-openq/files/patch-src-send_file.c
--- gaim-openq.orig/files/patch-src-send_file.c	Wed Apr 20 23:18:47 2005
+++ gaim-openq/files/patch-src-send_file.c	Thu Aug 18 18:50:55 2005
@@ -1,10 +1,56 @@
---- src/send_file.c.orig	Thu Dec 23 06:22:22 2004
-+++ src/send_file.c	Wed Apr 20 13:16:55 2005
-@@ -22,6 +22,7 @@
+--- src/send_file.c.orig	Thu Dec 23 18:22:22 2004
++++ src/send_file.c	Thu Aug 18 18:18:11 2005
+@@ -22,6 +22,8 @@
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
++#include <sys/types.h>
 +#include <sys/socket.h>
  #include <network.h>
  
  #include "send_file.h"
+@@ -203,8 +205,8 @@
+ 	info = (ft_info *) xfer->data;
+ 
+ 	qq_xfer_close_file(xfer);
+-	if (info->dest_fp != NULL) {
+-		fclose(info->dest_fp);
++	if (info->un.dest_fp != NULL) {
++		fclose(info->un.dest_fp);
+ 		gaim_debug(GAIM_DEBUG_INFO, "QQ", "file closed\n");
+ 	}
+ 	if (info->major_fd != 0) {
+@@ -499,6 +501,8 @@
+ 	guint8 *cursor, *raw_data;
+ 	gint packet_len, bytes;
+ 	ft_info *info;
++	guint16 minor_port;
++	guint32 real_ip;
+ 
+ 	g_return_if_fail (gc != NULL && gc->proto_data != NULL);
+ 	qd = (qq_data *) gc->proto_data;
+@@ -506,8 +510,6 @@
+ 
+ 	gaim_debug(GAIM_DEBUG_INFO, "QQ", "I've accepted the file transfer request from %d\n", to_uid);
+ 	_qq_xfer_init_socket(qd->xfer);
+-	guint16 minor_port;
+-	guint32 real_ip;
+ 
+ 	packet_len = 79;
+ 	raw_data = g_newa (guint8, packet_len);
+@@ -809,6 +811,7 @@
+ 	GaimXfer *xfer;
+ 	gchar *sender_name;
+ 	ft_info *info;
++	gchar **fileinfo;
+ 
+ 	g_return_if_fail (gc != NULL && data != NULL && data_len != 0);
+ 	qd = (qq_data *) gc->proto_data;
+@@ -834,7 +837,6 @@
+ 			GAIM_XFER_RECEIVE,
+ 			sender_name);
+ 
+-	gchar **fileinfo;
+ 	fileinfo = g_strsplit(data + 81 + 12, "\x1f", 2);
+ 	g_return_if_fail (fileinfo != NULL && fileinfo[0] != NULL && fileinfo[1] != NULL);
+ 	gaim_xfer_set_filename(xfer, fileinfo[0]);
diff -uNr gaim-openq.orig/files/patch-src-send_file.h gaim-openq/files/patch-src-send_file.h
--- gaim-openq.orig/files/patch-src-send_file.h	Thu Jan  1 12:00:00 1970
+++ gaim-openq/files/patch-src-send_file.h	Thu Aug 18 18:50:13 2005
@@ -0,0 +1,11 @@
+--- src/send_file.h.orig	Thu Aug 18 18:49:04 2005
++++ src/send_file.h	Thu Aug 18 17:55:56 2005
+@@ -40,7 +40,7 @@
+ 	union {
+ 		FILE *dest_fp;
+ 		guint8 *buffer;
+-	};
++	} un;
+ 	gboolean use_major;
+ } ft_info;
+ 
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->garga 
Responsible-Changed-By: garga 
Responsible-Changed-When: Fri Aug 19 15:33:49 GMT 2005 
Responsible-Changed-Why:  
I'll take it 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85075 
State-Changed-From-To: open->feedback 
State-Changed-By: garga 
State-Changed-When: Fri Aug 19 16:12:52 GMT 2005 
State-Changed-Why:  
Ask maintainer for approval. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85075 

From: Renato Botelho <garga@FreeBSD.org>
To: hamigua@hotpop.com
Cc: bug-followup@FreeBSD.org, mjl@luckie.org.nz
Subject: Re: ports/85075: [patch] unbreak net/gaim-openq on 4.X
Date: Fri, 19 Aug 2005 13:16:03 -0300

 Dear maintainer of FreeBSD gaim-openq port, take a look here:
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/85075
 
 Do you approve this patch?
 -- 
 Renato Botelho <garga @ FreeBSD.org>
                <freebsd @ galle.com.br>
 GnuPG Key: http://www.FreeBSD.org/~garga/pubkey.asc
 
 Experience is what you get when you were expecting something else.
State-Changed-From-To: feedback->closed 
State-Changed-By: garga 
State-Changed-When: Tue Aug 30 17:10:05 GMT 2005 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85075 

From: hamigua@hotpop.com
To: garga@FreeBSD.org
Cc: bug-followup@FreeBSD.org, mjl@luckie.org.nz, relaxbsd@gmail.com
Subject: Re: ports/85075: [patch] unbreak net/gaim-openq on 4.X
Date: Tue, 30 Aug 2005 20:44:03 +0800

  Test OK in 4.11-stable and 5.4-stable,thanks for your job!
  
  http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/85075
 

From: hamigua@hotpop.com
To: garga@FreeBSD.org
Cc: bug-followup@FreeBSD.org, mjl@luckie.org.nz, relaxbsd@gmail.com
Subject: Re: ports/85075: [patch] unbreak net/gaim-openq on 4.X
Date: Tue, 30 Aug 2005 20:44:03 +0800

  Test OK in 4.11-stable and 5.4-stable,thanks for your job!
  
  http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/85075
 

From: hamigua <hamigua@hotpop.com>
To: garga@FreeBSD.org
Cc: bug-followup@FreeBSD.org, mjl@luckie.org.nz
Subject: Re: ports/85075: [patch] unbreak net/gaim-openq on 4.X
Date: Tue, 30 Aug 2005 21:22:01 +0800

 Test OK in 4.11-stable and 5.4-stable,thanks for your job!
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/85075
 
>Unformatted:
