Subject: Changes to imap-uw build process
To: None <tech-pkg@netbsd.org>
From: Chris Ross <cross+netbsd@distal.com>
List: current-users
Date: 04/08/2005 02:02:32
--Apple-Mail-2--658517007
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed


   I was once again trying to fine-tune by build and install of imap-uw 
from pkgsrc.
This time, from the 2005Q1 branch, but that doesn't matter too much.

   There is no way to configure it to use IPv6.  So, I took a look at 
how some of
the other pkgsrc things with options (of the PKG_OPTIONS.pkgname form)
work.

   I've made changes to the Makefile for mail/imap-uw to allow an inet6 
option,
as well as moving the other boolean options that were previously handled
with BUILD_DEFS into options.

   It should be clear what I was trying to do, and I think this is a 
good way to
do it.  If you think work should be done to support the old BUILD_DEFS 
and
adapt to them, in case someone's put them in mk.conf or the like, then
that could also be done.

   Thanks.  Let me know any feedback anyone has on this...

                                            - Chris


--Apple-Mail-2--658517007
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="imap-uw.diff"
Content-Disposition: attachment;
	filename=imap-uw.diff

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/imap-uw/Makefile,v
retrieving revision 1.93
diff -u -r1.93 Makefile
--- Makefile	15 Mar 2005 17:03:16 -0000	1.93
+++ Makefile	8 Apr 2005 05:57:20 -0000
@@ -55,7 +55,7 @@
 .  endif
 .endif
 
-BUILD_DEFS+=	IMAP_UW_CCLIENT_MBOX_FMT IMAP_UW_NO_CLEARTEXT IMAP_UW_USE_WHOSON
+BUILD_DEFS+=	IMAP_UW_CCLIENT_MBOX_FMT
 CCLIENT_INCS=	c-client.h env.h env_unix.h flocksim.h flstring.h	\
 		fs.h ftl.h imap4r1.h linkage.c linkage.h mail.h misc.h	\
 		netmsg.h newsrc.h nl.h nntp.h osdep.h rfc822.h		\
@@ -83,21 +83,33 @@
 MAKE_ENV+=	CCLIENT_MINOR=${CCLIENT_MINOR:Q}
 MAKE_ENV+=	CREATEPROTO=${IMAP_UW_CCLIENT_MBOX_FMT:Q}proto
 
+PKG_OPTIONS_VAR=	PKG_OPTIONS.imap-uw
+PKG_SUPPORTED_OPTIONS=	inet6 ssl whoson no-cleartext
+.if !defined(PKG_OPTIONS.imap-uw)
+PKG_DEFAULT_OPTIONS+=	ssl
+.endif
+
+.include "../../mk/bsd.options.mk"
+
 BUILD_TARGET+=	CC="${LIBTOOL} ${CC}"
-.if defined(IMAP_UW_USE_WHOSON) && ${IMAP_UW_USE_WHOSON} == "YES"
+.if !empty(PKG_OPTIONS:Mwhoson)
 BUILD_TARGET+=	EXTRALDFLAGS="${LDFLAGS} -lwhoson"
 BUILD_TARGET+=	EXTRACFLAGS="${CFLAGS} -DUSE_WHOSON"
 .else
 BUILD_TARGET+=	EXTRALDFLAGS="${LDFLAGS}"
 BUILD_TARGET+=	EXTRACFLAGS="${CFLAGS}"
 .endif
-.if defined(IMAP_UW_NO_CLEARTEXT) && ${IMAP_UW_NO_CLEARTEXT} == "YES"
+.if !empty(PKG_OPTIONS:Mno-cleartext)
 BUILD_TARGET+=	SSLTYPE="nopwd"
-.elif !defined(IMAP_UW_NO_SSL) || ${IMAP_UW_NO_SSL} != "YES"
+.elif !empty(PKG_OPTIONS:Mssl)
 BUILD_TARGET+=	SPECIALAUTHENTICATORS="ssl"
 BUILD_TARGET+=	SSLTYPE="unix"
 .endif
 
+.if !empty(PKG_OPTIONS:Minet6)
+BUILD_TARGET+=	IP=6
+.endif
+
 # reduce optimization level on alpha to avoid compiler bugs
 .if ${OPSYS} == "NetBSD"
 .  if ${MACHINE_ARCH} == "alpha"
@@ -191,11 +203,11 @@
 	${INST_PROG} ${WRKSRC}/tmail/tmail ${PREFIX}/bin
 	${INSTALL_MAN} ${WRKSRC}/src/tmail/tmail.1 ${PREFIX}/man/man1
 
-.if !defined(IMAP_UW_NO_SSL) || ${IMAP_UW_NO_SSL} != "YES"
+.if !empty(PKG_OPTIONS:Mssl)
 .include "../../security/openssl/buildlink3.mk"
 .endif
 
-.if defined(IMAP_UW_USE_WHOSON) && ${IMAP_UW_USE_WHOSON} == "YES"
+.if !empty(PKG_OPTIONS:Mwhoson)
 .include "../../net/whoson/buildlink3.mk"
 .endif
 

--Apple-Mail-2--658517007--