summaryrefslogtreecommitdiff
path: root/textproc/xmlcatmgr/catalogs.mk
diff options
context:
space:
mode:
authorjmmv <jmmv>2003-01-29 20:21:06 +0000
committerjmmv <jmmv>2003-01-29 20:21:06 +0000
commitca4a699c9d5ceb08c9a65f2ffe0abc8a09cf5d20 (patch)
tree508da3c11def095a402be3a6655c70f001c27238 /textproc/xmlcatmgr/catalogs.mk
parent983dc20fbba7a9b3367915cf062ff6647b8f68e2 (diff)
downloadpkgsrc-ca4a699c9d5ceb08c9a65f2ffe0abc8a09cf5d20.tar.gz
Update xmlcatmgr to 0.2. Changes in this version:
* Added XML Catalogs management. You must use the new `-s' flag to handle SGML Catalogs as XML format becomes the default. * Dropped use of getopt in favour of getopts, as the former does not handle whitespace in variables properly. * Handle comments in SGML catalogs properly. * Several manpage improvements. Changes in the package: * Implement a new framework to automatically register/deregister catalog entries. This is available through the catalogs.mk file. Packages do not need to call xmlcatmgr directly any more, nor do tricky things in their PLISTs. * Install two catalog files under PKG_SYSCONFDIR, one called sgml/catalog and the other xml/catalog. Both are completely different things, so they can't be mixed. Also avoid that any of these catalogs refer to the other one, as this could cause problems.
Diffstat (limited to 'textproc/xmlcatmgr/catalogs.mk')
-rw-r--r--textproc/xmlcatmgr/catalogs.mk81
1 files changed, 81 insertions, 0 deletions
diff --git a/textproc/xmlcatmgr/catalogs.mk b/textproc/xmlcatmgr/catalogs.mk
new file mode 100644
index 00000000000..76eeb7d46fe
--- /dev/null
+++ b/textproc/xmlcatmgr/catalogs.mk
@@ -0,0 +1,81 @@
+# $NetBSD: catalogs.mk,v 1.1 2003/01/29 20:21:07 jmmv Exp $
+#
+# This Makefile fragment is intended to be included by packages that install
+# catalog files or DTDs. It takes care of registering them into the right
+# database.
+#
+# The following variables are automatically defined for free use in packages:
+# XMLCATMGR - Path to the xmlcatmgr program.
+# SGML_DEFAULT_CATALOG - Path to the system-wide (tunable) SGML catalog.
+# XML_DEFAULT_CATALOG - Path to the system-wide (tunable) XML catalog.
+#
+# Packages that recognize a system-wide catalog file should be configured
+# to use SGML_DEFAULT_CATALOG or XML_DEFAULT_CATALOG, depending on the
+# type of tool they are.
+#
+# The following variables can be defined by a package to automatically
+# register catalog files:
+# SGML_CATALOGS - List of SGML catalogs to register into share/sgml/catalog.
+# XML_CATALOGS - List of XML catalogs to register into share/xml/catalog.
+#
+# If you need to call xmlcatmgr with very specific arguments, you can use
+# the following variables. Add three words each time; they are fed to
+# xmlcatmgr in groups of three when calling the `add' action.
+# SGML_ENTRIES - Extra arguments used to add entries to the SGML catalog.
+# XML_ENTRIES - Extra arguments used to add entries to the XML catalog.
+#
+
+.if !defined(XMLCATMGR_CATALOGS_MK)
+XMLCATMGR_CATALOGS_MK= # defined
+
+# Location of the xmlcatmgr binary program.
+XMLCATMGR= ${BUILDLINK_PREFIX.xmlcatmgr}/bin/xmlcatmgr
+
+# System-wide configurable catalogs.
+.if defined(PKG_SYSCONFDIR.xmlcatmgr) && !empty(PKG_SYSCONFDIR.xmlcatmgr)
+SGML_DEFAULT_CATALOG= ${PKG_SYSCONFDIR.xmlcatmgr}/sgml/catalog
+XML_DEFAULT_CATALOG= ${PKG_SYSCONFDIR.xmlcatmgr}/xml/catalog
+.else
+SGML_DEFAULT_CATALOG= ${PKG_SYSCONFBASE}/sgml/catalog
+XML_DEFAULT_CATALOG= ${PKG_SYSCONFBASE}/xml/catalog
+.endif
+
+# Catalogs to be registered.
+SGML_CATALOGS?=
+XML_CATALOGS?=
+
+# Single entries to be added to catalogs.
+SGML_ENTRIES?=
+XML_ENTRIES?=
+
+# Convert SGML_CATALOGS files into arguments for SGML_ENTRIES.
+.if !empty(SGML_CATALOGS)
+.for c in ${SGML_CATALOGS}
+SGML_ENTRIES+= CATALOG ${PREFIX:=$c} --
+.endfor
+.endif
+
+# Convert XML_CATALOGS files into arguments for XML_ENTRIES.
+.if !empty(XML_CATALOGS)
+.for c in ${XML_CATALOGS}
+XML_ENTRIES+= nextCatalog ${PREFIX:=$c} --
+.endfor
+.endif
+
+# If there are any entries to register, export required variables and
+# use bsd.pkg.install.mk.
+.if !empty(SGML_ENTRIES) || !empty(XML_ENTRIES)
+FILES_SUBST+= XMLCATMGR="${XMLCATMGR}"
+FILES_SUBST+= SGML_CATALOG="${BUILDLINK_PREFIX.xmlcatmgr}/share/sgml/catalog"
+FILES_SUBST+= XML_CATALOG="${BUILDLINK_PREFIX.xmlcatmgr}/share/xml/catalog"
+FILES_SUBST+= SGML_ENTRIES="${SGML_ENTRIES}"
+FILES_SUBST+= XML_ENTRIES="${XML_ENTRIES}"
+INSTALL_EXTRA_TMPL+= ../../textproc/xmlcatmgr/files/install.tmpl
+DEINSTALL_EXTRA_TMPL+= ../../textproc/xmlcatmgr/files/deinstall.tmpl
+USE_PKGINSTALL= YES
+.endif # !empty(SGML_ENTRIES) || !empty(XML_ENTRIES)
+
+USE_BUILDLINK2= YES
+.include "../../textproc/xmlcatmgr/buildlink2.mk"
+
+.endif # XMLCATMGR_CATALOGS_MK