[86409] trunk/dports/textproc/iso8879/Portfile
dports at macports.org
dports at macports.org
Tue Oct 25 04:13:31 PDT 2011
Revision: 86409
http://trac.macports.org/changeset/86409
Author: dports at macports.org
Date: 2011-10-25 04:13:28 -0700 (Tue, 25 Oct 2011)
Log Message:
-----------
iso8879: install catalog and register with main catalog in
${prefix}/etc/sgml/catalog (#31674)
Modified Paths:
--------------
trunk/dports/textproc/iso8879/Portfile
Modified: trunk/dports/textproc/iso8879/Portfile
===================================================================
--- trunk/dports/textproc/iso8879/Portfile 2011-10-25 10:47:46 UTC (rev 86408)
+++ trunk/dports/textproc/iso8879/Portfile 2011-10-25 11:13:28 UTC (rev 86409)
@@ -3,6 +3,7 @@
PortSystem 1.0
name iso8879
version 1986
+revision 1
categories textproc
maintainers nomaintainer
description Character entity sets from ISO 8879:1986 (SGML)
@@ -17,18 +18,48 @@
use_zip yes
-depends_run bin:mkcatalog:mkcatalog
+depends_run port:xmlcatmgr
use_configure no
build {}
-set instdir share/sgml/iso8879
+set install_dir ${prefix}/share/sgml/${name}
+# xmlcatmgr as installed by MacPorts defaults to using
+# ${prefix}/etc/sgml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for
+# SGML) if no catalog is specified, but we'll specify the path just in case
+# users have another installation of xmlcatmgr and happen to have it before
+# ${prefix}/bin in their PATH.
+set catalog.sgml ${prefix}/etc/sgml/catalog
+set xmlcatmgr.args "-s -c ${catalog.sgml}"
+
destroot {
- xinstall -m 755 -d ${destroot}${prefix}/${instdir}
- xinstall -m 644 ${portpath}/${filesdir}/catalog ${destroot}${prefix}/${instdir}
- eval xinstall -m 644 [glob ${workpath}/ISO*] ${destroot}${prefix}/${instdir}
+ xinstall -m 755 -d ${destroot}${install_dir}
+ xinstall -m 644 ${portpath}/${filesdir}/catalog ${destroot}${install_dir}
+ eval xinstall -m 644 [glob ${workpath}/ISO*] ${destroot}${install_dir}
}
destroot.args prefix=${destroot}${prefix}
+post-activate {
+ # Make the directory if it doesn't exist
+ if {![file exists ${prefix}/etc/sgml]} {
+ xinstall -m 755 -d ${prefix}/etc/sgml
+ }
+
+ # Create the catalog file if it doesn't exist
+ if {![file exists ${catalog.sgml}]} {
+ system "xmlcatmgr ${xmlcatmgr.args} create"
+ }
+
+ # Add the CATALOG entry to the catalog if it doesn't exist
+ if {[catch {exec xmlcatmgr ${xmlcatmgr.args} lookup ${install_dir}/catalog}]} {
+ system "xmlcatmgr ${xmlcatmgr.args} add CATALOG ${install_dir}/catalog"
+ }
+}
+
+# This will remove the catalog entry for this port.
+post-deactivate {
+ # Remove the CATALOG entry from the catalog
+ system "xmlcatmgr ${xmlcatmgr.args} remove CATALOG ${install_dir}/catalog"
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111025/c71142f1/attachment.html>
More information about the macports-changes
mailing list