[Midnightbsd-cvs] mports: mports/news: Add newsfetch.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri May 30 22:56:29 EDT 2008


Log Message:
-----------
Add newsfetch.

Modified Files:
--------------
    mports/news:
        Makefile (r1.2 -> r1.3)

Added Files:
-----------
    mports/news/newsfetch:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-descr (r1.1)
    mports/news/newsfetch/files:
        patch-ab (r1.1)
        patch-ac (r1.1)
        patch-nntp.c (r1.1)
        patch-opt.c (r1.1)
        patch-util.c (r1.1)

-------------- next part --------------
--- /dev/null
+++ news/newsfetch/pkg-descr
@@ -0,0 +1,3 @@
+Newsfetch pulls news from an NNTP server and writes the articles to a file
+or pipes them to the specified command. The file created by newsfetch can be
+used with any mail reader.
--- /dev/null
+++ news/newsfetch/Makefile
@@ -0,0 +1,33 @@
+# New ports collection makefile for:	newsfetch
+# Date created:		12 September 1997
+# Whom:			Jun-ichiro itojun Itoh <itojun at itojun.org>
+#
+# $MidnightBSD: mports/news/newsfetch/Makefile,v 1.1 2008/05/31 02:56:27 laffer1 Exp $
+# $FreeBSD: ports/news/newsfetch/Makefile,v 1.20 2005/11/11 20:41:17 pav Exp $
+#
+
+PORTNAME=	newsfetch
+PORTVERSION=	1.21
+PORTREVISION=	0
+CATEGORIES=	news
+MASTER_SITES=	${MASTER_SITE_SUNSITE}
+MASTER_SITE_SUBDIR=	system/news/readers
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Download news articles from NNTP server
+LICENSE=	other
+
+MAKE_ENV=	BINDIR="${PREFIX}/bin" MANDIR="${PREFIX}/man/man"
+
+MAN1=		newsfetch.1
+MANCOMPRESSED=	maybe
+PLIST_FILES=	bin/newsfetch
+
+do-configure:
+	cd ${WRKSRC} && ( \
+	${ECHO_CMD} "PROG= newsfetch"; \
+	${ECHO_CMD} "SRCS=" *.c; \
+	${ECHO_CMD} ".include <bsd.prog.mk>"; \
+	) > Makefile
+
+.include <bsd.port.mk>
--- /dev/null
+++ news/newsfetch/distinfo
@@ -0,0 +1,3 @@
+MD5 (newsfetch-1.21.tar.gz) = e343a34d50d0c304f939938a8ee6cbaf
+SHA256 (newsfetch-1.21.tar.gz) = 4cf8ad372adfbdfdf6f85311adecebe45a8f54a2f8c21de04a3cf604185872d2
+SIZE (newsfetch-1.21.tar.gz) = 10758
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/news/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -L news/Makefile -L news/Makefile -u -r1.2 -r1.3
--- news/Makefile
+++ news/Makefile
@@ -3,6 +3,7 @@
 
     COMMENT = Network news
 
+    SUBDIR += newsfetch
     SUBDIR += slrn
     SUBDIR += tin
 
--- /dev/null
+++ news/newsfetch/files/patch-opt.c
@@ -0,0 +1,13 @@
+--- opt.c.orig	Wed Nov 19 19:01:47 2003
++++ opt.c	Wed Nov 19 19:01:47 2003
+@@ -192,8 +192,8 @@
+ {
+ 
+ char *options=
+-"	[-clsyvV] [-d dirname] [-f rcfile] [-t N] 
+-	[-T timeout] [-w M ] [-pPY filter] [-x command]
++"	[-clsyvV] [-d dirname] [-f rcfile] [-t N]\n\
++	[-T timeout] [-w M ] [-pPY filter] [-x command]\n\
+ ";	
+ 		fprintf(stderr,"Usage: %s nntp_server [options]\n", prog_name);
+ 		fprintf(stderr,"Options:\n%s\n",options);
--- /dev/null
+++ news/newsfetch/files/patch-nntp.c
@@ -0,0 +1,106 @@
+--- nntp.c.orig	Thu Jul 23 12:03:11 1998
++++ nntp.c	Thu Jan 27 17:19:01 2005
+@@ -20,6 +20,7 @@
+ 
+ char *header;
+ #define MAXBUFSIZE 500
++#define GROUP_FMT "%99s"
+ char command_buf[MAXBUFSIZE+1];
+ 
+ readNNTPdata()
+@@ -33,7 +34,7 @@
+ {
+ 	/* dummy read to flush input */
+ 	readNNTPdata();
+-	fprintf(socket_fp[0],"MODE READER\n");
++	fprintf(socket_fp[0],"MODE READER\r\n");
+ 	readNNTPdata();
+ return(get_error(command_buf));
+ }
+@@ -140,7 +141,8 @@
+ 	else
+ 		fprintf(rctmpfp,"%s",command_buf);
+ 	}
+-	items_read=sscanf(command_buf,"%s %d %d", group, &first_article, &max_article);
++	items_read=sscanf(command_buf,GROUP_FMT "%d %d", group, &first_article, &max_article);
++	group[sizeof(group)-1] = '\0';
+ 	if(items_read < 2)
+ 		return(0);
+ return(items_read);
+@@ -151,7 +153,7 @@
+ int first_art, last_art, total_art, tmp ;
+ 
+ 	fprintf(stderr,"%s: ",group);
+-	fprintf(socket_fp[0],"GROUP %s\n",group);
++	fprintf(socket_fp[0],"GROUP %s\r\n",group);
+ 	readNNTPdata();
+ 	
+ 	#ifdef DEBUG
+@@ -180,7 +182,7 @@
+ 		first_article = last_art - max_article + 1;
+ 	}
+ 	
+-	fprintf(socket_fp[0],"STAT %d\n",first_article);
++	fprintf(socket_fp[0],"STAT %d\r\n",first_article);
+ 	readNNTPdata();
+ 
+ 	while(!get_error1(command_buf))
+@@ -196,7 +198,7 @@
+ 			return(0); 
+ 			}
+ 
+-		fprintf(socket_fp[0],"STAT %d\n",first_article);
++		fprintf(socket_fp[0],"STAT %d\r\n",first_article);
+ 		readNNTPdata();
+ 		}
+ 	fprintf(stderr,"articles %d to %d\n",first_article,last_art);
+@@ -256,7 +258,7 @@
+ 		fprintf(stderr,"                                    %c",0xd);
+ 	}
+ 
+-	fprintf(socket_fp[0],"ARTICLE\n");
++	fprintf(socket_fp[0],"ARTICLE\r\n");
+ 	readNNTPdata();
+ 	if(!get_error(command_buf))
+ 		return(0);	
+@@ -275,7 +277,7 @@
+ 		}
+ 
+ 	/* Make it little fast */
+-	fprintf(socket_fp[0],"NEXT\n");
++	fprintf(socket_fp[0],"NEXT\r\n");
+ 
+ 	article_fetching=1;
+ 
+@@ -329,17 +331,19 @@
+ char groupname[100];
+ 
+ 	fprintf(stderr, "\nList of NewsGroups:\n"); 
+-	fprintf(socket_fp[0],"LIST\n");
++	fprintf(socket_fp[0],"LIST\r\n");
+ 	readNNTPdata();
+ 	if(!get_error2(command_buf))
+ 		exit(1);	
+ 	readNNTPdata();
+-	sscanf(command_buf,"%s",groupname);
++	sscanf(command_buf,GROUP_FMT,groupname);
++	groupname[sizeof(groupname)-1] = '\0';
+ 	while(command_buf[0] != '.' || command_buf[1] != 13 )/*|| command_buf[1] != 10)*/
+ 		{
+ 		fprintf(stderr,"%s\n",groupname);
+ 		readNNTPdata();
+-		sscanf(command_buf,"%s",groupname);
++		sscanf(command_buf,GROUP_FMT,groupname);
++		groupname[sizeof(groupname)-1] = '\0';
+ 		}
+ exit(1);
+ 
+@@ -348,7 +352,7 @@
+ sendQuit()
+ {
+ 
+-	fprintf(socket_fp[0],"QUIT\n");
++	fprintf(socket_fp[0],"QUIT\r\n");
+ 	readNNTPdata();
+ }
+ 
--- /dev/null
+++ news/newsfetch/files/patch-ac
@@ -0,0 +1,11 @@
+--- newsfetch.1.orig	Tue Apr 14 20:04:25 1998
++++ newsfetch.1	Fri Jan 26 23:41:22 2001
+@@ -5,7 +5,7 @@
+ .SH SYNOPSIS
+ .B newsfetch
+ .BI
+-hostname
++hostname[:port]
+ [
+ .BI \-clsyvV
+ ]
--- /dev/null
+++ news/newsfetch/files/patch-ab
@@ -0,0 +1,44 @@
+--- newsfetch.c.orig	Thu Jul 23 18:28:56 1998
++++ newsfetch.c	Fri Jan 26 23:41:22 2001
+@@ -7,6 +7,7 @@
+ 
+  
+ #include <stdio.h>
++#include <string.h>
+ #include <signal.h>
+ #include <pwd.h>
+ #include <sys/types.h>
+@@ -28,6 +29,7 @@
+ int wait_after_articles = 0, articles_fetched=0, last_than_current;
+ int wait_for_time = 0, timeout=READ_TIMEOUT, article_fetching=0;
+ int cleanup=1, max_article, news_target=0, first_article, only_list=0;
++int port = 119;
+ char group[100], pipe_command[100];
+ FILE *rcfp, *rctmpfp, *socket_fp[2];
+ char lockfile[100];
+@@ -59,6 +61,16 @@
+ 	getHomedir(homedir);
+ 	strcpy(hostname,argv[1]);
+ 
++	{
++	  char *p;
++	  int n;
++
++	  if (NULL != (p = strchr(hostname, ':')) && 0 < (n = atoi(p + 1))) {
++	    port = n;
++	    *p = '\0';
++	  }
++	}
++
+ 	get_commandline(argc, argv, dirname, rcfile,
+                 &cleanup, &wait_after_articles, &wait_for_time, 
+ 		&command_flag, execute_command,
+@@ -75,7 +87,7 @@
+ 			generateProcmailrc(homedir, rcfile, dirname, pipe_command);
+ 		}
+ 
+-	socket_id=ConnectServer(hostname,119, 0);
++	socket_id=ConnectServer(hostname, port, 0);
+ 
+ 	/* two file descriptor are for portability among diff systems */
+ 	createFd(socket_id, socket_fp);
--- /dev/null
+++ news/newsfetch/files/patch-util.c
@@ -0,0 +1,27 @@
+--- util.c.orig	Wed Nov 19 19:01:47 2003
++++ util.c	Wed Nov 19 19:01:47 2003
+@@ -61,15 +61,15 @@
+ FILE *fp, *fp1, *fp2;
+ char *tmp, buf[200], group[180], filterfile[100], procmailrcfile[100];
+ int i,j;
+-char *title="
+-
+-############### Generated by  Newsfetch ##############################
+-# New version of Newsfetch is available from                         #
+-#                                                                    #
+-#        http://ulf.wep.net/newsfetch.html                           #
+-# Feedback and Comments to Yusuf Motiwala <yusuf at scientist.com>      #
+-######################################################################
+-
++char *title="\n\
++\n\
++############### Generated by  Newsfetch ##############################\n\
++# New version of Newsfetch is available from                         #\n\
++#                                                                    #\n\
++#        http://ulf.wep.net/newsfetch.html                           #\n\
++# Feedback and Comments to Yusuf Motiwala <yusuf at scientist.com>      #\n\
++######################################################################\n\
++\n\
+ ";								     
+ 
+        	strcpy(filterfile,homedir);


More information about the Midnightbsd-cvs mailing list