View | Details | Raw Unified | Return to bug 73236
Collapse All | Expand All

(-)bld/Makefile (-4 / +6 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	bld
8
PORTNAME=	bld
9
PORTVERSION=	0.2.4
9
PORTVERSION=	0.3.1
10
CATEGORIES=	net
10
CATEGORIES=	net
11
MASTER_SITES=	http://www.online.redhate.org/bld/
11
MASTER_SITES=	http://www.online.redhate.org/bld/
12
12
Lines 17-25 Link Here
17
MANCOMPRESSED=	yes
17
MANCOMPRESSED=	yes
18
GNU_CONFIGURE=	yes
18
GNU_CONFIGURE=	yes
19
19
20
PORTDOCS=	README
20
CONFIGURE_ARGS=	--sysconfdir=${PREFIX}/etc/bld
21
MAN5=		bld_whitelist.conf.5 bld_acl.conf.5
21
PORTDOCS=	README README.postfix
22
MAN8=		bldsubmit.8 bld.8 bldquery.8 bldread.8
22
MAN5=		bld_whitelist.conf.5 bld_acl.conf.5 bld.conf.5
23
MAN8=		bldsubmit.8 bld.8 bldquery.8 bldread.8 bldinsert.8 blddecr.8 \
24
		bld-pf_policy.8
23
25
24
SED_SCRIPT=	-e 's|%%PREFIX%%|${PREFIX}|g'
26
SED_SCRIPT=	-e 's|%%PREFIX%%|${PREFIX}|g'
25
RC_DIR=		${PREFIX}/etc/rc.d
27
RC_DIR=		${PREFIX}/etc/rc.d
(-)bld/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
MD5 (bld-0.2.4.tar.gz) = 5add7fcdae1344bdb9cd9349e05240b2
1
MD5 (bld-0.3.1.tar.gz) = 8b3a35f431a575687269aa19db2bc3f0
2
SIZE (bld-0.2.4.tar.gz) = 52915
2
SIZE (bld-0.3.1.tar.gz) = 69256
(-)bld/files/bld.sh (-1 / +1 lines)
Lines 24-30 Link Here
24
# set defaults
24
# set defaults
25
25
26
bld_enable=${bld_enable:-"NO"}
26
bld_enable=${bld_enable:-"NO"}
27
bld_flags=${bld_flags:-""}
27
bld_flags=${bld_flags:-"-u bld -g bld"}
28
28
29
load_rc_config $name
29
load_rc_config $name
30
run_rc_command "$1"
30
run_rc_command "$1"
(-)bld/files/patch-aa (+13 lines)
Line 0 Link Here
1
--- Makefile.in.orig	Thu Oct 28 11:44:20 2004
2
+++ Makefile.in	Thu Oct 28 11:44:43 2004
3
@@ -49,6 +49,10 @@
4
 	    && (cd $(DESTDIR)$(sbindir) && ln -s $(SUBMITNAME) $(INSERTNAME)) \
5
 	    && (cd $(DESTDIR)$(sbindir) && ln -s $(SUBMITNAME) $(DECRNAME))
6
 	strip $(DESTDIR)$(sbindir)/$(SUBMITNAME)
7
+	cp utils/bld-pf_policy.pl $(DESTDIR)/$(sbindir)
8
+	cp utils/bld-pf_log.pl $(DESTDIR)/$(sbindir)
9
+	[ -d $(DESTDIR)$(sysconfdir) ] || mkdir -p $(DESTDIR)$(sysconfdir)
10
+	cp bld.conf.sample $(DESTDIR)/$(sysconfdir)
11
 	[ -d $(DESTDIR)$(mandir) ] || mkdir -p $(DESTDIR)$(mandir)/man8
12
 	$(GZIP) -c bld.8 > $(DESTDIR)$(mandir)/man8/bld.8.gz
13
 	$(GZIP) -c bldread.8 > $(DESTDIR)$(mandir)/man8/bldread.8.gz
(-)bld/files/patch-ab (+15 lines)
Line 0 Link Here
1
--- bld.conf.sample.orig	Thu Oct 28 12:52:25 2004
2
+++ bld.conf.sample	Thu Oct 28 12:52:37 2004
3
@@ -26,10 +26,10 @@
4
 #log_level=1
5
 
6
 ## User to run as
7
-#user=
8
+#user=bld
9
 
10
 ## Group to run as
11
-#group=
12
+#group=bld
13
 
14
 ## Client timeout
15
 #client_timeout=60
(-)bld/files/patch-ac (+11 lines)
Line 0 Link Here
1
--- Makefile.in.orig	Thu Oct 28 12:13:49 2004
2
+++ Makefile.in	Thu Oct 28 12:13:57 2004
3
@@ -60,7 +60,7 @@
4
 	$(GZIP) -c bldsubmit.8 > $(DESTDIR)$(mandir)/man8/bldsubmit.8.gz
5
 	$(GZIP) -c bldinsert.8 > $(DESTDIR)$(mandir)/man8/bldinsert.8.gz
6
 	$(GZIP) -c blddecr.8 > $(DESTDIR)$(mandir)/man8/blddecr.8.gz
7
-	$(GZIP) -c bld-pf_policy.8 > $(DESTDIR)$(mandir)/man8/bld_pf_policy.8.gz
8
+	$(GZIP) -c bld-pf_policy.8 > $(DESTDIR)$(mandir)/man8/bld-pf_policy.8.gz
9
 	[ -d $(DESTDIR)$(mandir) ] || mkdir -p $(DESTDIR)$(mandir)/man5
10
 	$(GZIP) -c bld.conf.5 > $(DESTDIR)$(mandir)/man5/bld.conf.5.gz
11
 	$(GZIP) -c bld_acl.conf.5 > $(DESTDIR)$(mandir)/man5/bld_acl.conf.5.gz
(-)bld/files/patch-ad (+10 lines)
Line 0 Link Here
1
--- bld.conf.5.in.orig	Thu Oct 28 12:06:07 2004
2
+++ bld.conf.5.in	Thu Oct 28 12:06:13 2004
3
@@ -56,7 +56,6 @@
4
 You need to completely restart \fBbld\fR after any modification of this
5
 file.
6
 .SH FILES
7
-.SH FILES
8
 .PP
9
 @sysconfdir@/bld.conf
10
 .SH SEE ALSO
(-)bld/pkg-descr (-7 / +9 lines)
Lines 1-10 Link Here
1
BLD stands for "black list daemon" and is intended to build blacklists
1
BLD stands for "blacklist daemon" and is intended to serve a
2
using simple rules based on a maximum number of submissions of the same
2
blacklist.  The blacklist is built by simply inserting IP addresses
3
IP address during a minimum time interval.  BLD was primarily designed to
3
or by using submission rate limits based on a maximum number of
4
fight against dictionnary-based spams (by making the MTA report to BLD
4
submissions of the same IP address within a minimum time interval.
5
any host that tries to send a mail to an unknown user) but can be used  
5
You can build a BLD cluster by configuring the daemon to notify
6
by any application that needs a blacklist based on connection rate
6
other similar daemon(s) every time an IP address is added to the
7
limits.
7
blacklist.  BLD was primarily designed to fight against dictionnary-based
8
spams (by making the MTA report to BLD any host that tries to send
9
a mail to an unknown user) but can be used by any program.
8
10
9
See homepage for more infos:
11
See homepage for more infos:
10
12
(-)bld/pkg-install (-33 / +57 lines)
Lines 1-13 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
2
3
if [ $2 != "POST-INSTALL" ]
3
if [ $2 != "POST-INSTALL" ]
4
then
4
    then
5
	exit
5
    exit
6
fi
6
fi
7
7
8
varrun=/var/run/bld
8
varrun=/var/run/bld
9
logfile=/var/log/bld.log
9
user=bld
10
user=bld
10
group=bld
11
group=bld
12
newsyslog_conf=/etc/newsyslog.conf
13
syslog_conf=/etc/syslog.conf
14
syslog_pid=/var/run/syslog.pid
15
nonexistent=/nonexistent
11
16
12
ask() {
17
ask() {
13
    local question default answer
18
    local question default answer
Lines 31-41 Link Here
31
    while :; do
36
    while :; do
32
	answer=$(ask "${question}" "${dflt}")
37
	answer=$(ask "${question}" "${dflt}")
33
	case "${answer}" in
38
	case "${answer}" in
34
	[Yy]*)		return 0;;
39
	    [Yy]*)		return 0;;
35
	[Nn]*)		return 1;;
40
[Nn]*)		return 1;;
36
	esac
41
esac
37
	echo "Please answer yes or no."
42
echo "Please answer yes or no."
38
    done
43
done
39
}
44
}
40
45
41
make_account() {
46
make_account() {
Lines 59-112 Link Here
59
    else
64
    else
60
	echo "You need a user \"${u}\"."
65
	echo "You need a user \"${u}\"."
61
	pw useradd ${u} -g ${g} -h - ${homeopt} \
66
	pw useradd ${u} -g ${g} -h - ${homeopt} \
62
		-s /nonexistent -c "${gcos}" || exit
67
	    -s $nonexistent -c "${gcos}" || exit
63
	echo "Done."
68
	echo "Done."
64
    fi
69
    fi
65
70
66
    if [ x"$homeopt" = x ]; then
71
    if [ x"$homeopt" = x ]; then
67
	eval home=~${u}
72
	eval home=~${u}
68
	if [ ! -d "${home}" ]; then
73
	if [ ! -d "${home}" ]; then
69
		mkdir -p ${home}/.cvsup || exit
74
	    mkdir -p ${home}/.cvsup || exit
70
		touch ${home}/.cvsup/auth || exit
75
	    touch ${home}/.cvsup/auth || exit
71
		chown -R ${u}:${g} ${home} || exit
76
	    chown -R ${u}:${g} ${home} || exit
72
		chmod -R go= ${home} || exit
77
	    chmod -R go= ${home} || exit
73
	fi
78
	fi
74
    fi
79
    fi
75
}
80
}
76
81
77
if [ ! -d "${varrun}" ]
82
if [ ! -d "${varrun}" ]
78
then
83
    then
79
	mkdir ${varrun} || exit
84
    mkdir ${varrun} || exit
80
fi
85
fi
81
86
82
echo ""
87
echo ""
83
make_account ${user} ${group} "Blacklist Daemon" "/nonexistent"
88
make_account ${user} ${group} "Blacklist Daemon" "$nonexistent"
84
chmod 700 ${varrun}
89
chmod 700 ${varrun}
85
chown bld ${varrun}
90
chown bld ${varrun}
86
91
87
if grep -q "^[^#]*${facility}.*/var/log/bld.log" /etc/syslog.conf; then
92
if grep -q "^[^#]*${facility}.*$logfile" $syslog_conf; then
88
	echo -n "It looks like you already have some logging set up, so I "
93
    echo -n "It looks like you already have some logging set up, so I "
89
	echo "will use it."
94
    echo "will use it."
90
else
95
else
91
	echo "Setting up server logging in \"/etc/syslog.conf\"."
96
    echo "Setting up server logging in \"$syslog_conf\"."
92
	cat <<EOF >>/etc/syslog.conf
97
    cat <<EOF >>$syslog_conf
93
!bld
98
!bld
94
*.*						/var/log/bld.log
99
*.*						$logfile
95
EOF
100
EOF
96
101
97
	if [ ! -f /var/log/bld.log ]; then
102
if [ ! -f $logfile ]; then
98
		echo "Creating \"/var/log/bld.log\"."
103
    echo "Creating \"$logfile\"."
99
		cp /dev/null /var/log/bld.log
104
    cp /dev/null $logfile
100
	fi
105
fi
101
106
102
	if [ -f /var/run/syslog.pid ]; then
107
if [ -f $syslog_pid ]; then
103
		echo "Giving syslogd a kick in the pants."
108
    echo "Giving syslogd a kick in the pants."
104
		kill -HUP $(cat /var/run/syslog.pid)
109
    kill -HUP $(cat $syslog_pid)
105
	fi
110
fi
106
111
107
	echo "Adding bld log entry to \"/etc/newsyslog.conf\"."
112
echo "Adding bld log entry to \"$newsyslog_conf\"."
108
	cat <<EOF >>/etc/newsyslog.conf
113
cat <<EOF >>$newsyslog_conf
109
/var/log/bld.log			664  7    *    24    Z
114
$logfile			664  7    *    24    Z
110
EOF
115
EOF
111
	echo "Done."
116
echo "Done."
112
fi
117
fi
118
119
# Compatibility from v0.2.4 port
120
for i in bld_acl.conf bld_whitelist.conf
121
do
122
  if [ -f ${PKG_PREFIX}/etc/$i ]
123
      then
124
      if [ -f ${PKG_PREFIX}/etc/bld/$i ]
125
	  then
126
	  echo "WARNING: You have a $i configuration file in two directories:"
127
	  echo "${PKG_PREFIX}/etc and ${PKG_PREFIX}/etc/bld"
128
	  echo "You must use ${PREFIX}/etc/bld/$i"
129
      else
130
	  echo "You seem to have a $i configuration file in ${PKG_PREFIX}/etc"
131
	  echo "Copying it to ${PKG_PREFIX}/etc/bld"
132
	  cp ${PKG_PREFIX}/etc/$i ${PKG_PREFIX}/etc/bld
133
	  echo "You should clean the old ${PKG_PREFIX}/etc/$i"
134
      fi
135
  fi
136
done
(-)bld/pkg-plist (-1 / +8 lines)
Lines 2-7 Link Here
2
sbin/bldsubmit
2
sbin/bldsubmit
3
sbin/bldread
3
sbin/bldread
4
sbin/bldquery
4
sbin/bldquery
5
sbin/bldinsert
6
sbin/blddecr
7
sbin/bld-pf_policy
8
sbin/bld-pf_policy.pl
9
sbin/bld-pf_log.pl
5
etc/rc.d/bld.sh
10
etc/rc.d/bld.sh
11
etc/bld/bld.conf.sample
12
@unexec rmdir %D/etc/bld 2>/dev/null || (echo ; echo "Keeping homemade configuration files in %D/etc/bld" ; echo) || true
6
%%PORTDOCS%%@unexec %D/%%DOCSDIR%% 2>/dev/null || true
13
%%PORTDOCS%%@unexec %D/%%DOCSDIR%% 2>/dev/null || true
7
@unexec rmdir /var/run/bld || (echo ; echo "Remove dumps from /var/run/bld/* if you don't want to keep them" ; echo) && true
14
@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

Return to bug 73236