Index: libpng/Portfile
===================================================================
--- libpng/Portfile	(revision 65713)
+++ libpng/Portfile	(working copy)
@@ -1,18 +1,16 @@
 # $Id$
 
 PortSystem              1.0
-PortGroup               muniversal 1.0
 PortGroup               archcheck 1.0
 
 name                    libpng
-version                 1.2.43
+version                 1.4.1
 categories              graphics
 maintainers             ryandesign waqar
 license                 libpng
 platforms               darwin openbsd freebsd sunos linux
 homepage                http://www.libpng.org/pub/png/libpng.html
 use_bzip2               yes
-use_parallel_build      yes
 master_sites            sourceforge
 
 description             Library for manipulating PNG images
@@ -28,13 +26,13 @@
                         understand. Currently, this library only supports C. \
                         Support for other languages is being considered.
 
-checksums               md5     976909556e6613804d810405c1f72ce6 \
-                        sha1    28ea29305d233669ce565894a95151e4427d1f34 \
-                        rmd160  6c108f06ae32a86ddd8571e9031f143932f19531
+checksums               md5     e1767bf290ded9fda9ee05bd23ae4cff \
+                        sha1    a29310db901f8d9b79a80ca85fd51fa48b243c31 \
+                        rmd160  55b210afa675ee735e59241fb7dac10b9d7877ad
 
-depends_lib             port:zlib
+depends_lib             port:zlib port:libpng12
 
-archcheck.files         lib/libz.dylib
+archcheck.files         lib/libz.dylib lib/libpng12.dylib
 
 use_parallel_build      yes
 
@@ -47,7 +45,6 @@
     xinstall -m 0644 -W ${worksrcpath} \
         ANNOUNCE \
         CHANGES \
-        KNOWNBUG \
         LICENSE \
         README \
         TODO \
Index: libpng12/Portfile
===================================================================
--- libpng12/Portfile	(revision 65646)
+++ libpng12/Portfile	(working copy)
@@ -1,10 +1,9 @@
 # $Id$
 
 PortSystem              1.0
-PortGroup               muniversal 1.0
 PortGroup               archcheck 1.0
 
-name                    libpng
+name                    libpng12
 version                 1.2.43
 categories              graphics
 maintainers             ryandesign waqar
@@ -12,7 +11,6 @@
 platforms               darwin openbsd freebsd sunos linux
 homepage                http://www.libpng.org/pub/png/libpng.html
 use_bzip2               yes
-use_parallel_build      yes
 master_sites            sourceforge
 
 description             Library for manipulating PNG images
@@ -28,6 +26,8 @@
                         understand. Currently, this library only supports C. \
                         Support for other languages is being considered.
 
+distname                libpng-${version}
+dist_subdir             libpng
 checksums               md5     976909556e6613804d810405c1f72ce6 \
                         sha1    28ea29305d233669ce565894a95151e4427d1f34 \
                         rmd160  6c108f06ae32a86ddd8571e9031f143932f19531
@@ -42,18 +42,24 @@
 test.target             check
 
 post-destroot {
-    set docdir ${prefix}/share/doc/${name}-${version}
-    xinstall -d ${destroot}${docdir}/examples
-    xinstall -m 0644 -W ${worksrcpath} \
-        ANNOUNCE \
-        CHANGES \
-        KNOWNBUG \
-        LICENSE \
-        README \
-        TODO \
-        ${destroot}${docdir}
-    xinstall -m 0644 ${worksrcpath}/example.c ${destroot}${docdir}/examples
+    foreach f {bin/libpng-config include/png.h include/pngconf.h lib/libpng.a
+               lib/libpng.dylib lib/libpng.la lib/pkgconfig/libpng.pc share/man} {
+        delete ${destroot}${prefix}/${f}
+    }
 }
 
+pre-activate {
+    if {[file exists ${prefix}/lib/libpng12.dylib] 
+        && ![catch {set vers [lindex [registry_active libpng] 0]}]
+        && [rpm-vercomp [lindex $vers 1] 1.4] < 0} {
+        # check for an arbitrary 1.9 feature (upgrade will fail if we deactivate here in 1.8)
+        if {[info exists negated_variants]} {
+            registry_deactivate libpng "" [list ports_nodepcheck 1]
+        } else {
+            return -code error "libpng [lindex $vers 1] conflicts with $name, please deactivate it first."
+        }
+    }
+}
+
 livecheck.type          regexm
-livecheck.regex         {Current.+?version.+?<B>([0-9.]+)</B>}
+livecheck.regex         {Previous<BR>series:.+?<B>(1\.2[0-9.]+)</B>}

