Index: dports/_resources/port1.0/group/muniversal-1.0.tcl
===================================================================
--- dports/_resources/port1.0/group/muniversal-1.0.tcl	(revision 46004)
+++ dports/_resources/port1.0/group/muniversal-1.0.tcl	(working copy)
@@ -34,6 +34,7 @@
 
 # User variables:
 #         merger_configure_env: associative array of configure.env variables
+#             merger_build_env: assoicative array of build.env variables
 #                  merger_host: associative array of host values
 #        merger_configure_args: associative array of configure.args
 #    merger_configure_cppflags: associative array of configure.cppflags
@@ -177,8 +178,15 @@
     build {
         foreach arch ${universal_archs_to_use} {
             ui_msg "universal: Running build for architecture ${arch}"
+            
+            if { [info exists merger_build_env(${arch})] } {
+                build.env-append  $merger_build_env(${arch})
+            }
             build.dir  ${workpath}/${arch}
             build_main
+            if { [info exists merger_build_env(${arch})] } {
+                build.env-delete  $merger_build_env(${arch})
+            }
         }
     }
 
@@ -243,7 +251,7 @@
                         # Files are neither directories nor links
                         if { ! [catch {system "/usr/bin/cmp ${dir1}/${fl} ${dir2}/${fl} && /bin/cp -v ${dir1}/${fl} ${dir}"}] } {
                             # Files are byte by byte the same
-                            ui_debug "universal: merge: ${prefixDir}${fl} is identical in ${base1} and ${base2}"
+                            ui_debug "universal: merge: ${prefixDir}/${fl} is identical in ${base1} and ${base2}"
                         } else {
                             # Actually try to merge the files
                             # First try lipo

Index: dports/devel/apr-util/Portfile
===================================================================
--- dports/devel/apr-util/Portfile	(revision 46004)
+++ dports/devel/apr-util/Portfile	(working copy)
@@ -1,6 +1,7 @@
 # $Id$
 
 PortSystem 1.0
+PortGroup  muniversal 1.0
 
 name		apr-util
 version		1.3.4
@@ -29,6 +30,20 @@
 		--with-iconv=${prefix} --with-berkeley-db=${prefix}/include:${prefix}/lib/db46 \
 		--without-mysql --without-pgsql --with-sqlite3=${prefix}
 
+array set merger_configure_env {
+    ppc     TARGET_ARCH=ppc
+    i386    TARGET_ARCH=i386
+    ppc64   TARGET_ARCH=ppc64
+    x86_64  TARGET_ARCH=x86_64
+}
+
+array set merger_build_env {
+    ppc     TARGET_ARCH=ppc
+    i386    TARGET_ARCH=i386
+    ppc64   TARGET_ARCH=ppc64
+    x86_64  TARGET_ARCH=x86_64
+}
+
 test.run	yes
 test.target	check
 test.env	DYLD_LIBRARY_PATH=${worksrcpath}/.libs

Index: dports/devel/apr/Portfile
===================================================================
--- dports/devel/apr/Portfile	(revision 46004)
+++ dports/devel/apr/Portfile	(working copy)
@@ -1,6 +1,7 @@
 # $Id$
 
 PortSystem	1.0
+PortGroup  muniversal 1.0
 
 name		apr
 version		1.3.3
@@ -34,6 +35,83 @@
 	use_parallel_build	no
 }
 
+# configure script expects to be able to run binaries
+if { ${os.arch}=="i386" } {
+    set universal_archs_supported  "i386 x86_64"
+} else {
+    set universal_archs_supported  "ppc ppc64"
+}
+
+set merger_dont_diff "${prefix}/bin/apr-1-config \
+    ${prefix}/share/apr-1/build/apr_rules.mk
+    ${prefix}/share/apr-1/build/libtool"
+          
+
+set diff_format_shell_ppc {--old-group-format='if test "x$TARGET_ARCH" != "xppc64"; then
+%<fi
+' --new-group-format='if test "x$TARGET_ARCH" = "xppc64"; then
+%>fi
+' --unchanged-group-format='%=' --changed-group-format='if test "x$TARGET_ARCH" = "xppc64"; then
+%>else
+%<fi
+'}
+
+set diff_format_make_ppc {--old-group-format='ifneq ($(TARGET_ARCH), ppc64)
+%<endif
+' --new-group-format='ifeq ($(TARGET_ARCH), ppc64)
+%>endif
+' --unchanged-group-format='%=' --changed-group-format='ifeq ($(TARGET_ARCH), ppc64)
+%>else
+%<endif
+'}
+
+set diff_format_shell_intel {--old-group-format='if test "x$TARGET_ARCH" != "xx86_64"; then
+%<fi
+' --new-group-format='if test "x$TARGET_ARCH" = "xx86_64"; then
+%>fi
+' --unchanged-group-format='%=' --changed-group-format='if test "x$TARGET_ARCH" = "xx86_64"; then
+%>else
+%<fi
+'}
+
+set diff_format_make_intel {--old-group-format='ifneq ($(TARGET_ARCH), x86_64)
+%<endif
+' --new-group-format='ifeq ($(TARGET_ARCH), x86_64)
+%>endif
+' --unchanged-group-format='%=' --changed-group-format='ifeq ($(TARGET_ARCH), x86_64)
+%>else
+%<endif
+'}
+
+post-destroot {
+    if {[variant_isset universal]} {
+        foreach fl ${merger_dont_diff} {
+            set fl [subst ${fl}]
+            if { ${os.arch}=="i386" } {
+                set fl64 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/x86_64-\1}]]
+                set fl32 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/i386-\1}]]
+                if { [file exists ${fl32}] && [file exists ${fl64}] } {
+                    if { [string match {*.mk} ${fl}] } {
+                        system "/usr/bin/diff -d ${diff_format_make_intel} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
+                    } else {
+                        system "/usr/bin/diff -d ${diff_format_shell_intel} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
+                    }
+                }
+            } else {
+                set fl64 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/ppc64-\1}]]
+                set fl32 [regsub {/([^/]*)$} ${fl} [subst -nobackslashes {/ppc-\1}]]
+                if { [file exists ${fl32}] && [file exists ${fl64}] } {
+                    if { [string match {*.mk} ${fl}] } {
+                        system "/usr/bin/diff -d ${diff_format_make_ppc} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
+                    } else {
+                        system "/usr/bin/diff -d ${diff_format_shell_ppc} ${destroot}${fl32} ${destroot}${fl64} > ${destroot}${fl}; test \$? -le 1"
+                    }
+                }
+            }
+        }
+    }
+}
+                        
 livecheck.check regex
 livecheck.url   http://apache.org/dist/apr/
 livecheck.regex {<a href="#apr">APR (\d+(?:\.\d+)*) is the latest available version</a>}


