Index: dports/devel/openssl/files/patch-opensslconf.h.in-universal-32-64.diff
===================================================================
--- dports/devel/openssl/files/patch-opensslconf.h.in-universal-32-64.diff	(revision 0)
+++ dports/devel/openssl/files/patch-opensslconf.h.in-universal-32-64.diff	(revision 0)
@@ -0,0 +1,97 @@
+diff -ur Configure openssl-0.9.8i/Configure
+--- Configure	2008-11-10 13:10:42.000000000 -0800
++++ Configure	2008-11-10 13:16:19.000000000 -0800
+@@ -1530,21 +1530,6 @@
+ 		$unistd = "<unistd.h>" if $unistd eq "";
+ 		print OUT "#define OPENSSL_UNISTD $unistd\n";
+ 		}
+-	elsif	(/^#((define)|(undef))\s+SIXTY_FOUR_BIT_LONG/)
+-		{ printf OUT "#%s SIXTY_FOUR_BIT_LONG\n",($b64l)?"define":"undef"; }
+-	elsif	(/^#((define)|(undef))\s+SIXTY_FOUR_BIT/)
+-		{ printf OUT "#%s SIXTY_FOUR_BIT\n",($b64)?"define":"undef"; }
+-	elsif	(/^#((define)|(undef))\s+THIRTY_TWO_BIT/)
+-		{ printf OUT "#%s THIRTY_TWO_BIT\n",($b32)?"define":"undef"; }
+-	elsif	(/^#((define)|(undef))\s+SIXTEEN_BIT/)
+-		{ printf OUT "#%s SIXTEEN_BIT\n",($b16)?"define":"undef"; }
+-	elsif	(/^#((define)|(undef))\s+EIGHT_BIT/)
+-		{ printf OUT "#%s EIGHT_BIT\n",($b8)?"define":"undef"; }
+-	elsif	(/^#((define)|(undef))\s+BN_LLONG\s*$/)
+-		{ printf OUT "#%s BN_LLONG\n",($bn_ll)?"define":"undef"; }
+-	elsif	(/^\#define\s+DES_LONG\s+.*/)
+-		{ printf OUT "#define DES_LONG unsigned %s\n",
+-			($des_int)?'int':'long'; }
+ 	elsif	(/^\#(define|undef)\s+DES_PTR/)
+ 		{ printf OUT "#%s DES_PTR\n",($des_ptr)?'define':'undef'; }
+ 	elsif	(/^\#(define|undef)\s+DES_RISC1/)
+@@ -1572,12 +1557,6 @@
+ 		{printf OUT "#define IDEA_INT unsigned %s\n",$type[$idea_int];}
+ 	elsif	(/^#define\s+RC2_INT\s/)
+ 		{printf OUT "#define RC2_INT unsigned %s\n",$type[$rc2_int];}
+-	elsif (/^#(define|undef)\s+BF_PTR/)
+-		{
+-		printf OUT "#undef BF_PTR\n" if $bf_ptr == 0;
+-		printf OUT "#define BF_PTR\n" if $bf_ptr == 1;
+-		printf OUT "#define BF_PTR2\n" if $bf_ptr == 2;
+-	        }
+ 	else
+ 		{ print OUT $_; }
+ 	}
+diff -ur crypto/opensslconf.h.in openssl-0.9.8i/crypto/opensslconf.h.in
+--- crypto/opensslconf.h.in	2008-11-10 13:10:41.000000000 -0800
++++ crypto/opensslconf.h.in	2008-11-10 13:15:02.000000000 -0800
+@@ -52,13 +52,21 @@
+ /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
+  * %20 speed up (longs are 8 bytes, int's are 4). */
+ #ifndef DES_LONG
++# ifdef __LP64__
++#define DES_LONG unsigned int
++# else
+ #define DES_LONG unsigned long
++# endif
+ #endif
+ #endif
+ 
+ #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
+ #define CONFIG_HEADER_BN_H
++# ifdef __LP64__
++#define BN_LLONG
++# else
+ #undef BN_LLONG
++# endif
+ 
+ /* Should we define BN_DIV2W here? */
+ 
+@@ -66,12 +74,20 @@
+ /* The prime number generation stuff may not work when
+  * EIGHT_BIT but I don't care since I've only used this mode
+  * for debuging the bignum libraries */
++# ifdef __LP64__
++#define SIXTY_FOUR_BIT_LONG
++#undef SIXTY_FOUR_BIT
++#undef THIRTY_TWO_BIT
++#undef SIXTEEN_BIT
++#undef EIGHT_BIT
++# else
+ #undef SIXTY_FOUR_BIT_LONG
+ #undef SIXTY_FOUR_BIT
+ #define THIRTY_TWO_BIT
+ #undef SIXTEEN_BIT
+ #undef EIGHT_BIT
++# endif
+ #endif
+ 
+ #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
+ #define CONFIG_HEADER_RC4_LOCL_H
+@@ -82,7 +98,11 @@
+ 
+ #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
+ #define CONFIG_HEADER_BF_LOCL_H
+-#undef BF_PTR
++# ifdef __LP64__
++#define BF_PTR2 
++# else
++#define BF_PTR
++# endif
+ #endif /* HEADER_BF_LOCL_H */
+ 
+ #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
Index: dports/devel/openssl/Portfile
===================================================================
--- dports/devel/openssl/Portfile	(revision 41756)
+++ dports/devel/openssl/Portfile	(working copy)
@@ -52,92 +52,42 @@
 
 #make 4-way universal build ready
 variant universal {
+	patchfiles-append patch-opensslconf.h.in-universal-32-64.diff
+
 	post-patch {
-#		foreach arch {i386 x86_64 ppc ppc64}
-		foreach arch {i386 ppc} {
+		foreach arch ${universal_archs} {
 			file copy ${worksrcpath} ${workpath}/${arch}
 		}
 	}
 
 	configure {
-		foreach arch {i386 ppc} {
-			system "cd ${workpath}/${arch} && ./Configure darwin-${arch}-cc ${configure.pre_args} ${configure.args}"
-		}
-#		system "cd ${workpath}/x86_64 && ./Configure darwin64-x86_64-cc ${configure.pre_args} ${configure.args}"
-#		system "cd ${workpath}/ppc64 && ./Configure darwin64-ppc-cc ${configure.pre_args} ${configure.args}"
+                if {[lsearch ${universal_archs} i386] != -1} {
+                    system "cd ${workpath}/i386 && ./Configure darwin-i386-cc ${configure.pre_args} ${configure.args}"
+                }
+                if {[lsearch ${universal_archs} ppc] != -1} {
+                    system "cd ${workpath}/ppc && ./Configure darwin-ppc-cc ${configure.pre_args} ${configure.args}"
+                }
+                if {[lsearch ${universal_archs} x86_64] != -1} {
+                    system "cd ${workpath}/x86_64 && ./Configure darwin64-x86_64-cc ${configure.pre_args} ${configure.args}"
+                }
+                if {[lsearch ${universal_archs} ppc64] != -1} {
+                    system "cd ${workpath}/ppc64 && ./Configure darwin64-ppc-cc ${configure.pre_args} ${configure.args}"
+                }
 	}
 
 	build {
-#		foreach arch {i386 x86_64 ppc ppc64}
-		foreach arch {i386 ppc} {
+		foreach arch ${universal_archs} {
 			system "cd ${workpath}/${arch} && make all"
 		}
 	}
 
 	destroot {
-# in port 1.7, just call:
-#		merge "${workpath}/pre-dest"
-# till then, do this:
-#		foreach arch {i386 x86_64 ppc ppc64}
-		foreach arch {i386 ppc} {
+		foreach arch ${universal_archs} {
 			xinstall -d ${workpath}/pre-dest/${arch}
 			system "cd ${workpath}/${arch} && make install INSTALL_PREFIX=${workpath}/pre-dest/${arch} MANDIR=${prefix}/share/man"
 		}
-
-		set basepath "${workpath}/pre-dest/i386"
-		fs-traverse file "${basepath}" {
-			set fpath [string range "${file}" [string length "${basepath}"] [string length "${file}"]]
-			if {${fpath} != ""} {
-				ui_debug ":: ${fpath}"
-
-				switch -exact [file type "${basepath}${fpath}"] {
-					directory {
-						# just create directories
-						ui_debug "-- dir:: ${fpath}"
-						file mkdir "${destroot}${fpath}"
-					}
-					link {
-						# copy symlinks (TODO: check if target matches)
-						ui_debug "-- lnk:: ${fpath}"
-						file copy "${basepath}${fpath}" "${destroot}${fpath}"
-					}
-					file {
-						# treat files depending on their filetype
-						ui_debug "-- file:: ${fpath}"
-						set filetype [exec "/usr/bin/file" "-b" "${basepath}${fpath}"]
-						switch -regexp ${filetype} {
-							Mach-O.* {
-								# Mach-O binaries get lipo-ed
-								ui_debug "Mach-O file -- lipo-ing"
-#								system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch x86_64 ${workpath}/pre-dest/x86_64/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -arch ppc64 ${workpath}/pre-dest/ppc64/${fpath} -create -output ${destroot}${fpath}"
-								system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -create -output ${destroot}${fpath}"
-							}
-							current\ ar\ archive {
-								# ar archives get lipo-ed
-								ui_debug "ar archive -- lipo-ing"
-#								system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch x86_64 ${workpath}/pre-dest/x86_64/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -arch ppc64 ${workpath}/pre-dest/ppc64/${fpath} -create -output ${destroot}${fpath}"
-								system "lipo -arch i386 ${workpath}/pre-dest/i386/${fpath} -arch ppc ${workpath}/pre-dest/ppc/${fpath} -create -output ${destroot}${fpath}"
-							}
-							default {
-								# unknown file types are copied IF they do not differ across ALL architectures -- if they do: This is an error!
-								ui_debug "unknown filetype: ${filetype}"
-								set differ1 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/ppc/${fpath}"]
-#								set differ2 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/x86_64/${fpath}"]
-#								set differ3 [exec "/usr/bin/diff" "-q" "${workpath}/pre-dest/i386/${fpath}" "${workpath}/pre-dest/ppc64/${fpath}"]
-								if {${differ1} != ""} {
-									ui_debug "ERROR"
-								} else {
-									ui_debug "files match, just copying"
-									file copy "${basepath}${fpath}" "${destroot}${fpath}"
-								}
-							}
-						}
-					}
-					default { ui_debug "serious error" }
-				}
-			}
-		}
-	}
+		merge "${workpath}/pre-dest"
+        }
 }
 
 # the test suite can only be run *after* destrooting
