Index: Makefile =================================================================== RCS file: /home/pcvs/ports/mail/postgrey/Makefile,v retrieving revision 1.15 diff -u -r1.15 Makefile --- Makefile 5 Apr 2007 19:54:45 -0000 1.15 +++ Makefile 27 Jun 2007 07:30:41 -0000 @@ -6,9 +6,9 @@ # PORTNAME= postgrey -PORTVERSION= 1.27 +PORTVERSION= 1.28 CATEGORIES= mail -MASTER_SITES= http://postgrey.schweikert.ch/pub/ +MASTER_SITES= http://postgrey.schweikert.ch/pub/ LOCAL/beech MAINTAINER= haroldp@internal.org COMMENT= Greylisting policy server for Postfix @@ -20,7 +20,10 @@ USE_PERL5_RUN= yes USE_RC_SUBR= postgrey NO_BUILD= yes - +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 @@ -28,28 +31,11 @@ PGY_GROUPID?= ${PGY_USERID} PGY_DIR?= /var/db/postgrey -PKGINSTALL= ${WRKDIR}/pkg-install -PKGDEINSTALL= ${WRKDIR}/pkg-deinstall - -.include - -# Sys::Syslog::openlog won't return 1 for success in perl 5.00503, and causes -# "Couldn't open syslog[] at ... Net/Server.pm line ..." problem. -# See the thread of http://lists.ee.ethz.ch/postgrey/msg00001.html -.if ${PERL_LEVEL} < 500600 -IGNORE= needs perl 5.6.0 or higher, install lang/perl5.8 and try again -.endif - post-patch: ${REINPLACE_CMD} -e "s#/etc/#${PREFIX}/etc/#" ${WRKSRC}/postgrey pre-install: - ${SED} -e 's#%%USER%%#${PGY_USERNAME}#g' -e 's#%%UID%%#${PGY_USERID}#g' \ - -e 's#%%GROUP%%#${PGY_GROUPNAME}#g' -e 's#%%GID%%#${PGY_GROUPID}#g' \ - -e 's#%%PREFIX%%#${PREFIX}#g' -e 's#%%ETCFILES%%#${ETCFILES}#g' \ - -e 's#%%POSTGREYDIR%%#${PGY_DIR}#g' ${MASTERDIR}/pkg-install > \ - ${PKGINSTALL} - ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL do-install: ${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${PREFIX}/sbin @@ -60,6 +46,6 @@ .endfor post-install: - ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL -.include +.include Index: distinfo =================================================================== RCS file: /home/pcvs/ports/mail/postgrey/distinfo,v retrieving revision 1.9 diff -u -r1.9 distinfo --- distinfo 1 Sep 2006 11:03:48 -0000 1.9 +++ distinfo 27 Jun 2007 07:30:41 -0000 @@ -1,3 +1,3 @@ -MD5 (postgrey-1.27.tar.gz) = df3a8b4a0c6ab7e8e5bb5be0de096c47 -SHA256 (postgrey-1.27.tar.gz) = b29f9e6a0648ea8cddd6c96ea827bb33b8346605f6d45d6ebb33a1af8470ce42 -SIZE (postgrey-1.27.tar.gz) = 29221 +MD5 (postgrey-1.28.tar.gz) = 5d9d8a5c62f32fe7584aba2863774926 +SHA256 (postgrey-1.28.tar.gz) = a47ccc0654bc168a68d15a79bd021647292984c4a0c3a67d7a5ff57957b3f8fa +SIZE (postgrey-1.28.tar.gz) = 33445 Index: pkg-install =================================================================== RCS file: pkg-install diff -N pkg-install --- pkg-install 1 Sep 2004 22:11:21 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,63 +0,0 @@ -#! /bin/sh -# -# $FreeBSD: ports/mail/postgrey/pkg-install,v 1.1 2004/09/01 22:11:21 will Exp $ - -PATH=/bin:/usr/bin:/usr/sbin - -case $2 in - -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 group if required - if pw group show "%%GROUP%%" >/dev/null 2>&1; then - echo "---> Using existing group \"%%GROUP%%\"" - else - echo "---> Adding group \"%%GROUP%%\" (%%GID%%)" - /usr/sbin/pw groupadd %%GROUP%% -g %%GID%% || exit 1 - fi - - # Create user if required - if pw user show "%%USER%%" >/dev/null 2>&1; then - echo "---> Using existing user \"%%USER%%\"" - else - echo "---> Adding user \"%%USER%%\" (%%UID%%)" - pw useradd "%%USER%%" -u "%%UID%%" -g "%%GROUP%%" -h - \ - -d "%%POSTGREYDIR%%" -s "/sbin/nologin" -c "Postgrey Owner" || exit 1 - fi - - # Create home directory if required - 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.)" - else - 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 Index: files/pkg-install.in =================================================================== RCS file: files/pkg-install.in diff -N files/pkg-install.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/pkg-install.in 27 Jun 2007 07:30:41 -0000 @@ -0,0 +1,63 @@ +#! /bin/sh +# +# $FreeBSD: ports/mail/postgrey/pkg-install,v 1.1 2004/09/01 22:11:21 will Exp $ + +PATH=/bin:/usr/bin:/usr/sbin + +case $2 in + +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 group if required + if pw group show "%%GROUP%%" >/dev/null 2>&1; then + echo "---> Using existing group \"%%GROUP%%\"" + else + echo "---> Adding group \"%%GROUP%%\" (%%GID%%)" + /usr/sbin/pw groupadd %%GROUP%% -g %%GID%% || exit 1 + fi + + # Create user if required + if pw user show "%%USER%%" >/dev/null 2>&1; then + echo "---> Using existing user \"%%USER%%\"" + else + echo "---> Adding user \"%%USER%%\" (%%UID%%)" + pw useradd "%%USER%%" -u "%%UID%%" -g "%%GROUP%%" -h - \ + -d "%%POSTGREYDIR%%" -s "/sbin/nologin" -c "Postgrey Owner" || exit 1 + fi + + # Create home directory if required + 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.)" + else + 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