summaryrefslogtreecommitdiff
path: root/net/bld
diff options
context:
space:
mode:
authorAnton Berezin <tobez@FreeBSD.org>2004-10-30 07:47:50 +0000
committerAnton Berezin <tobez@FreeBSD.org>2004-10-30 07:47:50 +0000
commitec435a465f9208de5c9291c017fc56acf7521a60 (patch)
tree82f684c8abc21f8e06eb371f622da8eb19530cbd /net/bld
parentAdding corresponding #iZ (diff)
Update to 0.3.1.
PR: 73236 Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=120479
Diffstat (limited to 'net/bld')
-rw-r--r--net/bld/Makefile10
-rw-r--r--net/bld/distinfo4
-rw-r--r--net/bld/files/bld.sh2
-rw-r--r--net/bld/files/patch-aa13
-rw-r--r--net/bld/files/patch-ab15
-rw-r--r--net/bld/files/patch-ac11
-rw-r--r--net/bld/files/patch-ad10
-rw-r--r--net/bld/pkg-descr16
-rw-r--r--net/bld/pkg-install90
-rw-r--r--net/bld/pkg-plist9
10 files changed, 132 insertions, 48 deletions
diff --git a/net/bld/Makefile b/net/bld/Makefile
index 2639cb1821d1..600110d1e582 100644
--- a/net/bld/Makefile
+++ b/net/bld/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= bld
-PORTVERSION= 0.2.4
+PORTVERSION= 0.3.1
CATEGORIES= net
MASTER_SITES= http://www.online.redhate.org/bld/
@@ -17,9 +17,11 @@ USE_RC_SUBR= yes
MANCOMPRESSED= yes
GNU_CONFIGURE= yes
-PORTDOCS= README
-MAN5= bld_whitelist.conf.5 bld_acl.conf.5
-MAN8= bldsubmit.8 bld.8 bldquery.8 bldread.8
+CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/bld
+PORTDOCS= README README.postfix
+MAN5= bld_whitelist.conf.5 bld_acl.conf.5 bld.conf.5
+MAN8= bldsubmit.8 bld.8 bldquery.8 bldread.8 bldinsert.8 blddecr.8 \
+ bld-pf_policy.8
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g'
RC_DIR= ${PREFIX}/etc/rc.d
diff --git a/net/bld/distinfo b/net/bld/distinfo
index 006a1901a46d..fa5efcab4118 100644
--- a/net/bld/distinfo
+++ b/net/bld/distinfo
@@ -1,2 +1,2 @@
-MD5 (bld-0.2.4.tar.gz) = 5add7fcdae1344bdb9cd9349e05240b2
-SIZE (bld-0.2.4.tar.gz) = 52915
+MD5 (bld-0.3.1.tar.gz) = 8b3a35f431a575687269aa19db2bc3f0
+SIZE (bld-0.3.1.tar.gz) = 69256
diff --git a/net/bld/files/bld.sh b/net/bld/files/bld.sh
index b0371b5de11b..de3f04256497 100644
--- a/net/bld/files/bld.sh
+++ b/net/bld/files/bld.sh
@@ -24,7 +24,7 @@ required_dirs=/var/run/bld
# set defaults
bld_enable=${bld_enable:-"NO"}
-bld_flags=${bld_flags:-""}
+bld_flags=${bld_flags:-"-u bld -g bld"}
load_rc_config $name
run_rc_command "$1"
diff --git a/net/bld/files/patch-aa b/net/bld/files/patch-aa
new file mode 100644
index 000000000000..738ccf3ef2e5
--- /dev/null
+++ b/net/bld/files/patch-aa
@@ -0,0 +1,13 @@
+--- Makefile.in.orig Thu Oct 28 11:44:20 2004
++++ Makefile.in Thu Oct 28 11:44:43 2004
+@@ -49,6 +49,10 @@
+ && (cd $(DESTDIR)$(sbindir) && ln -s $(SUBMITNAME) $(INSERTNAME)) \
+ && (cd $(DESTDIR)$(sbindir) && ln -s $(SUBMITNAME) $(DECRNAME))
+ strip $(DESTDIR)$(sbindir)/$(SUBMITNAME)
++ cp utils/bld-pf_policy.pl $(DESTDIR)/$(sbindir)
++ cp utils/bld-pf_log.pl $(DESTDIR)/$(sbindir)
++ [ -d $(DESTDIR)$(sysconfdir) ] || mkdir -p $(DESTDIR)$(sysconfdir)
++ cp bld.conf.sample $(DESTDIR)/$(sysconfdir)
+ [ -d $(DESTDIR)$(mandir) ] || mkdir -p $(DESTDIR)$(mandir)/man8
+ $(GZIP) -c bld.8 > $(DESTDIR)$(mandir)/man8/bld.8.gz
+ $(GZIP) -c bldread.8 > $(DESTDIR)$(mandir)/man8/bldread.8.gz
diff --git a/net/bld/files/patch-ab b/net/bld/files/patch-ab
new file mode 100644
index 000000000000..00f3069fff0d
--- /dev/null
+++ b/net/bld/files/patch-ab
@@ -0,0 +1,15 @@
+--- bld.conf.sample.orig Thu Oct 28 12:52:25 2004
++++ bld.conf.sample Thu Oct 28 12:52:37 2004
+@@ -26,10 +26,10 @@
+ #log_level=1
+
+ ## User to run as
+-#user=
++#user=bld
+
+ ## Group to run as
+-#group=
++#group=bld
+
+ ## Client timeout
+ #client_timeout=60
diff --git a/net/bld/files/patch-ac b/net/bld/files/patch-ac
new file mode 100644
index 000000000000..17cde15f6c23
--- /dev/null
+++ b/net/bld/files/patch-ac
@@ -0,0 +1,11 @@
+--- Makefile.in.orig Thu Oct 28 12:13:49 2004
++++ Makefile.in Thu Oct 28 12:13:57 2004
+@@ -60,7 +60,7 @@
+ $(GZIP) -c bldsubmit.8 > $(DESTDIR)$(mandir)/man8/bldsubmit.8.gz
+ $(GZIP) -c bldinsert.8 > $(DESTDIR)$(mandir)/man8/bldinsert.8.gz
+ $(GZIP) -c blddecr.8 > $(DESTDIR)$(mandir)/man8/blddecr.8.gz
+- $(GZIP) -c bld-pf_policy.8 > $(DESTDIR)$(mandir)/man8/bld_pf_policy.8.gz
++ $(GZIP) -c bld-pf_policy.8 > $(DESTDIR)$(mandir)/man8/bld-pf_policy.8.gz
+ [ -d $(DESTDIR)$(mandir) ] || mkdir -p $(DESTDIR)$(mandir)/man5
+ $(GZIP) -c bld.conf.5 > $(DESTDIR)$(mandir)/man5/bld.conf.5.gz
+ $(GZIP) -c bld_acl.conf.5 > $(DESTDIR)$(mandir)/man5/bld_acl.conf.5.gz
diff --git a/net/bld/files/patch-ad b/net/bld/files/patch-ad
new file mode 100644
index 000000000000..a6c66f24ff92
--- /dev/null
+++ b/net/bld/files/patch-ad
@@ -0,0 +1,10 @@
+--- bld.conf.5.in.orig Thu Oct 28 12:06:07 2004
++++ bld.conf.5.in Thu Oct 28 12:06:13 2004
+@@ -56,7 +56,6 @@
+ You need to completely restart \fBbld\fR after any modification of this
+ file.
+ .SH FILES
+-.SH FILES
+ .PP
+ @sysconfdir@/bld.conf
+ .SH SEE ALSO
diff --git a/net/bld/pkg-descr b/net/bld/pkg-descr
index 94496f279688..57df966e5c53 100644
--- a/net/bld/pkg-descr
+++ b/net/bld/pkg-descr
@@ -1,10 +1,12 @@
-BLD stands for "black list daemon" and is intended to build blacklists
-using simple rules based on a maximum number of submissions of the same
-IP address during a minimum time interval. BLD was primarily designed to
-fight against dictionnary-based spams (by making the MTA report to BLD
-any host that tries to send a mail to an unknown user) but can be used
-by any application that needs a blacklist based on connection rate
-limits.
+BLD stands for "blacklist daemon" and is intended to serve a
+blacklist. The blacklist is built by simply inserting IP addresses
+or by using submission rate limits based on a maximum number of
+submissions of the same IP address within a minimum time interval.
+You can build a BLD cluster by configuring the daemon to notify
+other similar daemon(s) every time an IP address is added to the
+blacklist. BLD was primarily designed to fight against dictionnary-based
+spams (by making the MTA report to BLD any host that tries to send
+a mail to an unknown user) but can be used by any program.
See homepage for more infos:
diff --git a/net/bld/pkg-install b/net/bld/pkg-install
index b857c55b1b33..fbd5350d4787 100644
--- a/net/bld/pkg-install
+++ b/net/bld/pkg-install
@@ -1,13 +1,18 @@
#!/bin/sh
if [ $2 != "POST-INSTALL" ]
-then
- exit
+ then
+ exit
fi
varrun=/var/run/bld
+logfile=/var/log/bld.log
user=bld
group=bld
+newsyslog_conf=/etc/newsyslog.conf
+syslog_conf=/etc/syslog.conf
+syslog_pid=/var/run/syslog.pid
+nonexistent=/nonexistent
ask() {
local question default answer
@@ -31,11 +36,11 @@ yesno() {
while :; do
answer=$(ask "${question}" "${dflt}")
case "${answer}" in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- esac
- echo "Please answer yes or no."
- done
+ [Yy]*) return 0;;
+[Nn]*) return 1;;
+esac
+echo "Please answer yes or no."
+done
}
make_account() {
@@ -59,54 +64,73 @@ make_account() {
else
echo "You need a user \"${u}\"."
pw useradd ${u} -g ${g} -h - ${homeopt} \
- -s /nonexistent -c "${gcos}" || exit
+ -s $nonexistent -c "${gcos}" || exit
echo "Done."
fi
if [ x"$homeopt" = x ]; then
eval home=~${u}
if [ ! -d "${home}" ]; then
- mkdir -p ${home}/.cvsup || exit
- touch ${home}/.cvsup/auth || exit
- chown -R ${u}:${g} ${home} || exit
- chmod -R go= ${home} || exit
+ mkdir -p ${home}/.cvsup || exit
+ touch ${home}/.cvsup/auth || exit
+ chown -R ${u}:${g} ${home} || exit
+ chmod -R go= ${home} || exit
fi
fi
}
if [ ! -d "${varrun}" ]
-then
- mkdir ${varrun} || exit
+ then
+ mkdir ${varrun} || exit
fi
echo ""
-make_account ${user} ${group} "Blacklist Daemon" "/nonexistent"
+make_account ${user} ${group} "Blacklist Daemon" "$nonexistent"
chmod 700 ${varrun}
chown bld ${varrun}
-if grep -q "^[^#]*${facility}.*/var/log/bld.log" /etc/syslog.conf; then
- echo -n "It looks like you already have some logging set up, so I "
- echo "will use it."
+if grep -q "^[^#]*${facility}.*$logfile" $syslog_conf; then
+ echo -n "It looks like you already have some logging set up, so I "
+ echo "will use it."
else
- echo "Setting up server logging in \"/etc/syslog.conf\"."
- cat <<EOF >>/etc/syslog.conf
+ echo "Setting up server logging in \"$syslog_conf\"."
+ cat <<EOF >>$syslog_conf
!bld
-*.* /var/log/bld.log
+*.* $logfile
EOF
- if [ ! -f /var/log/bld.log ]; then
- echo "Creating \"/var/log/bld.log\"."
- cp /dev/null /var/log/bld.log
- fi
+if [ ! -f $logfile ]; then
+ echo "Creating \"$logfile\"."
+ cp /dev/null $logfile
+fi
- if [ -f /var/run/syslog.pid ]; then
- echo "Giving syslogd a kick in the pants."
- kill -HUP $(cat /var/run/syslog.pid)
- fi
+if [ -f $syslog_pid ]; then
+ echo "Giving syslogd a kick in the pants."
+ kill -HUP $(cat $syslog_pid)
+fi
- echo "Adding bld log entry to \"/etc/newsyslog.conf\"."
- cat <<EOF >>/etc/newsyslog.conf
-/var/log/bld.log 664 7 * 24 Z
+echo "Adding bld log entry to \"$newsyslog_conf\"."
+cat <<EOF >>$newsyslog_conf
+$logfile 664 7 * 24 Z
EOF
- echo "Done."
+echo "Done."
fi
+
+# Compatibility from v0.2.4 port
+for i in bld_acl.conf bld_whitelist.conf
+do
+ if [ -f ${PKG_PREFIX}/etc/$i ]
+ then
+ if [ -f ${PKG_PREFIX}/etc/bld/$i ]
+ then
+ echo "WARNING: You have a $i configuration file in two directories:"
+ echo "${PKG_PREFIX}/etc and ${PKG_PREFIX}/etc/bld"
+ echo "You must use ${PREFIX}/etc/bld/$i"
+ else
+ echo "You seem to have a $i configuration file in ${PKG_PREFIX}/etc"
+ echo "Copying it to ${PKG_PREFIX}/etc/bld"
+ cp ${PKG_PREFIX}/etc/$i ${PKG_PREFIX}/etc/bld
+ echo "You should clean the old ${PKG_PREFIX}/etc/$i"
+ fi
+ fi
+done
diff --git a/net/bld/pkg-plist b/net/bld/pkg-plist
index 196f7dd2d6f1..754123752db7 100644
--- a/net/bld/pkg-plist
+++ b/net/bld/pkg-plist
@@ -2,6 +2,13 @@ sbin/bld
sbin/bldsubmit
sbin/bldread
sbin/bldquery
+sbin/bldinsert
+sbin/blddecr
+sbin/bld-pf_policy
+sbin/bld-pf_policy.pl
+sbin/bld-pf_log.pl
etc/rc.d/bld.sh
+etc/bld/bld.conf.sample
+@unexec rmdir %D/etc/bld 2>/dev/null || (echo ; echo "Keeping homemade configuration files in %D/etc/bld" ; echo) || true
%%PORTDOCS%%@unexec %D/%%DOCSDIR%% 2>/dev/null || true
-@unexec rmdir /var/run/bld || (echo ; echo "Remove dumps from /var/run/bld/* if you don't want to keep them" ; echo) && true
+@unexec rmdir /var/run/bld 2>/dev/null || (echo ; echo "Remove dumps from /var/run/bld/* if you don't want to keep them" ; echo) && true