ports/65392: [maintainer update]: dns/rbldnsd - small, fast RBL dns server

Paul Chvostek paul+fbsd at it.ca
Sat Apr 10 07:00:41 UTC 2004


>Number:         65392
>Category:       ports
>Synopsis:       [maintainer update]: dns/rbldnsd - small, fast RBL dns server
>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:   Sat Apr 10 00:00:40 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Paul Chvostek
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
>Environment:
System: FreeBSD foo.it.ca 4.9-STABLE FreeBSD 4.9-STABLE #0: Sat Nov 15 16:25:16 EST 2003 paul at foo.it.ca:/usr/obj/usr/src/sys/foo i386


	
>Description:
	- upgrade version to 0.992
	- switch to rc.subr start mechanism
	- added user/group
	- added example data on install, target directory
	- added pkg-message
	- added more doc files

	I've done some odd stuff with substring processing in
	files/rbldnsd.sh, and invite comment.

>How-To-Repeat:
	n/a
>Fix:

	

--- rbldnsd.diff.0992 begins here ---
diff -ruN /usr/ports/dns/rbldnsd/Makefile ./rbldnsd/Makefile
--- /usr/ports/dns/rbldnsd/Makefile	Wed Mar 17 14:36:57 2004
+++ ./rbldnsd/Makefile	Sat Apr 10 02:36:13 2004
@@ -2,11 +2,11 @@
 # Date created:				Fri Jun 13 05:30:12 EDT 2003
 # Whom:					Paul Chvostek <paul at it.ca>
 #
-# $FreeBSD: ports/dns/rbldnsd/Makefile,v 1.4 2004/03/06 11:33:55 kris Exp $
+# $FreeBSD: ports/dns/rbldnsd/Makefile,v 1.2 2004/01/19 18:40:30 krion Exp $
 #
 
 PORTNAME=	rbldnsd
-PORTVERSION=	0.991
+PORTVERSION=	0.992
 CATEGORIES=	dns
 MASTER_SITES=	http://www.corpit.ru/mjt/rbldnsd/:0 \
 		http://www.it.ca/~paul/src/:0
@@ -23,11 +23,39 @@
 IGNOREFILES+=	rbldnsd.html
 .endif
 
+RBLDNSUSER=	rbldns
+RBLDNSGROUP=	${RBLDNSUSER}
+ROOTDIR=	${PREFIX}/etc/rbldnsd/
+
 MAN8=		rbldnsd.8
 
 HAS_CONFIGURE=	yes
 
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 500038
+RC_SUBR?=       /etc/rc.subr
+.else
+USE_RC_SUBR=    yes
+.endif
+
+SED_SCRIPT+=	-e 's,%%PREFIX%%,${PREFIX},g' \
+		-e 's,%%RC_SUBR%%,${RC_SUBR},g'
+
+post-build:
+		@${SED} ${SED_SCRIPT} <${FILESDIR}/rbldnsd.sh >${WRKSRC}/rbldnsd.sh
+
+pre-install:
+		@${ECHO} "==>  Creating custom user to run rbldnsd..."
+		${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
 do-install:
+		@if [ ! -d ${ROOTDIR} ]; then \
+			${MKDIR} ${ROOTDIR}; \
+			${CHMOD} 710 ${ROOTDIR}; \
+			${CHGRP} ${RBLDNSGROUP} ${ROOTDIR}; \
+		fi
+		@${INSTALL_DATA} -g ${RBLDNSUSER} -m 640 ${FILESDIR}/example ${PREFIX}/etc/rbldnsd/
 		@${INSTALL_PROGRAM} ${WRKSRC}/rbldnsd ${PREFIX}/sbin/
 		@${INSTALL_MAN} ${WRKSRC}/rbldnsd.8 ${PREFIX}/man/man8/
 .if !defined(NOPORTDOCS)
@@ -35,8 +63,16 @@
 		@${INSTALL_DATA} ${WRKSRC}/CHANGES-0.81 ${DOCSDIR}
 		@${INSTALL_DATA} ${WRKSRC}/TODO ${DOCSDIR}
 		@${INSTALL_DATA} ${WRKSRC}/NEWS ${DOCSDIR}
+		@${INSTALL_DATA} ${WRKSRC}/debian/changelog ${DOCSDIR}
+		@${INSTALL_DATA} ${WRKSRC}/debian/copyright ${DOCSDIR}
+		@${INSTALL_DATA} ${WRKSRC}/debian/rbldnsd.default ${DOCSDIR}
+		@${INSTALL_DATA} ${WRKSRC}/debian/rbldnsd.init ${DOCSDIR}
 		@${INSTALL_DATA} ${WRKSRC}/rbldnsd.spec ${DOCSDIR}
 		@${INSTALL_DATA} ${DISTDIR}/rbldnsd.html ${DOCSDIR}
 .endif
+		@${INSTALL_SCRIPT} -m 751 ${WRKSRC}/rbldnsd.sh ${PREFIX}/etc/rc.d/rbldnsd.sh
+
+post-install:
+		@${SED} ${SED_SCRIPT} < ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ruN /usr/ports/dns/rbldnsd/distinfo ./rbldnsd/distinfo
--- /usr/ports/dns/rbldnsd/distinfo	Wed Mar 17 14:36:57 2004
+++ ./rbldnsd/distinfo	Fri Apr  9 19:30:46 2004
@@ -1,3 +1,3 @@
-MD5 (rbldnsd_0.991.tar.gz) = f7c3642a92014e8a5712386fb32a2ab0
-SIZE (rbldnsd_0.991.tar.gz) = 78979
+MD5 (rbldnsd_0.992.tar.gz) = d2f3768efe301312abae6b2cbb185e24
+SIZE (rbldnsd_0.992.tar.gz) = 84629
 MD5 (rbldnsd.html) = IGNORE
diff -ruN /usr/ports/dns/rbldnsd/files/example ./rbldnsd/files/example
--- /usr/ports/dns/rbldnsd/files/example	Wed Dec 31 19:00:00 1969
+++ ./rbldnsd/files/example	Fri Apr  9 20:25:48 2004
@@ -0,0 +1,30 @@
+:127.0.0.2:Open relay, see http://relays.example.com/lookup?$
+# The above is a default or implicit value which is used when no value given
+# for an entry.  The `$' characters will be replaced by an IP address in
+# question.
+127.0.0.2
+# A simplest case: single IP address, with default value.
+10.8.60.0/24 :127.0.0.3:Address $ is from private IP range
+# Netblock - 256 IP addresses with it's own A and TXT records
+224/4        Reserved multicast address
+# Another netblock, with default A and explitit TXT values.
+192.168 Dialup pool, see http://dialups.example.com/lookup?$ for explanations
+# IP numbers may be abbreviated, the above is the same as 192.168.0.0/16
+10.10    :5:This network blocked due to massive spam issues
+# A value may be abbreviated as well - :5: is the same as :127.0.0.5:.
+10.10.5-129:5:Those hosts are nasty
+# repeat last octet: 10.10.5.0..10.10.129.255 inclusive
+!10.10.1.2
+# exclusion entry
+#
+# The following examples are for name-based zones.
+#example.com   :2:This domain has no working postmaster@ address
+#*.example.com :2:All subdomains of example.com lacks working abuse@ address
+# Simple and wildcarded entry, both will return 127.0.0.2 A record
+#
+# some specials
+$SOA 3000 ns1.example.com admin.example.com 0 600 300 86400 300
+# Start of authority record (TTL 3000), with serial (0) computed as
+# a timestamp of data file
+$NS 3000 ns1.example.com ns2.example.com
+# two nameservers
diff -ruN /usr/ports/dns/rbldnsd/files/rbldnsd.sh ./rbldnsd/files/rbldnsd.sh
--- /usr/ports/dns/rbldnsd/files/rbldnsd.sh	Wed Dec 31 19:00:00 1969
+++ ./rbldnsd/files/rbldnsd.sh	Sat Apr 10 02:42:37 2004
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+# PROVIDE: rbldnsd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD shutdown
+#
+# Add the following lines to /etc/rc.conf to enable rbldnsd:
+#
+#   rbldnsd_enable="YES"
+#
+# See rbldnsd(8) for flags.
+#
+
+. %%RC_SUBR%%
+
+name=rbldnsd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/rbldnsd
+pidfile=/var/run/rbldnsd.pid
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+  rm -f $pidfile
+}
+
+# set defaults, enforce pidfile by making it last option before db
+
+rbldnsd_enable=${rbldnsd_enable:-"NO"}
+rbldnsd_flags=${rbldnsd_flags:-"-r /usr/local/etc/rbldnsd -b 127.0.0.1 bl.example.com:ip4set:example"}
+rbldnsd_flags="${rbldnsd_flags% *} -p $pidfile ${rbldnsd_flags##* }"
+
+load_rc_config $name
+run_rc_command "$1"
+
diff -ruN /usr/ports/dns/rbldnsd/pkg-install ./rbldnsd/pkg-install
--- /usr/ports/dns/rbldnsd/pkg-install	Wed Dec 31 19:00:00 1969
+++ ./rbldnsd/pkg-install	Fri Apr  9 20:52:17 2004
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if [ "$2" != "PRE-INSTALL" ]; then
+    exit 0
+fi
+
+RBLDNSUSER=${RBLDNSUSER:-rbldns}
+RBLDNSGROUP=${RBLDNSGROUP:-rbldns}
+
+if ! pw groupshow "$RBLDNSGROUP" 2>/dev/null 1>&2; then
+	if pw groupadd $RBLDNSGROUP; then
+		echo "=> Added group \"$RBLDNSGROUP\"."
+	else
+                echo "=> Adding group \"$RBLDNSGROUP\" failed..."
+                exit 1
+        fi
+fi
+
+if ! pw usershow "$RBLDNSUSER" 2>/dev/null 1>&2; then
+        if pw useradd $RBLDNSUSER -g $RBLDNSGROUP -h - \
+                -s "/sbin/nologin" -d "/nonexistent" \
+                -c "rbldnsd pseudo-user"; \
+        then
+                echo "=> Added user \"$RBLDNSUSER\"."
+        else
+                echo "=> Adding user \"$RBLDNSUSER\" failed..."
+                exit 1
+        fi
+fi
+exit 0
diff -ruN /usr/ports/dns/rbldnsd/pkg-message ./rbldnsd/pkg-message
--- /usr/ports/dns/rbldnsd/pkg-message	Wed Dec 31 19:00:00 1969
+++ ./rbldnsd/pkg-message	Sat Apr 10 02:27:39 2004
@@ -0,0 +1,17 @@
+========================================================================
+   NOTICE    NOTICE    NOTICE    NOTICE    NOTICE    NOTICE    NOTICE
+========================================================================
+
+The rbldnsd port has been installed with an example zone file, located
+in %%PREFIX%%/etc/rbldnsd/.
+
+After starting the daemon with this example data, you should be able to
+test the success of your install with the command:
+
+	% host -a 1.1.168.192.bl.example.com. localhost
+or
+	% dig @localhost 1.1.168.192.bl.example.com. any
+
+If you see a response that mentions 127.0.0.2, the install worked!
+
+========================================================================
diff -ruN /usr/ports/dns/rbldnsd/pkg-plist ./rbldnsd/pkg-plist
--- /usr/ports/dns/rbldnsd/pkg-plist	Wed Jan 28 23:46:07 2004
+++ ./rbldnsd/pkg-plist	Sat Apr 10 02:34:35 2004
@@ -1,7 +1,14 @@
 sbin/rbldnsd
+etc/rbldnsd/example
+etc/rc.d/rbldnsd.sh
 %%PORTDOCS%%%%DOCSDIR%%/CHANGES-0.81
 %%PORTDOCS%%%%DOCSDIR%%/NEWS
 %%PORTDOCS%%%%DOCSDIR%%/TODO
+%%PORTDOCS%%%%DOCSDIR%%/changelog
+%%PORTDOCS%%%%DOCSDIR%%/copyright
+%%PORTDOCS%%%%DOCSDIR%%/rbldnsd.default
+%%PORTDOCS%%%%DOCSDIR%%/rbldnsd.init
 %%PORTDOCS%%%%DOCSDIR%%/rbldnsd.spec
 %%PORTDOCS%%%%DOCSDIR%%/rbldnsd.html
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
+ at unexec rmdir %D/etc/rbldnsd/ 2>/dev/null || true
--- rbldnsd.diff.0992 ends here ---


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



More information about the freebsd-ports-bugs mailing list