aboutsummaryrefslogtreecommitdiffstats
path: root/dns/rbldnsd
diff options
context:
space:
mode:
authorleeym <leeym@FreeBSD.org>2004-04-13 08:54:39 +0800
committerleeym <leeym@FreeBSD.org>2004-04-13 08:54:39 +0800
commit19823e7bd3f0a4f87662ba531761a25b96fcc40a (patch)
tree3397a89b9ba7bdb62cc5f08aeb0807caae5e0b71 /dns/rbldnsd
parent83f2faaffcf994a31d5dd488c3882a79bb36793b (diff)
downloadfreebsd-ports-gnome-19823e7bd3f0a4f87662ba531761a25b96fcc40a.tar.gz
freebsd-ports-gnome-19823e7bd3f0a4f87662ba531761a25b96fcc40a.tar.zst
freebsd-ports-gnome-19823e7bd3f0a4f87662ba531761a25b96fcc40a.zip
- 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 PR: 65392 Submitted by: Paul Chvostek <paul+fbsd@it.ca>
Diffstat (limited to 'dns/rbldnsd')
-rw-r--r--dns/rbldnsd/Makefile40
-rw-r--r--dns/rbldnsd/distinfo4
-rw-r--r--dns/rbldnsd/files/example30
-rw-r--r--dns/rbldnsd/files/rbldnsd.sh41
-rw-r--r--dns/rbldnsd/pkg-install30
-rw-r--r--dns/rbldnsd/pkg-message17
-rw-r--r--dns/rbldnsd/pkg-plist7
7 files changed, 165 insertions, 4 deletions
diff --git a/dns/rbldnsd/Makefile b/dns/rbldnsd/Makefile
index e15801c3b619..aa6bc5a620e1 100644
--- a/dns/rbldnsd/Makefile
+++ b/dns/rbldnsd/Makefile
@@ -6,7 +6,7 @@
#
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 @@ DISTFILES+= rbldnsd.html:1
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..."
+ @${SH} ${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 @@ do-install:
@${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 --git a/dns/rbldnsd/distinfo b/dns/rbldnsd/distinfo
index 4e63b990f952..174290563719 100644
--- a/dns/rbldnsd/distinfo
+++ b/dns/rbldnsd/distinfo
@@ -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 --git a/dns/rbldnsd/files/example b/dns/rbldnsd/files/example
new file mode 100644
index 000000000000..3e245bcc6c34
--- /dev/null
+++ b/dns/rbldnsd/files/example
@@ -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 --git a/dns/rbldnsd/files/rbldnsd.sh b/dns/rbldnsd/files/rbldnsd.sh
new file mode 100644
index 000000000000..593adaa299f8
--- /dev/null
+++ b/dns/rbldnsd/files/rbldnsd.sh
@@ -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 --git a/dns/rbldnsd/pkg-install b/dns/rbldnsd/pkg-install
new file mode 100644
index 000000000000..c51c36a6e7ae
--- /dev/null
+++ b/dns/rbldnsd/pkg-install
@@ -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 --git a/dns/rbldnsd/pkg-message b/dns/rbldnsd/pkg-message
new file mode 100644
index 000000000000..41ecefdfdb57
--- /dev/null
+++ b/dns/rbldnsd/pkg-message
@@ -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 --git a/dns/rbldnsd/pkg-plist b/dns/rbldnsd/pkg-plist
index 98f99d47d8f5..9bdb355f975d 100644
--- a/dns/rbldnsd/pkg-plist
+++ b/dns/rbldnsd/pkg-plist
@@ -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%%
+@unexec rmdir %D/etc/rbldnsd/ 2>/dev/null || true