Subject: pkg/15308: initial QMAILDIR patch for packages using/supporting qmail to correctly handle qmail base directory
To: None <gnats-bugs@gnats.netbsd.org>
From: Lubomir Sedlacik <salo@Xtrmntr.org>
List: netbsd-bugs
Date: 01/20/2002 07:54:41
>Number:         15308
>Category:       pkg
>Synopsis:       initial QMAILDIR patch for packages using/supporting qmail to correctly handle qmail base directory
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 19 23:55:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Lubomir Sedlacik
>Release:        NetBSD 1.5ZA
>Organization:
>Environment:
>Description:

this patch adds QMAILDIR functionality to various packages using or dependent
on qmail to correctly handle qmail base install directory with default value
/var/qmail, which is already used in some of them but in general causing
problems at this moment.

applications patched:

 qmail, qmail-lint, dot-forward, fastforward, ezmlm

others will be patched as soon as i find more time to finnish this task.

when this transformation is finnished, it would be cool to have QMAILDIR as
general variable available in according mk/bsd.mk.* files too. it is extremely
useful when you want to mount your /var nosuid, noexec, etc.

>How-To-Repeat:
>Fix:

patch for mail/qmail:

Index: MESSAGE
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail/MESSAGE,v
retrieving revision 1.2
diff -u -r1.2 MESSAGE
--- MESSAGE	2001/11/26 22:22:19	1.2
+++ MESSAGE	2002/01/20 06:59:54
@@ -1,7 +1,7 @@
 ======================================================================
 $NetBSD: MESSAGE,v 1.2 2001/11/26 22:22:19 zuntum Exp $
 
-  To be able to view manpages either add "/var/qmail/man/" to the
+  To be able to view manpages either add "${QMAILDIR}/man/" to the
   _default line in /etc/man.conf or specify this directory in
   MANPATH variable in your environment.
 
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	2001/11/26 22:22:19	1.4
+++ Makefile	2002/01/20 06:59:54
@@ -29,7 +29,8 @@
 IS_INTERACTIVE=	YES
 NO_PACKAGE=	"Has to be compiled on target system due to installation path issue"
 
-QMAILDIR=	/var/qmail
+QMAILDIR?=	/var/qmail
+MESSAGE_SUBST+=	QMAILDIR=${QMAILDIR}
 
 OWN_DIRS+=	${QMAILDIR}


patch for mail/qmail-lint: 

Index: DESCR
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail-lint/DESCR,v
retrieving revision 1.1
diff -u -r1.1 DESCR
--- DESCR	2001/11/01 01:01:12	1.1
+++ DESCR	2002/01/20 07:15:11
@@ -2,4 +2,3 @@
 
 usage: qmail-lint [-v]
 	-v -- print an explanation of the reports the first time one is printed.
-
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail-lint/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- Makefile	2001/08/13 14:27:07	1.1.1.1
+++ Makefile	2002/01/20 07:15:11
@@ -14,9 +14,18 @@
 
 WRKSRC=		${WRKDIR}
 
+QMAILDIR?=	/var/qmail
+
+FILES_SUBST+=		QMAILDIR=${QMAILDIR}
+FILES_SUBST_SED=	${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/-e s!@/}
+
 USE_PERL5=	yes
 REPLACE_PERL=	${DISTNAME}
 NO_BUILD=	yes
+
+pre-install:
+	@${SED} ${FILES_SUBST_SED} ${WRKSRC}/qmail-lint-0.55 > ${WRKSRC}/qmail-lint-0.55.tmp
+	@${MV} ${WRKSRC}/qmail-lint-0.55.tmp ${WRKSRC}/qmail-lint-0.55
 
 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/${DISTNAME} ${PREFIX}/bin/qmail-lint
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/mail/qmail-lint/distinfo,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 distinfo
--- distinfo	2001/08/13 14:27:07	1.1.1.1
+++ distinfo	2002/01/20 07:15:11
@@ -2,3 +2,4 @@
 
 SHA1 (qmail-lint-0.55) = bbe23a144a216cc85046e0aa9596806b81613c3e
 Size (qmail-lint-0.55) = 13531 bytes
+SHA1 (patch-aa) = c32feefd9acd52d82cc4fdd94353b2bd63355108

NEW FILE! patches/patch-aa
^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /dev/null	Sun Jan 20 08:12:13 2002
+++ patches/patch-aa	Sun Jan 20 08:04:10 2002
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- qmail-lint-0.55.orig	Sun Jan 20 08:00:53 2002
++++ qmail-lint-0.55
+@@ -13,7 +13,7 @@
+ 
+ # CONFIGURATION:
+ 
+-$qmail = "/var/qmail";		# conf-qmail
++$qmail = "@QMAILDIR@";		# conf-qmail
+ $auto_patrn = 002;		# conf-patrn
+ 
+ # CHANGES:


patch for mail/dot-forward:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/dot-forward/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	2002/01/16 07:19:06	1.3
+++ Makefile	2002/01/20 07:35:20
@@ -11,6 +11,8 @@
 
 DEPENDS+=		qmail>=1.03:../../mail/qmail
 
+QMAILDIR?=	/var/qmail
+
 ALL_TARGET=		it
 INSTALL_TARGET=		setup check
 
@@ -21,6 +23,6 @@
 post-patch:
 	${ECHO} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
 	${ECHO} ${CC} ${STRIPFLAG} > ${WRKSRC}/conf-ld
-	${ECHO} ${LOCALBASE}/qmail > ${WRKSRC}/conf-qmail
+	${ECHO} ${QMAILDIR} > ${WRKSRC}/conf-qmail
 
 .include "../../mk/bsd.pkg.mk"


patch for mail/fastforward:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/fastforward/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	2002/01/16 07:19:07	1.3
+++ Makefile	2002/01/20 07:32:45
@@ -11,6 +11,8 @@
 
 DEPENDS+=		qmail>=1.03:../../mail/qmail
 
+QMAILDIR?=	/var/qmail
+
 ALL_TARGET=		it
 INSTALL_TARGET=		setup check
 
@@ -21,5 +23,6 @@
 post-patch:
 	${ECHO} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
 	${ECHO} ${CC} ${STRIPFLAG} > ${WRKSRC}/conf-ld
+	${ECHO} ${QMAILDIR} > ${WRKSRC}/conf-qmail
 
 .include "../../mk/bsd.pkg.mk"


patch for mail/ezmlm:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/ezmlm/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	2002/01/16 07:19:07	1.3
+++ Makefile	2002/01/20 07:30:19
@@ -11,6 +11,8 @@
 
 DEPENDS+=		qmail>=1.03:../../mail/qmail
 
+QMAILDIR?=	/var/qmail
+
 ALL_TARGET=		it man
 INSTALL_TARGET=		setup
 
@@ -23,5 +25,6 @@
 	${ECHO} ${CC} ${STRIPFLAG} > ${WRKSRC}/conf-ld
 	${ECHO} ${PREFIX}/bin > ${WRKSRC}/conf-bin
 	${ECHO} ${PREFIX}/man > ${WRKSRC}/conf-man
+	${ECHO} ${QMAILDIR} > ${WRKSRC}/conf-qmail
 
 .include "../../mk/bsd.pkg.mk"
>Release-Note:
>Audit-Trail:
>Unformatted: