Ticket #31676: macports.openjade.diff

File macports.openjade.diff, 3.0 KB (added by fgp (Florian G. Pflug), 13 years ago)

Portfile patch. Seem comments for details.

  • openjade/Portfile

     
    2323                patch-configure patch-GroveApp.h patch-GroveBuilder.cxx patch-Node.h
    2424
    2525depends_lib     port:opensp
    26 depends_run     port:mkcatalog
     26depends_run     port:xmlcatmgr
    2727
     28# xmlcatmgr as installed by MacPorts defaults to using
     29# ${prefix}/etc/sgml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for
     30# SGML). For historic reasons, openjade expects the catalog to be in
     31# share/sgml/catalog. To avoid breaking existing setup, we simply add
     32# a reference to the root catalog (/etc/sgml/catalog) to openjade's
     33# catalog (/share/sgml/catalog)
     34set catalog.sgml ${prefix}/etc/sgml/catalog
     35set catalog.openjade ${prefix}/share/sgml/catalog
     36
    2837configure.compiler llvm-gcc-4.2
    2938
    3039configure.args  --enable-http --enable-html --enable-mif \
    3140                --disable-dependency-tracking \
    32                 --enable-default-catalog=${prefix}/share/sgml/catalog \
     41                --enable-default-catalog=${catalog.openjade} \
    3342                --datadir=${prefix}/share/sgml/openjade \
    3443                --mandir=${prefix}/share/man
    3544
     
    5362
    5463post-destroot   { system "install -d -m 755 ${destroot}${prefix}/share/sgml/openjade"
    5564                  system "install -m 644 ${worksrcpath}/dsssl/* ${destroot}${prefix}/share/sgml/openjade" }
     65
     66post-activate {
     67    # Make the directory if it doesn't exist
     68    if {![file exists ${prefix}/etc/sgml]} {
     69        xinstall -m 755 -d ${prefix}/etc/sgml
     70    }
     71
     72    # Create the root catalog file if it doesn't exist
     73    if {![file exists ${catalog.sgml}]} {
     74        system "xmlcatmgr -s -c ${catalog.sgml} create"
     75    }
     76
     77    # Create the openjade catalog file if it doesn't exist
     78    if {![file exists ${catalog.openjade}]} {
     79        system "xmlcatmgr -s -c ${catalog.openjade} create"
     80    }
     81
     82    # Add the root catalog to openjade's catalog
     83    if {[catch {exec xmlcatmgr -s -c ${catalog.openjade} lookup ${catalog.sgml}}]} {
     84        system "xmlcatmgr -s -c ${catalog.openjade} add CATALOG ${catalog.sgml}"
     85    }
     86
     87    # And add openjade's catalog to the root catalog
     88    if {[catch {exec xmlcatmgr -s -c ${catalog.sgml} lookup ${prefix}/share/sgml/openjade/catalog}]} {
     89        system "xmlcatmgr -s -c ${catalog.sgml} add CATALOG ${prefix}/share/sgml/openjade/catalog"
     90    }
     91}
     92
     93if {${registry.format} == "receipt_flat"} {
     94    notes \
     95"######################################################################
     96# As the flat registry format does not support post-deactivate hooks,
     97# you will need to ensure that you manually remove the catalog
     98# entry for this port when you uninstall it.  To do so, run
     99# \"xmlcatmgr -s -c ${catalog.sgml} remove CATALOG ${prefix}/share/sgml/openjade/catalog\".
     100######################################################################"
     101}
     102
     103# This will remove the catalog entry for this port.
     104post-deactivate {
     105    # Remove the CATALOG entry from the catalog
     106    system "xmlcatmgr -s -c ${catalog.sgml} remove CATALOG ${prefix}/share/sgml/openjade/catalog"
     107}