Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Feb 2003 16:09:40 +0100 (CET)
From:      Matthias Andree <matthias.andree@web.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/48670: maintainer update: (fixes pkg-*) news/leafnode -> 1.9.35_1 
Message-ID:  <200302251509.h1PF9eEr041254@libertas.emma.line.org>

next in thread | raw e-mail | index | archive | help

>Number:         48670
>Category:       ports
>Synopsis:       maintainer update: (fixes pkg-*) news/leafnode -> 1.9.35_1
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 25 07:10:09 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 4.8-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD libertas.emma.line.org 4.8-PRERELEASE FreeBSD 4.8-PRERELEASE #15: Tue Feb 25 00:45:38 CET 2003 toor@libertas.emma.line.org:/usr/src/sys/compile/LIBERTAS i386


	
>Description:
* Add upstream patch to fix fetchnews going out of sync with server when
  an article is filtered out and make minor documentation fixes.
  These patches are from the upcoming leafnode-1.9.36 version. 
* LOCALBASE -> PREFIX
* Fix extra files after uninstall
* Add "deinstall for good" instructions.
* Use the more efficient quickmkdir program from pkg-install.
* Move spooldir into ${PREFIX} and lockfile into ${SPOOLDIR}
  (compatibility hack for ports that aren't turned into packages to allow for
   continued use of /var/spool/news for ${SPOOLDIR} is in place)
* Execute pkg-install stuff only once (in POST-INSTALL phase).
	
>How-To-Repeat:
	
>Fix:

diff -Nur /usr/ports/news/leafnode/Makefile /root/leafnode/Makefile
--- /usr/ports/news/leafnode/Makefile	Mon Feb 24 22:03:33 2003
+++ /root/leafnode/Makefile	Tue Feb 25 15:47:18 2003
@@ -2,12 +2,12 @@
 # Whom:			Brian Somers <brian@FreeBSD.org>
 # Date created:		1997-06-27
 #
-# $FreeBSD: ports/news/leafnode/Makefile,v 1.33 2003/02/22 15:56:02 leeym Exp $
+# $FreeBSD: ports/news/leafnode/Makefile,v 1.31 2003/02/19 01:21:08 leeym Exp $
 #
 
 PORTNAME=	leafnode
 PORTVERSION=	1.9.35
-PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	news ipv6
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:S/$/:sourceforge/} \
 		http://www.dt.e-technik.uni-dortmund.de/~ma/${PORTNAME}/ \
@@ -24,32 +24,41 @@
 
 LIB_DEPENDS=	pcre.0:${PORTSDIR}/devel/pcre
 
+.if exists(/var/spool/news) && !defined(PACKAGE_BUILDING)
+LEAFNODE_SPOOLDIR?=/var/spool/news
+.endif
+LEAFNODE_SPOOLDIR?=${PREFIX}/var/spool/leafnode
+PLIST_SUB=	SPOOLDIR=${LEAFNODE_SPOOLDIR}
+
 USE_BZIP2=	yes
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--quiet --sysconfdir=${LOCALBASE}/etc/leafnode \
-		--with-lockfile=/var/spool/lock/news/leafnode.lck \
-		--with-spooldir=/var/spool/news --with-ipv6
+CONFIGURE_ARGS=	--quiet --prefix=${PREFIX} --sysconfdir=${PREFIX}/etc/leafnode \
+		--with-lockfile=${LEAFNODE_SPOOLDIR}/leaf.node/lock.file \
+		--with-spooldir=${LEAFNODE_SPOOLDIR} --with-ipv6
 CONFIGURE_TARGET=    --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 MAKE_ARGS=
 MAN1=		leafnode-version.1 newsq.1
 MAN8=		applyfilter.8 checkgroups.8 fetchnews.8 leafnode.8 texpire.8
 
 post-install:
-		${INSTALL_SCRIPT} ${WRKSRC}/setup-daemontools.sh ${LOCALBASE}/sbin/
+		${INSTALL_PROGRAM} ${WRKSRC}/quickmkdir ${PREFIX}/sbin/
+		${INSTALL_SCRIPT} ${WRKSRC}/setup-daemontools.sh ${PREFIX}/sbin/
 .if !defined(NOPORTDOCS)
-		${MKDIR} ${LOCALBASE}/share/doc/${PORTNAME}
+		${MKDIR} ${PREFIX}/share/doc/${PORTNAME}
 		for i in ChangeLog COPYING CREDITS FAQ.txt FAQ.pdf FAQ.html \
 			 INSTALL NEWS README \
 			 README-FQDN README-FQDN.html README-daemontools \
 			 README.FIRST TODO leafnode.cron.daily ; do \
 		  ${INSTALL_MAN} ${WRKSRC}/$$i \
-			${LOCALBASE}/share/doc/${PORTNAME} ; done
-		${MKDIR} ${LOCALBASE}/share/doc/${PORTNAME}/doc_german
+			${PREFIX}/share/doc/${PORTNAME} ; done
+		${MKDIR} ${PREFIX}/share/doc/${PORTNAME}/doc_german
 		for i in INSTALL_de LIESMICH-daemontools README \
 			README_de newsq.1 ${MAN8} ; do \
 		  ${INSTALL_MAN} ${WRKSRC}/doc_german/$$i \
-			${LOCALBASE}/share/doc/${PORTNAME}/doc_german ; done
+			${PREFIX}/share/doc/${PORTNAME}/doc_german ; done
 .endif
 		${CAT} pkg-message
+		PKG_PREFIX=${PREFIX} SPOOLDIR=${LEAFNODE_SPOOLDIR} \
+			${SH} pkg-install ${PORTNAME} POST-INSTALL
 
 .include <bsd.port.mk>
diff -Nur /usr/ports/news/leafnode/files/patch-aa /root/leafnode/files/patch-aa
--- /usr/ports/news/leafnode/files/patch-aa	Thu Jan  1 01:00:00 1970
+++ /root/leafnode/files/patch-aa	Tue Feb 25 15:27:01 2003
@@ -0,0 +1,182 @@
+Index: README
+===================================================================
+RCS file: /var/CVS/leafnode-1/README,v
+retrieving revision 1.24
+retrieving revision 1.25
+diff -u -u -r1.24 -r1.25
+--- README	18 Feb 2003 23:29:20 -0000	1.24
++++ README	24 Feb 2003 16:41:20 -0000	1.25
+@@ -170,9 +170,8 @@
+ Note: some things have changed in 1.9.20.
+ 
+ 1. Fetchnews now tries to send XOVER to figure which articles to
+-   download, older versions only used XHDR. If that's unsuitable for
+-   a certain server, write "preferxhdr=1" just below your server= line
+-   for that particular server.
++   download, older versions only used XHDR. Leafnode will automatically fall
++   back to using XHDR if XOVER fails.
+ 
+ 2. Most leafnode programs enforce a fully-qualified unique domain name
+    and exit if gethostbyname("HOSTNAME") does not yield one. (HOSTNAME
+
+Index: fetchnews.c
+===================================================================
+RCS file: /var/CVS/leafnode-1/fetchnews.c,v
+retrieving revision 1.94
+retrieving revision 1.95
+diff -u -u -r1.94 -r1.95
+--- fetchnews.c	28 Jan 2003 14:14:04 -0000	1.94
++++ fetchnews.c	24 Feb 2003 23:49:02 -0000	1.95
+@@ -967,8 +967,10 @@
+ 	xsnprintf(lineout, SIZE_lineout, "%s %lu\r\n", cmd, stufftoget[i]);
+ 	putaline();
+ 	l = getaline(nntpin);
+-	if (!l)			/* timeout */
++	/* timeout */
++	if (!l)
+ 	    return server;
++	/* check proper reply code */
+ 	if (sscanf(l, "%3ld %lu", &n, &h) < 2 || ((n / 10) != 22)) {
+ 	    if (verbose > 2)
+ 		printf("%s %s %lu: reply %s (%ld more up in the air)\n",
+@@ -978,6 +980,9 @@
+ 	    continue;
+ 	}
+ 
++	/* anything below this line will have to make sure that data is
++	 * drained properly in case */
++
+ 	debug = 0;
+ 	if (verbose > 2)
+ 	    printf("%s: receiving article %lu (%ld more up in the air)\n",
+@@ -1026,8 +1031,7 @@
+ 	    free(l);
+ 
+ 	if (!takethis) {
+-	    if (requested_body)
+-		ignore_answer(nntpin);
++	    if (requested_body) ignore_answer(nntpin);
+ 	    continue;		/* filtered article */
+ 	}
+ 
+@@ -1045,6 +1049,7 @@
+ 		       "Discarding article %lu - no %s found",
+ 		       stufftoget[i], hnames[h]);
+ 		killed++;
++		if (requested_body) ignore_answer(nntpin);
+ 		continue;
+ 	    }
+ 	}
+@@ -1056,6 +1061,7 @@
+ 	    syslog(LOG_INFO, "Discarding article %lu %s - older than %d days",
+ 		   stufftoget[i], hd[4], localmaxage);
+ 	    killed++;
++	    if (requested_body) ignore_answer(nntpin);
+ 	    continue;
+ 	}
+ 	if (minlines || maxlines) {
+@@ -1071,6 +1077,7 @@
+ 			   "Discarding article %lu %s -- %ld < minlines",
+ 			   stufftoget[i], hd[4], n);
+ 		    killed++;
++		    if (requested_body) ignore_answer(nntpin);
+ 		    continue;
+ 		}
+ 		if (maxlines && n > maxlines) {
+@@ -1081,6 +1088,7 @@
+ 			   "Discarding article %lu %s -- %ld > maxlines",
+ 			   stufftoget[i], hd[4], n);
+ 		    killed++;
++		    if (requested_body) ignore_answer(nntpin);
+ 		    continue;
+ 		}
+ 	    }
+@@ -1102,6 +1110,7 @@
+ 		       "Discarding article %lu %s - posted to %ld groups "
+ 		       "(max. %ld)", stufftoget[i], hd[4], n, crosspostlimit);
+ 		killed++;
++		if (requested_body) ignore_answer(nntpin);
+ 		continue;
+ 	    }
+ 	}
+@@ -1112,11 +1121,13 @@
+ 
+ 	if (!c) {
+ 	    syslog(LOG_ERR, "lookup of %s failed", hd[1]);
++	    if (requested_body) ignore_answer(nntpin);
+ 	    continue;
+ 	}
+ 
+ 	if (!stat(c, &st)) {
+ 	    syslog(LOG_INFO, "article %s already stored", c);
++	    if (requested_body) ignore_answer(nntpin);
+ 	    continue;		/* for some reasons, article is already there */
+ 	} else if (errno == ENOENT) {
+ 	    if ((f = fopen(c, "w")) == NULL) {
+@@ -1140,12 +1151,14 @@
+ 		syslog(LOG_ERR, "unable to create article %s: %m", c);
+ 		if (verbose)
+ 		    printf("unable to create article %s\n", c);
++		if (requested_body) ignore_answer(nntpin);
+ 		continue;
+ 	    }
+ 	} else {
+ 	    syslog(LOG_ERR, "unable to store article %s: %m", c);
+ 	    if (verbose)
+ 		printf("unable to store article %s\n", c);
++	    if (requested_body) ignore_answer(nntpin);
+ 	    continue;
+ 	}
+ 
+@@ -1177,6 +1190,7 @@
+ 	if (fflush(f)) {
+ 	    (void)fclose(f);
+ 	    (void)unlink(c);
++	    if (requested_body) ignore_answer(nntpin);
+ 	    continue;
+ 	}
+ 
+Index: texpire.8.in
+===================================================================
+RCS file: /var/CVS/leafnode-1/texpire.8.in,v
+retrieving revision 1.10
+retrieving revision 1.11
+diff -u -u -r1.10 -r1.11
+--- texpire.8.in	22 Aug 2002 14:34:07 -0000	1.10
++++ texpire.8.in	22 Feb 2003 16:58:56 -0000	1.11
+@@ -7,7 +7,7 @@
+ .\" Use, modification and distribution is allowed without limitation,
+ .\" warranty, or liability of any kind.
+ .\"
+-.\" $Id: texpire.8.in,v 1.10 2002/08/22 14:34:07 ralf Exp $
++.\" $Id: texpire.8.in,v 1.11 2003/02/22 16:58:56 emma Exp $
+ .\"
+ .\" hilit19 is stupid: "
+ .SH NAME
+@@ -26,7 +26,7 @@
+ The design of
+ .B leafnode
+ is intended to repair any problems itself, to detect what newsgroups
+-the users read, and to require no manual manual maintenance.
++the users read, and to require no manual maintenance.
+ .PP
+ .B Texpire
+ is the program which deletes old articles from the local news spool.
+Index: doc_german/README_de
+===================================================================
+RCS file: /var/CVS/leafnode-1/doc_german/README_de,v
+retrieving revision 1.3
+retrieving revision 1.4
+diff -u -u -r1.3 -r1.4
+--- doc_german/README_de	22 Aug 2002 15:25:24 -0000	1.3
++++ doc_german/README_de	24 Feb 2003 16:42:15 -0000	1.4
+@@ -188,8 +188,7 @@
+ 1. fetchnews verwendet nun auch den XOVER-Befehl, um zu schauen, welche
+    neuen Artikel der/die Upstream-Server vorhalten; vorher wurde lediglich
+    XHDR verwendet.  Sollte einer Ihrer Upstream-Server den XOVER-Befehl
+-   nicht verstehen, so schreiben Sie "preferxhdr=1" unter die server=
+-   Zeile in die Konfigurationsdatei.
++   nicht verstehen, wird Leafnode stattdessen automatisch XHDR verwenden.
+ 
+ 2. Die meisten Leafnode-Programme verlangen die Einstellung eines voll
+    qualifizierten Domainnamens ("fully qualified domain name", FQDN) und
diff -Nur /usr/ports/news/leafnode/pkg-install /root/leafnode/pkg-install
--- /usr/ports/news/leafnode/pkg-install	Fri Aug 23 17:19:12 2002
+++ /root/leafnode/pkg-install	Tue Feb 25 15:44:00 2003
@@ -1,31 +1,32 @@
 #! /bin/sh
 
-SPOOLDIR=${VAR:=/var}/spool/news
-LOCKFILE=$VAR/spool/lock/news/fetch.lck
-LIBDIR=${PREFIX:=/usr/local}/lib/leafnode
-
-mkdir -p `dirname $LOCKFILE`
-mkdir -p $SPOOLDIR $LIBDIR
-mkdir -p $SPOOLDIR/leaf.node
-mkdir -p $SPOOLDIR/message.id
-mkdir -p $SPOOLDIR/interesting.groups
-mkdir -p $SPOOLDIR/out.going
-chown news:news `dirname $LOCKFILE`
-chown news:news $SPOOLDIR $LIBDIR
-chown news:news $SPOOLDIR/leaf.node
-chown news:news $SPOOLDIR/message.id
-chown news:news $SPOOLDIR/interesting.groups
-chown news:news $SPOOLDIR/out.going
-cd $SPOOLDIR/message.id
-for a in 0 1 2 3 4 5 6 7 8 9 ; do
-	for b in 0 1 2 3 4 5 6 7 8 9 ; do
-		mkdir -p ${a}${b}0 ${a}${b}1 ${a}${b}2 \
-			${a}${b}3 ${a}${b}4 ${a}${b}5 \
-			${a}${b}6 ${a}${b}7 ${a}${b}8 \
-			${a}${b}9
-		chown news:news ${a}${b}0 ${a}${b}1 ${a}${b}2 \
-			${a}${b}3 ${a}${b}4 ${a}${b}5 \
-			${a}${b}6 ${a}${b}7 ${a}${b}8 \
-			${a}${b}9 ; \
-	done
-done
+case $2 in
+PRE-INSTALL)
+	;;
+POST-INSTALL)
+	SPOOLDIR=${SPOOLDIR:=${PKG_PREFIX}/var/spool/leafnode}
+	LOCKFILE=${SPOOLDIR}/leaf.node/lock.file
+	
+	mkdir -p `dirname $LOCKFILE`
+	mkdir -p $SPOOLDIR
+	mkdir -p $SPOOLDIR/failed.postings
+	mkdir -p $SPOOLDIR/leaf.node
+	mkdir -p $SPOOLDIR/message.id
+	mkdir -p $SPOOLDIR/interesting.groups
+	mkdir -p $SPOOLDIR/out.going
+	mkdir -p $SPOOLDIR/temp.files
+	chown news:news `dirname $LOCKFILE`
+	chown news:news $SPOOLDIR
+	chown news:news $SPOOLDIR/failed.postings
+	chown news:news $SPOOLDIR/leaf.node
+	chown news:news $SPOOLDIR/message.id
+	chown news:news $SPOOLDIR/interesting.groups
+	chown news:news $SPOOLDIR/out.going
+	chown news:news $SPOOLDIR/temp.files
+	${PKG_PREFIX}/sbin/quickmkdir
+	;;
+*)
+	echo >&2 "Unknown argument in $0 $@"
+	exit 1
+	;;
+esac
diff -Nur /usr/ports/news/leafnode/pkg-plist /root/leafnode/pkg-plist
--- /usr/ports/news/leafnode/pkg-plist	Thu Jan  2 13:07:07 2003
+++ /root/leafnode/pkg-plist	Tue Feb 25 15:50:19 2003
@@ -14,6 +14,7 @@
 sbin/checkgroups
 sbin/applyfilter
 sbin/setup-daemontools.sh
+sbin/quickmkdir
 share/doc/leafnode/ChangeLog
 share/doc/leafnode/COPYING
 share/doc/leafnode/CREDITS
@@ -41,5 +42,19 @@
 share/doc/leafnode/doc_german/texpire.8
 @dirrm share/doc/leafnode/doc_german
 @dirrm share/doc/leafnode
-@unexec rmdir %D/lib/leafnode 2>/dev/null || true
+@comment only remove these when empty:
+@unexec rm -f %%SPOOLDIR%%/leaf.node/lock.file
+@unexec rmdir %%SPOOLDIR%%/failed.postings 2>/dev/null || :
+@unexec rmdir %%SPOOLDIR%%/failed.postings 2>/dev/null || :
+@unexec rmdir %%SPOOLDIR%%/leaf.node 2>/dev/null || :
+@unexec rmdir %%SPOOLDIR%%/message.id/* 2>/dev/null || :
+@unexec rmdir %%SPOOLDIR%%/message.id 2>/dev/null || :
+@unexec rmdir %%SPOOLDIR%%/interesting.groups 2>/dev/null || :
+@unexec rmdir %%SPOOLDIR%%/out.going 2>/dev/null || :
+@unexec rmdir %%SPOOLDIR%%/temp.files 2>/dev/null || :
+@unexec rmdir %%SPOOLDIR%% 2>/dev/null || :
+@unexec rmdir %%PREFIX%%/var/spool 2>/dev/null || :
+@unexec rmdir %%PREFIX%%/var 2>/dev/null || :
+@unexec rmdir %D/lib/leafnode 2>/dev/null || :
 @dirrm etc/leafnode
+@unexec if test -d "%%SPOOLDIR%%" ; then echo ; echo "==================================================" ; echo "If you want to remove leafnode for good," ; echo "type: rm -rf %%SPOOLDIR%%" ; echo "==================================================" ; fi
	


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302251509.h1PF9eEr041254>