Changeset 97547


Ignore:
Timestamp:
Sep 8, 2012, 5:44:37 PM (8 years ago)
Author:
pixilla@…
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
Location:
trunk/dports/textproc
Files:
6 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/textproc/docbook-xml/Portfile

    r79795 r97547  
     1# -*- 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
    12# $Id$
    23
    3 PortSystem      1.0
    4 
    5 name            docbook-xml
    6 # the version should always be the version of the highest
    7 # versioned docbook-xml-* port.
    8 version         5.0
    9 categories      textproc
    10 platforms       darwin
    11 license         BSD
    12 maintainers     nomaintainer
    13 supported_archs noarch
    14 description     Install all of the versioned docbook-xml-* ports
    15 
    16 long_description \
    17     This port is an uninstallable metaport that simply ensures \
    18     that a number of other ports are installed.
    19 
    20 homepage        http://www.docbook.org/
    21 distfiles
    22 
    23 # add every docbook-xml-* port as it is created
    24 depends_run \
    25     port:docbook-xml-4.1.2 \
    26     port:docbook-xml-4.2 \
    27     port:docbook-xml-4.3 \
    28     port:docbook-xml-4.4 \
    29     port:docbook-xml-4.5 \
    30     port:docbook-xml-5.0
    31 
    32 use_configure   no
    33 build {}
    34 
    35 destroot {
    36     set docdir ${prefix}/share/doc/${name}
    37     xinstall -d ${destroot}${docdir}
    38     xinstall -m 0644 ${filespath}/README ${destroot}${docdir}
     4PortSystem          1.0
     5
     6name                docbook-xml
     7revision            1
     8set docbook-xml-versions {
     9    4.1.2
     10    {
     11        rmd160  89af805434b21f12f7be7ef58cf52edeb458e0c9 \
     12        sha256  30f0644064e0ea71751438251940b1431f46acada814a062870f486c772e7772
     13    }
     14    4.2
     15    {
     16        rmd160  3ba17bf96ab2ab8fe6dc9ff82da8e22aaf9ce5e0 \
     17        sha256  acc4601e4f97a196076b7e64b368d9248b07c7abf26b34a02cca40eeebe60fa2
     18    }
     19    4.3
     20    {
     21        rmd160  deeb29ed336bcce6ed199c516f01bb1542ea16ee \
     22        sha256  23068a94ea6fd484b004c5a73ec36a66aa47ea8f0d6b62cc1695931f5c143464
     23    }
     24    4.4
     25    {
     26        rmd160  691a9230442be14d019af9d07e94f269824d85cc \
     27        sha256  02f159eb88c4254d95e831c51c144b1863b216d909b5ff45743a1ce6f5273090
     28    }
     29    4.5
     30    {
     31        rmd160  723347ef17950c5c8e81a7c9d44812261dcadc5d \
     32        sha256  4e4e037a2b83c98c6c94818390d4bdd3f6e10f6ec62dd79188594e26190dc7b4
     33    }
     34    5.0
     35    {
     36        rmd160  3fc1b6a1c6f94b77223ad9139676d5b8d8f36786 \
     37        sha256  3dcd65e1f5d9c0c891b3be204fa2bb418ce485d32310e1ca052e81d36623208e
     38    }
    3939}
    40 
    41 livecheck.type  regex
    42 livecheck.url   ${homepage}schemas/
    43 livecheck.regex {DocBook V(\d+(?:\.\w+)*)<}
     40version             [lindex ${docbook-xml-versions} [llength ${docbook-xml-versions}]-2]
     41categories          textproc
     42platforms           darwin
     43license             BSD
     44maintainers         fourpalms.org:lockhart openmaintainer
     45supported_archs     noarch
     46description         Install all the versioned docbook-xml-* ports.
     47long_description    ${description}
     48
     49homepage            http://www.docbook.org
     50
     51foreach {docbook-xml-version docbook-xml-checksums} ${docbook-xml-versions} {
     52
     53    subport docbook-xml-${docbook-xml-version} {
     54
     55        if {[vercmp ${docbook-xml-version} 4.1.2] == 0} {
     56
     57            distname            docbkx412
     58            extract.mkdir       yes
     59
     60            depends_lib-append  port:docbook-xml-4.2
     61
     62            post-extract {
     63
     64                copy ${prefix}/share/xml/docbook/4.2/catalog.xml \
     65                    ${worksrcpath}/
     66            }
     67            post-patch {
     68
     69                reinplace "s,V4.2 ..,V4.1.2 ,g" \
     70                    ${worksrcpath}/catalog.xml
     71                reinplace "s,V4.2,V4.1.2,g" \
     72                    ${worksrcpath}/catalog.xml
     73            }
     74        } elseif {[vercmp ${docbook-xml-version} 5.0] >= 0} {
     75
     76            distname            docbook-${docbook-xml-version}
     77        } else {
     78
     79            distname            docbook-xml-${docbook-xml-version}
     80            extract.mkdir       yes
     81        }
     82
     83        foreach part [string trim ${docbook-xml-checksums}] {
     84
     85            checksums-append    $part
     86        }
     87
     88        description         Version ${docbook-xml-version} of the DocBook XML DTDs
     89        long_description    Version ${docbook-xml-version} of the DocBook XML DTDs, which provide a \
     90                            structured, semantic markup format for books and documentation, \
     91                            especially for computer hardware and software.
     92        homepage            http://www.docbook.org/xml/${docbook-xml-version}
     93        master_sites        ${homepage}
     94
     95        depends_run         port:xmlcatmgr
     96
     97        use_zip             yes
     98        use_configure       no
     99        build               {}
     100
     101        set install_dir    ${prefix}/share/xml/docbook/${docbook-xml-version}
     102
     103        # xmlcatmgr as installed by MacPorts defaults to using
     104        # ${prefix}/etc/xml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for
     105        # SGML) if no catalog is specified, but we'll specify the path just in case
     106        # users have another installation of xmlcatmgr and happen to have it before
     107        # ${prefix}/bin in their PATH.
     108        set catalog.xml    ${prefix}/etc/xml/catalog
     109        set xml.args       "-c ${catalog.xml}"
     110        set catalog.sgml   ${prefix}/etc/sgml/catalog
     111        set sgml.args      "-s -c ${catalog.sgml}"
     112
     113        destroot {
     114
     115            set destroot_dir    ${destroot}${install_dir}
     116            set destroot_files  [readdir ${worksrcpath}]
     117            xinstall -m 755 -d ${destroot_dir}
     118            foreach file ${destroot_files} {
     119
     120                copy ${worksrcpath}/${file} ${destroot_dir}
     121            }
     122        }
     123
     124        post-activate {
     125
     126            # XML catalog
     127            # Make the directory if it doesn't exist
     128            if {![file exists ${prefix}/etc/xml]} {
     129
     130                xinstall -m 755 -d ${prefix}/etc/xml
     131            }
     132
     133            # Create the catalog file if it doesn't exist
     134            if {![file exists ${catalog.xml}]} {
     135
     136                system "xmlcatmgr ${xml.args} create"
     137            }
     138
     139            # Add the nextCatalog entry to the catalog if it doesn't exist
     140            if {[catch {exec xmlcatmgr ${xml.args} lookup ${install_dir}/catalog.xml}]} {
     141
     142                system "xmlcatmgr ${xml.args} add nextCatalog ${install_dir}/catalog.xml"
     143            }
     144
     145            # SGML catalog
     146            # SGML catalog support is only in the 4.x transitional versions...
     147            if {[file exists ${install_dir}/docbook.cat]} {
     148                # Make the directory if it doesn't exist
     149                if {![file exists ${prefix}/etc/sgml]} {
     150
     151                    xinstall -m 755 -d ${prefix}/etc/sgml
     152                }
     153
     154                # Create the catalog file if it doesn't exist
     155                if {![file exists ${catalog.sgml}]} {
     156
     157                    system "xmlcatmgr ${sgml.args} create"
     158                }
     159
     160                # Add the CATALOG entry to the catalog if it doesn't exist
     161                if {[catch {exec xmlcatmgr ${sgml.args} lookup ${install_dir}/docbook.cat}]} {
     162
     163                    system "xmlcatmgr ${sgml.args} add CATALOG ${install_dir}/docbook.cat"
     164                }
     165            }
     166        }
     167
     168        if {${registry.format} == "receipt_flat"} {
     169
     170            set notes-cmds "    xmlcatmgr remove nextCatalog ${install_dir}/catalog.xml"
     171            if {[file exists ${install_dir}/docbook.cat]} {
     172                append notes-cmds "\n    xmlcatmgr ${sgml.args} remove CATALOG ${install_dir}/docbook.cat"
     173            }
     174            notes "
     175
     176As the flat registry format does not support post-deactivate hooks,
     177you will need to ensure that you manually remove the catalog
     178entry for this port when you uninstall it.  To do so, run
     179${notes-cmds}
     180
     181"
     182        }
     183
     184        # This will remove the catalog entry for this port.
     185        post-deactivate {
     186
     187            system "xmlcatmgr ${xml.args} remove nextCatalog ${install_dir}/catalog.xml"
     188            # Remove the CATALOG entry from the catalog
     189            # SGML catalog support is only in the 4.x transitional versions...
     190            system "xmlcatmgr ${sgml.args} remove CATALOG ${install_dir}/docbook.cat"
     191        }
     192    }
     193}
     194
     195if {${name} == ${subport}} {
     196
     197    use_configure       no
     198    build               {}
     199    distfiles
     200    foreach {docbook-xml-version docbook-xml-checksums} ${docbook-xml-versions} {
     201
     202        depends_lib-append  port:docbook-xml-${docbook-xml-version}
     203    }
     204    destroot {
     205
     206        set docdir ${prefix}/share/doc/${name}
     207        xinstall -d ${destroot}${docdir}
     208        xinstall -m 0644 ${filespath}/README ${destroot}${docdir}
     209    }
     210}
     211
     212livecheck.type      regex
     213livecheck.url       http://www.docbook.org/xml/
     214livecheck.regex     {>(\d+(?:\.\d+)*)/<}
Note: See TracChangeset for help on using the changeset viewer.