summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-07-26 20:00:27 +0000
committerjlam <jlam@pkgsrc.org>2006-07-26 20:00:27 +0000
commit25e4103cb1266bd0073a2e073d70eb2dee7a1dec (patch)
tree0cc8dc70edc163eb89205dbfe4f361e97659b8c8 /mail
parent0da14467e5ad966f9c252cdc8dc45392d78e6305 (diff)
downloadpkgsrc-25e4103cb1266bd0073a2e073d70eb2dee7a1dec.tar.gz
* Split the MESSAGE file into two parts, one of which only shows up
if "ssl" is a package option. * Stop the abuse of BUILD_TARGET and use MAKE_FLAGS instead. Also, use OPSYSVARS to simplify the specification of the correct BUILD_TARGET for each platform. * Make use of the EXTRASPECIALS variable used by imap makefiles to pass special MAKE_FLAGS settings through to all recursive make processes. This gets rid of some MAKE_ENV statements. * Split off the special alpha-codegen hack into a hacks.mk file. * Do man page fixups at post-build time, not post-extract time. This leaves the files pristine for possible patching. * Add back the special handling if IMAP_UW_MAILSPOOLHOME is defined. It was accidentally removed in patch-am when the whoson modifications were added. Move the modifications to the configure phase instead of post-patch so that the modifications aren't accidentally picked up by mkpatches. * Instead of listing each Makefile that needs the sed modification s/c-client.a/libc-client.la/ and modifying them at post-extract time, simply create patches for them. * Instead of listing each header file to be installed, just derive the list from the PLIST. * Make the libtoolification a bit more transparent by patching libtool references directly into the imap makefiles. * Drop the -limapuw -> -lc-client buildlink transform that was only needed for much older versions of the imap-uw package, and stop installing libimapuw.*. All dependents of imap-uw already correctly use -lc-client. * Fix the handling of the kerberos package option so that we can use the pkgsrc Kerberos 5 packages instead of only using the native ones. * Properly document the options.mk file. Bump the PKGREVISION for the libimapuw.* changes and for the IMAP_UW_MAILSPOOLHOME fixes. The rest of the changes are all pkgsrc-related and don't really affect the binary package.
Diffstat (limited to 'mail')
-rw-r--r--mail/imap-uw/MESSAGE21
-rw-r--r--mail/imap-uw/MESSAGE.ssl23
-rw-r--r--mail/imap-uw/Makefile219
-rw-r--r--mail/imap-uw/PLIST6
-rw-r--r--mail/imap-uw/buildlink3.mk7
-rw-r--r--mail/imap-uw/distinfo23
-rw-r--r--mail/imap-uw/hacks.mk13
-rw-r--r--mail/imap-uw/options.mk80
-rw-r--r--mail/imap-uw/patches/patch-aa28
-rw-r--r--mail/imap-uw/patches/patch-ab73
-rw-r--r--mail/imap-uw/patches/patch-ac15
-rw-r--r--mail/imap-uw/patches/patch-ad15
-rw-r--r--mail/imap-uw/patches/patch-ae15
-rw-r--r--mail/imap-uw/patches/patch-af11
-rw-r--r--mail/imap-uw/patches/patch-aj34
-rw-r--r--mail/imap-uw/patches/patch-al12
-rw-r--r--mail/imap-uw/patches/patch-am14
-rw-r--r--mail/imap-uw/patches/patch-be22
-rw-r--r--mail/imap-uw/patches/patch-bf26
-rw-r--r--mail/imap-uw/patches/patch-bg22
20 files changed, 385 insertions, 294 deletions
diff --git a/mail/imap-uw/MESSAGE b/mail/imap-uw/MESSAGE
index d8d1951415e..5fff7ccfd33 100644
--- a/mail/imap-uw/MESSAGE
+++ b/mail/imap-uw/MESSAGE
@@ -1,33 +1,18 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.3 2005/03/06 17:03:06 thorpej Exp $
+$NetBSD: MESSAGE,v 1.4 2006/07/26 20:00:27 jlam Exp $
Add the following to /etc/services (if not already there):
imap 143/tcp # Internet Message Access Protocol
imap 143/udp
- imaps 993/tcp # imap4 protocol over TLS/SSL
- imaps 993/udp # imap4 protocol over TLS/SSL
- pop3s 995/tcp # pop3 protocol over TLS/SSL (was spop3)
- pop3s 995/udp # pop3 protocol over TLS/SSL (was spop3)
Add the following to /etc/inetd.conf:
imap stream tcp nowait root ${PREFIX}/libexec/imapd imapd
- imaps stream tcp nowait root ${PREFIX}/libexec/imapd imapd
pop2 stream tcp nowait root ${PREFIX}/libexec/ipop2d ipop2d
pop3 stream tcp nowait root ${PREFIX}/libexec/ipop3d ipop3d
- pop3s stream tcp nowait root ${PREFIX}/libexec/ipop3d ipop3d
-In order to use SSL, you will need to configure a certificate and store it
-in the ${SSLCERTS} directory, using the imapd.pem name. Place the key for
-the certificate in the ${SSLKEYS} directory, also using the imapd.pem name.
-If you want to use an existing certificate, say from Apache, just copy the
-certificate and key files to the appropriate locations.
-
-To put the changes into effect, make inetd reload its configuration:
-On NetBSD 1.5 or later:
- /etc/rc.d/inetd reload
-on earlier NetBSD releases:
- kill -HUP `cat /var/run/inetd.pid`
+You will need to make inetd reload its configuration for the changes to
+take effect.
===========================================================================
diff --git a/mail/imap-uw/MESSAGE.ssl b/mail/imap-uw/MESSAGE.ssl
new file mode 100644
index 00000000000..301a77f88eb
--- /dev/null
+++ b/mail/imap-uw/MESSAGE.ssl
@@ -0,0 +1,23 @@
+===========================================================================
+$NetBSD: MESSAGE.ssl,v 1.1 2006/07/26 20:00:27 jlam Exp $
+
+Add the following to /etc/services (if not already there):
+
+ imaps 993/tcp # imap4 protocol over TLS/SSL
+ imaps 993/udp # imap4 protocol over TLS/SSL
+ pop3s 995/tcp # pop3 protocol over TLS/SSL (was spop3)
+ pop3s 995/udp # pop3 protocol over TLS/SSL (was spop3)
+
+Add the following to /etc/inetd.conf:
+
+ imaps stream tcp nowait root ${PREFIX}/libexec/imapd imapd
+ pop3s stream tcp nowait root ${PREFIX}/libexec/ipop3d ipop3d
+
+The imapd daemon looks for the following files to use SSL:
+
+ ${SSLCERTS}/imapd.pem (certificate)
+ ${SSLKEYS}/imapd.pem (private key)
+
+and similarly for the ipopd daemon.
+
+===========================================================================
diff --git a/mail/imap-uw/Makefile b/mail/imap-uw/Makefile
index 71eede37e6d..75c9bcaf6d4 100644
--- a/mail/imap-uw/Makefile
+++ b/mail/imap-uw/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.110 2006/03/04 21:30:00 jlam Exp $
+# $NetBSD: Makefile,v 1.111 2006/07/26 20:00:27 jlam Exp $
#
# ATTENTION:
# The Kerberos support in this software is known to be problematic. If you
@@ -7,6 +7,7 @@
DISTNAME= imap-2004g
PKGNAME= ${DISTNAME:S/-/-uw-/}
+PKGREVISION= 1
CATEGORIES= mail
MASTER_SITES= ftp://ftp.cac.washington.edu/imap/
EXTRACT_SUFX= .tar.Z
@@ -15,162 +16,122 @@ MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.washington.edu/imap/
COMMENT= University of Washington's IMAP, POP2, and POP3 servers
-USE_LIBTOOL= yes
-
-INST_PROG= ${LIBTOOL} --mode=install ${INSTALL_PROGRAM}
-INST_LIB= ${LIBTOOL} --mode=install ${INSTALL_LIB}
-INC_DIR= ${PREFIX}/include/c-client
-LIB_DIR= ${PREFIX}/lib
-DOC_DIR= ${PREFIX}/share/doc/imap-uw
+USE_LIBTOOL= yes
+MAKE_ENV+= LIBTOOL=libtool
+MAKE_ENV+= LTCOMPILE="libtool --mode=compile"
+MAKE_ENV+= LTLINK="libtool --mode=link"
+LTINSTALL_PROGRAM= ${LIBTOOL} --mode=install ${INSTALL_PROGRAM}
+LTINSTALL_LIB= ${LIBTOOL} --mode=install ${INSTALL_LIB}
.include "../../mk/bsd.prefs.mk"
-.if ${OPSYS} == "SunOS"
-BUILD_TARGET= gso
-.elif ${OPSYS} == "Linux"
-BUILD_TARGET= slx
-.elif ${OPSYS} == "Darwin"
-BUILD_TARGET= osx
-.elif ${OPSYS} == "IRIX"
+# Each platform has its own special target in the imap Makefiles.
+OPSYSVARS+= BUILD_TARGET
+BUILD_TARGET.SunOS= gso
+BUILD_TARGET.Linux= slx
+BUILD_TARGET.Darwin= osx
+.if ${OPSYS} == "IRIX"
. if ${OS_VERSION} >= 6.5
-BUILD_TARGET= sg6
+BUILD_TARGET.IRIX= sg6
. else
-BUILD_TARGET= sgi
+BUILD_TARGET.IRIX= sgi
. endif
-.elif ${OPSYS} == "OSF1"
-BUILD_TARGET= osf
-.elif ${OPSYS} == "OpenBSD"
-BUILD_TARGET= bso
-.else
-BUILD_TARGET= neb
.endif
+BUILD_TARGET.OSF1= osf
+BUILD_TARGET.OpenBSD= bso
+BUILD_TARGET.*= neb
+
+MESSAGE_SRC= ${PKGDIR}/MESSAGE
.include "options.mk"
-BUILD_DEFS+= IMAP_UW_CCLIENT_MBOX_FMT IMAP_UW_MAILSPOOLHOME
-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 \
- smtp.h tcp.h utf8.h
-CCLIENT_LIB= libc-client.la
-CCLIENT_PICLIB= libc-client_pic.a
-CCLIENT_MAJOR= 4
-CCLIENT_MINOR= 3
-CCLIENT_MFILES= src/imapd/Makefile \
- src/ipopd/Makefile \
- src/mtest/Makefile \
- src/osdep/unix/Makefile
-
-MESSAGE_SUBST+= SSLCERTS=${SSLCERTS:Q}
-MESSAGE_SUBST+= SSLKEYS=${SSLKEYS:Q}
-PLIST_SUBST+= CCLIENT_MAJOR=${CCLIENT_MAJOR:Q}
-PLIST_SUBST+= CCLIENT_MINOR=${CCLIENT_MINOR:Q}
-
-MANFILES= src/imapd/imapd.8 src/ipopd/ipopd.8
-
-MAKE_ENV+= SSLDIR=${SSLBASE:Q}
-MAKE_ENV+= SSLCERTS=${SSLCERTS:Q}
-MAKE_ENV+= SSLKEYS=${SSLKEYS:Q}
-MAKE_ENV+= CCLIENT_MAJOR=${CCLIENT_MAJOR:Q}
-MAKE_ENV+= CCLIENT_MINOR=${CCLIENT_MINOR:Q}
-MAKE_ENV+= CREATEPROTO=${IMAP_UW_CCLIENT_MBOX_FMT:Q}proto
-
-BUILD_TARGET+= CC="${LIBTOOL} ${CC}"
-BUILD_TARGET+= EXTRALDFLAGS="${LDFLAGS}"
-BUILD_TARGET+= EXTRACFLAGS="${CFLAGS}"
-
-# reduce optimization level on alpha to avoid compiler bugs
-.if ${OPSYS} == "NetBSD"
-. if ${MACHINE_ARCH} == "alpha"
-CPPFLAGS:= ${CPPFLAGS:C/-O[0-9]*/-O/g}
-CFLAGS:= ${CFLAGS:C/-O[0-9]*/-O/g}
-CONFIGURE_ENV+= CPPFLAGS=${CPPFLAGS:M*:Q}
-CONFIGURE_ENV+= CFLAGS=${CFLAGS:M*:Q}
-. endif
+# The defaults for these values are set in pkgsrc/mk/defaults/mk.conf.
+#IMAP_US_CCLIENT_MBOX_FMT?= unix
+#IMAP_US_MAILSPOOLHOME?= .Mailbox
+BUILD_DEFS+= IMAP_UW_CCLIENT_MBOX_FMT IMAP_UW_MAILSPOOLHOME
+
+CCLIENT_LIB= libc-client.la
+CCLIENT_PICLIB= libc-client_pic.a
+CCLIENT_MAJOR= 4
+CCLIENT_MINOR= 3
+MAKE_ENV+= CCLIENT_MAJOR=${CCLIENT_MAJOR:Q}
+MAKE_ENV+= CCLIENT_MINOR=${CCLIENT_MINOR:Q}
+
+EXTRASPECIALS+= CREATEPROTO=${IMAP_UW_CCLIENT_MBOX_FMT:Q}proto
+
+MAKE_FLAGS+= EXTRALDFLAGS=${LDFLAGS:Q}
+MAKE_FLAGS+= EXTRACFLAGS=${CFLAGS:Q}
+MAKE_FLAGS+= EXTRASPECIALS=${EXTRASPECIALS:Q}
+
+SUBST_CLASSES+= mbox
+SUBST_STAGE.mbox= do-configure
+SUBST_FILES.mbox= src/osdep/unix/env_unix.c
+.if defined(IMAP_USE_MAILSPOOLHOME)
+SUBST_SED.mbox= -e 's|@SPOOLDIR@|myhomedir ()|' \
+ -e 's|@MAILBOX@|"${IMAP_UW_MAILSPOOLHOME}"|'
+.else
+SUBST_SED.mbox= -e 's|@SPOOLDIR@|MAILSPOOL|' \
+ -e 's|@MAILBOX@|myusername ()|'
.endif
-INSTALLATION_DIRS+= bin libexec sbin ${PKGMANDIR}/man1 ${PKGMANDIR}/man8
-
-post-extract:
- #
- # Change references to the built library to ${CCLIENT_LIB}.
- #
- cd ${WRKSRC}; for file in ${CCLIENT_MFILES}; do \
- ${MV} -f $${file} $${file}.orig; \
- ${SED} -e "s|c-client.a|${CCLIENT_LIB}|g" \
- $${file}.orig > $${file}; \
- ${RM} -f $${file}.orig; \
- done
- #
- # Correct hardcoded paths in man pages.
- #
- cd ${WRKSRC}; for FILE in ${MANFILES}; do \
- ${CP} $${FILE} $${FILE}.broken; \
- ${SED} -e "s|/usr/etc/imapd|${PREFIX}/libexec/imapd|g" \
+SUBST_CLASSES+= man
+SUBST_STAGE.man= post-build
+SUBST_FILES.man= src/imapd/imapd.8 src/ipopd/ipopd.8
+SUBST_SED.man= -e "s|/usr/etc/imapd|${PREFIX}/libexec/imapd|g" \
-e "s|/etc/rimapd|${PREFIX}/sbin/rimapd|g" \
-e "s|/usr/etc/ipop2d|${PREFIX}/libexec/ipop2d|g" \
- -e "s|/usr/etc/ipop3d|${PREFIX}/libexec/ipop3d|g" \
- $${FILE}.broken > $${FILE}; \
- done
+ -e "s|/usr/etc/ipop3d|${PREFIX}/libexec/ipop3d|g"
-post-patch:
-.if defined(IMAP_UW_MAILSPOOLHOME)
- cd ${WRKSRC}/src/osdep/unix && \
- ${SED} -e 's|@SPOOLDIR@|myhomedir ()|' \
- -e 's|@MAILBOX@|"${IMAP_UW_MAILSPOOLHOME}"|' \
- env_unix.c > env_unix.c.new && \
- ${MV} -f env_unix.c.new env_unix.c
-.else
- cd ${WRKSRC}/src/osdep/unix && \
- ${SED} -e 's|@SPOOLDIR@|MAILSPOOL|' \
- -e 's|@MAILBOX@|myusername ()|' \
- env_unix.c > env_unix.c.new && \
- ${MV} -f env_unix.c.new env_unix.c
-.endif
+INSTALLATION_DIRS+= bin lib libexec sbin \
+ ${PKGMANDIR}/man1 ${PKGMANDIR}/man8
# Generate _pic.a library from shared objects.
-#
post-build:
cd ${WRKSRC}/c-client; \
${LIBTOOL} --mode=link ${CC} -o ${CCLIENT_PICLIB:.a=.la} *.lo
-do-install:
- ${INSTALL_DATA_DIR} ${INC_DIR}
- cd ${WRKSRC}/c-client; ${INSTALL_DATA} ${CCLIENT_INCS} ${INC_DIR}
- ${INSTALL_LIB_DIR} ${LIB_DIR}
- ${INST_LIB} ${WRKSRC}/c-client/${CCLIENT_LIB} ${LIB_DIR}
- ${INSTALL_LIB} ${WRKSRC}/c-client/.libs/${CCLIENT_PICLIB} ${LIB_DIR}
- ${RANLIB} ${LIB_DIR}/${CCLIENT_PICLIB}
- cd ${LIB_DIR}; for file in libc-client.*; do \
- case $$file in \
- *.la) ;; \
- *) \
- f=`${ECHO} $${file} | ${SED} "s|libc-client|libimapuw|g"`; \
- ${TEST} -f $${file} && ${LN} -f $${file} $${f}; \
- ;; \
- esac; \
- done
- ${INST_PROG} ${WRKSRC}/imapd/imapd ${PREFIX}/libexec
- ${INST_PROG} ${WRKSRC}/ipopd/ipop2d ${PREFIX}/libexec
- ${INST_PROG} ${WRKSRC}/ipopd/ipop3d ${PREFIX}/libexec
- ${INST_PROG} ${WRKSRC}/mtest/mtest ${PREFIX}/sbin
+do-install: install-headers install-lib install-doc
+ ${LTINSTALL_PROGRAM} ${WRKSRC}/imapd/imapd ${PREFIX}/libexec
+ ${LTINSTALL_PROGRAM} ${WRKSRC}/ipopd/ipop2d ${PREFIX}/libexec
+ ${LTINSTALL_PROGRAM} ${WRKSRC}/ipopd/ipop3d ${PREFIX}/libexec
+ ${LTINSTALL_PROGRAM} ${WRKSRC}/mtest/mtest ${PREFIX}/sbin
${LN} -sf ../libexec/imapd ${PREFIX}/sbin/rimapd
${INSTALL_MAN} ${WRKSRC}/src/imapd/imapd.8 ${PREFIX}/${PKGMANDIR}/man8
${INSTALL_MAN} ${WRKSRC}/src/ipopd/ipopd.8 ${PREFIX}/${PKGMANDIR}/man8
${LN} -sf ipopd.8 ${PREFIX}/${PKGMANDIR}/man8/ipop2d.8
${LN} -sf ipopd.8 ${PREFIX}/${PKGMANDIR}/man8/ipop3d.8
- ${INSTALL_DATA_DIR} ${DOC_DIR}
- ${CP} -R ${WRKSRC}/docs/* ${DOC_DIR}
- ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DOC_DIR}
- ${FIND} ${DOC_DIR} -type d -print | ${XARGS} ${CHMOD} ${PKGDIRMODE}
- ${FIND} ${DOC_DIR} -type f -print | ${XARGS} ${CHMOD} ${SHAREMODE}
-
- ${INST_PROG} ${WRKSRC}/mailutil/mailutil ${PREFIX}/bin
+ ${LTINSTALL_PROGRAM} ${WRKSRC}/mailutil/mailutil ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/src/mailutil/mailutil.1 ${PREFIX}/${PKGMANDIR}/man1
- ${INST_PROG} ${WRKSRC}/dmail/dmail ${PREFIX}/bin
+ ${LTINSTALL_PROGRAM} ${WRKSRC}/dmail/dmail ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/src/dmail/dmail.1 ${PREFIX}/${PKGMANDIR}/man1
- ${INST_PROG} ${WRKSRC}/mlock/mlock ${PREFIX}/bin
- ${INST_PROG} ${WRKSRC}/tmail/tmail ${PREFIX}/bin
+ ${LTINSTALL_PROGRAM} ${WRKSRC}/mlock/mlock ${PREFIX}/bin
+ ${LTINSTALL_PROGRAM} ${WRKSRC}/tmail/tmail ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/src/tmail/tmail.1 ${PREFIX}/${PKGMANDIR}/man1
+.PHONY: install-headers install-lib install-doc
+install-headers:
+ ${INSTALL_DATA_DIR} ${PREFIX}/include/c-client
+ ${CAT} ${PKGDIR}/PLIST | \
+ while read entry; do \
+ case "$$entry" in \
+ include/c-client/*) \
+ src="${WRKSRC}/c-client/`${BASENAME} $$entry`"; \
+ dest="${PREFIX}/$$entry"; \
+ ${INSTALL_DATA} $$src $$dest; \
+ esac; \
+ done
+
+install-lib:
+ ${LTINSTALL_LIB} ${WRKSRC}/c-client/${CCLIENT_LIB} ${PREFIX}/lib
+ ${INSTALL_LIB} ${WRKSRC}/c-client/.libs/${CCLIENT_PICLIB} ${PREFIX}/lib
+ ${RANLIB} ${PREFIX}/lib/${CCLIENT_PICLIB}
+
+DOCDIR= ${PREFIX}/share/doc/${PKGBASE}
+install-doc:
+ ${INSTALL_DATA_DIR} ${DOCDIR}
+ ${CP} -R ${WRKSRC}/docs/* ${DOCDIR}
+ ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DOCDIR}
+ ${FIND} ${DOCDIR} -type d -print | ${XARGS} ${CHMOD} ${PKGDIRMODE}
+ ${FIND} ${DOCDIR} -type f -print | ${XARGS} ${CHMOD} ${SHAREMODE}
+
.include "../../mk/bsd.pkg.mk"
diff --git a/mail/imap-uw/PLIST b/mail/imap-uw/PLIST
index b5ba2bb17da..7cbd17670b1 100644
--- a/mail/imap-uw/PLIST
+++ b/mail/imap-uw/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.11 2006/01/13 12:12:19 abs Exp $
+@comment $NetBSD: PLIST,v 1.12 2006/07/26 20:00:27 jlam Exp $
bin/dmail
bin/mailutil
bin/mlock
@@ -26,10 +26,6 @@ include/c-client/tcp.h
include/c-client/utf8.h
lib/libc-client.la
lib/libc-client_pic.a
-lib/libimapuw.a
-lib/libimapuw.so
-lib/libimapuw.so.4
-lib/libimapuw.so.4.0.3
libexec/imapd
libexec/ipop2d
libexec/ipop3d
diff --git a/mail/imap-uw/buildlink3.mk b/mail/imap-uw/buildlink3.mk
index a02f1ed9900..0611835b5bc 100644
--- a/mail/imap-uw/buildlink3.mk
+++ b/mail/imap-uw/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.9 2006/07/08 23:10:57 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.10 2006/07/26 20:00:27 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
IMAP_UW_BUILDLINK3_MK:= ${IMAP_UW_BUILDLINK3_MK}+
@@ -15,11 +15,6 @@ BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}imap-uw
BUILDLINK_API_DEPENDS.imap-uw+= imap-uw>=2004
BUILDLINK_ABI_DEPENDS.imap-uw+= imap-uw>=2004enb1
BUILDLINK_PKGSRCDIR.imap-uw?= ../../mail/imap-uw
-#
-# Make "-limapuw" resolve into "-lc-client".
-#
-BUILDLINK_TRANSFORM+= l:imapuw:c-client
-
.endif # IMAP_UW_BUILDLINK3_MK
.include "../../security/openssl/buildlink3.mk"
diff --git a/mail/imap-uw/distinfo b/mail/imap-uw/distinfo
index fd194b4ffa0..3dff987fa19 100644
--- a/mail/imap-uw/distinfo
+++ b/mail/imap-uw/distinfo
@@ -1,21 +1,21 @@
-$NetBSD: distinfo,v 1.28 2006/07/07 05:45:51 minskim Exp $
+$NetBSD: distinfo,v 1.29 2006/07/26 20:00:27 jlam Exp $
SHA1 (imap-2004g.tar.Z) = 791a8bb247ca51ce0a4c32e814a2f736c2bcf066
RMD160 (imap-2004g.tar.Z) = a016a06ba073e879d2574a6395ce1074ea74c687
Size (imap-2004g.tar.Z) = 2246713 bytes
-SHA1 (patch-aa) = 6ea304a31bb501921600e40e480854f2f30a46cf
-SHA1 (patch-ab) = bdb366eec82bf8a5851a7c3b8acba9393f889aea
-SHA1 (patch-ac) = 8b4ea8c15929c65eda1b3444c68fdbf70fa68b6a
-SHA1 (patch-ad) = 3404de4e4acb456e3c7b34ca80b31b80b465b3e1
-SHA1 (patch-ae) = 702473377ca66266bdb6d5d13045d279a38ea7de
-SHA1 (patch-af) = 07e6b95a8aea0ea0ee6ccc20c1906ddf16ef6d61
+SHA1 (patch-aa) = 5e7dd27e949a191ddaeac9d7ba1db4e0fd258bc8
+SHA1 (patch-ab) = 3209c7902e2f91a701b7b5e8ae300920d9506646
+SHA1 (patch-ac) = 802b456555f6e79f60444cfe32d42e053d73cef8
+SHA1 (patch-ad) = e4b64935d0af726d3771489df411454788722727
+SHA1 (patch-ae) = 2e33641db5081e0f15e612db98f841591d5b2dd7
+SHA1 (patch-af) = 5800937da2881849508c9012bc268e5acd2fff3e
SHA1 (patch-ag) = 452fcfc1bd17d3cc65e5012db56d37af25bcf3b6
SHA1 (patch-ah) = 06d780220e21b4dd4b601f66efb6e73ee95991e2
SHA1 (patch-ai) = c495ed39fbc01e1d8b05f6acd3d11394978f9b43
-SHA1 (patch-aj) = 0a728d3b5271c048275a4d41002877e86ac275b2
+SHA1 (patch-aj) = 607286c1fd5eb97a07ffb812387f6a005aaee9c5
SHA1 (patch-ak) = c798b2aad17091526c667a552839cfe1ec0e23c9
-SHA1 (patch-al) = b746d36cb324114468d07d1aba7d22c5bd5b23b2
-SHA1 (patch-am) = 891de03bbc24de9eaf70d74c69b5b66d0b6b94b4
+SHA1 (patch-al) = 2915edc654c185311e09cef571b443c4a9ff7e3c
+SHA1 (patch-am) = 0aea2cbe98da312740e678355b11fc964a822cda
SHA1 (patch-ao) = 777b30793ea2e1f33be14e34d837f1f0cc5d0d67
SHA1 (patch-ap) = ce224812b0744a699e5e07916ca04510bf62da25
SHA1 (patch-aq) = 7cf038fcb8e072fa46604ac0ac8c02c0d6d3608e
@@ -32,3 +32,6 @@ SHA1 (patch-ba) = 64b89d377501861ddeecaf58f845132b95ac8f75
SHA1 (patch-bb) = 220bfb5885dd73cf3375b26bda6be1ea2d39d069
SHA1 (patch-bc) = b3cd7d728de313cd00af2d9c99cadc2478006232
SHA1 (patch-bd) = 2dbffe2f11d1c0c2b05eabe3fc976c230e821709
+SHA1 (patch-be) = 032ae39806995e27aba5ab67089a467d3fbe5597
+SHA1 (patch-bf) = 42eee80df6095a7ca0141306743786f6f44545f8
+SHA1 (patch-bg) = 778318297c8a5af995286e447c23503790152bb9
diff --git a/mail/imap-uw/hacks.mk b/mail/imap-uw/hacks.mk
new file mode 100644
index 00000000000..a781c361e59
--- /dev/null
+++ b/mail/imap-uw/hacks.mk
@@ -0,0 +1,13 @@
+# $NetBSD: hacks.mk,v 1.1 2006/07/26 20:00:27 jlam Exp $
+
+.include "../../mk/compiler.mk"
+
+### [Thu Jan 23 01:28:36 2003 UTC : dmcmahill]
+### On PowerPC, building with optimisation with GCC causes an "attempt
+### to free unreference scalar". Remove optimisation flags as a
+### workaround until GCC is fixed.
+###
+.if !empty(CC_VERSION:Mgcc*) && !empty(MACHINE_PLATFORM:MNetBSD-*-alpha)
+PKG_HACKS+= alpha-codegen
+BUILDLINK_TRANSFORM+= rename:-O[0-9]*:-O
+.endif
diff --git a/mail/imap-uw/options.mk b/mail/imap-uw/options.mk
index cde1fa53b86..ad394cc12c3 100644
--- a/mail/imap-uw/options.mk
+++ b/mail/imap-uw/options.mk
@@ -1,44 +1,74 @@
-# $NetBSD: options.mk,v 1.2 2006/01/01 18:53:03 wiz Exp $
+# $NetBSD: options.mk,v 1.3 2006/07/26 20:00:27 jlam Exp $
.include "../../mk/bsd.prefs.mk"
-# Kerberos is explicitly not enabled on NetBSD 1.x due to interoperability
-# issues with later versions of OpenSSL (e.g. 0.9.7)
-.if empty(MACHINE_PLATFORM:MNetBSD-1.*)
-PKG_SUPPORTED_OPTIONS+= kerberos
-.endif
-
PKG_OPTIONS_VAR= PKG_OPTIONS.imap-uw
-PKG_SUPPORTED_OPTIONS+= inet6 ssl imapuw-cleartextpwd imapuw-whoson
-PKG_SUGGESTED_OPTIONS+= ssl imapuw-cleartextpwd
-
-.include "../../mk/bsd.options.mk"
+PKG_SUPPORTED_OPTIONS+= imapuw-cleartextpwd imapuw-whoson inet6 ssl
+PKG_SUGGESTED_OPTIONS+= imapuw-cleartextpwd ssl
-.if empty(PKG_OPTIONS:Minet6)
-MAKE_ENV+= IP=4
+# On NetBSD 1.x, using the native Kerberos 5 implementation causes
+# interoperability problems with OpenSSL 0.9.7 and above.
+#
+.if !empty(MACHINE_PLATFORM:MNetBSD-1.*)
+CHECK_BUILTIN.heimdal:= yes
+. include "../../security/heimdal/builtin.mk"
+CHECK_BUILTIN.heimdal:= no
+. if !empty(USE_BUILTIN.heimdal:M[nN][oO])
+PKG_SUPPORTED_OPTIONS+= kerberos
+. endif
.else
-MAKE_ENV+= IP=6
+PKG_SUPPORTED_OPTIONS+= kerberos
.endif
-.if !empty(PKG_OPTIONS:Mkerberos)
-PKG_USE_KERBEROS= yes
+.include "../../mk/bsd.options.mk"
-BUILD_TARGET+= EXTRAAUTHENTICATORS="gss"
+###
+### Support both IPv6 and IPv4 connections.
+###
+.if !empty(PKG_OPTIONS:Minet6)
+MAKE_FLAGS+= IP=6
+.else
+MAKE_FLAGS+= IP=4
.endif
-.if !empty(PKG_OPTIONS:Mssl)
-.include "../../security/openssl/buildlink3.mk"
+###
+### Support GSSAPI authentication via Kerberos 5.
+###
+.if !empty(PKG_OPTIONS:Mkerberos)
+. include "../../mk/krb5.buildlink3.mk"
+MAKE_ENV+= KRB5_TYPE=${KRB5_TYPE}
+MAKE_FLAGS+= EXTRAAUTHENTICATORS=gss
+EXTRASPECIALS+= GSSDIR=${KRB5BASE}
+CFLAGS.heimdal= -DHEIMDAL_KRB5
+CFLAGS+= ${CFLAGS.${KRB5_TYPE}}
.endif
+###
+### Support using WHOSON for authentication.
+###
.if !empty(PKG_OPTIONS:Mimapuw-whoson)
+. include "../../net/whoson/buildlink3.mk"
LDFLAGS+= -lwhoson
CFLAGS+= -DUSE_WHOSON
-.include "../../net/whoson/buildlink3.mk"
.endif
-.if empty(PKG_OPTIONS:Mimapuw-cleartextpwd)
-BUILD_TARGET+= SSLTYPE="nopwd"
-.elif !empty(PKG_OPTIONS:Mssl)
-BUILD_TARGET+= SPECIALAUTHENTICATORS="ssl"
-BUILD_TARGET+= SSLTYPE="unix"
+###
+### Support SSL/TLS connections.
+###
+.if !empty(PKG_OPTIONS:Mssl)
+. include "../../security/openssl/buildlink3.mk"
+. if !empty(PKG_OPTIONS:Mimapuw-cleartextpwd)
+MAKE_FLAGS+= SSLTYPE=unix # plaintext auth
+. else
+MAKE_FLAGS+= SSLTYPE=nopwd # plaintext auth only over SSL/TLS
+. endif
+MESSAGE_SRC+= ${PKGDIR}/MESSAGE.ssl
+MESSAGE_SUBST+= SSLCERTS=${SSLCERTS:Q}
+MESSAGE_SUBST+= SSLKEYS=${SSLKEYS:Q}
+
+EXTRASPECIALS+= SSLDIR=${SSLBASE:Q}
+EXTRASPECIALS+= SSLCERTS=${SSLCERTS:Q}
+EXTRASPECIALS+= SSLKEYS=${SSLKEYS:Q}
+.else
+MAKE_FLAGS+= SSLTYPE=none # no SSL/TLS
.endif
diff --git a/mail/imap-uw/patches/patch-aa b/mail/imap-uw/patches/patch-aa
index 7afeb974bd5..331474cf76a 100644
--- a/mail/imap-uw/patches/patch-aa
+++ b/mail/imap-uw/patches/patch-aa
@@ -1,26 +1,24 @@
-$NetBSD: patch-aa,v 1.16 2006/01/12 20:53:51 adam Exp $
+$NetBSD: patch-aa,v 1.17 2006/07/26 20:00:27 jlam Exp $
---- Makefile.orig 2005-04-30 22:50:20.000000000 +0200
+--- Makefile.orig 2005-04-30 16:50:20.000000000 -0400
+++ Makefile
-@@ -180,7 +180,7 @@ SSLTYPE=nopwd
- # 4 (default) IPv4 support only
- # 6 IPv6 and IPv4 support
-
--IP=4
-+#IP=4
-
-
- # The following extra compilation flags are defined. None of these flags are
-@@ -474,9 +474,9 @@ sslunix sslsco:
+@@ -474,9 +474,6 @@ sslunix sslsco:
@echo + In order to rectify this problem, you MUST build with:
@echo ++ SSLTYPE=$(SSLTYPE).nopwd
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- @echo
- @echo Do you want to continue this build anyway? Type y or n please:
- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) exit 1;; esac'
-+# @echo
-+# @echo Do you want to continue this build anyway? Type y or n please:
-+# @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) exit 1;; esac'
sslnone:
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+@@ -489,9 +486,6 @@ sslnone:
+ @echo ++ SSLTYPE=nopwd
+ @echo + You must also have OpenSSL or equivalent installed.
+ @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+- @echo
+- @echo Do you want to continue this build anyway? Type y or n please:
+- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) exit 1;; esac'
+
+
+ # C compiler types
diff --git a/mail/imap-uw/patches/patch-ab b/mail/imap-uw/patches/patch-ab
index 0e0f825e0a6..5e5f91b27c8 100644
--- a/mail/imap-uw/patches/patch-ab
+++ b/mail/imap-uw/patches/patch-ab
@@ -1,44 +1,17 @@
-$NetBSD: patch-ab,v 1.18 2006/07/07 05:45:51 minskim Exp $
+$NetBSD: patch-ab,v 1.19 2006/07/26 20:00:27 jlam Exp $
---- src/osdep/unix/Makefile.orig 2006-07-06 22:20:44.000000000 -0700
+--- src/osdep/unix/Makefile.orig 2005-04-30 16:51:13.000000000 -0400
+++ src/osdep/unix/Makefile
-@@ -41,9 +41,6 @@ GCCOPTLEVEL= -O2
+@@ -124,7 +124,7 @@ DEFAULTDRIVERS=imap nntp pop3 mh mx mbx
- # Extended flags needed for SSL. You may need to modify.
+ # Normally no need to change any of these
--SSLDIR=/usr/local/ssl
--SSLCERTS=$(SSLDIR)/certs
--SSLKEYS=$(SSLCERTS)
- SSLINCLUDE=$(SSLDIR)/include
- SSLLIB=$(SSLDIR)/lib
-
-@@ -60,7 +57,7 @@ SSLRSA= # -lRSAglue -lrsaref
-
- SSLCFLAGS= -I$(SSLINCLUDE) -I$(SSLINCLUDE)/openssl\
- -DSSL_CERT_DIRECTORY=\"$(SSLCERTS)\" -DSSL_KEY_DIRECTORY=\"$(SSLKEYS)\"
--SSLLDFLAGS= -L$(SSLLIB) -lssl $(SSLCRYPTO) $(SSLRSA)
-+SSLLDFLAGS= -lssl $(SSLCRYPTO) $(SSLRSA)
-
-
- # Extended flags needed for non-standard passwd types. You may need to modify.
-@@ -104,14 +101,14 @@ LOCKPGM=/etc/mlock
- # set certain other formats (e.g. mbx and mx) as the EMPTYPROTO since these
- # formats can never be empty files.
-
--CREATEPROTO=unixproto
-+#CREATEPROTO=unixproto
- EMPTYPROTO=unixproto
-
-
- # Commands possibly overriden by the individual port
-
- ARRC=ar rc
--CC=cc
-+#CC=cc
- LN=ln -s
- RANLIB=ranlib
-
-@@ -403,9 +400,9 @@ gso: os_sol.h # GCC Solaris
+-ARCHIVE=c-client.a
++ARCHIVE=libc-client.la
+ BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf8.o siglocal.o \
+ dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
+ rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
+@@ -403,9 +403,9 @@ gso: os_sol.h # GCC Solaris
SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
ACTIVEFILE=/usr/share/news/active \
RSHPATH=/usr/bin/rsh \
@@ -50,7 +23,7 @@ $NetBSD: patch-ab,v 1.18 2006/07/07 05:45:51 minskim Exp $
gsu: # GCC SUN-OS
$(BUILD) `$(CAT) SPECIALS` OS=sun \
-@@ -495,9 +492,9 @@ neb: # NetBSD
+@@ -495,9 +495,9 @@ neb: # NetBSD
$(BUILD) `$(CAT) SPECIALS` OS=bsi \
CRXTYPE=nfs \
SPOOLDIR=/var \
@@ -62,7 +35,7 @@ $NetBSD: patch-ab,v 1.18 2006/07/07 05:45:51 minskim Exp $
BASELDFLAGS="-lcrypt"
nec: # NEC UX
-@@ -549,7 +546,7 @@ osx: # Mac OS X
+@@ -549,7 +549,7 @@ osx: # Mac OS X
$(BUILD) `$(CAT) SPECIALS` OS=$@ \
CRXTYPE=nfs \
SPOOLDIR=/var/spool MAILSPOOL=/var/mail \
@@ -71,12 +44,30 @@ $NetBSD: patch-ab,v 1.18 2006/07/07 05:45:51 minskim Exp $
ptx: # PTX
$(BUILD) `$(CAT) SPECIALS` OS=$@ \
-@@ -924,7 +921,7 @@ onceenv:
+@@ -811,7 +811,7 @@ $(ARCHIVE): $(BINARIES)
+ @$(SH) ARCHIVE
+
+ .c.o:
+- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
++ $(LTCOMPILE) `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
+
+
+ # Cleanup
+@@ -869,7 +869,7 @@ osdep.o:mail.h misc.h env.h fs.h ftl.h n
+ @echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
+ @echo is not installed on your system. Either install OpenSSL first
+ @echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none
+- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
++ $(LTCOMPILE) `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
+
+ osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
+ $(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
+@@ -924,7 +924,7 @@ onceenv:
-DACTIVEFILE=\"$(ACTIVEFILE)\" -DNEWSSPOOL=\"$(NEWSSPOOL)\" \
-DRSHPATH=\"$(RSHPATH)\" -DLOCKPGM=\"$(LOCKPGM)\" > OSCFLAGS
echo $(BASELDFLAGS) $(EXTRALDFLAGS) > LDFLAGS
- echo "$(ARRC) $(ARCHIVE) $(BINARIES);$(RANLIB) $(ARCHIVE)" > ARCHIVE
-+ echo "$(CC) -o $(ARCHIVE) $(BINARIES:.o=.lo) -rpath $(PREFIX)/lib -version-info $(CCLIENT_MAJOR):$(CCLIENT_MINOR) \`cat LDFLAGS\`" > ARCHIVE
++ echo "$(LTLINK) $(CC) -o $(ARCHIVE) $(BINARIES:.o=.lo) -rpath $(PREFIX)/lib -version-info $(CCLIENT_MAJOR):$(CCLIENT_MINOR) `$(CAT) LDFLAGS`" > ARCHIVE
echo $(OS) > OSTYPE
./drivers $(EXTRADRIVERS) $(DEFAULTDRIVERS) dummy
./mkauths $(EXTRAAUTHENTICATORS) $(DEFAULTAUTHENTICATORS)
diff --git a/mail/imap-uw/patches/patch-ac b/mail/imap-uw/patches/patch-ac
index 1e176aebbc7..889aa10010e 100644
--- a/mail/imap-uw/patches/patch-ac
+++ b/mail/imap-uw/patches/patch-ac
@@ -1,7 +1,7 @@
-$NetBSD: patch-ac,v 1.5 2002/12/11 12:21:23 tron Exp $
+$NetBSD: patch-ac,v 1.6 2006/07/26 20:00:27 jlam Exp $
---- src/mailutil/Makefile.orig Tue Nov 19 01:41:46 2002
-+++ src/mailutil/Makefile Wed Dec 11 12:34:19 2002
+--- src/mailutil/Makefile.orig 2002-11-18 19:41:46.000000000 -0500
++++ src/mailutil/Makefile
@@ -19,7 +19,7 @@
@@ -11,3 +11,12 @@ $NetBSD: patch-ac,v 1.5 2002/12/11 12:21:23 tron Exp $
SHELL = /bin/sh
# Get local definitions from c-client directory
+@@ -29,7 +29,7 @@ CFLAGS = -I$C `cat $C/CFLAGS`
+ LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+
+ mailutil: $(CCLIENTLIB) mailutil.o
+- $(CC) $(CFLAGS) -o mailutil mailutil.o $(LDFLAGS)
++ $(LTLINK) $(CC) $(CFLAGS) -o mailutil mailutil.o $(LDFLAGS)
+
+ mailutil.o: $C/mail.h $C/misc.h $C/osdep.h
+
diff --git a/mail/imap-uw/patches/patch-ad b/mail/imap-uw/patches/patch-ad
index 54a27808953..79163224251 100644
--- a/mail/imap-uw/patches/patch-ad
+++ b/mail/imap-uw/patches/patch-ad
@@ -1,7 +1,7 @@
-$NetBSD: patch-ad,v 1.5 2002/12/11 12:21:24 tron Exp $
+$NetBSD: patch-ad,v 1.6 2006/07/26 20:00:27 jlam Exp $
---- src/dmail/Makefile.orig Tue Nov 19 01:43:31 2002
-+++ src/dmail/Makefile Wed Dec 11 12:34:22 2002
+--- src/dmail/Makefile.orig 2002-11-18 19:43:31.000000000 -0500
++++ src/dmail/Makefile
@@ -18,7 +18,7 @@
@@ -11,3 +11,12 @@ $NetBSD: patch-ad,v 1.5 2002/12/11 12:21:24 tron Exp $
SHELL = /bin/sh
# Get local definitions from c-client directory
+@@ -28,7 +28,7 @@ CFLAGS = -I$C `cat $C/CFLAGS`
+ LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+
+ dmail: $(CCLIENTLIB) dmail.o
+- $(CC) $(CFLAGS) -o dmail dmail.o $(LDFLAGS)
++ $(LTLINK) $(CC) $(CFLAGS) -o dmail dmail.o $(LDFLAGS)
+
+ dmail.o: $C/mail.h $C/misc.h $C/osdep.h
+
diff --git a/mail/imap-uw/patches/patch-ae b/mail/imap-uw/patches/patch-ae
index dea4c804fb0..c17bf1315e0 100644
--- a/mail/imap-uw/patches/patch-ae
+++ b/mail/imap-uw/patches/patch-ae
@@ -1,7 +1,7 @@
-$NetBSD: patch-ae,v 1.15 2002/12/11 12:21:24 tron Exp $
+$NetBSD: patch-ae,v 1.16 2006/07/26 20:00:27 jlam Exp $
---- src/tmail/Makefile.orig Tue Nov 19 01:45:14 2002
-+++ src/tmail/Makefile Wed Dec 11 12:34:26 2002
+--- src/tmail/Makefile.orig 2002-11-18 19:45:14.000000000 -0500
++++ src/tmail/Makefile
@@ -18,7 +18,7 @@
@@ -11,3 +11,12 @@ $NetBSD: patch-ae,v 1.15 2002/12/11 12:21:24 tron Exp $
SHELL = /bin/sh
# Get local definitions from c-client directory
+@@ -28,7 +28,7 @@ CFLAGS = -I$C `cat $C/CFLAGS`
+ LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+
+ tmail: $(CCLIENTLIB) tmail.o
+- $(CC) $(CFLAGS) -o tmail tmail.o $(LDFLAGS)
++ $(LTLINK) $(CC) $(CFLAGS) -o tmail tmail.o $(LDFLAGS)
+
+ tmail.o: $C/mail.h $C/misc.h $C/osdep.h
+
diff --git a/mail/imap-uw/patches/patch-af b/mail/imap-uw/patches/patch-af
index 371d6bf3785..198b4cc5046 100644
--- a/mail/imap-uw/patches/patch-af
+++ b/mail/imap-uw/patches/patch-af
@@ -1,13 +1,12 @@
-$NetBSD: patch-af,v 1.5 2003/07/28 14:40:27 adam Exp $
+$NetBSD: patch-af,v 1.6 2006/07/26 20:00:27 jlam Exp $
---- src/osdep/unix/kerb_mit.c.orig 2003-03-05 06:27:21.000000000 +0100
-+++ src/osdep/unix/kerb_mit.c 2003-07-28 15:47:17.000000000 +0200
-@@ -18,9 +18,16 @@
+--- src/osdep/unix/kerb_mit.c.orig 2003-10-17 12:39:42.000000000 -0400
++++ src/osdep/unix/kerb_mit.c
+@@ -18,9 +18,15 @@
* CPYRIGHT, included with this Distribution.
*/
-+#ifdef __NetBSD__
-+/* This is really Heimdal specific, but . . . */
++#ifdef HEIMDAL_KRB5
+#include <gssapi/gssapi.h>
+#include <krb5/krb5.h>
+#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
diff --git a/mail/imap-uw/patches/patch-aj b/mail/imap-uw/patches/patch-aj
index 66179ef4477..239fb5a2aa6 100644
--- a/mail/imap-uw/patches/patch-aj
+++ b/mail/imap-uw/patches/patch-aj
@@ -1,28 +1,20 @@
-$NetBSD: patch-aj,v 1.11 2003/07/28 14:38:06 adam Exp $
+$NetBSD: patch-aj,v 1.12 2006/07/26 20:00:27 jlam Exp $
---- src/osdep/unix/Makefile.gss.orig 2003-07-28 15:34:51.000000000 +0200
-+++ src/osdep/unix/Makefile.gss 2003-07-28 15:37:26.000000000 +0200
-@@ -20,12 +20,16 @@
-
+--- src/osdep/unix/Makefile.gss.orig 2003-03-04 22:29:59.000000000 -0500
++++ src/osdep/unix/Makefile.gss
+@@ -21,11 +21,13 @@
# Extended flags needed for additional authenticators. You may need to modify.
--GSSDIR=/usr/local
+ GSSDIR=/usr/local
-GSSCFLAGS= -I$(GSSDIR)/include -DGSS_C_NT_HOSTBASED_SERVICE=gss_nt_service_name
--GSSOLDLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err
--GSSNEWLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
-+#GSSDIR=/usr/local
-+#GSSCFLAGS= -I$(GSSDIR)/include
-+#GSSOLDLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err
-+#GSSNEWLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
-+#
-+#gss: # GSSAPI Kerberos V flags
-+# echo $(GSSCFLAGS) >> OSCFLAGS
-+# sh -c '(test -f $(GSSDIR)/lib/libk5crypto.a) && echo $(GSSNEWLDFLAGS) || echo $(GSSOLDLDFLAGS)' >> LDFLAGS
++GSSCFLAGS= -I$(GSSDIR)/include -I$(GSSDIR)/include/krb5
+ GSSOLDLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err
+ GSSNEWLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
--gss: # GSSAPI Kerberos V flags
-- echo $(GSSCFLAGS) >> OSCFLAGS
+ gss: # GSSAPI Kerberos V flags
+ echo $(GSSCFLAGS) >> OSCFLAGS
- sh -c '(test -f $(GSSDIR)/lib/libk5crypto.a) && echo $(GSSNEWLDFLAGS) || echo $(GSSOLDLDFLAGS)' >> LDFLAGS
-+gss:
++ sh -c '(test -f $(GSSDIR)/lib/libk5crypto.a) && echo $(GSSNEWLDFLAGS) || echo $(GSSOLDLDFLAGS)' > LDFLAGS.gss1
++ sh -c '(test -z "$(KRB5_CONFIG)") || $(KRB5_CONFIG) --libs gssapi' > LDFLAGS.gss2
++ sh -c '(test -z "$(KRB5_CONFIG)") && cat LDFLAGS.gss1 || cat LDFLAGS.gss2' >> LDFLAGS
echo "#include \"kerb_mit.c\"" >> auths.c
-+ echo "-I/usr/include/krb5" >> OSCFLAGS
-+ echo "-lgssapi -lkrb5 -lasn1 -lcrypto ${GSS_EXTRA_LDFLAGS} -lcom_err -lroken" >> LDFLAGS
diff --git a/mail/imap-uw/patches/patch-al b/mail/imap-uw/patches/patch-al
index dfa397ab5c8..497d3cf26dd 100644
--- a/mail/imap-uw/patches/patch-al
+++ b/mail/imap-uw/patches/patch-al
@@ -1,16 +1,14 @@
-$NetBSD: patch-al,v 1.5 2004/05/13 18:14:34 adam Exp $
+$NetBSD: patch-al,v 1.6 2006/07/26 20:00:27 jlam Exp $
---- src/c-client/auth_gss.c.orig 2004-03-15 19:59:22.000000000 +0000
+--- src/c-client/auth_gss.c.orig 2005-05-03 20:24:03.000000000 -0400
+++ src/c-client/auth_gss.c
-@@ -18,6 +18,16 @@
+@@ -18,6 +18,14 @@
* CPYRIGHT, included with this Distribution.
*/
-+#ifdef __NetBSD__
-+/* This is really Heimdal specific, but . . . */
++#ifdef HEIMDAL_KRB5
+#include <gssapi/gssapi.h>
+#include <krb5/krb5.h>
-+
+#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
+#else
+#include <gssapi/gssapi_generic.h>
@@ -19,7 +17,7 @@ $NetBSD: patch-al,v 1.5 2004/05/13 18:14:34 adam Exp $
long auth_gssapi_valid (void);
long auth_gssapi_client (authchallenge_t challenger,authrespond_t responder,
-@@ -56,15 +66,32 @@ long auth_gssapi_valid (void)
+@@ -56,15 +64,32 @@ long auth_gssapi_valid (void)
OM_uint32 smn;
gss_buffer_desc buf;
gss_name_t name;
diff --git a/mail/imap-uw/patches/patch-am b/mail/imap-uw/patches/patch-am
index bd536d6ed28..14b4c35a903 100644
--- a/mail/imap-uw/patches/patch-am
+++ b/mail/imap-uw/patches/patch-am
@@ -1,6 +1,6 @@
-$NetBSD: patch-am,v 1.4 2004/10/11 16:56:28 abs Exp $
+$NetBSD: patch-am,v 1.5 2006/07/26 20:00:27 jlam Exp $
---- src/osdep/unix/env_unix.c.orig 2004-08-22 19:54:29.000000000 +0100
+--- src/osdep/unix/env_unix.c.orig 2004-09-13 17:31:19.000000000 -0400
+++ src/osdep/unix/env_unix.c
@@ -21,6 +21,9 @@
#include <grp.h>
@@ -29,3 +29,13 @@ $NetBSD: patch-am,v 1.4 2004/10/11 16:56:28 abs Exp $
syslog (level|LOG_AUTH,"Login %s user=%.64s auth=%.64s host=%.80s",err,
user,(authuser && *authuser) ? authuser : user,tcp_clienthost ());
sleep (3); /* slow down possible cracker */
+@@ -830,7 +841,8 @@ char *sysinbox ()
+ {
+ char tmp[MAILTMPLEN];
+ if (!sysInbox) { /* initialize if first time */
+- sprintf (tmp,"%s/%s",MAILSPOOL,myusername ());
++ /* Substitute SPOOLDIR and MAILBOX appropriately for pkgsrc. */
++ sprintf (tmp,"%s/%s",@SPOOLDIR@,@MAILBOX@);
+ sysInbox = cpystr (tmp); /* system inbox is from mail spool */
+ }
+ return sysInbox;
diff --git a/mail/imap-uw/patches/patch-be b/mail/imap-uw/patches/patch-be
new file mode 100644
index 00000000000..2737608ce21
--- /dev/null
+++ b/mail/imap-uw/patches/patch-be
@@ -0,0 +1,22 @@
+$NetBSD: patch-be,v 1.1 2006/07/26 20:00:27 jlam Exp $
+
+--- src/imapd/Makefile.orig 2004-06-29 17:26:28.000000000 -0400
++++ src/imapd/Makefile
+@@ -45,7 +45,7 @@ SHELL= /bin/sh
+ # Get local definitions from c-client directory
+
+ C = ../c-client
+-CCLIENTLIB = $C/c-client.a
++CCLIENTLIB = $C/libc-client.la
+ CC = `cat $C/CCTYPE`
+ CFLAGS = -I$C `cat $C/CFLAGS` $(NSBD) $(ENBD) -DANOFILE=\"$(ANO)\" \
+ -DALERTFILE=\"$(ALERT)\" -DNNTPFILE=\"$(NNTP)\" \
+@@ -55,7 +55,7 @@ LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+ all: imapd
+
+ imapd: $(CCLIENTLIB) imapd.o
+- $(CC) $(CFLAGS) -o imapd imapd.o $(LDFLAGS)
++ $(LTLINK) $(CC) $(CFLAGS) -o imapd imapd.o $(LDFLAGS)
+
+ imapd.o: $C/mail.h $C/misc.h $C/osdep.h
+
diff --git a/mail/imap-uw/patches/patch-bf b/mail/imap-uw/patches/patch-bf
new file mode 100644
index 00000000000..130c255d7c4
--- /dev/null
+++ b/mail/imap-uw/patches/patch-bf
@@ -0,0 +1,26 @@
+$NetBSD: patch-bf,v 1.1 2006/07/26 20:00:27 jlam Exp $
+
+--- src/ipopd/Makefile.orig 2000-10-24 19:55:07.000000000 -0400
++++ src/ipopd/Makefile
+@@ -19,7 +19,7 @@
+
+
+ C = ../c-client
+-CCLIENTLIB = $C/c-client.a
++CCLIENTLIB = $C/libc-client.la
+ SHELL = /bin/sh
+
+ # Get local definitions from c-client directory
+@@ -31,10 +31,10 @@ LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+ ipopd: ipop2d ipop3d
+
+ ipop2d: $(CCLIENTLIB) ipop2d.o
+- $(CC) $(CFLAGS) -o ipop2d ipop2d.o $(LDFLAGS)
++ $(LTLINK) $(CC) $(CFLAGS) -o ipop2d ipop2d.o $(LDFLAGS)
+
+ ipop3d: $(CCLIENTLIB) ipop3d.o
+- $(CC) $(CFLAGS) -o ipop3d ipop3d.o $(LDFLAGS)
++ $(LTLINK) $(CC) $(CFLAGS) -o ipop3d ipop3d.o $(LDFLAGS)
+
+ ipop2d.o: $C/mail.h $C/misc.h $C/osdep.h
+
diff --git a/mail/imap-uw/patches/patch-bg b/mail/imap-uw/patches/patch-bg
new file mode 100644
index 00000000000..a58d65b0ab6
--- /dev/null
+++ b/mail/imap-uw/patches/patch-bg
@@ -0,0 +1,22 @@
+$NetBSD: patch-bg,v 1.1 2006/07/26 20:00:27 jlam Exp $
+
+--- src/mtest/Makefile.orig 2000-10-24 19:55:39.000000000 -0400
++++ src/mtest/Makefile
+@@ -19,7 +19,7 @@
+
+
+ C = ../c-client
+-CCLIENTLIB = $C/c-client.a
++CCLIENTLIB = $C/libc-client.la
+ SHELL = /bin/sh
+
+ # Get local definitions from c-client directory
+@@ -31,7 +31,7 @@ LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+ all: mtest
+
+ mtest: $(CCLIENTLIB) mtest.o
+- $(CC) $(CFLAGS) -o mtest mtest.o $(LDFLAGS)
++ $(LTLINK) $(CC) $(CFLAGS) -o mtest mtest.o $(LDFLAGS)
+
+ mtest.o: $C/mail.h $C/misc.h $C/osdep.h $C/rfc822.h $C/smtp.h $C/nntp.h
+