summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2003-01-29 20:21:06 +0000
committerjmmv <jmmv@pkgsrc.org>2003-01-29 20:21:06 +0000
commit50c90b2f77085d9d55051f5adee5ebaa84ee6b59 (patch)
tree508da3c11def095a402be3a6655c70f001c27238 /textproc
parent9aaa6ee3c1775413e308bc0b8d39e651179a7c0d (diff)
downloadpkgsrc-50c90b2f77085d9d55051f5adee5ebaa84ee6b59.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')
-rw-r--r--textproc/xmlcatmgr/DESCR3
-rw-r--r--textproc/xmlcatmgr/MESSAGE10
-rw-r--r--textproc/xmlcatmgr/Makefile29
-rw-r--r--textproc/xmlcatmgr/PLIST5
-rw-r--r--textproc/xmlcatmgr/buildlink2.mk4
-rw-r--r--textproc/xmlcatmgr/catalogs.mk81
-rw-r--r--textproc/xmlcatmgr/distinfo6
-rw-r--r--textproc/xmlcatmgr/files/deinstall.tmpl33
-rw-r--r--textproc/xmlcatmgr/files/install.tmpl33
9 files changed, 181 insertions, 23 deletions
diff --git a/textproc/xmlcatmgr/DESCR b/textproc/xmlcatmgr/DESCR
index ce414c82f80..0a83164cde4 100644
--- a/textproc/xmlcatmgr/DESCR
+++ b/textproc/xmlcatmgr/DESCR
@@ -1,7 +1,8 @@
xmlcatmgr is a command line script used to manipulate SGML and XML catalogs.
It is designed with simplicity in mind: it does not depend on external
programs nor libraries, so it is ideal to manage catalog files from inside
-pkgsrc.
+pkgsrc. It is also useful to handle shared directories like share/sgml and
+share/xml.
XML catalogs are files that contain mappings from public identifiers to
system identifiers. This allows XML parsers to locate public identifiers
diff --git a/textproc/xmlcatmgr/MESSAGE b/textproc/xmlcatmgr/MESSAGE
index 9d868e5bc96..02f7d51c8e6 100644
--- a/textproc/xmlcatmgr/MESSAGE
+++ b/textproc/xmlcatmgr/MESSAGE
@@ -1,12 +1,16 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.2 2003/01/11 21:08:42 jmmv Exp $
+$NetBSD: MESSAGE,v 1.3 2003/01/29 20:21:07 jmmv Exp $
The following catalogs have been installed:
- * ${PKG_SYSCONFDIR}/catalog
- System wide catalog. This can be edited by the administrator and
+ * ${PKG_SYSCONFDIR}/sgml/catalog
+ System wide SGML catalog. Can be edited by the administrator and
is not changed by packages.
+ * ${PKG_SYSCONFDIR}/xml/catalog
+ System wide XML catalog. Can be edited by the administrator and
+ is not changed by packages. This is the *default* catalog.
+
* ${PREFIX}/share/sgml/catalog
Handles SGML stuff installed under ${PREFIX}/share/sgml.
Automatically handled by packages.
diff --git a/textproc/xmlcatmgr/Makefile b/textproc/xmlcatmgr/Makefile
index 5eb749154cf..fe0345bbd18 100644
--- a/textproc/xmlcatmgr/Makefile
+++ b/textproc/xmlcatmgr/Makefile
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.3 2003/01/28 22:04:22 jlam Exp $
+# $NetBSD: Makefile,v 1.4 2003/01/29 20:21:07 jmmv Exp $
#
-DISTNAME= xmlcatmgr-0.1
-PKGREVISION= 1
+DISTNAME= xmlcatmgr-0.2
CATEGORIES= textproc
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=xmlcatmgr/}
@@ -17,25 +16,31 @@ MAKEFILE= Makefile.boot
MAKE_ENV+= BT_PREFIX="${PREFIX}"
MAKE_ENV+= BT_PROG_AWK="${AWK}"
MAKE_ENV+= BT_PROG_SH="${SH}"
-MAKE_ENV+= BT_DIR_CATALOG="${PKG_SYSCONFDIR}"
+MAKE_ENV+= BT_DIR_CATALOG="${PKG_SYSCONFDIR}/xml"
+OWN_DIRS= ${PKG_SYSCONFDIR}/sgml ${PKG_SYSCONFDIR}/xml
EGDIR= ${PREFIX}/share/examples/xmlcatmgr
-CONF_FILES= ${EGDIR}/catalog.global ${PKG_SYSCONFDIR}/catalog
+CONF_FILES= ${EGDIR}/catalog.etc.sgml ${PKG_SYSCONFDIR}/sgml/catalog
+CONF_FILES+= ${EGDIR}/catalog.etc.xml ${PKG_SYSCONFDIR}/xml/catalog
post-build:
- ${WRKSRC}/bin/xmlcatmgr.sh -c ${WRKDIR}/catalog.global create
- ${WRKSRC}/bin/xmlcatmgr.sh -c ${WRKDIR}/catalog.sgml create
- ${WRKSRC}/bin/xmlcatmgr.sh -c ${WRKDIR}/catalog.xml create
- ${WRKSRC}/bin/xmlcatmgr.sh -c ${WRKDIR}/catalog.global add \
+ @${ECHO} "Creating SGML catalogs..."
+ @${WRKSRC}/bin/xmlcatmgr.sh -sc ${WRKDIR}/catalog.etc.sgml create
+ @${WRKSRC}/bin/xmlcatmgr.sh -sc ${WRKDIR}/catalog.sgml create
+ @${WRKSRC}/bin/xmlcatmgr.sh -sc ${WRKDIR}/catalog.etc.sgml add \
CATALOG ${PREFIX}/share/sgml/catalog
- ${WRKSRC}/bin/xmlcatmgr.sh -c ${WRKDIR}/catalog.global add \
- CATALOG ${PREFIX}/share/xml/catalog
+ @${ECHO} "Creating XML catalogs..."
+ @${WRKSRC}/bin/xmlcatmgr.sh -c ${WRKDIR}/catalog.etc.xml create
+ @${WRKSRC}/bin/xmlcatmgr.sh -c ${WRKDIR}/catalog.xml create
+ @${WRKSRC}/bin/xmlcatmgr.sh -c ${WRKDIR}/catalog.etc.xml add \
+ nextCatalog ${PREFIX}/share/xml/catalog
post-install:
${INSTALL_DATA_DIR} ${EGDIR}
${INSTALL_DATA_DIR} ${PREFIX}/share/sgml
${INSTALL_DATA_DIR} ${PREFIX}/share/xml
- ${INSTALL_DATA} ${WRKDIR}/catalog.global ${EGDIR}/catalog.global
+ ${INSTALL_DATA} ${WRKDIR}/catalog.etc.sgml ${EGDIR}/catalog.etc.sgml
+ ${INSTALL_DATA} ${WRKDIR}/catalog.etc.xml ${EGDIR}/catalog.etc.xml
${INSTALL_DATA} ${WRKDIR}/catalog.sgml ${PREFIX}/share/sgml/catalog
${INSTALL_DATA} ${WRKDIR}/catalog.xml ${PREFIX}/share/xml/catalog
diff --git a/textproc/xmlcatmgr/PLIST b/textproc/xmlcatmgr/PLIST
index fa89f6b8edd..32dd5de0913 100644
--- a/textproc/xmlcatmgr/PLIST
+++ b/textproc/xmlcatmgr/PLIST
@@ -1,7 +1,8 @@
-@comment $NetBSD: PLIST,v 1.2 2003/01/11 21:08:42 jmmv Exp $
+@comment $NetBSD: PLIST,v 1.3 2003/01/29 20:21:07 jmmv Exp $
bin/xmlcatmgr
man/man1/xmlcatmgr.1
-share/examples/xmlcatmgr/catalog.global
+share/examples/xmlcatmgr/catalog.etc.sgml
+share/examples/xmlcatmgr/catalog.etc.xml
share/sgml/catalog
share/xml/catalog
@dirrm share/xml
diff --git a/textproc/xmlcatmgr/buildlink2.mk b/textproc/xmlcatmgr/buildlink2.mk
index 799ac8ad6b1..7977f70b661 100644
--- a/textproc/xmlcatmgr/buildlink2.mk
+++ b/textproc/xmlcatmgr/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.2 2003/01/11 21:08:42 jmmv Exp $
+# $NetBSD: buildlink2.mk,v 1.3 2003/01/29 20:21:07 jmmv Exp $
#
# This Makefile fragment is included by packages that use xmlcatmgr.
#
@@ -9,7 +9,7 @@
XMLCATMGR_BUILDLINK2_MK= # defined
BUILDLINK_PACKAGES+= xmlcatmgr
-BUILDLINK_DEPENDS.xmlcatmgr?= xmlcatmgr>=0.1nb1
+BUILDLINK_DEPENDS.xmlcatmgr?= xmlcatmgr>=0.2
BUILDLINK_PKGSRCDIR.xmlcatmgr?= ../../textproc/xmlcatmgr
EVAL_PREFIX+= BUILDLINK_PREFIX.xmlcatmgr=xmlcatmgr
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
diff --git a/textproc/xmlcatmgr/distinfo b/textproc/xmlcatmgr/distinfo
index 587e9797dbb..875035c7b72 100644
--- a/textproc/xmlcatmgr/distinfo
+++ b/textproc/xmlcatmgr/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1.1.1 2003/01/10 19:24:48 jmmv Exp $
+$NetBSD: distinfo,v 1.2 2003/01/29 20:21:07 jmmv Exp $
-SHA1 (xmlcatmgr-0.1.tar.gz) = 0b0e617642bd95f527ee2f70eb0521d661b27e62
-Size (xmlcatmgr-0.1.tar.gz) = 6757 bytes
+SHA1 (xmlcatmgr-0.2.tar.gz) = d83cf8cf926d5f330525f118944d5502b84e8fd0
+Size (xmlcatmgr-0.2.tar.gz) = 8136 bytes
diff --git a/textproc/xmlcatmgr/files/deinstall.tmpl b/textproc/xmlcatmgr/files/deinstall.tmpl
new file mode 100644
index 00000000000..392e8a30a35
--- /dev/null
+++ b/textproc/xmlcatmgr/files/deinstall.tmpl
@@ -0,0 +1,33 @@
+# $NetBSD: deinstall.tmpl,v 1.1 2003/01/29 20:21:08 jmmv Exp $
+#
+# Unregister SGML/XML catalog entries.
+#
+
+XMLCATMGR='@XMLCATMGR@'
+SGML_CATALOG='@SGML_CATALOG@'
+XML_CATALOG='@XML_CATALOG@'
+SGML_ENTRIES='@SGML_ENTRIES@'
+XML_ENTRIES='@XML_ENTRIES@'
+
+case ${STAGE} in
+DEINSTALL)
+ if [ -n "${SGML_ENTRIES}" ]; then
+ ${ECHO} "===> Unregistering SGML catalog entries for ${PKGBASE}"
+ set -- ${SGML_ENTRIES}
+ while [ $# -gt 0 ]; do
+ ${XMLCATMGR} -sc ${SGML_CATALOG} remove "$2"
+ shift; shift; shift
+ done
+ fi
+ if [ -n "${XML_ENTRIES}" ]; then
+ ${ECHO} "===> Unregistering XML catalog entries for ${PKGBASE}"
+ set -- ${XML_ENTRIES}
+ while [ $# -gt 0 ]; do
+ ${XMLCATMGR} -c ${XML_CATALOG} remove "$2"
+ shift; shift; shift
+ done
+ fi
+ ;;
+*)
+ ;;
+esac
diff --git a/textproc/xmlcatmgr/files/install.tmpl b/textproc/xmlcatmgr/files/install.tmpl
new file mode 100644
index 00000000000..448391362fe
--- /dev/null
+++ b/textproc/xmlcatmgr/files/install.tmpl
@@ -0,0 +1,33 @@
+# $NetBSD: install.tmpl,v 1.1 2003/01/29 20:21:08 jmmv Exp $
+#
+# Register SGML/XML catalog entries.
+#
+
+XMLCATMGR='@XMLCATMGR@'
+SGML_CATALOG='@SGML_CATALOG@'
+XML_CATALOG='@XML_CATALOG@'
+SGML_ENTRIES='@SGML_ENTRIES@'
+XML_ENTRIES='@XML_ENTRIES@'
+
+case ${STAGE} in
+POST-INSTALL)
+ if [ -n "${SGML_ENTRIES}" ]; then
+ ${ECHO} "===> Registering SGML catalog entries for ${PKGBASE}"
+ set -- ${SGML_ENTRIES}
+ while [ $# -gt 0 ]; do
+ ${XMLCATMGR} -sc ${SGML_CATALOG} add "$1" "$2" "$3"
+ shift; shift; shift
+ done
+ fi
+ if [ -n "${XML_ENTRIES}" ]; then
+ ${ECHO} "===> Registering XML catalog entries for ${PKGBASE}"
+ set -- ${XML_ENTRIES}
+ while [ $# -gt 0 ]; do
+ ${XMLCATMGR} -c ${XML_CATALOG} add "$1" "$2" "$3"
+ shift; shift; shift
+ done
+ fi
+ ;;
+*)
+ ;;
+esac