1 | # $Id: Portfile 80952 2011-07-21 23:51:47Z jmr@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name docbook-sgml-4.2 |
---|
6 | version [strsed ${name} {s/docbook-sgml-//}] |
---|
7 | description Version ${version} of the DocBook SGML DTDs |
---|
8 | long_description \ |
---|
9 | Version ${version} of the DocBook SGML DTDs, which provide a structured,\ |
---|
10 | semantic markup format for books and documentation, especially for\ |
---|
11 | computer hardware and software. |
---|
12 | categories textproc |
---|
13 | license MIT Permissive |
---|
14 | platforms darwin |
---|
15 | maintainers phlo.org:fgp |
---|
16 | supported_archs noarch |
---|
17 | distname docbook-${version} |
---|
18 | |
---|
19 | homepage http://www.docbook.org/sgml/${version}/ |
---|
20 | master_sites http://www.oasis-open.org/docbook/sgml/${version}/ |
---|
21 | checksums md5 0dfeb94569334dd22a62d90d99fc0630 \ |
---|
22 | sha1 98afcae616ed24edb30e40baa4ddd8cd8731f2c7 |
---|
23 | worksrcdir ${distname} |
---|
24 | |
---|
25 | depends_run port:xmlcatmgr port:docbook-dsssl port:iso8879 |
---|
26 | |
---|
27 | use_zip yes |
---|
28 | |
---|
29 | extract.mkdir yes |
---|
30 | |
---|
31 | use_configure no |
---|
32 | build {} |
---|
33 | |
---|
34 | set install_dir ${prefix}/share/sgml/docbook/${version} |
---|
35 | |
---|
36 | # xmlcatmgr as installed by MacPorts defaults to using |
---|
37 | # ${prefix}/etc/sgml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for |
---|
38 | # SGML) if no catalog is specified, but we'll specify the path just in case |
---|
39 | # users have another installation of xmlcatmgr and happen to have it before |
---|
40 | # ${prefix}/bin in their PATH. |
---|
41 | set catalog.sgml ${prefix}/etc/sgml/catalog |
---|
42 | set xmlcatmgr.args "-s -c ${catalog.sgml}" |
---|
43 | |
---|
44 | destroot { |
---|
45 | set destroot_dir ${destroot}${install_dir} |
---|
46 | set destroot_files [readdir ${worksrcpath}] |
---|
47 | xinstall -m 755 -d ${destroot_dir} |
---|
48 | foreach file ${destroot_files} { |
---|
49 | copy ${worksrcpath}/${file} ${destroot_dir} |
---|
50 | } |
---|
51 | } |
---|
52 | |
---|
53 | post-activate { |
---|
54 | # Make the directory if it doesn't exist |
---|
55 | if {![file exists ${prefix}/etc/sgml]} { |
---|
56 | xinstall -m 755 -d ${prefix}/etc/sgml |
---|
57 | } |
---|
58 | |
---|
59 | # Create the catalog file if it doesn't exist |
---|
60 | if {![file exists ${catalog.sgml}]} { |
---|
61 | system "xmlcatmgr ${xmlcatmgr.args} create" |
---|
62 | } |
---|
63 | |
---|
64 | # Add the CATALOG entry to the catalog if it doesn't exist |
---|
65 | if {[catch {exec xmlcatmgr ${xmlcatmgr.args} lookup ${install_dir}/docbook.cat}]} { |
---|
66 | system "xmlcatmgr ${xmlcatmgr.args} add CATALOG ${install_dir}/docbook.cat" |
---|
67 | } |
---|
68 | } |
---|
69 | |
---|
70 | if {${registry.format} == "receipt_flat"} { |
---|
71 | notes \ |
---|
72 | "###################################################################### |
---|
73 | # As the flat registry format does not support post-deactivate hooks, |
---|
74 | # you will need to ensure that you manually remove the catalog |
---|
75 | # entry for this port when you uninstall it. To do so, run |
---|
76 | # \"xmlcatmgr ${xmlcatmgr.args} remove CATALOG ${install_dir}/docbook.cat\". |
---|
77 | ######################################################################" |
---|
78 | } |
---|
79 | |
---|
80 | # This will remove the catalog entry for this port. |
---|
81 | post-deactivate { |
---|
82 | # Remove the CATALOG entry from the catalog |
---|
83 | system "xmlcatmgr ${xmlcatmgr.args} remove CATALOG ${install_dir}/docbook.cat" |
---|
84 | } |
---|