aboutsummaryrefslogtreecommitdiffstats
path: root/mail/sqlgrey
diff options
context:
space:
mode:
authorfeld <feld@FreeBSD.org>2014-09-04 04:49:19 +0800
committerfeld <feld@FreeBSD.org>2014-09-04 04:49:19 +0800
commitebad0a2843f9a34348522297bb0fa6a4cd05d330 (patch)
treedc71f79a0fbdd5a94d1c6c34bd4b32c2ec54b046 /mail/sqlgrey
parent5abbd265a0bd9471375df4e885fe152f39c912d2 (diff)
downloadfreebsd-ports-gnome-ebad0a2843f9a34348522297bb0fa6a4cd05d330.tar.gz
freebsd-ports-gnome-ebad0a2843f9a34348522297bb0fa6a4cd05d330.tar.zst
freebsd-ports-gnome-ebad0a2843f9a34348522297bb0fa6a4cd05d330.zip
Revive from the dead. This port is too important to let slip through the
cracks. - Support STAGE - Appease rclint and portlint - Remove pkg-install. We can do this in @unexec and rc script. - Set a default database option -- PGSQL will be default as recommended upstream. - Use new @sample capability - SHEBANGFIX Sponsored by: SupraNet Communications, Inc
Diffstat (limited to 'mail/sqlgrey')
-rw-r--r--mail/sqlgrey/Makefile77
-rw-r--r--mail/sqlgrey/distinfo2
-rw-r--r--mail/sqlgrey/files/patch-ipv611
-rw-r--r--mail/sqlgrey/files/sqlgrey.in43
-rw-r--r--mail/sqlgrey/pkg-descr7
-rw-r--r--mail/sqlgrey/pkg-plist13
6 files changed, 153 insertions, 0 deletions
diff --git a/mail/sqlgrey/Makefile b/mail/sqlgrey/Makefile
new file mode 100644
index 000000000000..4cdc3a3c89a4
--- /dev/null
+++ b/mail/sqlgrey/Makefile
@@ -0,0 +1,77 @@
+# Created by: mat
+# $FreeBSD$
+
+PORTNAME= sqlgrey
+PORTVERSION= 1.8.0
+PORTREVISION= 1
+CATEGORIES= mail
+MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-1.8%20%28stable%29
+
+MAINTAINER= ports@FreeBSD.org
+COMMENT= Greylisting policy server for Postfix using an SQL backend
+
+LICENSE= GPLV2
+
+RUN_DEPENDS= p5-Net-Server>=0:${PORTSDIR}/net/p5-Net-Server \
+ p5-IO-Multiplex>=0:${PORTSDIR}/devel/p5-IO-Multiplex \
+ p5-Pod-Parser>=0:${PORTSDIR}/textproc/p5-Pod-Parser
+
+USES= perl5 shebangfix
+SHEBANG_FILES= ${WRKSRC}/sqlgrey-logstats.pl ${WRKSRC}/update_sqlgrey_config ${WRKSRC}/sqlgrey
+USE_PERL5= run
+USE_RC_SUBR= sqlgrey
+NO_BUILD= yes
+
+ETCFILES= clients_fqdn_whitelist clients_ip_whitelist dyn_fqdn.regexp smtp_server.regexp sqlgrey.conf
+USERS= sqlgrey
+GROUPS= ${USERS}
+ETCDIR?= etc/sqlgrey
+
+SUB_LIST+= PERL=${PERL} USERS=${USERS} GROUPS=${GROUPS}
+PLIST_SUB= TOUCH=${TOUCH}
+
+OPTIONS_DEFINE= PGSQL MYSQL SQLITE STATS DOCS
+OPTIONS_DEFAULT=PGSQL
+STATS_DESC= Depend on Date::Calc for logstats.pl script
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDOCS}
+PORTDOCS= Changelog FAQ HOWTO README TODO
+.endif
+
+.if ${PORT_OPTIONS:MPGSQL}
+RUN_DEPENDS+= p5-DBD-Pg>=0:${PORTSDIR}/databases/p5-DBD-Pg
+.endif
+
+.if ${PORT_OPTIONS:MMYSQL}
+RUN_DEPENDS+= p5-DBD-mysql>=0:${PORTSDIR}/databases/p5-DBD-mysql
+.endif
+
+.if ${PORT_OPTIONS:MSQLITE}
+RUN_DEPENDS+= p5-DBD-SQLite>=0:${PORTSDIR}/databases/p5-DBD-SQLite
+.endif
+
+.if ${PORT_OPTIONS:MSTATS}
+RUN_DEPENDS+= p5-Date-Calc>=0:${PORTSDIR}/devel/p5-Date-Calc
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's-#!/usr/bin/perl-#!${PERL}-' -e 's!/etc/sqlgrey!${PREFIX}/${ETCDIR}!g' ${WRKSRC}/sqlgrey
+
+do-install:
+ @${INSTALL_SCRIPT} ${WRKSRC}/sqlgrey-logstats.pl ${STAGEDIR}/${PREFIX}/bin
+ @${INSTALL_SCRIPT} ${WRKSRC}/sqlgrey ${STAGEDIR}/${PREFIX}/sbin
+ @${INSTALL_SCRIPT} ${WRKSRC}/update_sqlgrey_config ${STAGEDIR}/${PREFIX}/sbin
+ @cd ${WRKSRC} && perldoc -u sqlgrey | pod2man sqlgrey > ${STAGEDIR}/${MANPREFIX}/man/man1/sqlgrey.1
+ @${MKDIR} ${STAGEDIR}/${PREFIX}/${ETCDIR}
+.for i in ${ETCFILES}
+ @${INSTALL_DATA} ${WRKSRC}/etc/${i} ${STAGEDIR}/${PREFIX}/${ETCDIR}/${i}.sample
+.endfor
+.if ${PORT_OPTIONS:MDOCS}
+ @${MKDIR} ${STAGEDIR}/${DOCSDIR}
+ @${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}/${DOCSDIR}
+ @${ECHO_MSG} "===> Documentation installed in ${STAGEDIR}/${DOCSDIR}."
+.endif
+
+.include <bsd.port.mk>
diff --git a/mail/sqlgrey/distinfo b/mail/sqlgrey/distinfo
new file mode 100644
index 000000000000..4cc0eca85587
--- /dev/null
+++ b/mail/sqlgrey/distinfo
@@ -0,0 +1,2 @@
+SHA256 (sqlgrey-1.8.0.tar.gz) = 94e0fa191b30d672b748e934728ca73383bf9b36e4b17618b01adaaba40280e2
+SIZE (sqlgrey-1.8.0.tar.gz) = 69476
diff --git a/mail/sqlgrey/files/patch-ipv6 b/mail/sqlgrey/files/patch-ipv6
new file mode 100644
index 000000000000..8be3f957e0a2
--- /dev/null
+++ b/mail/sqlgrey/files/patch-ipv6
@@ -0,0 +1,11 @@
+--- sqlgrey.orig 2013-09-27 06:51:40.913265753 -0500
++++ sqlgrey 2013-09-27 06:51:25.000000000 -0500
+@@ -1037,7 +1037,7 @@
+ return join(":", (split(/:/, $addr))[0..3]);
+ } else {
+ ## For Non-EUI64 or Non-Global-Unicast return the address
+- return $addr;
++ return join(":", (split(/:/, $addr))[0..3]);
+ }
+ }
+
diff --git a/mail/sqlgrey/files/sqlgrey.in b/mail/sqlgrey/files/sqlgrey.in
new file mode 100644
index 000000000000..00008cbb09bd
--- /dev/null
+++ b/mail/sqlgrey/files/sqlgrey.in
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: sqlgrey
+# REQUIRE: LOGIN
+# BEFORE: mail
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable sqlgrey:
+#
+# sqlgrey_enable="YES"
+#
+# See man sqlgrey for flags or the config file.
+
+. /etc/rc.subr
+
+name=sqlgrey
+rcvar=sqlgrey_enable
+
+load_rc_config ${name}
+
+command=%%PREFIX%%/sbin/sqlgrey
+extra_commands=reload
+command_interpreter=%%PERL%%
+
+start_precmd=${name}_prestart
+stop_postcmd="rm -f ${pidfile}"
+
+sqlgrey_enable=${sqlgrey_enable-"NO"}
+required_files=${sqlgrey_config-"%%PREFIX%%/%%ETCDIR%%/sqlgrey.conf"}
+pidfile=${sqlgrey_pidfile-"/var/run/sqlgrey.pid"}
+
+command_args="--configfile=${required_files} --pidfile=${pidfile} --daemonize"
+
+sqlgrey_prestart()
+{
+ if [ ! -d %%DATADIR%% ]; then
+ install -d -o %%USERS%% -g %%GROUPS%% -m 2775 %%DATADIR%%
+ fi
+}
+
+run_rc_command "$1"
diff --git a/mail/sqlgrey/pkg-descr b/mail/sqlgrey/pkg-descr
new file mode 100644
index 000000000000..3dd01be78a1b
--- /dev/null
+++ b/mail/sqlgrey/pkg-descr
@@ -0,0 +1,7 @@
+SQLgrey is a postfix policy service implementing a grey-listing policy.
+
+SQLgrey is written in Perl and uses DBI to access an SQL database.
+
+Its goal is reducing the SPAM reaching user mailboxes
+
+WWW: http://sqlgrey.sourceforge.net/
diff --git a/mail/sqlgrey/pkg-plist b/mail/sqlgrey/pkg-plist
new file mode 100644
index 000000000000..47b6844d2be9
--- /dev/null
+++ b/mail/sqlgrey/pkg-plist
@@ -0,0 +1,13 @@
+bin/sqlgrey-logstats.pl
+@sample %%ETCDIR%%/clients_fqdn_whitelist.sample
+@sample %%ETCDIR%%/clients_ip_whitelist.sample
+@sample %%ETCDIR%%/dyn_fqdn.regexp.sample
+@sample %%ETCDIR%%/smtp_server.regexp.sample
+@sample %%ETCDIR%%/sqlgrey.conf.sample
+man/man1/sqlgrey.1.gz
+sbin/sqlgrey
+sbin/update_sqlgrey_config
+@dirrmtry %%ETCDIR%%
+@unexec echo "---> Please, remember to remove the database directory:"
+@unexec echo " %%DATADIR%%"
+@unexec echo " If you're only updating, you can leave the things as they are."