aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2007-07-23 06:40:58 +0800
committerpav <pav@FreeBSD.org>2007-07-23 06:40:58 +0800
commita6f2c58b45bf9e7d3dd136d261cbaa2c82802e9a (patch)
tree9734e8f41d3df5b1ace89c7b78ac549b496b724a
parent25ebfdf9a2031f3cafaf0180560abc434d375e13 (diff)
downloadfreebsd-ports-gnome-a6f2c58b45bf9e7d3dd136d261cbaa2c82802e9a.tar.gz
freebsd-ports-gnome-a6f2c58b45bf9e7d3dd136d261cbaa2c82802e9a.tar.zst
freebsd-ports-gnome-a6f2c58b45bf9e7d3dd136d261cbaa2c82802e9a.zip
- take sa-compile out of Makefile and put into pkg-install, so it gets executed
from pkg_add - add two interactive questions (with 120 seconds timeout) - raise minimal version of p5-Net-DNS to .60 - despire documentation, dkim still needs p5-Mail-DomainKeys PR: ports/114188 Submitted by: Michael Scheidell <scheidell@secnap.net> (maintainer)
-rw-r--r--mail/p5-Mail-SpamAssassin/Makefile9
-rw-r--r--mail/p5-Mail-SpamAssassin/pkg-install41
-rw-r--r--mail/p5-Mail-SpamAssassin/pkg-plist4
3 files changed, 50 insertions, 4 deletions
diff --git a/mail/p5-Mail-SpamAssassin/Makefile b/mail/p5-Mail-SpamAssassin/Makefile
index 5c3ba6bc9267..92fcd3de7e2a 100644
--- a/mail/p5-Mail-SpamAssassin/Makefile
+++ b/mail/p5-Mail-SpamAssassin/Makefile
@@ -7,6 +7,7 @@
PORTNAME= Mail-SpamAssassin
PORTVERSION= 3.2.1
+PORTREVISION= 1
CATEGORIES= mail perl5
MASTER_SITES= ${MASTER_SITE_APACHE:S/$/:apache/} ${MASTER_SITE_PERL_CPAN:S/$/:cpan/}
MASTER_SITE_SUBDIR= spamassassin/source/:apache Mail/:cpan
@@ -16,7 +17,7 @@ DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:apache,cpan
MAINTAINER= scheidell@secnap.net
COMMENT= A highly efficient mail filter for identifying spam
-BUILD_DEPENDS= p5-Net-DNS>=0.58:${PORTSDIR}/dns/p5-Net-DNS \
+BUILD_DEPENDS= p5-Net-DNS>=0.60:${PORTSDIR}/dns/p5-Net-DNS \
p5-IO-Zlib>=1.04:${PORTSDIR}/archivers/p5-IO-Zlib \
p5-HTML-Parser>=3.43:${PORTSDIR}/www/p5-HTML-Parser \
p5-IO-Compress-Zlib>=2.04:${PORTSDIR}/archivers/p5-IO-Compress-Zlib \
@@ -61,7 +62,6 @@ WITHOUT_SSL=1
.if defined(WITH_SPF_QUERY)
RUN_DEPENDS+= p5-NetAddr-IP>=4.00.7:${PORTSDIR}/net-mgmt/p5-NetAddr-IP
-# see http://www.freebsd.org/cgi/query-pr.cgi?pr=113638
RUN_DEPENDS+= ${SITE_PERL}/Mail/SPF.pm:${PORTSDIR}/mail/p5-Mail-SPF
.endif
@@ -97,6 +97,7 @@ RUN_DEPENDS+= razor-agents>=2.84:${PORTSDIR}/mail/razor-agents
.if defined(WITH_DKIM)
RUN_DEPENDS+= p5-Mail-DKIM>=.20:${PORTSDIR}/mail/p5-Mail-DKIM
RUN_DEPENDS+= ${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL
+RUN_DEPENDS+= p5-Mail-DomainKeys>=0.80:${PORTSDIR}/mail/p5-Mail-DomainKeys
.endif
.if defined(WITH_SACOMPILE)
@@ -211,6 +212,7 @@ post-patch:
.endif
.if defined(WITH_DKIM)
${REINPLACE_CMD} -e '/DKIM/s/^#loadplugin/loadplugin/' ${WRKSRC}/rules/v312.pre
+ ${REINPLACE_CMD} -e '/DomainKeys/s/^#loadplugin/loadplugin/' ${WRKSRC}/rules/v310.pre
.endif
.if !defined(WITH_SPF_QUERY)
${REINPLACE_CMD} -e '/SPF/s/^loadplugin/#loadplugin/' ${WRKSRC}/rules/init.pre
@@ -239,7 +241,9 @@ pre-install:
@${INSTALL_DATA} ${WRKSRC}/spamc/libspamc.h ${PREFIX}/include
post-install:
+.if defined (WITH_SPAMC)
@${STRIP_CMD} ${PREFIX}/bin/spamc
+.endif
@[ -f ${PREFIX}/etc/mail/spamassassin/init.pre ] || \
${CP} ${PREFIX}/etc/mail/spamassassin/init.pre.sample \
${PREFIX}/etc/mail/spamassassin/init.pre
@@ -252,6 +256,7 @@ post-install:
@[ -f ${PREFIX}/etc/mail/spamassassin/v320.pre ] || \
${CP} ${PREFIX}/etc/mail/spamassassin/v320.pre.sample \
${PREFIX}/etc/mail/spamassassin/v320.pre
+ @PKG_PREFIX=${PREFIX} BATCH=${BATCH} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR} ${DOCSDIR}/sql ${DOCSDIR}/ldap
diff --git a/mail/p5-Mail-SpamAssassin/pkg-install b/mail/p5-Mail-SpamAssassin/pkg-install
index fdb1fde81aef..3167f6aebf62 100644
--- a/mail/p5-Mail-SpamAssassin/pkg-install
+++ b/mail/p5-Mail-SpamAssassin/pkg-install
@@ -1,4 +1,45 @@
#!/bin/sh
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ read -t120 -p "${question} [${default}]? " answer
+ fi
+ echo ${answer:-${default}}
+}
+
+yesno() {
+ local question default answer
+
+ question=$1
+ default=$2
+ while :; do
+ answer=$(ask "${question}" "${default}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+if [ "$2" = "POST-INSTALL" ];then
+
+ if yesno "Do you wish to run sa-update to fetch new rules" "N";then
+ ${PKG_PREFIX}/bin/sa-update
+ fi
+ grep '^load.*Rule2XSBody' ${PKG_PREFIX}/etc/mail/spamassassin/v320.pre > /dev/null
+ if [ $? -eq 0 ];then
+ if yesno "Do you with to compile rules with re2c (will take a long time)" "N";then
+ ${PKG_PREFIX}/bin/sa-compile
+ fi
+ fi
+ exit 0
+fi # post-install
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
diff --git a/mail/p5-Mail-SpamAssassin/pkg-plist b/mail/p5-Mail-SpamAssassin/pkg-plist
index cbc9b1788990..bab87e10fba2 100644
--- a/mail/p5-Mail-SpamAssassin/pkg-plist
+++ b/mail/p5-Mail-SpamAssassin/pkg-plist
@@ -169,8 +169,8 @@ etc/mail/spamassassin/v320.pre.sample
%%DATADIR%%/languages
%%DATADIR%%/sa-update-pubkey.txt
%%DATADIR%%/user_prefs.template
-@unexec rm -rf %D/libdata/spamassassin || true
-@unexec rm -rf /var/lib/spamassassin || true
+@unexec rm -rf /var/lib/spamassassin/2* || true
+@unexec rmdir /var/lib/spamassassin 2>/dev/null || true
@unexec rmdir /var/lib 2>/dev/null || true
@dirrm %%DATADIR%%
@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Mail/SpamAssassin