[86411] trunk/dports/textproc/openjade/Portfile

dports at macports.org dports at macports.org
Tue Oct 25 04:18:39 PDT 2011


Revision: 86411
          http://trac.macports.org/changeset/86411
Author:   dports at macports.org
Date:     2011-10-25 04:18:39 -0700 (Tue, 25 Oct 2011)
Log Message:
-----------
openjade: use root catalog in etc/sgml/catalog for SGML processing
(see #31676)

${prefix{/etc/sgml/catalog is a more standard place for ports to
install SGML DTDs (it's the default for xmlcatmgr and analogous to
where we install XML DTDs). openjade searches in
${prefix}/share/sgml/catalog by default, so add a reference to
${prefix}/etc/sgml/catalog to that.

Modified Paths:
--------------
    trunk/dports/textproc/openjade/Portfile

Modified: trunk/dports/textproc/openjade/Portfile
===================================================================
--- trunk/dports/textproc/openjade/Portfile	2011-10-25 11:15:36 UTC (rev 86410)
+++ trunk/dports/textproc/openjade/Portfile	2011-10-25 11:18:39 UTC (rev 86411)
@@ -5,7 +5,7 @@
 
 name		openjade
 version		1.3.2
-revision	2
+revision	3
 categories	textproc
 maintainers	nomaintainer
 description	James Clark's implementation of DSSSL
@@ -23,11 +23,20 @@
 		patch-configure patch-GroveApp.h patch-GroveBuilder.cxx patch-Node.h
 
 depends_lib	port:opensp
-depends_run	port:mkcatalog
+depends_run	port:xmlcatmgr
 
+# xmlcatmgr as installed by MacPorts defaults to using
+# ${prefix}/etc/sgml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for
+# SGML). For historic reasons, openjade expects the catalog to be in
+# share/sgml/catalog. To avoid breaking existing setup, we simply add
+# a reference to the root catalog (/etc/sgml/catalog) to openjade's
+# catalog (/share/sgml/catalog)
+set catalog.sgml ${prefix}/etc/sgml/catalog
+set catalog.openjade ${prefix}/share/sgml/catalog
+ 
 configure.args	--enable-http --enable-html --enable-mif \
 		--disable-dependency-tracking \
-		--enable-default-catalog=${prefix}/share/sgml/catalog \
+		--enable-default-catalog=${catalog.openjade} \
 		--datadir=${prefix}/share/sgml/openjade \
 		--mandir=${prefix}/share/man
 
@@ -51,3 +60,36 @@
 
 post-destroot	{ system "install -d -m 755 ${destroot}${prefix}/share/sgml/openjade"
 		  system "install -m 644 ${worksrcpath}/dsssl/* ${destroot}${prefix}/share/sgml/openjade" }
+
+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 root catalog file if it doesn't exist
+    if {![file exists ${catalog.sgml}]} {
+        system "xmlcatmgr -s -c ${catalog.sgml} create"
+    }
+
+    # Create the openjade catalog file if it doesn't exist
+    if {![file exists ${catalog.openjade}]} {
+        system "xmlcatmgr -s -c ${catalog.openjade} create"
+    }
+
+    # Add the root catalog to openjade's catalog
+    if {[catch {exec xmlcatmgr -s -c ${catalog.openjade} lookup ${catalog.sgml}}]} {
+        system "xmlcatmgr -s -c ${catalog.openjade} add CATALOG ${catalog.sgml}"
+    }
+
+    # And add openjade's catalog to the root catalog
+    if {[catch {exec xmlcatmgr -s -c ${catalog.sgml} lookup ${prefix}/share/sgml/openjade/catalog}]} {
+        system "xmlcatmgr -s -c ${catalog.sgml} add CATALOG ${prefix}/share/sgml/openjade/catalog"
+    }
+}
+
+# This will remove the catalog entry for this port.
+post-deactivate {
+    # Remove the CATALOG entry from the catalog
+    system "xmlcatmgr -s -c ${catalog.sgml} remove CATALOG ${prefix}/share/sgml/openjade/catalog"
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111025/b1a5b83a/attachment.html>


More information about the macports-changes mailing list