svn commit: r367233 - in head/mail/sqlgrey: . files
Mark Felder
feld at FreeBSD.org
Wed Sep 3 20:49:20 UTC 2014
Author: feld
Date: Wed Sep 3 20:49:19 2014
New Revision: 367233
URL: http://svnweb.freebsd.org/changeset/ports/367233
QAT: https://qat.redports.org/buildarchive/r367233/
Log:
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
Added:
head/mail/sqlgrey/
- copied from r366958, head/mail/sqlgrey/
Deleted:
head/mail/sqlgrey/files/pkg-install.in
Modified:
head/mail/sqlgrey/Makefile
head/mail/sqlgrey/files/sqlgrey.in
head/mail/sqlgrey/pkg-plist
Modified: head/mail/sqlgrey/Makefile
==============================================================================
--- head/mail/sqlgrey/Makefile Mon Sep 1 21:24:52 2014 (r366958)
+++ head/mail/sqlgrey/Makefile Wed Sep 3 20:49:19 2014 (r367233)
@@ -7,14 +7,17 @@ PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-1.8%20%28stable%29
-MAINTAINER= ports at FreeBSD.org
+MAINTAINER= ports at 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
+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
@@ -24,20 +27,13 @@ USERS= sqlgrey
GROUPS= ${USERS}
ETCDIR?= etc/sqlgrey
-SUB_FILES= pkg-install
-MY_SUB_LIST= ETCDIR=${ETCDIR} ETCFILES="${ETCFILES}" USER=${USERS} GROUP=${GROUPS} PERL=${PERL}
-SUB_LIST+= ${MY_SUB_LIST}
-PLIST_SUB= TOUCH=${TOUCH} ${MY_SUB_LIST}
-
-PKGINSTALL= ${WRKDIR}/pkg-install
-PKGDEINSTALL= ${PKGINSTALL}
-
-MAN1= sqlgrey.1
+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
-NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MDOCS}
@@ -64,23 +60,18 @@ 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 ${PREFIX}/bin
- @${INSTALL_SCRIPT} ${WRKSRC}/sqlgrey ${PREFIX}/sbin
- @${INSTALL_SCRIPT} ${WRKSRC}/update_sqlgrey_config ${PREFIX}/sbin
- @cd ${WRKSRC} && perldoc -u sqlgrey | pod2man sqlgrey > ${MANPREFIX}/man/man1/sqlgrey.1
- @${MKDIR} ${PREFIX}/${ETCDIR}
+ @${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} ${PREFIX}/${ETCDIR}/${i}.dist
- @[ "${i}" = "dyn_fqdn.regexp" ] || [ "${i}" = "smtp_server.regexp" ] || [ "${i}" = "sqlgrey.conf" ] || ${TOUCH} ${PREFIX}/${ETCDIR}/${i}.local
- @[ -f ${PREFIX}/${ETCDIR}/${i} ] || ${INSTALL_DATA} ${WRKSRC}/etc/${i} ${PREFIX}/${ETCDIR}/${i}
+ @${INSTALL_DATA} ${WRKSRC}/etc/${i} ${STAGEDIR}/${PREFIX}/${ETCDIR}/${i}.sample
.endfor
.if ${PORT_OPTIONS:MDOCS}
- @${MKDIR} ${DOCSDIR}
- @${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR}
- @${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
+ @${MKDIR} ${STAGEDIR}/${DOCSDIR}
+ @${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}/${DOCSDIR}
+ @${ECHO_MSG} "===> Documentation installed in ${STAGEDIR}/${DOCSDIR}."
.endif
-post-install:
- @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-
.include <bsd.port.mk>
Modified: head/mail/sqlgrey/files/sqlgrey.in
==============================================================================
--- head/mail/sqlgrey/files/sqlgrey.in Mon Sep 1 21:24:52 2014 (r366958)
+++ head/mail/sqlgrey/files/sqlgrey.in Wed Sep 3 20:49:19 2014 (r367233)
@@ -18,13 +18,14 @@
name=sqlgrey
rcvar=sqlgrey_enable
+load_rc_config ${name}
+
command=%%PREFIX%%/sbin/sqlgrey
extra_commands=reload
command_interpreter=%%PERL%%
-stop_postcmd=${name}_poststop
-
-load_rc_config $name
+start_precmd=${name}_prestart
+stop_postcmd="rm -f ${pidfile}"
sqlgrey_enable=${sqlgrey_enable-"NO"}
required_files=${sqlgrey_config-"%%PREFIX%%/%%ETCDIR%%/sqlgrey.conf"}
@@ -32,9 +33,11 @@ pidfile=${sqlgrey_pidfile-"/var/run/sqlg
command_args="--configfile=${required_files} --pidfile=${pidfile} --daemonize"
-sqlgrey_poststop()
+sqlgrey_prestart()
{
- rm -f $pidfile
+ if [ ! -d %%DATADIR%% ]; then
+ install -d -o %%USERS%% -g %%GROUPS%% -m 2775 %%DATADIR%%
+ fi
}
run_rc_command "$1"
Modified: head/mail/sqlgrey/pkg-plist
==============================================================================
--- head/mail/sqlgrey/pkg-plist Mon Sep 1 21:24:52 2014 (r366958)
+++ head/mail/sqlgrey/pkg-plist Wed Sep 3 20:49:19 2014 (r367233)
@@ -1,24 +1,13 @@
- at unexec if cmp -s %D/%%ETCDIR%%/clients_fqdn_whitelist.dist %D/%%ETCDIR%%/clients_fqdn_whitelist; then rm -f %D/%%ETCDIR%%/clients_fqdn_whitelist; fi
- at unexec [ -e %D/%%ETCDIR%%/clients_fqdn_whitelist.local -a ! -s %D/%%ETCDIR%%/clients_fqdn_whitelist.local ] && rm -f %D/%%ETCDIR%%/clients_fqdn_whitelist.local
- at unexec if cmp -s %D/%%ETCDIR%%/clients_ip_whitelist.dist %D/%%ETCDIR%%/clients_ip_whitelist; then rm -f %D/%%ETCDIR%%/clients_ip_whitelist; fi
- at unexec [ -e %D/%%ETCDIR%%/clients_ip_whitelist.local -a ! -s %D/%%ETCDIR%%/clients_ip_whitelist.local ] && rm -f %D/%%ETCDIR%%/clients_ip_whitelist.local
- at unexec if cmp -s %D/%%ETCDIR%%/dyn_fqdn.regexp.dist %D/%%ETCDIR%%/dyn_fqdn.regexp; then rm -f %D/%%ETCDIR%%/dyn_fqdn.regexp; fi
- at unexec if cmp -s %D/%%ETCDIR%%/smtp_server.regexp.dist %D/%%ETCDIR%%/smtp_server.regexp; then rm -f %D/%%ETCDIR%%/smtp_server.regexp; fi
- at unexec if cmp -s %D/%%ETCDIR%%/sqlgrey.conf.dist %D/%%ETCDIR%%/sqlgrey.conf; then rm -f %D/%%ETCDIR%%/sqlgrey.conf; fi
-%%ETCDIR%%/clients_fqdn_whitelist.dist
- at exec [ -f %B/clients_fqdn_whitelist ] || cp %B/%f %B/clients_fqdn_whitelist
- at exec [ -f %B/clients_fqdn_whitelist.local ] || %%TOUCH%% %B/clients_fqdn_whitelist.local
-%%ETCDIR%%/clients_ip_whitelist.dist
- at exec [ -f %B/clients_ip_whitelist ] || cp %B/%f %B/clients_ip_whitelist
- at exec [ -f %B/clients_ip_whitelist.local ] || %%TOUCH%% %B/clients_ip_whitelist.local
-%%ETCDIR%%/dyn_fqdn.regexp.dist
-%%ETCDIR%%/smtp_server.regexp.dist
-%%ETCDIR%%/sqlgrey.conf.dist
- at exec [ -f %B/dyn_fqdn.regexp.dist ] || cp %B/%f %B/dyn_fqdn.regexp.dist
- at exec [ -f %B/smtp_server.regexp.dist ] || cp %B/%f %B/smtp_server.regexp.dist
- at exec [ -f %B/sqlgrey.conf ] || cp %B/%f %B/sqlgrey.conf
bin/sqlgrey-logstats.pl
+ at sample %%ETCDIR%%/clients_fqdn_whitelist.sample
+ at sample %%ETCDIR%%/clients_ip_whitelist.sample
+ at sample %%ETCDIR%%/dyn_fqdn.regexp.sample
+ at sample %%ETCDIR%%/smtp_server.regexp.sample
+ at sample %%ETCDIR%%/sqlgrey.conf.sample
+man/man1/sqlgrey.1.gz
sbin/sqlgrey
sbin/update_sqlgrey_config
- at dirrmtry %%DATADIR%%
@dirrmtry %%ETCDIR%%
+ at unexec echo "---> Please, remember to remove the database directory:"
+ at unexec echo " %%DATADIR%%"
+ at unexec echo " If you're only updating, you can leave the things as they are."
More information about the svn-ports-all
mailing list