pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/qmail-qfilter Use qmail-qfilter's installer, whic...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fa9ccab2fe0f
branches:  trunk
changeset: 478325:fa9ccab2fe0f
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Wed Jul 21 22:53:36 2004 +0000

description:
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:

 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(-)

diffs (125 lines):

diff -r 514ee28663c1 -r fa9ccab2fe0f mail/qmail-qfilter/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-qfilter/MESSAGE        Wed Jul 21 22:53:36 2004 +0000
@@ -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 -r 514ee28663c1 -r fa9ccab2fe0f mail/qmail-qfilter/Makefile
--- a/mail/qmail-qfilter/Makefile       Wed Jul 21 22:42:04 2004 +0000
+++ b/mail/qmail-qfilter/Makefile       Wed Jul 21 22:53:36 2004 +0000
@@ -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@localhost
+MAINTAINER=            schmonz%NetBSD.org@localhost
 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
+
+post-build:
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/qmail-qfilter-queue.sh   \
+               > ${WRKDIR}/qmail-qfilter-queue
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/qmail-qfilter ${PREFIX}/bin
-
+       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 -r 514ee28663c1 -r fa9ccab2fe0f mail/qmail-qfilter/PLIST
--- a/mail/qmail-qfilter/PLIST  Wed Jul 21 22:42:04 2004 +0000
+++ b/mail/qmail-qfilter/PLIST  Wed Jul 21 22:53:36 2004 +0000
@@ -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 -r 514ee28663c1 -r fa9ccab2fe0f mail/qmail-qfilter/files/qmail-qfilter-queue.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail-qfilter/files/qmail-qfilter-queue.sh   Wed Jul 21 22:53:36 2004 +0000
@@ -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}



Home | Main Index | Thread Index | Old Index