aboutsummaryrefslogtreecommitdiffstats
path: root/mail/postgrey
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2011-11-10 14:45:45 +0800
committermm <mm@FreeBSD.org>2011-11-10 14:45:45 +0800
commit307b516e638be49c0ddbdfdfa7e3cfdbb16ccbd7 (patch)
tree5bb90eb4c519967bbea187acc05c67ad75f6f368 /mail/postgrey
parenta643dc615ca76241f37b0a051b163b94051ae690 (diff)
downloadfreebsd-ports-gnome-307b516e638be49c0ddbdfdfa7e3cfdbb16ccbd7.tar.gz
freebsd-ports-gnome-307b516e638be49c0ddbdfdfa7e3cfdbb16ccbd7.tar.zst
freebsd-ports-gnome-307b516e638be49c0ddbdfdfa7e3cfdbb16ccbd7.zip
Revert update of mail/postgrey on maintainer request.
Diffstat (limited to 'mail/postgrey')
-rw-r--r--mail/postgrey/Makefile42
-rw-r--r--mail/postgrey/files/pkg-install.in48
-rw-r--r--mail/postgrey/files/pkg-message.in11
-rw-r--r--mail/postgrey/pkg-plist14
4 files changed, 57 insertions, 58 deletions
diff --git a/mail/postgrey/Makefile b/mail/postgrey/Makefile
index 18bd6a8564fa..60a797c685e1 100644
--- a/mail/postgrey/Makefile
+++ b/mail/postgrey/Makefile
@@ -7,7 +7,7 @@
PORTNAME= postgrey
PORTVERSION= 1.34
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= mail
MASTER_SITES= http://postgrey.schweikert.ch/pub/ \
http://postgrey.schweikert.ch/pub/old/
@@ -15,9 +15,6 @@ MASTER_SITES= http://postgrey.schweikert.ch/pub/ \
MAINTAINER= ports.maintainer@evilphi.com
COMMENT= Greylisting policy server for Postfix
-LICENSE= GPLv2
-LICENSE_FILE= ${WRKSRC}/COPYING
-
RUN_DEPENDS= ${SITE_PERL}/Net/Server.pm:${PORTSDIR}/net/p5-Net-Server \
${SITE_PERL}/IO/Multiplex.pm:${PORTSDIR}/devel/p5-IO-Multiplex \
${SITE_PERL}/Parse/Syslog.pm:${PORTSDIR}/textproc/p5-Parse-Syslog \
@@ -29,35 +26,37 @@ USE_RC_SUBR= ${PORTNAME}
NO_BUILD= yes
POD2MAN?= pod2man
PORTDOCS= README Changes README.exim
-MAN1= ${PORTNAME}.1 policy-test.1 postgreyreport.1
-
-PGY_DBDIR= /var/db/postgrey
+SUB_FILES= pkg-install
+SUB_LIST= USER=${PGY_USERNAME} UID=${PGY_USERID} GROUP=${PGY_GROUPNAME} \
+ GID=${PGY_GROUPID} ETCFILES="${ETCFILES}" \
+ POSTGREYDIR=${PGY_DIR}
+ETCFILES= whitelist_clients whitelist_recipients
+PGY_USERNAME?= postgrey
+PGY_USERID?= 225
+PGY_GROUPNAME?= ${PGY_USERNAME}
+PGY_GROUPID?= ${PGY_USERID}
+PGY_DIR?= /var/db/postgrey
-USERS?= postgrey
-GROUPS?= postgrey
-
-PLIST_SUB= DBDIR=${PGY_DBDIR}
-
-SUB_FILES= ${PORTNAME} pkg-install pkg-message
-SUB_LIST= USER=${USERS} GROUP=${GROUPS} DBDIR=${PGY_DBDIR}
+USERS= ${PGY_USERNAME}
+GROUPS= ${PGY_GROUPNAME}
+MAN1= ${PORTNAME}.1 policy-test.1 postgreyreport.1
post-patch:
@${REINPLACE_CMD} -e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
- @${REINPLACE_CMD} -e 's#/etc/postfix#${ETCDIR}#' ${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
- @${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PGY_DBDIR}#' ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
- @${REINPLACE_CMD} -e 's#nogroup#${GROUPS}#' ${WRKSRC}/postgrey
+ @${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' ${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
+ @${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PGY_DIR}#' ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
do-install:
+ @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@${POD2MAN} ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.1
@${POD2MAN} ${WRKSRC}/policy-test ${WRKSRC}/policy-test.1
@${POD2MAN} ${WRKSRC}/contrib/postgreyreport ${WRKSRC}/postgreyreport.1
@${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${PREFIX}/sbin
@${INSTALL_SCRIPT} ${WRKSRC}/policy-test ${PREFIX}/sbin
@${INSTALL_SCRIPT} ${WRKSRC}/contrib/postgreyreport ${PREFIX}/sbin
- @${INSTALL} -d ${ETCDIR}
-.for file in postgrey_whitelist_clients postgrey_whitelist_recipients
- ${INSTALL_DATA} ${WRKSRC}/${file} ${ETCDIR}/dist-${file}
- @${CP} -n ${ETCDIR}/dist-${file} ${ETCDIR}/${file}
+ @${INSTALL} -d ${PREFIX}/etc/postfix
+.for i in ${ETCFILES}
+ ${INSTALL_DATA} ${WRKSRC}/postgrey_${i} ${PREFIX}/etc/postfix/dist-postgrey_${i}
.endfor
.if !defined(NOPORTDOCS)
@@ -68,6 +67,5 @@ do-install:
post-install:
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
- @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/mail/postgrey/files/pkg-install.in b/mail/postgrey/files/pkg-install.in
index cd75eb295bc0..3abf0bd37462 100644
--- a/mail/postgrey/files/pkg-install.in
+++ b/mail/postgrey/files/pkg-install.in
@@ -1,32 +1,46 @@
#! /bin/sh
#
-# $FreeBSD: /tmp/pcvs/ports/mail/postgrey/files/pkg-install.in,v 1.4 2011-11-09 09:15:33 mm Exp $
+# $FreeBSD: /tmp/pcvs/ports/mail/postgrey/files/pkg-install.in,v 1.5 2011-11-10 06:45:45 mm Exp $
PATH=/bin:/usr/bin:/usr/sbin
-DBDIR="%%DBDIR%%"
-USER="%%USER%%"
-GROUP="%%GROUP%%"
case $2 in
-POST-INSTALL)
- echo "---> Starting post-install script:"
+PRE-INSTALL)
+ echo "---> Starting install script:"
+
+ if [ -z "%%POSTGREYDIR%%" -o \
+ -z "%%USER%%" -o -z "%%GROUP%%" -o \
+ -z "%%UID%%" -o -z "%%GID%%" ]; then
+ echo "ERROR: A required pragma was empty"
+ exit 1
+ fi
# Create home directory if required
- if [ -z ${DBDIR} ]; then
- echo "---> Default database directory not specified"
- elif [ -d ${DBDIR} ]; then
- echo "---> Using existing Postgrey database directory (${DBDIR})"
+ if [ -d "%%POSTGREYDIR%%" ]; then
+ echo "---> Using existing Postgrey database directory (%%POSTGREYDIR%%)"
echo " (There may be existing active postgrey databases - this installation"
echo " will attempt to preserve them.)"
- elif [ -e ${DBDIR} ]; then
- echo "---> The default Postgrey database directory (${DBDIR})"
- echo " exists but is not a directory - you have to create it yourself"
else
- echo "---> Creating Postgrey database directory (${DBDIR})"
- (umask 002 && mkdir -p ${DBDIR}) || exit 1
- chown -R ${USER}:${GROUP} ${DBDIR} || exit 1
- chmod g+s ${DBDIR} || exit 1
+ echo "---> Creating Postgrey database directory (%%POSTGREYDIR%%)"
+ (umask 002 && /bin/mkdir -p "%%POSTGREYDIR%%") || exit 1
+ /usr/sbin/chown -R "%%USER%%:%%GROUP%%" "%%POSTGREYDIR%%" || exit 1
+ /bin/chmod g+s "%%POSTGREYDIR%%" || exit 1
fi
+ ;;
+
+POST-INSTALL)
+ echo "---> Starting post-install script:"
+
+ for i in %%ETCFILES%%; do
+ if [ ! -f "%%PREFIX%%/etc/postfix/postgrey_${i}" ]; then
+ echo "---> Installing new config file %%PREFIX%%/etc/postfix/postgrey_${i}"
+ cp -p %%PREFIX%%/etc/postfix/dist-postgrey_${i} \
+ %%PREFIX%%/etc/postfix/postgrey_${i}
+ else
+ echo "---> Keeping existing config file %%PREFIX%%/etc/postfix/postgrey_${i}"
+ fi
+ done
+ ;;
esac
diff --git a/mail/postgrey/files/pkg-message.in b/mail/postgrey/files/pkg-message.in
deleted file mode 100644
index f242a7062411..000000000000
--- a/mail/postgrey/files/pkg-message.in
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-ATTENTION:
-
-The default location of the whitelist files has changed from
-%%PREFIX%%/etc/postfix to %%ETCDIR%%. If you modified the
-whitelists, you will need to either move them to the new location or
-specify their location by adding --whitelist-clients and
---whitelist-recipients parameters to postgrey_options in /etc/rc.conf.
-
-
diff --git a/mail/postgrey/pkg-plist b/mail/postgrey/pkg-plist
index 73c0386a176c..6bb75d12dfc9 100644
--- a/mail/postgrey/pkg-plist
+++ b/mail/postgrey/pkg-plist
@@ -1,11 +1,9 @@
-@unexec if cmp -s %D/%%ETCDIR%%/dist-postgrey_whitelist_recipients %D/%%ETCDIR%%/postgrey_whitelist_recipients; then rm %D/%%ETCDIR%%/postgrey_whitelist_recipients; fi
-@unexec if cmp -s %D/%%ETCDIR%%/dist-postgrey_whitelist_clients %D/%%ETCDIR%%/postgrey_whitelist_clients; then rm %D/%%ETCDIR%%/postgrey_whitelist_clients; fi
+@unexec if cmp -s %D/etc/postfix/dist-postgrey_whitelist_recipients %D/etc/postfix/postgrey_whitelist_recipients; then rm -f %D/etc/postfix/postgrey_whitelist_recipients; fi
+@unexec if cmp -s %D/etc/postfix/dist-postgrey_whitelist_clients %D/etc/postfix/postgrey_whitelist_clients; then rm -f %D/etc/postfix/postgrey_whitelist_clients; fi
sbin/postgrey
sbin/policy-test
sbin/postgreyreport
-%%ETCDIR%%/dist-postgrey_whitelist_recipients
-@exec [ ! -f %B/postgrey_whitelist_recipients ] && cp %B/%f %B/postgrey_whitelist_recipients
-%%ETCDIR%%/dist-postgrey_whitelist_clients
-@exec [ ! -f %B/postgrey_whitelist_clients ] && cp %B/%f %B/postgrey_whitelist_clients
-@dirrmtry %%ETCDIR%%
-@unexec rmdir %%DBDIR%% 2>/dev/null || true
+etc/postfix/dist-postgrey_whitelist_recipients
+etc/postfix/dist-postgrey_whitelist_clients
+@dirrmtry etc/postfix
+@unexec rmdir /var/db/postgrey 2>/dev/null || true