Changeset 119127


Ignore:
Timestamp:
Apr 17, 2014, 10:38:34 PM (6 years ago)
Author:
pixilla@…
Message:

textproc/docbook-xml:

  • Use new PortGroup xmlcatalog. See #41708
File:
1 edited

Legend:

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

    r104041 r119127  
    11# -*- 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
    22# $Id$
    3 
    4 PortSystem          1.0
     3PortSystem 1.0
     4PortGroup xmlcatalog 1.0
    55
    66name                docbook-xml
    77revision            1
    8 set revision-docbook-xml 2
     8set revision-docbook-xml 3
    99set docbook-xml-versions {
    1010    4.1.2
     
    5151
    5252foreach {docbook-xml-version docbook-xml-checksums} ${docbook-xml-versions} {
    53 
    5453    subport docbook-xml-${docbook-xml-version} {
    55 
    56         if {[vercmp ${docbook-xml-version} 4.1.2] == 0} {
    57 
     54        if {[vercmp ${docbook-xml-version} 4.1.2] == 0} {
    5855            distname            docbkx412
    5956            extract.mkdir       yes
     
    6259
    6360            post-extract {
    64 
    6561                copy ${prefix}/share/xml/docbook/4.2/catalog.xml \
    6662                    ${worksrcpath}/
    6763            }
    6864            post-patch {
    69 
    7065                reinplace "s,V4.2 ..,V4.1.2 ,g" \
    7166                    ${worksrcpath}/catalog.xml
     
    7469            }
    7570        } elseif {[vercmp ${docbook-xml-version} 5.0] >= 0} {
    76 
    7771            distname            docbook-${docbook-xml-version}
    7872        } else {
    79 
    8073            distname            docbook-xml-${docbook-xml-version}
    8174            extract.mkdir       yes
     
    8376
    8477        foreach part [string trim ${docbook-xml-checksums}] {
    85 
    8678            checksums-append    $part
    8779        }
     
    10294        set install_dir    ${prefix}/share/xml/docbook/${docbook-xml-version}
    10395
    104         # xmlcatmgr as installed by MacPorts defaults to using
    105         # ${prefix}/etc/xml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for
    106         # SGML) if no catalog is specified, but we'll specify the path just in case
    107         # users have another installation of xmlcatmgr and happen to have it before
    108         # ${prefix}/bin in their PATH.
    109         set catalog.xml    ${prefix}/etc/xml/catalog
    110         set xml.args       "-c ${catalog.xml}"
    111         set catalog.sgml   ${prefix}/etc/sgml/catalog
    112         set sgml.args      "-s -c ${catalog.sgml}"
     96        xml.catalog "${install_dir}/catalog.xml"
     97        # SGML catalog support is only in the 4.x transitional versions...
     98        if {[vercmp ${docbook-xml-version} 5.0] < 0} {
     99            sgml.catalog "${install_dir}/docbook.cat"
     100        }
    113101
    114102        destroot {
    115 
    116103            set destroot_dir    ${destroot}${install_dir}
    117104            set destroot_files  [readdir ${worksrcpath}]
    118105            xinstall -m 755 -d ${destroot_dir}
    119106            foreach file ${destroot_files} {
    120 
    121107                copy ${worksrcpath}/${file} ${destroot_dir}
    122108            }
    123         }
    124 
    125         post-activate {
    126 
    127             # XML catalog
    128             # Make the directory if it doesn't exist
    129             if {![file exists ${prefix}/etc/xml]} {
    130 
    131                 xinstall -m 755 -d ${prefix}/etc/xml
    132             }
    133 
    134             # Create the catalog file if it doesn't exist
    135             if {![file exists ${catalog.xml}]} {
    136 
    137                 system "xmlcatmgr ${xml.args} create"
    138             }
    139 
    140             # Add the nextCatalog entry to the catalog if it doesn't exist
    141             if {[catch {exec xmlcatmgr ${xml.args} lookup ${install_dir}/catalog.xml}]} {
    142 
    143                 system "xmlcatmgr ${xml.args} add nextCatalog ${install_dir}/catalog.xml"
    144             }
    145 
    146             # SGML catalog
    147             # SGML catalog support is only in the 4.x transitional versions...
    148             if {[file exists ${install_dir}/docbook.cat]} {
    149                 # Make the directory if it doesn't exist
    150                 if {![file exists ${prefix}/etc/sgml]} {
    151 
    152                     xinstall -m 755 -d ${prefix}/etc/sgml
    153                 }
    154 
    155                 # Create the catalog file if it doesn't exist
    156                 if {![file exists ${catalog.sgml}]} {
    157 
    158                     system "xmlcatmgr ${sgml.args} create"
    159                 }
    160 
    161                 # Add the CATALOG entry to the catalog if it doesn't exist
    162                 if {[catch {exec xmlcatmgr ${sgml.args} lookup ${install_dir}/docbook.cat}]} {
    163 
    164                     system "xmlcatmgr ${sgml.args} add CATALOG ${install_dir}/docbook.cat"
    165                 }
    166             }
    167         }
    168 
    169         # This will remove the catalog entry for this port.
    170         post-deactivate {
    171 
    172             system "xmlcatmgr ${xml.args} remove nextCatalog ${install_dir}/catalog.xml"
    173             # Remove the CATALOG entry from the catalog
    174             # SGML catalog support is only in the 4.x transitional versions...
    175             system "xmlcatmgr ${sgml.args} remove CATALOG ${install_dir}/docbook.cat"
    176109        }
    177110    }
     
    179112
    180113if {${name} == ${subport}} {
    181 
    182114    revision            ${revision-docbook-xml}
    183115    use_configure       no
     
    185117    distfiles
    186118    foreach {docbook-xml-version docbook-xml-checksums} ${docbook-xml-versions} {
    187 
    188119        depends_lib-append  port:docbook-xml-${docbook-xml-version}
    189120    }
    190121    destroot {
    191 
    192122        set docdir ${prefix}/share/doc/${name}
    193123        xinstall -d ${destroot}${docdir}
Note: See TracChangeset for help on using the changeset viewer.