diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2003-11-04 08:53:10 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2003-11-04 08:53:10 +0000 |
commit | 24efa94047de38fed54721a3d16fed0177539e2f (patch) | |
tree | 7e964af01789712ad9b138803d2f7dd42624eca6 /textproc/scrollkeeper | |
parent | Add p5-Lingua-EN-Numbers-Easy 1.2, a perl module providing hash (diff) |
Convert scrollkeeper over to use the system catalog location. This helps
to unbreak gtk-doc as well as removes a ton of gross hacks to support
the old location. Also, import some CVS patches from SK to fix some
potential crashes when installing bad catalogs.
While I tested this with a full SK database rebuild, problems may still
occur. Please let me know if you encounter any issues with OMF files
after this commit.
Notes
Notes:
svn path=/head/; revision=93046
Diffstat (limited to 'textproc/scrollkeeper')
-rw-r--r-- | textproc/scrollkeeper/Makefile | 6 | ||||
-rw-r--r-- | textproc/scrollkeeper/files/patch-configure | 6 | ||||
-rw-r--r-- | textproc/scrollkeeper/files/patch-extract_dtds_Makefile.in | 2 | ||||
-rw-r--r-- | textproc/scrollkeeper/files/patch-libs_Makefile.in | 12 | ||||
-rw-r--r-- | textproc/scrollkeeper/files/patch-libs_extract.c | 11 | ||||
-rw-r--r-- | textproc/scrollkeeper/files/patch-libs_install.c | 189 | ||||
-rw-r--r-- | textproc/scrollkeeper/files/patch-libs_merge.c | 11 | ||||
-rw-r--r-- | textproc/scrollkeeper/files/patch-libs_uninstall.c | 11 | ||||
-rw-r--r-- | textproc/scrollkeeper/files/patch-libs_update-uri.c | 10 | ||||
-rw-r--r-- | textproc/scrollkeeper/pkg-install | 6 | ||||
-rw-r--r-- | textproc/scrollkeeper/pkg-plist | 1 |
11 files changed, 186 insertions, 79 deletions
diff --git a/textproc/scrollkeeper/Makefile b/textproc/scrollkeeper/Makefile index 094911056ab1..2fc6ca5db607 100644 --- a/textproc/scrollkeeper/Makefile +++ b/textproc/scrollkeeper/Makefile @@ -7,7 +7,7 @@ PORTNAME= scrollkeeper PORTVERSION= 0.3.12 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= textproc gnome MASTER_SITES= ${MASTER_SITE_GNOME} @@ -19,10 +19,10 @@ COMMENT= An Open Document Cataloging Project LIB_DEPENDS= intl.5:${PORTSDIR}/devel/gettext BUILD_DEPENDS= intltool-extract:${PORTSDIR}/textproc/intltool \ - ${LOCALBASE}/share/sk/docbook/${DOCBOOK_VERSION}/docbook.cat:${PORTSDIR}/textproc/docbook-sk \ + ${LOCALBASE}/share/xml/docbook/${DOCBOOK_VERSION}/docbook.cat:${PORTSDIR}/textproc/docbook-sk \ ${LOCALBASE}/share/xsl/docbook/xhtml/chunk.xsl:${PORTSDIR}/textproc/docbook-xsl RUN_DEPENDS= intltool-extract:${PORTSDIR}/textproc/intltool \ - ${LOCALBASE}/share/sk/docbook/${DOCBOOK_VERSION}/docbook.cat:${PORTSDIR}/textproc/docbook-sk \ + ${LOCALBASE}/share/xml/docbook/${DOCBOOK_VERSION}/docbook.cat:${PORTSDIR}/textproc/docbook-sk \ ${LOCALBASE}/share/xsl/docbook/xhtml/chunk.xsl:${PORTSDIR}/textproc/docbook-xsl # Don't use USE_X_PREFIX - the port doesn't really require X11 to run. diff --git a/textproc/scrollkeeper/files/patch-configure b/textproc/scrollkeeper/files/patch-configure index 7997aae40391..72eece1037bc 100644 --- a/textproc/scrollkeeper/files/patch-configure +++ b/textproc/scrollkeeper/files/patch-configure @@ -13,7 +13,7 @@ echo "$as_me:$LINENO: checking for docbook-dtd412-xml" >&5 echo $ECHO_N "checking for docbook-dtd412-xml... $ECHO_C" >&6 - if xmlcatalog /etc/xml/catalog "-//OASIS//DTD DocBook XML V4.1.2//EN" | grep "No entry" >/dev/null ; then -+ if test ! -f $LOCALBASE/share/sk/docbook/4.1.2/docbook.cat ; then ++ if test ! -f $LOCALBASE/share/xml/docbook/4.1.2/docbook.cat ; then echo "* ERROR * " echo " " - echo "Couldn't find the DocBook XML V4.1.2 DTD. Please make sure that you have the docbook-dtd412-xml package installed. If it is installed, the package probably did not register the DTD in the catalog properly. Consult http://scrollkeeper.sourceforge.net/docbook.shtml for more information." @@ -21,8 +21,8 @@ echo " " - { { echo "$as_me:$LINENO: error: DocBook XML V4.1.2 DTD not present in /etc/xml/catalog. Make sure docbook-dtd412-xml is installed and registers DTD in catalog." >&5 -echo "$as_me: error: DocBook XML V4.1.2 DTD not present in /etc/xml/catalog. Make sure docbook-dtd412-xml is installed and registers DTD in catalog." >&2;} -+ { { echo "$as_me:$LINENO: error: DocBook XML V4.1.2 DTD not present in $LOCALBASE/share/sk. Make sure docbook-dtd412-xml is installed and registers DTD in catalog." >&5 -+echo "$as_me: error: DocBook XML V4.1.2 DTD not present in $LOCALBASE/share/sk. Make sure docbook-dtd412-xml is installed and registers DTD in catalog." >&2;} ++ { { echo "$as_me:$LINENO: error: DocBook XML V4.1.2 DTD not present in $LOCALBASE/share/xml. Make sure docbook-dtd412-xml is installed and registers DTD in catalog." >&5 ++echo "$as_me: error: DocBook XML V4.1.2 DTD not present in $LOCALBASE/share/xml. Make sure docbook-dtd412-xml is installed and registers DTD in catalog." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: found" >&5 diff --git a/textproc/scrollkeeper/files/patch-extract_dtds_Makefile.in b/textproc/scrollkeeper/files/patch-extract_dtds_Makefile.in index 0f0180e20448..d5a44cddaf16 100644 --- a/textproc/scrollkeeper/files/patch-extract_dtds_Makefile.in +++ b/textproc/scrollkeeper/files/patch-extract_dtds_Makefile.in @@ -5,7 +5,7 @@ am__quote = @am__quote@ install_sh = @install_sh@ -CATALOG = $(sysconfdir)/xml/catalog -+CATALOG = %%LOCALBASE%%/share/sk/catalog ++CATALOG = %%LOCALBASE%%/share/xml/catalog dtdsdir = $(datadir)/xml/scrollkeeper/dtds dtds_HEADERS = scrollkeeper-omf.dtd scrollkeeper-cl.dtd subdir = extract/dtds diff --git a/textproc/scrollkeeper/files/patch-libs_Makefile.in b/textproc/scrollkeeper/files/patch-libs_Makefile.in deleted file mode 100644 index d87fede54c3e..000000000000 --- a/textproc/scrollkeeper/files/patch-libs_Makefile.in +++ /dev/null @@ -1,12 +0,0 @@ ---- libs/Makefile.in.orig Wed Apr 23 00:46:23 2003 -+++ libs/Makefile.in Wed Apr 23 00:46:54 2003 -@@ -144,7 +144,8 @@ - $(XML_CFLAGS) \ - $(XSLT_CFLAGS) \ - $(HOST_TYPE) \ -- -DSCROLLKEEPER_STATEDIR=\""$(localstatedir)"\" -+ -DSCROLLKEEPER_STATEDIR=\""$(localstatedir)"\" \ -+ -DSK_XML_CATALOGS=\""%%LOCALBASE%%/share/sk/catalog %%LOCALBASE%%/share/sk/docbook/catalog"\" - - - libscrollkeeper_la_SOURCES = \ diff --git a/textproc/scrollkeeper/files/patch-libs_extract.c b/textproc/scrollkeeper/files/patch-libs_extract.c deleted file mode 100644 index 280fb7aceafd..000000000000 --- a/textproc/scrollkeeper/files/patch-libs_extract.c +++ /dev/null @@ -1,11 +0,0 @@ ---- libs/extract.c.orig Wed Apr 23 00:45:18 2003 -+++ libs/extract.c Wed Apr 23 00:45:58 2003 -@@ -54,6 +54,8 @@ - int temp1_fd, temp2_fd, errors_fd; - #endif - -+ setenv("XML_CATALOG_FILES", SK_XML_CATALOGS, 1); -+ - if (input_file == NULL || - stylesheets == NULL || - outputs == NULL) { diff --git a/textproc/scrollkeeper/files/patch-libs_install.c b/textproc/scrollkeeper/files/patch-libs_install.c index 30f873782bce..5e30af15fcb7 100644 --- a/textproc/scrollkeeper/files/patch-libs_install.c +++ b/textproc/scrollkeeper/files/patch-libs_install.c @@ -1,15 +1,178 @@ ---- libs/install.c.orig Wed Jan 15 23:27:11 2003 -+++ libs/install.c Wed Jan 15 23:26:31 2003 -@@ -165,6 +165,12 @@ - char *toc_stylesheet_name, *index_name, *index_stylesheet_name, *uid; - - /* -+ * Set up a custom catalog path. -+ */ +--- libs/install.c.orig Tue Nov 4 02:42:22 2003 ++++ libs/install.c Tue Nov 4 02:42:26 2003 +@@ -41,7 +41,7 @@ + static int get_unique_doc_id(char *); + static void add_doc_to_scrollkeeper_docs(char *, char *, char *, int, char *); + static void add_doc_to_content_list(xmlNodePtr, char *, char **, char *, char *, +- char *, char *, char *, int, int, char); ++ char *, char *, char *, int, int, char, char **); + static char *get_doc_property(xmlNodePtr, char *, char *); + static char *get_doc_parameter_value(xmlNodePtr, char *); + static char* remove_leading_and_trailing_white_spaces(char *); +@@ -113,6 +113,10 @@ + + snprintf(command, 1024, "scrollkeeper-get-toc-from-docpath %s", docpath); + config_fid = popen(command, "r"); + -+ setenv("XML_CATALOG_FILES", SK_XML_CATALOGS, 1); ++ if (config_fid == NULL) ++ return NULL; + -+ /* - * Read in OMF file - */ - omf_doc = xmlParseFile(omf_name); + fscanf(config_fid, "%s", tocpath); + if (pclose(config_fid)) + return NULL; +@@ -219,8 +223,13 @@ + { + /* create full content list path names and read trees */ + locale = get_doc_property(node, "language", "code"); +- if (!get_best_locale_dir(locale_dir, locale_name, scrollkeeper_dir, locale)) ++ if (locale == NULL) ++ continue; ++ if (!get_best_locale_dir(locale_dir, locale_name, scrollkeeper_dir, locale)) { ++ xmlFree(locale); + continue; ++ } ++ xmlFree(locale); + snprintf(cl_filename, PATHLEN, "%s/scrollkeeper_cl.xml", locale_dir); + snprintf(cl_ext_filename, PATHLEN, "%s/scrollkeeper_extended_cl.xml", locale_dir); + +@@ -245,6 +254,8 @@ + } + + docpath = get_doc_property(node, "identifier", "url"); ++ if (docpath == NULL) ++ continue; + + /* add to scrollkeeper_docs */ + unique_id = get_unique_doc_id(scrollkeeper_docs); +@@ -252,7 +263,7 @@ + locale_name); + + format = get_doc_property(node, "format", "mime"); +- if (!strcmp(format, "text/xml")) ++ if (format && !strcmp(format, "text/xml")) + { + /* create TOC file and index file */ + +@@ -304,6 +315,8 @@ + } + + uid = get_doc_property(node, "relation", "seriesid"); ++ if (uid == NULL) ++ continue; + + title = get_doc_parameter_value(node, "title"); + strncpy(str, title, 1024); +@@ -315,18 +328,25 @@ + /* look for subject nodes */ + if (!xmlStrcmp(s_node->name, (xmlChar *)"subject")) + { +- char *category, *token, *rest; ++ char *category, *token, *rest, *complete_cat_token = NULL; + + category = (char *)xmlGetProp(s_node, (xmlChar *)"category"); ++ if (category == NULL) ++ continue; + token = strtok_r(category, SEP, &rest); + add_doc_to_content_list(cl_doc->children->children, token, &rest, +- docpath, omf_name, title, format, uid, unique_id, 0, outputprefs); +- free((void *)category); ++ docpath, omf_name, title, format, uid, unique_id, 0, outputprefs, ++ &complete_cat_token); ++ xmlFree(category); ++ free((void *)complete_cat_token); + category = (char *)xmlGetProp(s_node, (xmlChar *)"category"); + token = strtok_r(category, SEP, &rest); ++ complete_cat_token = NULL; + add_doc_to_content_list(cl_ext_doc->children->children, token, &rest, +- docpath, omf_name, title, format, uid, unique_id, 1, outputprefs); +- free((void *)category); ++ docpath, omf_name, title, format, uid, unique_id, 1, outputprefs, ++ &complete_cat_token); ++ xmlFree(category); ++ free((void *)complete_cat_token); + } + } + +@@ -334,6 +354,9 @@ + xmlFreeDoc(cl_doc); + xmlSaveFile(cl_ext_filename, cl_ext_doc); + xmlFreeDoc(cl_ext_doc); ++ xmlFree(docpath); ++ xmlFree(format); ++ xmlFree(uid); + } + } + +@@ -409,6 +432,7 @@ + unique_id = id; + } + ++ fclose (fid); + return unique_id + 1; + } + +@@ -472,32 +496,38 @@ + static void add_doc_to_content_list(xmlNodePtr sect_node, char *cat_token, char **rest, + char *docpath, char *omf_name, + char *title, char *format, char *uid, +- int id, int add_toc, char outputprefs) ++ int id, int add_toc, char outputprefs, char **complete_cat_token) + { +- xmlNodePtr node, new_node, t_node, s_node; ++ xmlNodePtr node, new_node, s_node; + + if (sect_node == NULL || + cat_token == NULL) + return; + ++ if (*complete_cat_token == NULL) ++ *complete_cat_token = strdup(cat_token); ++ else { ++ char *ptr; ++ ptr = malloc(strlen(*complete_cat_token) + strlen(cat_token) + 2); ++ sprintf(ptr, "%s%s", *complete_cat_token, cat_token); ++ free(*complete_cat_token); ++ *complete_cat_token = ptr; ++ } ++ + /* these should all be <sect> nodes */ + for(node = sect_node; node != NULL; node = node->next) + { + if (xmlStrcmp(node->name, (xmlChar *)"sect")) + continue; +- +- for(t_node = node->children; t_node != NULL; t_node = t_node->next) +- { +- /* these should be <title>, <sect> or <doc> nodes */ +- if (t_node->type == XML_ELEMENT_NODE && +- !xmlStrcmp(t_node->name, (xmlChar *)"title")) +- break; +- } ++ ++ xmlChar *categorycode; ++ ++ categorycode = xmlGetProp(node, (xmlChar *)"categorycode"); ++ if (categorycode == NULL) ++ continue; + + /* these should be the actual titles */ +- if (t_node != NULL && t_node->children != NULL && +- t_node->children->type == XML_TEXT_NODE && +- !xmlStrcmp((xmlChar *)cat_token, t_node->children->content)) ++ if (!xmlStrcmp((xmlChar *)(*complete_cat_token), categorycode)) + { + cat_token = strtok_r(NULL, SEP, rest); + if (cat_token == NULL) +@@ -536,9 +566,11 @@ + if (s_node != NULL) + add_doc_to_content_list(s_node, cat_token, rest, + docpath, omf_name, title, format, +- uid, id, add_toc, outputprefs); ++ uid, id, add_toc, outputprefs, complete_cat_token); + return; + } + } ++ ++ xmlFree(categorycode); + } + } diff --git a/textproc/scrollkeeper/files/patch-libs_merge.c b/textproc/scrollkeeper/files/patch-libs_merge.c deleted file mode 100644 index e5b559c52456..000000000000 --- a/textproc/scrollkeeper/files/patch-libs_merge.c +++ /dev/null @@ -1,11 +0,0 @@ ---- libs/merge.c.orig Thu Jan 16 01:40:06 2003 -+++ libs/merge.c Thu Jan 16 01:40:34 2003 -@@ -192,6 +192,8 @@ - char **lang_tab, *path; - int i, lang_num, count; - xmlDocPtr merged_tree, *tree_tab; -+ -+ setenv("XML_CATALOG_FILES", SK_XML_CATALOGS, 1); - - lang_tab = sk_get_language_list(); - diff --git a/textproc/scrollkeeper/files/patch-libs_uninstall.c b/textproc/scrollkeeper/files/patch-libs_uninstall.c deleted file mode 100644 index f3439b34553e..000000000000 --- a/textproc/scrollkeeper/files/patch-libs_uninstall.c +++ /dev/null @@ -1,11 +0,0 @@ ---- libs/uninstall.c.orig Wed Jul 24 22:25:34 2002 -+++ libs/uninstall.c Thu Jan 16 01:50:53 2003 -@@ -70,6 +70,8 @@ - int start, end; - char cl_filename[PATHLEN], cl_ext_filename[PATHLEN]; - xmlDocPtr cl_doc, cl_ext_doc; -+ -+ setenv("XML_CATALOG_FILES", SK_XML_CATALOGS, 1); - - if (id_tab == NULL) - return; diff --git a/textproc/scrollkeeper/files/patch-libs_update-uri.c b/textproc/scrollkeeper/files/patch-libs_update-uri.c deleted file mode 100644 index 435f61e1d55e..000000000000 --- a/textproc/scrollkeeper/files/patch-libs_update-uri.c +++ /dev/null @@ -1,10 +0,0 @@ ---- libs/update-url.c.orig Thu Jan 16 01:41:36 2003 -+++ libs/update-url.c Thu Jan 16 01:41:40 2003 -@@ -33,6 +33,7 @@ - xmlNodePtr node; - xmlDocPtr omf_doc; - -+ setenv("XML_CATALOG_FILES", SK_XML_CATALOGS, 1); - - /* Parse file and make sure it is well-formed */ - omf_doc = xmlParseFile(omf_name); diff --git a/textproc/scrollkeeper/pkg-install b/textproc/scrollkeeper/pkg-install index 85d16db25bad..5f288365002a 100644 --- a/textproc/scrollkeeper/pkg-install +++ b/textproc/scrollkeeper/pkg-install @@ -4,8 +4,8 @@ PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin export PATH PREFIX=`xml2-config --prefix` -ROOTCATALOG=${PREFIX}/share/sk/catalog -CATALOG=${PREFIX}/share/sk/docbook/catalog +ROOTCATALOG=${PREFIX}/share/xml/catalog +CATALOG=${PREFIX}/share/xml/docbook/catalog if [ "$2" = "PRE-INSTALL" ]; then @@ -215,7 +215,7 @@ echo Found DocBook XSLT stylesheets in $xsldir for version in current 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 \ 1.48 1.49 1.50.0 1.51.0 1.52.0 1.52.1 1.52.2 1.53.0 1.54.0 \ 1.54.1 1.55.0 1.56.0 1.56.1 1.57.0 1.58.0 1.58.1 1.59.0 \ - 1.59.1 1.60.0 + 1.59.1 1.60.0 1.62.3 do xmlcatalog --noout --add "rewriteSystem" \ "http://docbook.sourceforge.net/release/xsl/$version" \ diff --git a/textproc/scrollkeeper/pkg-plist b/textproc/scrollkeeper/pkg-plist index 0d6743f3eb5c..7e1410434d4b 100644 --- a/textproc/scrollkeeper/pkg-plist +++ b/textproc/scrollkeeper/pkg-plist @@ -117,6 +117,5 @@ share/locale/zh_TW/LC_MESSAGES/scrollkeeper.mo @dirrm share/gnome/omf/scrollkeeper @unexec rm -f /var/log/scrollkeeper.log 2>/dev/null || true @unexec rm -rf /var/db/scrollkeeper 2>/dev/null || true -@unexec echo "If you are permantly removing this port, you should do a ``rm -rf %%LOCALBASE%%/share/sk/catalog %%LOCALBASE%%/share/sk/docbook/catalog`` to remove the XML catalogs that are left." | fmt @exec touch -f /var/log/scrollkeeper.log @exec mkdir -p /var/db/scrollkeeper |