Subject: pkg/34492: [PATCH] mail/rblcheck: Update: 1.4 -> 1.5
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Shaun Amott <shaun@inerd.com>
List: pkgsrc-bugs
Date: 09/08/2006 02:35:00
>Number:         34492
>Category:       pkg
>Synopsis:       [PATCH] mail/rblcheck: Update: 1.4 -> 1.5
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 08 02:35:00 +0000 2006
>Originator:     Shaun Amott
>Release:        NetBSD 3.0.1
>Organization:
>Environment:
System: NetBSD 3.0.1
Architecture: i386
Machine: i386
>Description:

- Update rblcheck to the latest release.
- Remove dead master site; add mirror to replace it.
- doc/TODO entry can be removed.

patch-ab was removed, as it is now redundant.

>How-To-Repeat:

>Fix:

-----Begin rblcheck-1.5.diff-----
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/rblcheck/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- Makefile	4 Mar 2006 21:30:02 -0000	1.13
+++ Makefile	8 Sep 2006 02:24:38 -0000
@@ -1,22 +1,25 @@
 # $NetBSD: Makefile,v 1.13 2006/03/04 21:30:02 jlam Exp $
 
-DISTNAME=	rblcheck-1.4
+DISTNAME=	rblcheck-1.5
 CATEGORIES=	mail
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=rblcheck/} \
-		http://www.xnet.com/%7Eemarshal/rblcheck/
+		http://mirror.inerd.com/FreeBSD/distfiles/rblcheck/
 
-MAINTAINER=	pkgsrc-users@NetBSD.org
+MAINTAINER=	shaun@inerd.com
 HOMEPAGE=	http://rblcheck.sourceforge.net/
 COMMENT=	Command-line interface to Paul Vixie's RBL filter
 
-DOCS=		BUGS CHANGES CREDITS INSTALL PLATFORMS TODO
+USE_TOOLS+=	gmake
+GNU_CONFIGURE=	yes
+
+DOCS=		README NEWS
 
 INSTALLATION_DIRS=	bin
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/rblcheck ${PREFIX}/bin
 	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/rblcheck
-	cd ${WRKSRC}/docs &&						\
+	cd ${WRKSRC} &&						\
 		${INSTALL_DATA} ${DOCS} ${PREFIX}/share/doc/rblcheck
 
 .include "../../mk/bsd.pkg.mk"
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/mail/rblcheck/PLIST,v
retrieving revision 1.1
diff -u -r1.1 PLIST
--- PLIST	1 Nov 2001 01:01:17 -0000	1.1
+++ PLIST	8 Sep 2006 02:24:38 -0000
@@ -1,9 +1,5 @@
 @comment $NetBSD: PLIST,v 1.1 2001/11/01 01:01:17 zuntum Exp $
 bin/rblcheck
-share/doc/rblcheck/BUGS
-share/doc/rblcheck/CHANGES
-share/doc/rblcheck/CREDITS
-share/doc/rblcheck/INSTALL
-share/doc/rblcheck/PLATFORMS
-share/doc/rblcheck/TODO
+share/doc/rblcheck/README
+share/doc/rblcheck/NEWS
 @dirrm share/doc/rblcheck
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/mail/rblcheck/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo	24 Feb 2005 09:59:28 -0000	1.3
+++ distinfo	8 Sep 2006 02:24:38 -0000
@@ -1,7 +1,6 @@
 $NetBSD: distinfo,v 1.3 2005/02/24 09:59:28 agc Exp $
 
-SHA1 (rblcheck-1.4.tar.gz) = b4a5b1b13b7b469ca8a6a34775ba47b7ac3095fa
-RMD160 (rblcheck-1.4.tar.gz) = e0aab76a1cc41a446a20c6b51772e69a2343afbc
-Size (rblcheck-1.4.tar.gz) = 20646 bytes
-SHA1 (patch-aa) = 1bdd4b8f49f9431a148f39e42ee86acba416df8d
-SHA1 (patch-ab) = 4ca0d8de6705d9336bdd42e634ff5c2c09353932
+SHA1 (rblcheck-1.5.tar.gz) = 395e4bde8c2d3ec350e81a0af64cb63f82c4cdb3
+RMD160 (rblcheck-1.5.tar.gz) = 82dd687151175084d74958090877311d9d2e8f23
+Size (rblcheck-1.5.tar.gz) = 150395 bytes
+SHA1 (patch-aa) = 3c3ded88623fe118e020b36e68683a7cd2ab2f3d
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/mail/rblcheck/patches/patch-aa,v
retrieving revision 1.4
diff -u -r1.4 patch-aa
--- patches/patch-aa	14 Feb 2001 06:02:44 -0000	1.4
+++ patches/patch-aa	8 Sep 2006 02:24:38 -0000
@@ -1,16 +1,19 @@
 $NetBSD: patch-aa,v 1.4 2001/02/14 06:02:44 itojun Exp $
 
---- rblcheck.c.orig	Thu Aug 20 14:47:03 1998
-+++ rblcheck.c	Wed Feb 14 15:01:20 2001
-@@ -79,6 +79,7 @@
+--- rblcheck.c.orig	Thu Nov  8 14:05:27 2001
++++ rblcheck.c	Wed May  1 08:19:16 2002
+@@ -28,8 +28,10 @@
  #include <sys/types.h>
  #include <netinet/in.h>
  #include <arpa/nameser.h>
 +#include <arpa/inet.h>
  #include <resolv.h>
  #include <netdb.h>
++#include <unistd.h>
  
-@@ -203,7 +204,7 @@
+ /*-- PORTABILITY ------------------------------------------------------------*/
+ 
+@@ -184,7 +186,7 @@
   * domain. If "txt" is non-zero, we perform a TXT record lookup. We
   * return the text returned from a TXT match, or an empty string, on
   * a successful match, or NULL on an unsuccessful match. */
@@ -19,7 +22,7 @@
  {
  	char * domain;
  	char * result = NULL;
-@@ -214,12 +215,15 @@
+@@ -195,12 +197,15 @@
  	const u_char * cend;
  	const u_char * rend;
  	int len;
@@ -36,7 +39,7 @@
  
  	/* Make our DNS query. */
  	res_init();
-@@ -261,8 +265,8 @@
+@@ -242,8 +247,8 @@
  	cp = answer + sizeof( HEADER );
  	while( *cp != '\0' )
  	{
@@ -47,7 +50,7 @@
  			cp++;
  	}
  
-@@ -277,8 +281,8 @@
+@@ -258,8 +263,8 @@
  	cp += ( NS_INT16SZ * 2 ) + NS_INT32SZ;
  
  	/* Get the length and end of the buffer. */
@@ -58,7 +61,7 @@
  
  	/* Iterate over any multiple answers we might have. In
  	   this context, it's unlikely, but anyway. */
-@@ -286,10 +290,10 @@
+@@ -267,10 +272,10 @@
  	rend = result + RESULT_SIZE - 1;
  	while( cp < cend && rp < rend )
  	{
@@ -73,73 +76,49 @@
  			{
  				if( *cp == '\n' || *cp == '"' ||
  				  *cp == '\\' )
-@@ -308,23 +312,30 @@
- 	char **argv;
+@@ -289,22 +294,39 @@
+  * RBL listing, handling output of results if necessary. */
+ int full_rblcheck( char * addr )
  {
- 	extern int optind;
 -	int a, b, c, d;
-+	extern char *optarg;
 +	struct hostent *ent;
 +	struct in_addr a;
- 	int quiet = 0;
- 	int txt = 0;
- 	int rblfiltered = 0;
+ 	int count = 0;
++	int rblchecking = 0;
  	char * response;
- 	struct rbl * rblsites = NULL;
  	struct rbl * ptr;
 +	int fail;
 +	int c;
  
- 	/* Add more sites you want in the default list of RBL-alike
- 	   systems here. ### An easier way to change this is needed. ### */
--	rblsites = togglesite( "rbl.maps.vix.com", rblsites );
--	rblsites = togglesite( "rbl.dorkslayers.com", rblsites );
-+	rblsites = togglesite( "blackholes.mail-abuse.org", rblsites );
-+	rblsites = togglesite( "inputs.orbs.org", rblsites );
-+	rblsites = togglesite( "outputs.orbs.org", rblsites );
-+	rblsites = togglesite( "dialups.mail-abuse.org", rblsites );
-+	rblsites = togglesite( "relays.mail-abuse.org", rblsites );
- 
- 	progname = argv[ 0 ];
- 
--	while( ( a = getopt( argc, argv, "qtls:c?hv" ) ) != EOF )
--		switch( a )
-+	while( ( c = getopt( argc, argv, "qtls:c?hv" ) ) != EOF )
-+		switch( c )
- 		{
- 			case 'q':
- 				/* Quiet */
-@@ -372,10 +383,20 @@
- 		return -1;
- 	}
- 
--	if( sscanf( argv[ optind ], "%d.%d.%d.%d", &a, &b, &c, &d ) != 4 ||
--	  a < 0 || a > 255 || b < 0 || b > 255 || c < 0 || c > 255 ||
--	  d < 0 || d > 255 )
--	{
-+	fail = 0;
-+	if (ent = gethostbyname(argv[optind])) {
-+		memcpy(&a, ent->h_addr_list[0], sizeof(a));
-+		if (ent->h_addr_list[1]) {
-+			fprintf(stderr, "%s resolved to mutiple addresses: ",
-+				argv[optind]);
-+		}
-+		fprintf(stderr, "checking %s\n", inet_ntoa(a));
-+	} else {
-+		if (!inet_aton(argv[optind], &a))
-+			fail++;
-+	}
-+
-+	if (fail) {
- 		fprintf( stderr, "%s: invalid IP address\n", progname );
- 		usage();	
- 		return -1;
-@@ -383,7 +404,7 @@
- 
  	for( ptr = rblsites; ptr != NULL; ptr = ptr->next )
  	{
+-		if( sscanf( addr, "%d.%d.%d.%d", &a, &b, &c, &d ) != 4
+-		  || a < 0 || a > 255 || b < 0 || b > 255 || c < 0 || c > 255
+-		  || d < 0 || d > 255 )
+-		{
++		fail = 0;
++		if ((ent = gethostbyname(addr)) != NULL) {
++			memcpy(&a, ent->h_addr_list[0], sizeof(a));
++			if (ent->h_addr_list[1]) {
++				if (!quiet && rblchecking == 0)
++					fprintf(stderr,
++					    "%s resolved to mutiple addresses: ",
++					    addr);
++			}
++			if (!quiet && rblchecking++ == 0)
++				fprintf(stderr, "checking %s\n", inet_ntoa(a));
++		} else {
++			if (!inet_aton(addr, &a))
++				fail++;
++		}
++
++		if (fail) {
+ 			fprintf( stderr, "%s: warning: invalid address `%s'\n",
+ 			  progname, addr );
+ 			return 0;
+ 		}
 -		response = rblcheck( a, b, c, d, ptr->site, txt );
 +		response = rblcheck( a, ptr->site, txt );
- 		printf( "%s%s%s%s%s%s", !quiet && !response ? "not " : "",
- 		  !quiet ? "RBL filtered by " : "", !quiet ? ptr->site : "",
- 		  txt && response && strlen( response ) && !quiet ? ": " : "",
+ 		if( !quiet || response )
+ 			printf( "%s %s%s%s%s%s%s", addr,
+ 			  ( !quiet && !response ? "not " : "" ),
Index: patches/patch-ab
===================================================================
RCS file: patches/patch-ab
diff -N patches/patch-ab
--- patches/patch-ab	26 Dec 1999 18:39:02 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,10 +0,0 @@
-$NetBSD: patch-ab,v 1.2 1999/12/26 18:39:02 itojun Exp $
-
---- Makefile.orig	Thu Aug 20 01:47:03 1998
-+++ Makefile	Wed Nov  4 15:56:48 1998
-@@ -41,4 +41,3 @@
- # below for an entry for your system.
--CC=gcc
--CFLAGS=-O -Wall
-+CFLAGS+=-Wall
- LDFLAGS=-s
-----End rblcheck-1.5.diff-----