# # Buildtool Generic Script # defs() { BT_REQUIRE="0.16" BT_PKG_NAME="buildtool-doc" BT_PKG_VERSION="0.16" BT_PKG_LICENSE="bsd" BT_PKG_MAINTAINER="jmmv@users.sourceforge.net" BT_PKG_HOMEPAGE="http://buildtool.sourceforge.net/" BT_PKG_COMMENT="Buildtool documentation" } docs() { bt_doc "CHANGES" "Major changes between package versions" bt_doc "COPYING" "BSD license text" bt_doc "PEOPLE" "Authors and contributors" bt_doc "README" "General documentation" } check_catalog() { bt_msg_chk "for XML catalog" if test x"${CATALOG_FILE}" = x""; then _cats="/etc/xml/catalog /usr/local/etc/xml/catalog \ /opt/etc/xml/catalog /usr/share/xml/catalog \ /usr/local/share/xml/catalog /usr/pkg/share/xml/catalog" if [ -f /etc/gentoo-release ]; then _cats="/usr/share/sgml/docbook/xml-dtd-4.2/docbook.cat $_cats" fi for _f in $_cats; do if test -f $_f; then CATALOG_FILE=$_f bt_msg_result "${CATALOG_FILE}" return 0 fi done bt_msg_result "not found" return 1 else bt_msg_result "${CATALOG_FILE} (cached)" return 0 fi } check_docbook_42() { bt_msg_chk "for Docbook/XML 4.2" _dtd="`${BT_PROG_XMLCATALOG} ${CATALOG_FILE:-/etc/xml/catalog} \ '-//OASIS//DTD DocBook XML V4.2//EN' 2>&1`" if test $? -eq 0; then bt_msg_result "$_dtd" return 0 else bt_msg_result "not found" return 1 fi } check_docbook_xsl() { bt_msg_chk "for Docbook/XSL" bt_subst DOCBOOK_XSL if test x"${DOCBOOK_XSL}" = x""; then _dirs="/usr/pkg/share/xsl/docbook" if [ -f /etc/gentoo-release ]; then eval _dirs=\""/usr/share/sgml/docbook/xsl-stylesheets-* $_dirs"\" fi for _d in $_dirs; do if test -d $_d -a -f $_d/html/chunk.xsl; then DOCBOOK_XSL=$_d bt_msg_result "${DOCBOOK_XSL}" return 0 fi done bt_msg_result "not found" return 1 else bt_msg_result "${DOCBOOK_XSL} (cached)" return 0 fi } config_init() { bt_dir HTML '\${BT_DIR_DOC}' \ 'Where HTML documentation is installed.' } config() { if ! bt_check_progs BT_PROG_XSLTPROC xsltproc; then bt_err "xsltproc was not found. Please install the libxslt package that you can" \ "fetch from http://www.xmlsoft.org/ or set the BT_PROG_XSLTPROC variable" \ "pointing to where the program binary is located." fi if ! bt_check_progs BT_PROG_XMLCATALOG xmlcatalog; then bt_err "xmlcatalog was not found. Please install the libxml2 package that you can" \ "fetch from http://www.xmlsoft.org/ or set the BT_PROG_XMLCATALOG variable" \ "pointing to where the program binary is located." fi if ! check_catalog; then bt_err "System wide XML catalog file was not found. Set the CATALOG_FILE variable" \ "pointing to where it is located and make sure it contains entities for the" \ "Docbook/XML 4.2 DTD." fi if ! check_docbook_42; then bt_err "Docbook/XML 4.2 was not found. Please install the package that you can" \ "fetch from http://www.docbook.org/ or set the CATALOG_FILE variable" \ "pointing to where the system wide XML catalog file is located." fi if ! check_docbook_xsl; then bt_err "Docbook/XSL was not found. Please install the package that you can" \ "fetch from http://www.docbook.org/ or set the DOCBOOK_XSL variable" \ "pointing to where its directory is located." fi bt_generate_output } logic() { bt_target xsl xml }