[86416] trunk/dports/textproc/docbook-dsssl/Portfile

dports at macports.org dports at macports.org
Tue Oct 25 06:29:15 PDT 2011


Revision: 86416
          http://trac.macports.org/changeset/86416
Author:   dports at macports.org
Date:     2011-10-25 06:29:15 -0700 (Tue, 25 Oct 2011)
Log Message:
-----------
docbook-dsssl: various fixes (#31656, maintainer timeout)
 * make bin/collateindex.pl executable
 * install package catalog (to share/dsssl/docbook-dsssl/catalog)
 * install VERSION file into share/dsssl/docbook-dsssl, not into the
   docs folder. This file is part of the code, and is referenced by
   html/version.dsl.
 * register the package catalog (share/dsssl/docbook-dsssl/catalog)
   with the root catalog (etc/sgml/catalog) upon activation. (And
   unregister upon deactivate).

Modified Paths:
--------------
    trunk/dports/textproc/docbook-dsssl/Portfile

Modified: trunk/dports/textproc/docbook-dsssl/Portfile
===================================================================
--- trunk/dports/textproc/docbook-dsssl/Portfile	2011-10-25 13:28:16 UTC (rev 86415)
+++ trunk/dports/textproc/docbook-dsssl/Portfile	2011-10-25 13:29:15 UTC (rev 86416)
@@ -3,9 +3,11 @@
 
 name 		docbook-dsssl
 version		1.79
+revision	1
 categories	textproc
 description	the docbook dsssl stylesheets
 platforms	darwin
+depends_run	port:xmlcatmgr
 maintainers     decibel.org:decibel
 master_sites	sourceforge:docbook
 homepage	http://docbook.sf.net/
@@ -13,17 +15,25 @@
 use_configure 	no
 build		{}
 
-set dirs_to_install	"common contrib dtds frames html images lib olink print"
-set instdir			"share/dsssl/${name}"
+set things_to_install	"common contrib dtds frames html images lib olink print catalog VERSION"
+set install_dir		${prefix}/share/dsssl/${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	{
     # Docs
-	xinstall -m 755 -d ${destroot}${prefix}/${instdir} \
+	xinstall -m 755 -d ${destroot}${install_dir} \
 		${destroot}${prefix}/share/doc/${name} \
 		${destroot}${prefix}/share/${name}
     
     # bin
-	xinstall -m 644 -W ${worksrcpath} bin/collateindex.pl \
+	xinstall -m 755 -W ${worksrcpath} bin/collateindex.pl \
 		${destroot}${prefix}/bin
     # man
 	xinstall -m 644 -W ${worksrcpath} bin/collateindex.pl.1 \
@@ -31,10 +41,32 @@
 
     # everything else
 	xinstall -m 644 -W ${worksrcpath} BUGS ChangeLog README \
-		RELEASE-NOTES.html RELEASE-NOTES.xml RELEASE-NOTES.txt VERSION WhatsNew \
+		RELEASE-NOTES.html RELEASE-NOTES.xml RELEASE-NOTES.txt WhatsNew \
 		${destroot}${prefix}/share/doc/${name}
-	foreach dirname $dirs_to_install {
-		file copy ${worksrcpath}/${dirname} ${destroot}${prefix}/${instdir}
+	foreach dirname $things_to_install {
+		file copy ${worksrcpath}/${dirname} ${destroot}${install_dir}
 	}
 }
 
+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/786cc89d/attachment.html>


More information about the macports-changes mailing list