Ticket #43386: Portfile.diff

File Portfile.diff, 2.5 KB (added by lockhart (Thomas Lockhart), 11 years ago)

Integrate this port with new portgroup and common infrastructure.

  • Portfile

    old new  
    22# $Id: Portfile 86420 2011-10-25 13:54:14Z dports@macports.org $
    33
    44PortSystem 1.0
     5PortGroup xmlcatalog 1.0
    56
    67name            docbook-sgml-4.2
    78version         [strsed ${name} {s/docbook-sgml-//}]
     9revision        1
    810description     Version ${version} of the DocBook SGML DTDs
    911long_description \
    1012    Version ${version} of the DocBook SGML DTDs, which provide a structured,\
     
    1820supported_archs noarch
    1921homepage        http://www.docbook.org/sgml/${version}/
    2022
    21 depends_run     port:xmlcatmgr port:docbook-dsssl port:iso8879
     23depends_lib     port:iso8879
     24depends_run     port:docbook-dsssl
    2225
    2326master_sites    http://www.oasis-open.org/docbook/sgml/${version}/
    2427distname        docbook-${version}
     
    3134extract.mkdir   yes
    3235
    3336use_configure   no
    34 build       {}
    3537
    36 set install_dir    ${prefix}/share/sgml/docbook/${version}
     38set install_dir ${prefix}/share/sgml/docbook/${version}
     39sgml.catalog "${install_dir}/docbook.cat"
    3740
    38 # xmlcatmgr as installed by MacPorts defaults to using
    39 # ${prefix}/etc/sgml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for
    40 # SGML) if no catalog is specified, but we'll specify the path just in case
    41 # users have another installation of xmlcatmgr and happen to have it before
    42 # ${prefix}/bin in their PATH.
    43 set catalog.sgml    ${prefix}/etc/sgml/catalog
    44 set xmlcatmgr.args  "-s -c ${catalog.sgml}"
     41build {}
    4542
    4643destroot {
    4744    set destroot_dir    ${destroot}${install_dir}
     
    5148        copy ${worksrcpath}/${file} ${destroot_dir}
    5249    }
    5350}
    54 
    55 post-activate {
    56     # Make the directory if it doesn't exist
    57     if {![file exists ${prefix}/etc/sgml]} {
    58         xinstall -m 755 -d ${prefix}/etc/sgml
    59     }
    60 
    61     # Create the catalog file if it doesn't exist
    62     if {![file exists ${catalog.sgml}]} {
    63         system "xmlcatmgr ${xmlcatmgr.args} create"
    64     }
    65 
    66     # Add the CATALOG entry to the catalog if it doesn't exist
    67     if {[catch {exec xmlcatmgr ${xmlcatmgr.args} lookup ${install_dir}/docbook.cat}]} {
    68         system "xmlcatmgr ${xmlcatmgr.args} add CATALOG ${install_dir}/docbook.cat"
    69     }
    70 }
    71 
    72 # This will remove the catalog entry for this port.
    73 post-deactivate {
    74     # Remove the CATALOG entry from the catalog
    75     system "xmlcatmgr ${xmlcatmgr.args} remove CATALOG ${install_dir}/docbook.cat"
    76 }