Index: files/patch-Makefile.in
===================================================================
--- files/patch-Makefile.in	(révision 41708)
+++ files/patch-Makefile.in	(copie de travail)
@@ -1,26 +0,0 @@
---- Makefile.in.orig	2005-05-15 14:58:33.000000000 +0900
-+++ Makefile.in	2005-08-29 14:59:13.000000000 +0900
-@@ -239,7 +239,7 @@
- @JAVA_TRUE@JAV = java
- @JAVA_FALSE@JAV = 
- @MACOSX_FALSE@INSTALLOSX = 
--@MACOSX_TRUE@INSTALLOSX = install-exec-local-osx
-+#@MACOSX_TRUE@INSTALLOSX = install-exec-local-osx
- 
- SUBDIRS = include sasldb plugins lib utils doc man $(PWC) $(SAM) $(JAV) $(SAD)
- EXTRA_DIST = config cmulocal win32 mac dlcompat-20010505 NTMakefile
-@@ -678,13 +678,7 @@
- 	  echo "* the library should use."; \
- 	  echo "********************************************************"; \
- 	fi
--install-exec-local-osx:
--	$(mkinstalldirs) $(framedir)/Versions/A/Headers
--	$(mkinstalldirs) $(framedir)/Versions/A/Resources
--	cd $(framedir)/Versions ; ln -fs A Current
--	cd $(framedir) ; ln -fs Versions/A/Headers .
--	cd $(framedir) ; ln -fs Versions/A/Resources .
--	$(INSTALL_DATA) $(srcdir)/config/Info.plist $(framedir)/Versions/A/Resources
-+
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
Index: files/patch-plugins-srp.c
===================================================================
--- files/patch-plugins-srp.c	(révision 41708)
+++ files/patch-plugins-srp.c	(copie de travail)
@@ -1,10 +0,0 @@
---- plugins/srp.c.orig	2005-08-29 14:54:37.000000000 +0900
-+++ plugins/srp.c	2005-08-29 14:54:42.000000000 +0900
-@@ -87,6 +87,7 @@
- /* for digest and cipher support */
- #include <openssl/evp.h>
- #include <openssl/hmac.h>
-+#include <openssl/md5.h>
- 
- #include <sasl.h>
- #define MD5_H  /* suppress internal MD5 */
Index: files/patch-include_Makefile.in
===================================================================
--- files/patch-include_Makefile.in	(révision 41708)
+++ files/patch-include_Makefile.in	(copie de travail)
@@ -1,15 +0,0 @@
---- include/Makefile.in.orig	2005-05-15 14:58:34.000000000 +0900
-+++ include/Makefile.in	2005-08-29 15:06:26.000000000 +0900
-@@ -242,9 +242,9 @@
- EXTRA_DIST = NTMakefile
- DISTCLEANFILES = md5global.h
- 
--@MACOSX_TRUE@framedir = /Library/Frameworks/SASL2.framework
--@MACOSX_TRUE@frameheaderdir = $(framedir)/Versions/A/Headers
--@MACOSX_TRUE@frameheader_DATA = $(saslinclude_HEADERS)
-+#@MACOSX_TRUE@framedir = /Library/Frameworks/SASL2.framework
-+#@MACOSX_TRUE@frameheaderdir = $(framedir)/Versions/A/Headers
-+#@MACOSX_TRUE@frameheader_DATA = $(saslinclude_HEADERS)
- subdir = include
- mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
- CONFIG_HEADER = $(top_builddir)/config.h
Index: files/patch-lib_client.c
===================================================================
--- files/patch-lib_client.c	(révision 41708)
+++ files/patch-lib_client.c	(copie de travail)
@@ -1,10 +0,0 @@
---- lib/client.c	2003-11-11 08:26:06.000000000 -0800
-+++ lib/client.c.new	2005-03-26 13:32:11.000000000 -0800
-@@ -61,7 +61,6 @@
- 
- static cmech_list_t *cmechlist; /* global var which holds the list */
- 
--static sasl_global_callbacks_t global_callbacks;
-
- static int _sasl_client_active = 0;
- 
Index: files/patch-lib_Makefile.in
===================================================================
--- files/patch-lib_Makefile.in	(révision 41708)
+++ files/patch-lib_Makefile.in	(copie de travail)
@@ -1,26 +0,0 @@
---- lib/Makefile.in.orig	2005-05-15 14:58:38.000000000 +0900
-+++ lib/Makefile.in	2005-08-29 15:04:37.000000000 +0900
-@@ -249,7 +249,7 @@
- libsasl2_la_DEPENDENCIES = $(LTLIBOBJS)
- libsasl2_la_LIBADD = $(LTLIBOBJS) $(SASL_DL_LIB) $(LIB_SOCKET) $(LIB_DOOR)
- 
--@MACOSX_TRUE@framedir = /Library/Frameworks/SASL2.framework
-+#@MACOSX_TRUE@framedir = /Library/Frameworks/SASL2.framework
- subdir = lib
- mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
- CONFIG_HEADER = $(top_builddir)/config.h
-@@ -621,10 +621,10 @@
- 	uninstall-libLTLIBRARIES
- 
- @MACOSX_TRUE@install-exec-hook:
--@MACOSX_TRUE@	$(mkinstalldirs) $(framedir)/Versions/A
--@MACOSX_TRUE@	ln -fs $(libdir)/libsasl2.dylib $(framedir)/Versions/A/SASL2
--@MACOSX_TRUE@	cd $(framedir) ; ln -fs Versions/A/SASL2 .
--@MACOSX_FALSE@install-exec-hook:
-+#@MACOSX_TRUE@	$(mkinstalldirs) $(framedir)/Versions/A
-+#@MACOSX_TRUE@	ln -fs $(libdir)/libsasl2.dylib $(framedir)/Versions/A/SASL2
-+#@MACOSX_TRUE@	cd $(framedir) ; ln -fs Versions/A/SASL2 .
-+#@MACOSX_FALSE@install-exec-hook:
- 
- libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS)
- 	@echo adding static plugins and dependencies
Index: files/patch-plugins-ntlm.c
===================================================================
--- files/patch-plugins-ntlm.c	(révision 41708)
+++ files/patch-plugins-ntlm.c	(copie de travail)
@@ -1,10 +0,0 @@
---- plugins/ntlm.c.orig	2005-08-29 14:55:01.000000000 +0900
-+++ plugins/ntlm.c	2005-08-29 14:55:03.000000000 +0900
-@@ -77,6 +77,7 @@
- #include <openssl/hmac.h>
- #include <openssl/des.h>
- #include <openssl/opensslv.h>
-+#include <openssl/md5.h>
- #if (OPENSSL_VERSION_NUMBER >= 0x0090700f) && \
-      !defined(OPENSSL_ENABLE_OLD_DES_SUPPORT)
- # define des_cblock DES_cblock
Index: Portfile
===================================================================
--- Portfile	(révision 41708)
+++ Portfile	(copie de travail)
@@ -3,7 +3,7 @@
 PortSystem	1.0
 
 name			cyrus-sasl2
-version			2.1.21
+version			2.1.22
 categories		security net
 maintainers		jmpp landonf@macports.org
 description		SASL is an authentication library.
@@ -19,72 +19,69 @@
 homepage		http://asg.web.cmu.edu/sasl/
 master_sites		ftp://ftp.andrew.cmu.edu/pub/cyrus-mail
 distname		cyrus-sasl-${version}
-checksums		md5 dde02db234dea892bee298390890502e \
-			sha1 6449f730c963d29d43600a95373a6e2db52d6d66 \
-			rmd160 93e0e1868453c5781602b5cce23e746b8823a26b
 
+checksums       md5     45dde9d19193ae9dd388eb68b2027bc9 \
+                sha1    d23454ab12054714ab97d229c86cb934ce63fbb1 \
+                rmd160  086e20d01588cb86decad001244b72a37223354c
+
 depends_lib		port:openssl \
-				lib:libz:zlib
+                port:zlib
 
-patchfiles		patch-Makefile.in \
-			patch-include_Makefile.in \
-			patch-lib_client.c \
-			patch-lib_Makefile.in \
-			patch-plugins-ntlm.c \
-			patch-plugins-srp.c
-
 default_variants	+kerberos
 
-configure.args	--sysconfdir=${prefix}/etc \
+configure.args \
 		--mandir=${prefix}/share/man \
-		--libexecdir=${prefix}/lib \
-		--includedir=${prefix}/include \
 		--with-openssl=${prefix} \
 		--with-dbpath=${prefix}/etc/sasldb2 \
 		--with-plugindir=${prefix}/lib/sasl2 \
 		--with-saslauthd=${prefix}/var/state/saslauthd \
 		--with-pwcheck=${prefix}/var/pwcheck \
-		--enable-checkapop \
-		--enable-cram \
-		--enable-digest \
-		--enable-otp \
+		--disable-macos-framework \
 		--enable-srp \
 		--enable-srp-setpass \
-		--enable-plain \
-		--enable-anon \
 		--enable-login \
-		--enable-auth-sasldb \
 		--enable-ntlm \
 		--with-rc4=openssl
 
-post-configure {
-	# On darwin, -L/usr/lib pulls in Apple's own non-suitable sasl libraries
-	reinplace s|-L/usr/lib||g ${worksrcpath}/utils/Makefile
+use_parallel_build  yes
+
+pre-build {
+    if {[file exists $prefix/lib/libsasl2.dylib]} {
+        ui_error "cyrus-sasl2 must be deactivated before upgrade."
+        error "Please run `sudo port deactivate cyrus-sasl2` and try again."
+    }
 }
 
+destroot.keepdirs \
+    ${destroot}${prefix}/var/state/saslauthd \
+    ${destroot}${prefix}/var/pwcheck
+
 post-destroot {
-	      xinstall -d -m 755 ${destroot}${prefix}/share/doc
-	      file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
-	      xinstall -d -m 755 ${destroot}${prefix}/var/state/saslauthd
-	      xinstall -d -m 755 ${destroot}${prefix}/var/pwcheck
-	      destroot.keepdirs ${destroot}${prefix}/var/state/saslauthd \
-	      ${destroot}${prefix}/var/pwcheck
+    xinstall -d \
+        ${destroot}${prefix}/share/doc \
+        ${destroot}${prefix}/var/state/saslauthd \
+	    ${destroot}${prefix}/var/pwcheck
+
+    file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
 }
 
 platform darwin {}
 platform freebsd {}
-variant kerberos {
+variant kerberos description "Enable Kerberos support (default)" {
+    configure.args-append   --enable-gssapi \
+                            --enable-keep-db-open
+
 	if {[variant_isset darwin]} {
-		configure.args-append --enable-gssapi --with-gss_impl=mit
+		configure.args-append --with-gss_impl=mit
 	}
 	if {[variant_isset freebsd]} {
-		configure.args-append --enable-gssapi --with-gss_impl=heimdal
+		configure.args-append --with-gss_impl=heimdal
 	}
 }
 
-variant sql	{ configure.args-append --enable-sql }
+variant sql description "Enable SQL support" { configure.args-append --enable-sql }
 
-variant static	{ configure.args-append --enable-static }
+variant static description "Build static library" { configure.args-append --enable-static }
 
 livecheck.check regex
 livecheck.url   http://ftp.andrew.cmu.edu/pub/cyrus-mail/
