From e69e3a3a3ca27e3e08abb5237579f7715d3af858 Mon Sep 17 00:00:00 2001 From: schmonz Date: Wed, 21 Jul 2004 22:53:36 +0000 Subject: 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. --- mail/qmail-qfilter/MESSAGE | 13 +++++++++ mail/qmail-qfilter/Makefile | 39 ++++++++++++++++--------- mail/qmail-qfilter/PLIST | 4 ++- mail/qmail-qfilter/files/qmail-qfilter-queue.sh | 28 ++++++++++++++++++ 4 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 mail/qmail-qfilter/MESSAGE create mode 100644 mail/qmail-qfilter/files/qmail-qfilter-queue.sh (limited to 'mail/qmail-qfilter') 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} -- cgit v1.2.3