From ajmawer@mawer.org  Fri Oct  7 01:48:41 2005
Return-Path: <ajmawer@mawer.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2AF1B16A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  7 Oct 2005 01:48:41 +0000 (GMT)
	(envelope-from ajmawer@mawer.org)
Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8E69743D45
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  7 Oct 2005 01:48:40 +0000 (GMT)
	(envelope-from ajmawer@mawer.org)
Received: from scooby.enchanted.net (c220-237-120-88.thorn1.nsw.optusnet.com.au [220.237.120.88])
	by mail14.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id j971mcdc000751
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 7 Oct 2005 11:48:38 +1000
Received: by scooby.enchanted.net (Postfix, from userid 1001)
	id 8D0867A; Fri,  7 Oct 2005 11:48:38 +1000 (EST)
Message-Id: <20051007014838.8D0867A@scooby.enchanted.net>
Date: Fri,  7 Oct 2005 11:48:38 +1000 (EST)
From: Antony Mawer <gnats@mawer.org>
Reply-To: Antony Mawer <gnats@mawer.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] net/xboxproxy does not build on FreeBSD 4.x
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         87024
>Category:       ports
>Synopsis:       [patch] net/xboxproxy does not build on FreeBSD 4.x
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ehaupt
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 07 01:50:16 GMT 2005
>Closed-Date:    Fri Oct 07 19:21:42 CEST 2005
>Last-Modified:  Fri Oct 07 19:21:42 CEST 2005
>Originator:     Antony Mawer
>Release:        FreeBSD 6.0-BETA2 i386
>Organization:
GP Technology Solutions
>Environment:
System: FreeBSD scooby.enchanted.net 6.0-BETA2 FreeBSD 6.0-BETA2 #1: Mon Aug 8 09:56:30 EST 2005 root@scooby.enchanted.net:/usr/obj/usr/src/sys/SCOOBY i386


	
>Description:
	The net/xboxproxy port I recently submitted was marked BROKEN on 4.x
	as it did not build on there. This was due to it requiring the port
	version of libpcap on 4.x, and a code incompatibility with gcc 2.95.

	The attached patch makes the port depend on net/libpcap on 4.x, as
	well as including a patch to allow it to build with gcc 2.95. The
	patch has been submitted back to the author for inclusion in future
	releases.

	I'm not 100% sure that the way I've set it to pickup the port pcap
	library in preference to the base system one is correct; if someone
	could rubber stamp that it would be appreciated!
>How-To-Repeat:
	Attempt to build net/xboxproxy on FreeBSD 4.x; observe it is marked
	BROKEN.
>Fix:

--- xboxproxy.patch begins here ---
--- Makefile	Thu Oct  6 21:50:34 2005
+++ Makefile	Fri Oct  7 11:06:23 2005
@@ -17,14 +17,17 @@
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--program-prefix=xbox
-USE_GMAKE=	yes
 
 PLIST_FILES=	bin/xboxproxy
 
 .include <bsd.port.pre.mk>
 
 .if ${OSVERSION} < 500000
-BROKEN=	"Doesn't build on FreeBSD < 5.x"
+# FreeBSD 4.x requires the libpcap port
+BUILD_DEPENDS+=	${LOCALBASE}/lib/libpcap.a:${PORTSDIR}/net/libpcap
+# Without this, configure picks up the pcap lib in /usr/lib
+CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include -I/usr/include" LDFLAGS="-L${LOCALBASE}/lib -L/usr/lib"
+CONFIGURE_ARGS+=	--with-libpcap=${LOCALBASE}
 .endif
 
 .include <bsd.port.post.mk>
--- files/patch-main.c	Thu Jan  1 10:00:00 1970
+++ files/patch-main.c	Fri Oct  7 11:06:23 2005
@@ -0,0 +1,29 @@
+--- src/main.c	Thu Sep 22 01:16:07 2005
++++ src/main.c	Fri Oct  7 10:52:40 2005
+@@ -519,9 +519,9 @@
+ 		int size = sizeof(struct sockaddr_in); /* sizeof(srcaddr) */
+ 		int sel;
+ 		struct timeval timeout;
++		struct fd_set proxycopy;
+ 		timeout.tv_sec = 10;
+ 		timeout.tv_usec = 0;
+-		fd_set proxycopy;
+ 
+ 		/* Some sort of select() thing here */
+ 
+@@ -735,6 +735,7 @@
+ 	char errbuf[PCAP_ERRBUF_SIZE];
+ 	//int *pthread_return;
+ 	char ch;
++	pthread_t pcapthread, proxythread;
+ 
+ 	progname = argv[0];
+ 
+@@ -743,7 +744,6 @@
+ 	proxies = hash_create(HASHSIZE, compareip, haship);
+ 	set_log_level(0);
+ 
+-	pthread_t pcapthread, proxythread;
+ 
+ 	/* Argument Processing */
+ 	while ((ch = getopt(argc, argv, "B:bxmus:i:d:h?p:f:")) != -1) {
--- xboxproxy.patch ends here ---

>Release-Note:
>Audit-Trail:

From: Antony Mawer <gnats@mawer.org>
To: bug-followup@FreeBSD.org, gnats@mawer.org
Cc:  
Subject: Re: ports/87024: [patch] net/xboxproxy does not build on FreeBSD
 4.x
Date: Fri, 07 Oct 2005 13:43:54 +1000

 Please disregard the above patch; the author has corrected these issues 
 in the the mainstream source. New patch coming up shortly.
 

From: Antony Mawer <gnats@mawer.org>
To: bug-followup@FreeBSD.org, gnats@mawer.org
Cc:  
Subject: Re: ports/87024: [patch] net/xboxproxy does not build on FreeBSD
 4.x
Date: Fri, 07 Oct 2005 14:18:51 +1000

 This is a multi-part message in MIME format.
 --------------030408010207030607040205
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 The attached patch upgrades xboxproxy to v2.1, which fixes the C99 
 issues and makes configure respect the --with-pcap option. Kudos to 
 Jordon Sissel (program author) for integrating these fixes so quickly!
 
 --------------030408010207030607040205
 Content-Type: text/plain;
  name="xboxproxy.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="xboxproxy.diff"
 
 --- Makefile	Thu Oct  6 21:50:34 2005
 +++ Makefile	Fri Oct  7 14:12:03 2005
 @@ -5,7 +5,7 @@
  # $FreeBSD: ports/net/xboxproxy/Makefile,v 1.1 2005/10/06 11:50:34 garga Exp $
  
  PORTNAME=	xboxproxy
 -PORTVERSION=	1.9
 +PORTVERSION=	2.1
  CATEGORIES=	net
  MASTER_SITES=	http://www.csh.rit.edu/~psionic/projects/xboxproxy/
  DISTNAME=	proxy-${PORTVERSION}
 @@ -17,14 +17,15 @@
  
  GNU_CONFIGURE=	yes
  CONFIGURE_ARGS=	--program-prefix=xbox
 -USE_GMAKE=	yes
  
  PLIST_FILES=	bin/xboxproxy
  
  .include <bsd.port.pre.mk>
  
  .if ${OSVERSION} < 500000
 -BROKEN=	"Doesn't build on FreeBSD < 5.x"
 +# FreeBSD 4.x requires the libpcap port
 +BUILD_DEPENDS+=	${LOCALBASE}/lib/libpcap.a:${PORTSDIR}/net/libpcap
 +CONFIGURE_ARGS+=	--with-pcap=${LOCALBASE}
  .endif
  
  .include <bsd.port.post.mk>
 --- distinfo	Fri Oct  7 14:12:41 2005
 +++ distinfo	Fri Oct  7 14:13:07 2005
 @@ -1,2 +1,2 @@
 -MD5 (proxy-1.9.tar.gz) = ac9bbf18833959399b0214bf97899221
 -SIZE (proxy-1.9.tar.gz) = 119703
 +MD5 (proxy-2.1.tar.gz) = 5fa352eef355192a53a44b36942c6022
 +SIZE (proxy-2.1.tar.gz) = 119717
 
 --------------030408010207030607040205--
 
Responsible-Changed-From-To: freebsd-ports-bugs->ehaupt 
Responsible-Changed-By: ehaupt 
Responsible-Changed-When: Fri Oct 7 09:29:46 CEST 2005 
Responsible-Changed-Why:  
I will take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87024 
State-Changed-From-To: open->closed 
State-Changed-By: ehaupt 
State-Changed-When: Fri Oct 7 19:21:41 CEST 2005 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87024 
>Unformatted:
