Index: python/py-yaml/files/patch-examples-yaml-highlight-yaml_hl.py.diff
===================================================================
--- python/py-yaml/files/patch-examples-yaml-highlight-yaml_hl.py.diff	(revision 0)
+++ python/py-yaml/files/patch-examples-yaml-highlight-yaml_hl.py.diff	(revision 0)
@@ -0,0 +1,8 @@
+--- examples/yaml-highlight/yaml_hl.py	2011-09-26 12:20:06.000000000 -0700
++++ examples/yaml-highlight/yaml_hl.py	2011-09-26 12:29:15.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!@PREFIX@/bin/python@PYTHONVERSION@
+ 
+ import yaml, codecs, sys, os.path, optparse
+ 
Index: python/py-yaml/files/patch-setup.py.diff
===================================================================
--- python/py-yaml/files/patch-setup.py.diff	(revision 0)
+++ python/py-yaml/files/patch-setup.py.diff	(revision 0)
@@ -0,0 +1,11 @@
+--- setup.py	2011-09-26 12:20:06.000000000 -0700
++++ setup.py	2011-09-26 12:30:56.000000000 -0700
+@@ -333,6 +333,8 @@
+         ext_modules=[
+             Extension('_yaml', ['ext/_yaml.pyx'],
+                 'libyaml', "LibYAML bindings", LIBYAML_CHECK,
++                include_dirs=['@PREFIX@/include'],
++                library_dirs=['@PREFIX@/lib'],
+                 libraries=['yaml']),
+         ],
+ 
Index: python/py-yaml/Portfile
===================================================================
--- python/py-yaml/Portfile	(revision 84928)
+++ python/py-yaml/Portfile	(working copy)
@@ -1,34 +1,59 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
 # $Id$
 
-PortSystem 1.0
-PortGroup python24 1.0
+PortSystem          1.0
+PortGroup           python 1.0
 
-name				py-yaml
-version				3.05
-categories-append	devel
-maintainers			akitada openmaintainer
-description			YAML 1.1 parser and emitter for Python
-long_description \
-    PyYAML is a YAML parser and emitter for Python, which supports YAML 1.1, \
-    unicode input and output, low-level event-based parser and emitter API, \
-    high-level API for serializing and deserializing native Python objects.
+name                py-yaml
+set name_package    PyYAML
+version             3.10
+categories          python devel
+platforms           darwin
+maintainers         akitada lightnin openmaintainer
+description         YAML 1.1 parser and emitter for Python
+long_description    PyYAML is a YAML parser and emitter for Python, which \
+                    supports YAML 1.1, unicode input and output, low-level \
+                    event-based parser and emitter API, high-level API for \
+                    serializing and deserializing native Python objects.
 
-platforms			darwin
+homepage            http://pyyaml.org/wiki/PyYAML
+master_sites        http://pyyaml.org/download/pyyaml/
+distname            ${name_package}-${version}
 
-homepage			http://pyyaml.org/wiki/PyYAML
-master_sites		http://pyyaml.org/download/pyyaml/
-distname			PyYAML-${version}
+checksums           rmd160  0fe20d93030c15b0ea6dcfc8dfee0f1f0d418aeb \
+                    sha256  e713da45c96ca53a3a8b48140d4120374db622df16ab71759c9ceb5b8d46fe7c
 
-checksums			md5 04ebb924a571cfb26d8143069068ce86 \
-				sha1 facf11bc9f6988b76538e46a7ce8a379a9296cb0 \
-				rmd160 1848e00b3b46c93fdd383092a3db8728b6b8bae0
+python.versions     24 25 26 27
+replaced_by         py24-yaml
 
-post-destroot {
-	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
-	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples
-	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
-	xinstall -m 644 -W ${worksrcpath} LICENSE README \
-		${destroot}${prefix}/share/doc/${name}
-	xinstall -m 644 -W ${worksrcpath}/examples/yaml-highlight yaml_hl.cfg yaml_hl.py \
-	    ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
+if {${subport} != ${name}} {
+    patchfiles              patch-setup.py.diff \
+                            patch-examples-yaml-highlight-yaml_hl.py.diff
+
+    variant libyaml description {Enable LibYAML bindings} {
+        depends_lib-append      port:libyaml \
+                                port:py${python.version}-pyrex-LOCAL
+    }
+    
+    post-patch {
+        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/setup.py
+        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/examples/yaml-highlight/yaml_hl.py
+        reinplace "s|@PYTHONVERSION@|${python.version}|g" ${worksrcpath}/examples/yaml-highlight/yaml_hl.py
+    }
+    
+    post-destroot {
+        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
+        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}/examples
+        xinstall -m 755 -d \
+          ${destroot}${prefix}/share/doc/${subport}/examples/yaml-highlight
+        xinstall -m 644 -W ${worksrcpath} LICENSE README \
+          ${destroot}${prefix}/share/doc/${subport}
+        xinstall -m 644 -W ${worksrcpath}/examples/yaml-highlight yaml_hl.cfg \
+          yaml_hl.py \
+          ${destroot}${prefix}/share/doc/${subport}/examples/yaml-highlight
+    }
 }
+
+livecheck.type      regex
+livecheck.url       [lindex ${master_sites} 0]
+livecheck.regex     ">${name_package}-((?!\${extract.suffix}).*)${extract.suffix}<"
Index: python/py25-yaml/files/patch-setup.py
===================================================================
--- python/py25-yaml/files/patch-setup.py	(revision 84928)
+++ python/py25-yaml/files/patch-setup.py	(working copy)
@@ -1,11 +0,0 @@
---- setup.py.orig	2009-02-01 19:01:52.000000000 +0900
-+++ setup.py	2009-02-01 19:02:20.000000000 +0900
-@@ -332,6 +332,8 @@
-         ext_modules=[
-             Extension('_yaml', ['ext/_yaml.pyx'],
-                 'libyaml', "LibYAML bindings", LIBYAML_CHECK,
-+                include_dirs=['__PREFIX__/include'],
-+                library_dirs=['__PREFIX__/lib'],
-                 libraries=['yaml']),
-         ],
- 
Index: python/py25-yaml/Portfile
===================================================================
--- python/py25-yaml/Portfile	(revision 84928)
+++ python/py25-yaml/Portfile	(working copy)
@@ -1,46 +0,0 @@
-# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-# $Id$
-
-PortSystem 1.0
-PortGroup python25 1.0
-
-name                py25-yaml
-version             3.08
-revision            1
-categories-append   devel
-maintainers         akitada openmaintainer
-description         YAML 1.1 parser and emitter for Python
-long_description \
-    PyYAML is a YAML parser and emitter for Python, which supports YAML 1.1, \
-    unicode input and output, low-level event-based parser and emitter API, \
-    high-level API for serializing and deserializing native Python objects.
-
-platforms           darwin
-
-homepage            http://pyyaml.org/wiki/PyYAML
-master_sites        http://pyyaml.org/download/pyyaml/
-distname            PyYAML-${version}
-
-checksums           md5 a4163a2017fa57f448c66815511fa555 \
-                    sha1 5f9738b74afabcf516ce536b462cb4d18403211d \
-                    rmd160 fe034d73a8cdc98381099106ac8884d6b6f917d8
-
-variant libyaml description {Enable LibYAML bindings} {
-    depends_lib-append      port:libyaml \
-                            port:py25-pyrex
-    patchfiles              patch-setup.py
-}
-
-post-patch {
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
-}
-
-post-destroot {
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
-    xinstall -m 644 -W ${worksrcpath} LICENSE README \
-        ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 644 -W ${worksrcpath}/examples/yaml-highlight yaml_hl.cfg yaml_hl.py \
-        ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
-}
Index: python/py26-yaml/files/patch-setup.py
===================================================================
--- python/py26-yaml/files/patch-setup.py	(revision 84928)
+++ python/py26-yaml/files/patch-setup.py	(working copy)
@@ -1,11 +0,0 @@
---- setup.py.orig	2009-02-01 19:01:52.000000000 +0900
-+++ setup.py	2009-02-01 19:02:20.000000000 +0900
-@@ -332,6 +332,8 @@
-         ext_modules=[
-             Extension('_yaml', ['ext/_yaml.pyx'],
-                 'libyaml', "LibYAML bindings", LIBYAML_CHECK,
-+                include_dirs=['__PREFIX__/include'],
-+                library_dirs=['__PREFIX__/lib'],
-                 libraries=['yaml']),
-         ],
- 
Index: python/py26-yaml/Portfile
===================================================================
--- python/py26-yaml/Portfile	(revision 84928)
+++ python/py26-yaml/Portfile	(working copy)
@@ -1,46 +0,0 @@
-# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-# $Id$
-
-PortSystem 1.0
-PortGroup python26 1.0
-
-name                py26-yaml
-version             3.09
-revision            0
-categories-append   devel
-maintainers         akitada openmaintainer
-description         YAML 1.1 parser and emitter for Python
-long_description \
-    PyYAML is a YAML parser and emitter for Python, which supports YAML 1.1, \
-    unicode input and output, low-level event-based parser and emitter API, \
-    high-level API for serializing and deserializing native Python objects.
-
-platforms           darwin
-
-homepage            http://pyyaml.org/wiki/PyYAML
-master_sites        http://pyyaml.org/download/pyyaml/
-distname            PyYAML-${version}
-
-checksums           md5     f219af2361e87fdc5e85e95b84c11d87 \
-                    sha1    6131d6a42bbd3e88d7efa3784d69395a136267be \
-                    rmd160  b5a5228db448e9c9507682cb36f620596a4a234c
-
-variant libyaml description {Enable LibYAML bindings} {
-    depends_lib-append      port:libyaml \
-                            port:py26-pyrex
-    patchfiles              patch-setup.py
-}
-
-post-patch {
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
-}
-
-post-destroot {
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
-    xinstall -m 644 -W ${worksrcpath} LICENSE README \
-        ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 644 -W ${worksrcpath}/examples/yaml-highlight yaml_hl.cfg yaml_hl.py \
-        ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
-}
Index: python/py27-yaml/files/patch-setup.py
===================================================================
--- python/py27-yaml/files/patch-setup.py	(revision 84928)
+++ python/py27-yaml/files/patch-setup.py	(working copy)
@@ -1,11 +0,0 @@
---- setup.py.orig	2009-02-01 19:01:52.000000000 +0900
-+++ setup.py	2009-02-01 19:02:20.000000000 +0900
-@@ -332,6 +332,8 @@
-         ext_modules=[
-             Extension('_yaml', ['ext/_yaml.pyx'],
-                 'libyaml', "LibYAML bindings", LIBYAML_CHECK,
-+                include_dirs=['__PREFIX__/include'],
-+                library_dirs=['__PREFIX__/lib'],
-                 libraries=['yaml']),
-         ],
- 
Index: python/py27-yaml/Portfile
===================================================================
--- python/py27-yaml/Portfile	(revision 84928)
+++ python/py27-yaml/Portfile	(working copy)
@@ -1,45 +0,0 @@
-# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-# $Id$
-
-PortSystem          1.0
-PortGroup           python27 1.0
-
-name                py27-yaml
-version             3.09
-categories          python devel
-platforms           darwin
-maintainers         lightnin openmaintainer
-description         YAML 1.1 parser and emitter for Python
-long_description    PyYAML is a YAML parser and emitter for Python, which \
-                    supports YAML 1.1, unicode input and output, low-level \
-                    event-based parser and emitter API, high-level API for \
-                    serializing and deserializing native Python objects.
-
-homepage            http://pyyaml.org/wiki/PyYAML
-master_sites        http://pyyaml.org/download/pyyaml/
-distname            PyYAML-${version}
-checksums           md5 f219af2361e87fdc5e85e95b84c11d87 \
-                    sha1 6131d6a42bbd3e88d7efa3784d69395a136267be \
-                    rmd160 b5a5228db448e9c9507682cb36f620596a4a234c
-
-variant libyaml description {Enable LibYAML bindings} {
-    depends_lib-append      port:libyaml \
-                            port:py27-pyrex-LOCAL
-    patchfiles              patch-setup.py
-}
-
-post-patch {
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
-}
-
-post-destroot {
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples
-    xinstall -m 755 -d \
-      ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
-    xinstall -m 644 -W ${worksrcpath} LICENSE README \
-      ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 644 -W ${worksrcpath}/examples/yaml-highlight yaml_hl.cfg \
-      yaml_hl.py \
-      ${destroot}${prefix}/share/doc/${name}/examples/yaml-highlight
-}
