Date: Thu, 28 Oct 2004 13:20:11 +0200 (CEST) From: Olivier Beyssac <obld@r14.freenix.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/73236: [PATCH] net/bld update to 0.3.1 Message-ID: <20041028112011.EDCD85C6B@r14.redhate.org> Resent-Message-ID: <200410281130.i9SBUV17043293@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 73236 >Category: ports >Synopsis: [PATCH] net/bld update to 0.3.1 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Thu Oct 28 11:30:31 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Olivier Beyssac >Release: FreeBSD 5.3-STABLE i386 >Organization: >Environment: System: FreeBSD r14.redhate.org 5.3-STABLE FreeBSD 5.3-STABLE #1: Sat Oct 23 11:46:39 CEST 2004 ob@r14.redhate.org:/usr/src/sys/i386/compile/R14 i386 >Description: Update to 0.3.1 and move configuration files to /usr/local/etc/bld instead of default /usr/local/etc (this is handled by pkg-install) >How-To-Repeat: >Fix: diff -ruN bld.orig/Makefile bld/Makefile --- bld.orig/Makefile Wed Oct 27 21:54:46 2004 +++ bld/Makefile Thu Oct 28 13:11:48 2004 @@ -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 @@ 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 -ruN bld.orig/distinfo bld/distinfo --- bld.orig/distinfo Wed Oct 27 21:54:46 2004 +++ bld/distinfo Thu Oct 28 11:13:23 2004 @@ -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 -ruN bld.orig/files/bld.sh bld/files/bld.sh --- bld.orig/files/bld.sh Wed Oct 27 21:54:46 2004 +++ bld/files/bld.sh Thu Oct 28 12:51:57 2004 @@ -24,7 +24,7 @@ # 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 -ruN bld.orig/files/patch-aa bld/files/patch-aa --- bld.orig/files/patch-aa Thu Jan 1 01:00:00 1970 +++ bld/files/patch-aa Thu Oct 28 11:44:59 2004 @@ -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 -ruN bld.orig/files/patch-ab bld/files/patch-ab --- bld.orig/files/patch-ab Thu Jan 1 01:00:00 1970 +++ bld/files/patch-ab Thu Oct 28 12:52:53 2004 @@ -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 -ruN bld.orig/files/patch-ac bld/files/patch-ac --- bld.orig/files/patch-ac Thu Jan 1 01:00:00 1970 +++ bld/files/patch-ac Thu Oct 28 12:14:09 2004 @@ -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 -ruN bld.orig/files/patch-ad bld/files/patch-ad --- bld.orig/files/patch-ad Thu Jan 1 01:00:00 1970 +++ bld/files/patch-ad Thu Oct 28 12:06:25 2004 @@ -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 -ruN bld.orig/pkg-descr bld/pkg-descr --- bld.orig/pkg-descr Wed Oct 27 21:54:46 2004 +++ bld/pkg-descr Thu Oct 28 11:16:45 2004 @@ -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 -ruN bld.orig/pkg-install bld/pkg-install --- bld.orig/pkg-install Wed Oct 27 21:54:46 2004 +++ bld/pkg-install Thu Oct 28 12:48:44 2004 @@ -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 @@ 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 @@ 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 -ruN bld.orig/pkg-plist bld/pkg-plist --- bld.orig/pkg-plist Wed Oct 27 21:54:46 2004 +++ bld/pkg-plist Thu Oct 28 12:36:55 2004 @@ -2,6 +2,13 @@ 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 >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041028112011.EDCD85C6B>