summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2004-07-21 22:53:36 +0000
committerschmonz <schmonz@pkgsrc.org>2004-07-21 22:53:36 +0000
commit1577f216d3a2eaee665651f55755faba99abb0c8 (patch)
treee0932de0c402aea7bb61c816b7ff841be39ddd65 /mail
parent23a537e19e06d7ef52307ed130de99b84fd42600 (diff)
downloadpkgsrc-1577f216d3a2eaee665651f55755faba99abb0c8.tar.gz
Use qmail-qfilter's installer, which wins us a manual page. Add
dependency on netqmail (but not qmail, as for pkgsrc purposes this requires the QMAILQUEUE patch). Enable pkgviews installation. Rename post-patch to do-configure, since that's what it's doing. Add a simple script that runs all the filters in ${PKG_SYSCONFDIR} whose filenames match "qfilter-*". Explain how to enable filtering on messages arriving via SMTP using this script. Take MAINTAINER. Bump PKGREVISION.
Diffstat (limited to 'mail')
-rw-r--r--mail/qmail-qfilter/MESSAGE13
-rw-r--r--mail/qmail-qfilter/Makefile39
-rw-r--r--mail/qmail-qfilter/PLIST4
-rw-r--r--mail/qmail-qfilter/files/qmail-qfilter-queue.sh28
4 files changed, 70 insertions, 14 deletions
diff --git a/mail/qmail-qfilter/MESSAGE b/mail/qmail-qfilter/MESSAGE
new file mode 100644
index 00000000000..7a5f3d729bc
--- /dev/null
+++ b/mail/qmail-qfilter/MESSAGE
@@ -0,0 +1,13 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2004/07/21 22:53:36 schmonz Exp $
+
+This package provides a simple script that runs all the filters in
+${PKG_SYSCONFDIR} whose filenames match "qfilter-*".
+These filters will be executed in sort(1) order with no arguments.
+
+To use this script to filter messages arriving via SMTP:
+- Set qmailsmtpd_postenv="QMAILQUEUE=${PREFIX}/bin/qmail-qfilter-queue"
+ in /etc/rc.conf.
+- Restart qmail-smtpd.
+
+===========================================================================
diff --git a/mail/qmail-qfilter/Makefile b/mail/qmail-qfilter/Makefile
index 83eaefbdfab..f6cfcde066e 100644
--- a/mail/qmail-qfilter/Makefile
+++ b/mail/qmail-qfilter/Makefile
@@ -1,34 +1,47 @@
-# $NetBSD: Makefile,v 1.3 2004/04/21 04:56:25 snj Exp $
+# $NetBSD: Makefile,v 1.4 2004/07/21 22:53:36 schmonz Exp $
#
DISTNAME= qmail-qfilter-1.5
+PKGREVISION= 1
CATEGORIES= mail
-MASTER_SITES= http://untroubled.org/qmail-qfilter/
+MASTER_SITES= ${HOMEPAGE}
-MAINTAINER= zuntum@NetBSD.org
+MAINTAINER= schmonz@NetBSD.org
HOMEPAGE= http://untroubled.org/qmail-qfilter/
COMMENT= qmail-queue multi-filter front end
+DEPENDS+= netqmail>=1.05:../../mail/netqmail
+
+PKG_INSTALLATION_TYPES= overwrite pkgviews
+
USE_BUILDLINK3= yes
+USE_PKGINSTALL= yes
+PKG_SYSCONFSUBDIR= qmail-qfilters
+MAKE_DIRS+= ${PKG_SYSCONFDIR}
REPLACE_PERL= samples/block-long-dates \
samples/deny-filetypes \
samples/rename-filetypes
-post-patch:
+INSTALLATION_DIRS= bin man man/man1 share/examples/qmail-qfilter
+
+do-configure:
${ECHO} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
${ECHO} ${CC} ${_STRIPFLAG_CC} > ${WRKSRC}/conf-ld
+ ${ECHO} ${PREFIX}/bin > ${WRKSRC}/conf-bin
+ ${ECHO} ${PREFIX}/man > ${WRKSRC}/conf-man
-do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/qmail-qfilter ${PREFIX}/bin
+post-build:
+ @${SED} ${FILES_SUBST_SED} ${FILESDIR}/qmail-qfilter-queue.sh \
+ > ${WRKDIR}/qmail-qfilter-queue
+do-install:
+ cd ${WRKSRC} && ./installer && ./instcheck
+ ${INSTALL_SCRIPT} ${WRKDIR}/qmail-qfilter-queue ${PREFIX}/bin
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/qmail-qfilter
-
- ${INSTALL_SCRIPT} ${WRKSRC}/samples/block-long-dates \
- ${PREFIX}/share/examples/qmail-qfilter
- ${INSTALL_SCRIPT} ${WRKSRC}/samples/deny-filetypes \
- ${PREFIX}/share/examples/qmail-qfilter
- ${INSTALL_SCRIPT} ${WRKSRC}/samples/rename-filetypes \
- ${PREFIX}/share/examples/qmail-qfilter
+ for i in ${REPLACE_PERL}; do \
+ ${INSTALL_SCRIPT} ${WRKSRC}/$${i} \
+ ${PREFIX}/share/examples/qmail-qfilter; \
+ done
.include "../../mk/bsd.pkg.mk"
diff --git a/mail/qmail-qfilter/PLIST b/mail/qmail-qfilter/PLIST
index d1a52b3d8e9..c51de0ebc88 100644
--- a/mail/qmail-qfilter/PLIST
+++ b/mail/qmail-qfilter/PLIST
@@ -1,5 +1,7 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2003/08/14 11:51:02 zuntum Exp $
+@comment $NetBSD: PLIST,v 1.2 2004/07/21 22:53:36 schmonz Exp $
bin/qmail-qfilter
+bin/qmail-qfilter-queue
+man/man1/qmail-qfilter.1
share/examples/qmail-qfilter/block-long-dates
share/examples/qmail-qfilter/deny-filetypes
share/examples/qmail-qfilter/rename-filetypes
diff --git a/mail/qmail-qfilter/files/qmail-qfilter-queue.sh b/mail/qmail-qfilter/files/qmail-qfilter-queue.sh
new file mode 100644
index 00000000000..9abbe7175fe
--- /dev/null
+++ b/mail/qmail-qfilter/files/qmail-qfilter-queue.sh
@@ -0,0 +1,28 @@
+#!@SH@
+#
+# Wrapper for qmail-queue that filters messages before injecting
+# into the queue.
+#
+# Using this wrapper, executable filters:
+# * Must be placed in @PKG_SYSCONFDIR@
+# * Must have filenames matching "qfilter-*"
+# * Will be executed with no arguments
+# * Will be executed in sort(1) order
+
+possible_qfilters=`@ECHO@ @PKG_SYSCONFDIR@/qfilter-* | @SORT@`
+qfilters=""
+
+if [ "${possible_qfilters}" = "@PKG_SYSCONFDIR@/qfilter-*" ]; then
+ qfilters="@CAT@"
+else
+ for qfilter in ${possible_qfilters}; do
+ if [ -x "${qfilter}" ]; then
+ qfilters="${qfilters} ${qfilter}"
+ fi
+ done
+ [ -z "${qfilters}" ] && qfilters="@CAT@"
+fi
+
+qfilter_cmd="@PREFIX@/bin/qmail-qfilter `@ECHO@ ${qfilters} | @SED@ -e 's| | -- |g'`"
+
+exec ${qfilter_cmd}