[97547] trunk/dports/textproc

pixilla at macports.org pixilla at macports.org
Sat Sep 8 10:44:40 PDT 2012


Revision: 97547
          https://trac.macports.org/changeset/97547
Author:   pixilla at macports.org
Date:     2012-09-08 10:44:37 -0700 (Sat, 08 Sep 2012)
Log Message:
-----------
textproc/docbook-xml*:
- Augmented docbook-xml to register the SGML catalogs for the 4.x versions where they are available.
  Previously only the XML catalogs were registered in a global catalog.
- Replace nomaintainer with fourpalms.org:lockhart and openmaintainer.
- Unify docbook-xml ports

Modified Paths:
--------------
    trunk/dports/textproc/docbook-xml/Portfile

Removed Paths:
-------------
    trunk/dports/textproc/docbook-xml-4.1.2/
    trunk/dports/textproc/docbook-xml-4.2/
    trunk/dports/textproc/docbook-xml-4.3/
    trunk/dports/textproc/docbook-xml-4.4/
    trunk/dports/textproc/docbook-xml-4.5/
    trunk/dports/textproc/docbook-xml-5.0/

Modified: trunk/dports/textproc/docbook-xml/Portfile
===================================================================
--- trunk/dports/textproc/docbook-xml/Portfile	2012-09-08 16:59:07 UTC (rev 97546)
+++ trunk/dports/textproc/docbook-xml/Portfile	2012-09-08 17:44:37 UTC (rev 97547)
@@ -1,43 +1,214 @@
+# -*- 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
+PortSystem          1.0
 
-name            docbook-xml
-# the version should always be the version of the highest
-# versioned docbook-xml-* port.
-version         5.0
-categories      textproc
-platforms       darwin
-license         BSD
-maintainers     nomaintainer
-supported_archs noarch
-description     Install all of the versioned docbook-xml-* ports
+name                docbook-xml
+revision            1
+set docbook-xml-versions {
+    4.1.2
+    {
+        rmd160  89af805434b21f12f7be7ef58cf52edeb458e0c9 \
+        sha256  30f0644064e0ea71751438251940b1431f46acada814a062870f486c772e7772
+    }
+    4.2
+    {
+        rmd160  3ba17bf96ab2ab8fe6dc9ff82da8e22aaf9ce5e0 \
+        sha256  acc4601e4f97a196076b7e64b368d9248b07c7abf26b34a02cca40eeebe60fa2
+    }
+    4.3
+    {
+        rmd160  deeb29ed336bcce6ed199c516f01bb1542ea16ee \
+        sha256  23068a94ea6fd484b004c5a73ec36a66aa47ea8f0d6b62cc1695931f5c143464
+    }
+    4.4
+    {
+        rmd160  691a9230442be14d019af9d07e94f269824d85cc \
+        sha256  02f159eb88c4254d95e831c51c144b1863b216d909b5ff45743a1ce6f5273090
+    }
+    4.5
+    {
+        rmd160  723347ef17950c5c8e81a7c9d44812261dcadc5d \
+        sha256  4e4e037a2b83c98c6c94818390d4bdd3f6e10f6ec62dd79188594e26190dc7b4
+    }
+    5.0
+    {
+        rmd160  3fc1b6a1c6f94b77223ad9139676d5b8d8f36786 \
+        sha256  3dcd65e1f5d9c0c891b3be204fa2bb418ce485d32310e1ca052e81d36623208e
+    }
+}
+version             [lindex ${docbook-xml-versions} [llength ${docbook-xml-versions}]-2]
+categories          textproc
+platforms           darwin
+license             BSD
+maintainers         fourpalms.org:lockhart openmaintainer
+supported_archs     noarch
+description         Install all the versioned docbook-xml-* ports.
+long_description    ${description}
 
-long_description \
-    This port is an uninstallable metaport that simply ensures \
-    that a number of other ports are installed.
+homepage            http://www.docbook.org
 
-homepage        http://www.docbook.org/
-distfiles
+foreach {docbook-xml-version docbook-xml-checksums} ${docbook-xml-versions} {
 
-# add every docbook-xml-* port as it is created
-depends_run \
-    port:docbook-xml-4.1.2 \
-    port:docbook-xml-4.2 \
-    port:docbook-xml-4.3 \
-    port:docbook-xml-4.4 \
-    port:docbook-xml-4.5 \
-    port:docbook-xml-5.0
+    subport docbook-xml-${docbook-xml-version} {
 
-use_configure   no
-build {}
+    	if {[vercmp ${docbook-xml-version} 4.1.2] == 0} {
 
-destroot { 
-    set docdir ${prefix}/share/doc/${name}
-    xinstall -d ${destroot}${docdir}
-    xinstall -m 0644 ${filespath}/README ${destroot}${docdir}
+            distname            docbkx412
+            extract.mkdir       yes
+
+            depends_lib-append  port:docbook-xml-4.2
+
+            post-extract {
+
+                copy ${prefix}/share/xml/docbook/4.2/catalog.xml \
+                    ${worksrcpath}/
+            }
+            post-patch {
+
+                reinplace "s,V4.2 ..,V4.1.2 ,g" \
+                    ${worksrcpath}/catalog.xml
+                reinplace "s,V4.2,V4.1.2,g" \
+                    ${worksrcpath}/catalog.xml
+            }
+        } elseif {[vercmp ${docbook-xml-version} 5.0] >= 0} {
+
+            distname            docbook-${docbook-xml-version}
+        } else {
+
+            distname            docbook-xml-${docbook-xml-version}
+            extract.mkdir       yes
+        }
+
+        foreach part [string trim ${docbook-xml-checksums}] {
+
+            checksums-append    $part
+        }
+
+        description         Version ${docbook-xml-version} of the DocBook XML DTDs
+        long_description    Version ${docbook-xml-version} of the DocBook XML DTDs, which provide a \
+                            structured, semantic markup format for books and documentation, \
+                            especially for computer hardware and software.
+        homepage            http://www.docbook.org/xml/${docbook-xml-version}
+        master_sites        ${homepage}
+
+        depends_run         port:xmlcatmgr
+
+        use_zip             yes
+        use_configure       no
+        build               {}
+
+        set install_dir    ${prefix}/share/xml/docbook/${docbook-xml-version}
+
+        # xmlcatmgr as installed by MacPorts defaults to using
+        # ${prefix}/etc/xml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for
+        # SGML) if no catalog is specified, but we'll specify the path just in case
+        # users have another installation of xmlcatmgr and happen to have it before
+        # ${prefix}/bin in their PATH.
+        set catalog.xml    ${prefix}/etc/xml/catalog
+        set xml.args       "-c ${catalog.xml}"
+        set catalog.sgml   ${prefix}/etc/sgml/catalog
+        set sgml.args      "-s -c ${catalog.sgml}"
+
+        destroot {
+
+            set destroot_dir    ${destroot}${install_dir}
+            set destroot_files  [readdir ${worksrcpath}]
+            xinstall -m 755 -d ${destroot_dir}
+            foreach file ${destroot_files} {
+
+                copy ${worksrcpath}/${file} ${destroot_dir}
+            }
+        }
+
+        post-activate {
+
+            # XML catalog
+            # Make the directory if it doesn't exist
+            if {![file exists ${prefix}/etc/xml]} {
+
+                xinstall -m 755 -d ${prefix}/etc/xml
+            }
+
+            # Create the catalog file if it doesn't exist
+            if {![file exists ${catalog.xml}]} {
+
+                system "xmlcatmgr ${xml.args} create"
+            }
+
+            # Add the nextCatalog entry to the catalog if it doesn't exist
+            if {[catch {exec xmlcatmgr ${xml.args} lookup ${install_dir}/catalog.xml}]} {
+
+                system "xmlcatmgr ${xml.args} add nextCatalog ${install_dir}/catalog.xml"
+            }
+
+            # SGML catalog
+            # SGML catalog support is only in the 4.x transitional versions...
+            if {[file exists ${install_dir}/docbook.cat]} {
+                # Make the directory if it doesn't exist
+                if {![file exists ${prefix}/etc/sgml]} {
+
+                    xinstall -m 755 -d ${prefix}/etc/sgml
+                }
+
+                # Create the catalog file if it doesn't exist
+                if {![file exists ${catalog.sgml}]} {
+
+                    system "xmlcatmgr ${sgml.args} create"
+                }
+
+                # Add the CATALOG entry to the catalog if it doesn't exist
+                if {[catch {exec xmlcatmgr ${sgml.args} lookup ${install_dir}/docbook.cat}]} {
+
+                    system "xmlcatmgr ${sgml.args} add CATALOG ${install_dir}/docbook.cat"
+                }
+            }
+        }
+
+        if {${registry.format} == "receipt_flat"} {
+
+            set notes-cmds "    xmlcatmgr remove nextCatalog ${install_dir}/catalog.xml"
+            if {[file exists ${install_dir}/docbook.cat]} {
+                append notes-cmds "\n    xmlcatmgr ${sgml.args} remove CATALOG ${install_dir}/docbook.cat"
+            }
+            notes "
+
+As the flat registry format does not support post-deactivate hooks,
+you will need to ensure that you manually remove the catalog
+entry for this port when you uninstall it.  To do so, run
+${notes-cmds}
+
+"
+        }
+
+        # This will remove the catalog entry for this port.
+        post-deactivate {
+
+            system "xmlcatmgr ${xml.args} remove nextCatalog ${install_dir}/catalog.xml"
+            # Remove the CATALOG entry from the catalog
+            # SGML catalog support is only in the 4.x transitional versions...
+            system "xmlcatmgr ${sgml.args} remove CATALOG ${install_dir}/docbook.cat"
+        }
+    }
 }
 
-livecheck.type  regex
-livecheck.url   ${homepage}schemas/
-livecheck.regex {DocBook V(\d+(?:\.\w+)*)<}
+if {${name} == ${subport}} {
+
+    use_configure       no
+    build               {}
+    distfiles
+    foreach {docbook-xml-version docbook-xml-checksums} ${docbook-xml-versions} {
+
+        depends_lib-append  port:docbook-xml-${docbook-xml-version}
+    }
+    destroot {
+
+        set docdir ${prefix}/share/doc/${name}
+        xinstall -d ${destroot}${docdir}
+        xinstall -m 0644 ${filespath}/README ${destroot}${docdir}
+    }
+}
+
+livecheck.type      regex
+livecheck.url       http://www.docbook.org/xml/
+livecheck.regex     {>(\d+(?:\.\d+)*)/<}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120908/77697cdf/attachment-0001.html>


More information about the macports-changes mailing list