From 71ba0b6c89718906b40fbbed65dbc3d5ca406860 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Wed, 22 Jul 2020 05:25:16 -0400 Subject: [PATCH 17/36] gnu: Add docbook-utils. * gnu/packages/docbook.scm (docbook-utils): New variable. * gnu/packages/patches: Add files docbook-utils-autotools.patch, docbook-utils-typo.patch, docbook-utils-frontends.patch, docbook-utils-helpers-date.patch, docbook-utils-helpers-name.patch, docbook-utils-helpers-whitespace.patch, docbook-utils-helpers-support.patch and docbook-utils-jade.patch. * gnu/local.mk: Add references to new patches. --- gnu/local.mk | 8 + gnu/packages/docbook.scm | 68 ++++ .../patches/docbook-utils-autotools.patch | 376 ++++++++++++++++++ .../patches/docbook-utils-frontends.patch | 42 ++ .../patches/docbook-utils-helpers-date.patch | 61 +++ .../patches/docbook-utils-helpers-name.patch | 34 ++ .../docbook-utils-helpers-support.patch | 29 ++ .../docbook-utils-helpers-whitespace.patch | 30 ++ gnu/packages/patches/docbook-utils-jade.patch | 211 ++++++++++ gnu/packages/patches/docbook-utils-typo.patch | 100 +++++ 10 files changed, 959 insertions(+) create mode 100644 gnu/packages/patches/docbook-utils-autotools.patch create mode 100644 gnu/packages/patches/docbook-utils-frontends.patch create mode 100644 gnu/packages/patches/docbook-utils-helpers-date.patch create mode 100644 gnu/packages/patches/docbook-utils-helpers-name.patch create mode 100644 gnu/packages/patches/docbook-utils-helpers-support.patch create mode 100644 gnu/packages/patches/docbook-utils-helpers-whitespace.patch create mode 100644 gnu/packages/patches/docbook-utils-jade.patch create mode 100644 gnu/packages/patches/docbook-utils-typo.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0ec7317050..3925fa024d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -876,6 +876,14 @@ dist_patch_DATA = \ %D%/packages/patches/diffutils-gets-undeclared.patch \ %D%/packages/patches/dkimproxy-add-ipv6-support.patch \ %D%/packages/patches/docbook-xsl-nonrecursive-string-subst.patch \ + %D%/packages/patches/docbook-utils-autotools.patch \ + %D%/packages/patches/docbook-utils-typo.patch \ + %D%/packages/patches/docbook-utils-frontends.patch \ + %D%/packages/patches/docbook-utils-helpers-date.patch \ + %D%/packages/patches/docbook-utils-helpers-name.patch \ + %D%/packages/patches/docbook-utils-helpers-whitespace.patch \ + %D%/packages/patches/docbook-utils-helpers-support.patch \ + %D%/packages/patches/docbook-utils-jade.patch \ %D%/packages/patches/doc++-include-directives.patch \ %D%/packages/patches/doc++-segfault-fix.patch \ %D%/packages/patches/docker-fix-tests.patch \ diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index fc9d28c490..9ad169531b 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -150,6 +150,74 @@ OpenJade or other tools to transform SGML and XML DocBook files.") (home-page "https://docbook.org") (license x11))) +(define-public docbook-utils + (package + (name "docbook-utils") + (version "0.6.14") + (source + (origin + (method url-fetch) + (uri + (string-append "ftp://sources.redhat.com/pub/docbook-tools/" + "new-trials/SOURCES/" name "-" version ".tar.gz")) + (sha256 + (base32 "1scj5vgw1xz872pq54a89blcxqqm11p90yzv8a9mqq57x27apyj8")) + (patches + (search-patches + "docbook-utils-autotools.patch" + "docbook-utils-typo.patch" + "docbook-utils-frontends.patch" + "docbook-utils-helpers-date.patch" + "docbook-utils-helpers-name.patch" + "docbook-utils-helpers-whitespace.patch" + "docbook-utils-helpers-support.patch" + "docbook-utils-jade.patch")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; XXX: Fix-me. + (add-after 'unpack 'skip-doc-dir + (lambda _ + (substitute* "Makefile.am" + (("SUBDIRS = backends bin doc frontends helpers") + "SUBDIRS = backends bin frontends helpers")) + #t)) + (add-after 'skip-doc-dir 'trigger-bootstrap + (lambda _ + (for-each delete-file + (list + "configure" + "Makefile.in" + "backends/Makefile.in" + "bin/Makefile.in" + "doc/Makefile.in" + "doc/HTML/Makefile.in" + "doc/man/Makefile.in" + "doc/refentry/Makefile.in" + "frontends/Makefile.in" + "helpers/Makefile.in")) + (rename-file "configure.in" "configure.ac") + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake))) + (inputs + `(("docbook-dsssl" ,docbook-dsssl) + ;; ("docbook-sgml" ,docbook-sgml) + ("openjade" ,openjade) + ("sgml-common" ,sgml-common) + ("perl" ,perl))) + (synopsis "Tools for DocBook") + (description "DocBook-Utils is a collection of utility scripts used to +convert and analyze SGML documents in general, and DocBook files in particular. +The scripts are used to convert from DocBook or other SGML formats into +classical file formats like HTML, man, info, RTF and many more. There's also a +utility to compare two SGML files and only display the differences in markup. +This is useful for comparing documents prepared for different languages.") + (home-page "https://www.sourceware.org/docbook-tools/") + (license gpl2+))) + (define-public docbook-xml-5 (package (name "docbook-xml") diff --git a/gnu/packages/patches/docbook-utils-autotools.patch b/gnu/packages/patches/docbook-utils-autotools.patch new file mode 100644 index 0000000000..2ab27f6ed9 --- /dev/null +++ b/gnu/packages/patches/docbook-utils-autotools.patch @@ -0,0 +1,376 @@ +Description: autotools_dev results +Author: Mathieu Malaterre + +--- docbook-utils-0.6.14.orig/Makefile.in ++++ docbook-utils-0.6.14/Makefile.in +@@ -128,7 +128,7 @@ sharedstatedir = @sharedstatedir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ + SUBDIRS = backends bin doc frontends helpers +-sgmldudir = $(prefix)/share/sgml/docbook/utils-@VERSION@ ++sgmldudir = $(prefix)/share/docbook-utils + sgmldu_DATA = docbook-utils.dsl + EXTRA_DIST = AUTHORS README COPYING INSTALL NEWS ChangeLog TODO \ + $(sgmldu_DATA) docbook-utils.spec +--- docbook-utils-0.6.14.orig/Makefile.am ++++ docbook-utils-0.6.14/Makefile.am +@@ -1,6 +1,6 @@ + SUBDIRS = backends bin doc frontends helpers + +-sgmldudir = $(prefix)/share/sgml/docbook/utils-@VERSION@ ++sgmldudir = $(prefix)/share/docbook-utils + sgmldu_DATA = docbook-utils.dsl + + EXTRA_DIST = AUTHORS README COPYING INSTALL NEWS ChangeLog TODO \ +--- docbook-utils-0.6.14.orig/backends/Makefile.in ++++ docbook-utils-0.6.14/backends/Makefile.in +@@ -104,7 +104,7 @@ sbindir = @sbindir@ + sharedstatedir = @sharedstatedir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ +-sgmldudir = $(prefix)/share/sgml/docbook/utils-@VERSION@ ++sgmldudir = $(prefix)/share/docbook-utils + sgmldubedir = $(sgmldudir)/backends + sgmldube_DATA = dvi html man pdf ps rtf tex texi txt + EXTRA_DIST = dvi html man.in pdf ps rtf tex texi.in txt +--- docbook-utils-0.6.14.orig/backends/Makefile.am ++++ docbook-utils-0.6.14/backends/Makefile.am +@@ -1,4 +1,4 @@ +-sgmldudir = $(prefix)/share/sgml/docbook/utils-@VERSION@ ++sgmldudir = $(prefix)/share/docbook-utils + sgmldubedir = $(sgmldudir)/backends + sgmldube_DATA = dvi html man pdf ps rtf tex texi txt + +--- docbook-utils-0.6.14.orig/backends/man.in ++++ docbook-utils-0.6.14/backends/man.in +@@ -3,7 +3,7 @@ + # This program is under GPL license. See LICENSE file for details. + + # Convert to *roff +-HELPER=$SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2man-spec.pl ++HELPER=docbook2man-spec.pl + TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \ + { echo >&2 "man backend: could not create secure temporary directory"; exit 1;} + trap 'rm -rf "${TMPDIR}"' EXIT +--- docbook-utils-0.6.14.orig/backends/texi.in ++++ docbook-utils-0.6.14/backends/texi.in +@@ -3,7 +3,7 @@ + # This program is under GPL license. See LICENSE file for details. + + # Convert to texinfo +-nsgmls $SGML_FILE | sgmlspl $SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2texi-spec.pl >$SGML_FILE_NAME.texi ++nsgmls $SGML_FILE | sgmlspl docbook2texi-spec.pl >$SGML_FILE_NAME.texi + if [ $? -ne 0 ] + then exit 1 + fi +--- docbook-utils-0.6.14.orig/bin/jw.in ++++ docbook-utils-0.6.14/bin/jw.in +@@ -87,10 +87,10 @@ then + fi + + # Set frontend to use +-SGML_FRONTEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends/docbook" ++SGML_FRONTEND="@prefix@/share/docbook-utils/frontends/docbook" + + # Set backend to use +-SGML_BACKEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/backends/html" ++SGML_BACKEND="@prefix@/share/docbook-utils/backends/html" + + # Set main stylesheet + SGML_STYLESHEET="default" +@@ -120,14 +120,14 @@ while [ $# -gt 0 ] + do case $1 in + -f|--frontend) case "$2" in + /*) SGML_FRONTEND="$2" ;; +- *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends ++ *) d=@prefix@/share/docbook-utils/frontends + SGML_FRONTEND="$d/$2" ;; + esac + shift 2 + ;; + -b|--backend) case "$2" in + /*) SGML_BACKEND="$2" ;; +- *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/backends ++ *) d=@prefix@/share/docbook-utils/backends + SGML_BACKEND="$d/$2" ;; + esac + shift 2 +@@ -186,8 +186,8 @@ do case $1 in + shift 2 + ;; + -w|--warning) case $2 in +- list) echo -e "List of allowed warning types (multiple -w options are allowed):\n" +- echo -e $SGML_WARNINGS_LIST ++ list) printf "List of allowed warning types (multiple -w options are allowed):\n\n" ++ printf "$SGML_WARNINGS_LIST\n" + exit 0 + ;; + xml|mixed|sgmldecl|should|default|duplicate|undefined|unclosed|empty|net|min-tag|unused-map|unused-param|notation-sysid|all|no-xml|no-mixed|no-sgmldecl|no-should|no-default|no-duplicate|no-undefined|no-unclosed|no-empty|no-net|no-min-tag|no-unused-map|no-unused-param|no-notation-sysid) \ +@@ -195,14 +195,14 @@ do case $1 in + shift 2 + ;; + *) echo "Unknown warning type \"$2\". Allowed warning types are:" >&2 +- echo -e $SGML_WARNINGS_LIST >&2 ++ printf "$SGML_WARNINGS_LIST\n" >&2 + exit 1 + ;; + esac + ;; + -e|--error) case $2 in +- list) echo -e "List of allowed error types (multiple -e options are allowed):\n" +- echo -e $SGML_ERRORS_LIST ++ list) printf "List of allowed error types (multiple -e options are allowed):\n\n" ++ printf "$SGML_ERRORS_LIST\n" + exit 0 + ;; + no-idref|no-significant|no-valid) \ +@@ -210,19 +210,19 @@ do case $1 in + shift 2 + ;; + *) echo "Unknown error type \"$2\". Allowed error types are:" >&2 +- echo -e $SGML_ERRORS_LIST >&2 ++ printf "$SGML_ERRORS_LIST\n" >&2 + exit 1 + ;; + esac + ;; +- -h|--help) echo -e "`basename $0` - Jade Wrapper\n" +- echo -e "$SGML_HELP_MESSAGE" ++ -h|--help) printf "`basename $0` - Jade Wrapper\n\n" ++ printf "$SGML_HELP_MESSAGE\n" + exit 0 + ;; +- -v|--version) echo -e "$SGML_VERSION_MESSAGE" ++ -v|--version) printf "$SGML_VERSION_MESSAGE\n" + exit 0 + ;; +- -*) echo -e "$SGML_HELP_MESSAGE" >&2 ++ -*) printf "$SGML_HELP_MESSAGE\n" >&2 + exit 1 + ;; + *) if [ -z "$SGML_FILE" ] +@@ -233,7 +233,7 @@ do case $1 in + esac + shift 1 + else +- echo -e "$SGML_HELP_MESSAGE" >&2 ++ printf "$SGML_HELP_MESSAGE\n" >&2 + exit 1 + fi + ;; +@@ -243,7 +243,7 @@ done + # Check that we have a frontend + if [ -z "$SGML_FRONTEND" ] + then +- echo -e $SGML_HELP_MESSAGE >&2 ++ printf "$SGML_HELP_MESSAGE\n" >&2 + exit 1 + fi + if [ ! -s $SGML_FRONTEND ] +@@ -255,7 +255,7 @@ fi + # Check that we have a backend + if [ -z "$SGML_BACKEND" ] + then +- echo -e $SGML_HELP_MESSAGE >&2 ++ printf "$SGML_HELP_MESSAGE\n" >&2 + exit 1 + fi + if [ ! -s $SGML_BACKEND ] +@@ -267,7 +267,7 @@ fi + # Check that we have a file to process + if [ -z "$SGML_FILE" ] + then +- echo -e $SGML_HELP_MESSAGE >&2 ++ printf "$SGML_HELP_MESSAGE\n" >&2 + exit 1 + fi + if [ ! -s $SGML_FILE ] +@@ -290,7 +290,7 @@ fi + + # Use SGML declaration for XML if needed + if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ] +-then SGML_DECL=${SGML_BASE_DIR}/xml.dcl ++then SGML_DECL=${SGML_BASE_DIR}/declaration/xml.dcl + fi + + # Try to find the SGML normalizer +@@ -402,7 +402,7 @@ fi + # Create output directory if not available + if [ -z "$SGML_OUTPUT_DIRECTORY" ] + then +- echo -e $SGML_HELP_MESSAGE >&2 ++ printf "$SGML_HELP_MESSAGE\n" >&2 + exit 1 + fi + if [ ! -d $SGML_OUTPUT_DIRECTORY ] +--- docbook-utils-0.6.14.orig/doc/refentry/jw.sgml ++++ docbook-utils-0.6.14/doc/refentry/jw.sgml +@@ -230,7 +230,7 @@ + Here we have chosen to generate HTML output. In fact we can + use any of the backends stored in the backends/ + subdirectory of the DocBook-utils distribution directory (usually +- /usr/share/sgml/docbook/utils-&version;). ++ /usr/share/docbook-utils). + Similarly, you can use any frontend defined in the + frontends/ subdirectory to convert from another + input format. +@@ -592,21 +592,21 @@ + + + +- /usr/share/sgml/docbook/utils-&version;/backends ++ /usr/share/docbook-utils/backends + + The various backends + + + + +- /usr/share/sgml/docbook/utils-&version;/frontends ++ /usr/share/docbook-utils/frontends + + The various frontends + + + + +- /usr/share/sgml/docbook/utils-&version;/helpers ++ /usr/share/perl5/sgmlspl-specs + + The various helper scripts like docbook2man or docbook2texi + +--- docbook-utils-0.6.14.orig/doc/man/jw.1 ++++ docbook-utils-0.6.14/doc/man/jw.1 +@@ -128,7 +128,7 @@ be in any other directory than the curre + Here we have chosen to generate HTML output. In fact we can + use any of the backends stored in the \fIbackends/\fR + subdirectory of the DocBook-utils distribution directory (usually +-\fI/usr/share/sgml/docbook/utils-0.6.14\fR). ++\fI/usr/share/docbook-utils\fR). + Similarly, you can use any frontend defined in the + \fIfrontends/\fR subdirectory to convert from another + input format. +@@ -355,13 +355,13 @@ Centralized SGML open catalog. This file + vary if another frontend than \fIdocbook\fR + is used. + .TP +-\fB\fI/usr/share/sgml/docbook/utils-0.6.14/backends\fB\fR ++\fB\fI/usr/share/docbook-utils/backends\fB\fR + The various backends + .TP +-\fB\fI/usr/share/sgml/docbook/utils-0.6.14/frontends\fB\fR ++\fB\fI/usr/share/docbook-utils/frontends\fB\fR + The various frontends + .TP +-\fB\fI/usr/share/sgml/docbook/utils-0.6.14/helpers\fB\fR ++\fB\fI/usr/share/perl5/sgmlspl-specs\fB\fR + The various helper scripts like docbook2man or docbook2texi + .SH "AUTHORS" + .PP +--- docbook-utils-0.6.14.orig/doc/HTML/Makefile.in ++++ docbook-utils-0.6.14/doc/HTML/Makefile.in +@@ -103,7 +103,7 @@ sbindir = @sbindir@ + sharedstatedir = @sharedstatedir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ +-htmldir = $(docdir)/html/docbook-utils-@VERSION@ ++htmldir = $(docdir)/html/ + html_DATA = api.html \ + backend-spec.html \ + docbook2man.html \ +--- docbook-utils-0.6.14.orig/frontends/Makefile.in ++++ docbook-utils-0.6.14/frontends/Makefile.in +@@ -104,7 +104,7 @@ sbindir = @sbindir@ + sharedstatedir = @sharedstatedir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ +-sgmldudir = $(prefix)/share/sgml/docbook/utils-@VERSION@ ++sgmldudir = $(prefix)/share/docbook-utils + sgmldufedir = $(sgmldudir)/frontends + sgmldufe_DATA = docbook + all: all-am +--- docbook-utils-0.6.14.orig/frontends/Makefile.am ++++ docbook-utils-0.6.14/frontends/Makefile.am +@@ -1,3 +1,3 @@ +-sgmldudir = $(prefix)/share/sgml/docbook/utils-@VERSION@ ++sgmldudir = $(prefix)/share/docbook-utils + sgmldufedir = $(sgmldudir)/frontends + sgmldufe_DATA = docbook +--- docbook-utils-0.6.14.orig/frontends/docbook.in ++++ docbook-utils-0.6.14/frontends/docbook.in +@@ -27,10 +27,7 @@ case "$1" in + done + if [ -z "$SGML_CATALOG" ] + then +- if [ "${SGML_XML}" != "sgml" ] +- then SGML_CATALOG=${SGML_CATALOGS_DIR}/${SGML_XML}-docbook.cat +- else SGML_CATALOG=${SGML_CATALOGS_DIR}/catalog +- fi ++ SGML_CATALOG=${SGML_CATALOGS_DIR}/catalog + fi + echo "$SGML_CATALOG" + ;; +@@ -38,7 +35,7 @@ case "$1" in + style-sheet) + case $SGML_STYLESHEET in + default) +- echo "${SGML_BASE_DIR}/docbook/utils-@VERSION@/docbook-utils.dsl#${SGML_TYPE}" ++ echo "/usr/share/docbook-utils/docbook-utils.dsl#${SGML_TYPE}" + ;; + none) + find $SGML_BASE_DIR -name docbook.dsl | grep "$SGML_TYPE/docbook.dsl" | awk '{print $1}' +--- docbook-utils-0.6.14.orig/helpers/docbook2man-spec.pl ++++ docbook-utils-0.6.14/helpers/docbook2man-spec.pl +@@ -1199,8 +1199,8 @@ sgml('cdata', sub + $_[0] =~ s/\\/\\\\/g; + + # Escape dots and single quotes in column 1 +- $_[0] =~ s/^\./\\\&\./; +- $_[0] =~ s/^\'/\\\&\'/; ++ $_[0] =~ s/^[ \t]*\./\\\&\./; ++ $_[0] =~ s/^[ \t]*\'/\\\&\'/; + + # In non-'pre'-type elements: + if(!$nocollapse_whitespace) { +--- docbook-utils-0.6.14.orig/helpers/Makefile.in ++++ docbook-utils-0.6.14/helpers/Makefile.in +@@ -103,8 +103,8 @@ sbindir = @sbindir@ + sharedstatedir = @sharedstatedir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ +-sgmldudir = $(prefix)/share/sgml/docbook/utils-@VERSION@ +-sgmlduhedir = $(sgmldudir)/helpers ++sgmldudir = $(prefix)/share ++sgmlduhedir = $(sgmldudir)/perl5/sgmlspl-specs + sgmlduhe_DATA = docbook2man-spec.pl docbook2texi-spec.pl + EXTRA_DIST = $(sgmlduhe_DATA) + all: all-am +--- docbook-utils-0.6.14.orig/helpers/Makefile.am ++++ docbook-utils-0.6.14/helpers/Makefile.am +@@ -1,5 +1,5 @@ +-sgmldudir = $(prefix)/share/sgml/docbook/utils-@VERSION@ +-sgmlduhedir = $(sgmldudir)/helpers ++sgmldudir = $(prefix)/share ++sgmlduhedir = $(sgmldudir)/perl5/sgmlspl-specs + sgmlduhe_DATA = docbook2man-spec.pl docbook2texi-spec.pl + + EXTRA_DIST = $(sgmlduhe_DATA) +--- docbook-utils-0.6.14.orig/helpers/docbook2texi-spec.pl ++++ docbook-utils-0.6.14/helpers/docbook2texi-spec.pl +@@ -774,7 +774,7 @@ texi_sgml('', "\n\@page\n"); + ## Print the URL + sgml('', sub { + if($skip_inline++) { return; } # hopefully doesn't happen +- output '@uref{', output $_[0]->attribute('URL'), ', ' ++ output '@uref{', $_[0]->attribute('URL')->value, ', ' + }); + sgml('', sub { + output '}' unless --$skip_inline; +@@ -807,6 +807,7 @@ sgml('', sub { + sgml('|[lt ]|', "<"); + sgml('|[gt ]|', ">"); + sgml('|[amp ]|', "&"); ++sgml('|[ndash ]|', "-"); + + # + # Default handlers (uncomment these if needed). Right now, these are set diff --git a/gnu/packages/patches/docbook-utils-frontends.patch b/gnu/packages/patches/docbook-utils-frontends.patch new file mode 100644 index 0000000000..73fb2c06d0 --- /dev/null +++ b/gnu/packages/patches/docbook-utils-frontends.patch @@ -0,0 +1,42 @@ +Definition: docbook frontend runs sgmlnorm on xml input, + WARNING: I know very little about the docbook toolchain! Please + double-check and triple-check my suggestion. Works For Me (tm) + + + Running + + db2html foo.xml + + causes unnecessary long waits (up to 30 seconds or so) if the + input document is an XML document. + + I traced down the problem to the file + /usr/share/sgml/docbook/utils-0.6.13/frontend/docbook (which is + called from /usr/bin/jw). Apparently it runs 'sgmlnorm' even + over XML documents (which should be expected to be well-formed, no?). + This is because $SGML_NORM is set to either 'sgml' or 'xml' in + /usr/bin/jw in any case (and exported), so that the check in docbook + will always lead to sgmlnorm being used. + + To me it seems unnecessary to run sgmlnorm over XML input, but I + may well be wrong :) + + If there is something to it, please have a look at the attached + patch, which works fine for me and fixes those long waits for me. +Author: Tim-Philipp Müller +Forwarded: not-needed +Bug-Debian: http://bugs.debian.org/212088 + +Index: docbook-utils-0.6.14/frontends/docbook.in +=================================================================== +--- docbook-utils-0.6.14.orig/frontends/docbook.in 2012-05-09 19:15:17.396741140 +0200 ++++ docbook-utils-0.6.14/frontends/docbook.in 2012-05-09 19:15:34.988740507 +0200 +@@ -6,7 +6,7 @@ + # Give the location of the centralized catalog + # First try the one with a version matching the version that is indicated in the document + centralized-catalog) +- if [ -n "$SGML_NORM" ]; then ++ if [ -n "$SGML_NORM" ] && [ "$SGML_XML" = "sgml" ]; then + SGML_NORM_OPTS='-d' + else + SGML_NORM=cat diff --git a/gnu/packages/patches/docbook-utils-helpers-date.patch b/gnu/packages/patches/docbook-utils-helpers-date.patch new file mode 100644 index 0000000000..192233d41f --- /dev/null +++ b/gnu/packages/patches/docbook-utils-helpers-date.patch @@ -0,0 +1,61 @@ +Description: patch to get the from the sgml file + For the moment, docbook2man doesn't use the tag date in + to but `date "+%d %B %Y"`, and thus depend on the current locale. + + + + 06 September 2003 + + + + A patch against /usr/share/perl5/sgmlspl-specs/docbook2man-spec.pl + allows to use the date written in the source SGML file (which can be + localized) instead of the current date. + + However, if no correct date tag is present in the SGML file, the date + written in the manpage will depend on the current locale. +Author: Simon Paillard +Forwarded: not-needed +Bug-Debian: http://bugs.debian.org/214982 + +Index: docbook-utils-0.6.14/helpers/docbook2man-spec.pl +=================================================================== +--- docbook-utils-0.6.14.orig/helpers/docbook2man-spec.pl 2012-05-09 18:27:28.000000000 +0200 ++++ docbook-utils-0.6.14/helpers/docbook2man-spec.pl 2012-05-09 18:55:53.276783163 +0200 +@@ -278,8 +278,9 @@ + .\\" etc. to Steve Cheng . + _END_BANNER + +- my $manpage_date = `date "+%d %B %Y"`; +- ++ my $date = `date "+%d %B %Y"`; ++ my $manpage_date = $manpage_date || $date ; ++ + output '.TH "'; + + # If the title is not mixed-case, convention says to +@@ -292,7 +293,7 @@ + } + + output '" "', fold_string($manpage_sect), +- '" "', fold_string(`date "+%d %B %Y"`), ++ '" "', fold_string($manpage_date), + '" "', $manpage_misc, + '" "', $manpage_manual, + "\"\n"; +@@ -568,6 +569,15 @@ + sgml('', sub { $_[0]->parent->ext->{'attribution'} = pop_output(); }); + + ++sgml('', sub { ++ save_cdata(); ++}); ++sgml('', sub { ++ $manpage_date = fold_string(pop_output()); ++ $raw_cdata--; ++}); ++ ++ + # IGNORE. + sgml('', sub { push_output('nul'); }); + sgml('', sub { pop_output(); }); diff --git a/gnu/packages/patches/docbook-utils-helpers-name.patch b/gnu/packages/patches/docbook-utils-helpers-name.patch new file mode 100644 index 0000000000..d577fed748 --- /dev/null +++ b/gnu/packages/patches/docbook-utils-helpers-name.patch @@ -0,0 +1,34 @@ +Description: docbook2man should translate the NAME section according to the REFENTRY's lang attribute + Currently, docbook2man translates the NAME section according to the lang + attribute provided to the REFNAMEDIV tag. + When a lang attribute is specified in the REFENTRY tag and no lang + attribute is specified with the REFNAMEDIV, the lang attribute of the + REFENTRY should be used. +Author: Nicolas François +Forwarded: not-needed +Bug-Debian: http://bugs.debian.org/394511 + +Index: docbook-utils-0.6.14/helpers/docbook2man-spec.pl +=================================================================== +--- docbook-utils-0.6.14.orig/helpers/docbook2man-spec.pl 2012-05-09 18:55:53.276783163 +0200 ++++ docbook-utils-0.6.14/helpers/docbook2man-spec.pl 2012-05-09 18:58:04.792778418 +0200 +@@ -359,11 +359,14 @@ + # NAME section + man_sgml('', sub { + my %words = qw( fr NOM es NOMBRE de NAME ); +- if (defined($_[0]->attribute('LANG')->value)) { +- my $id = $_[0]->attribute('LANG')->value; +- my $ad = $words{$id}; +- output("\n.SH $ad\n");} +- else {output("\n.SH NAME\n");} ++ # Use the REFNAMEDIV's lang attribute, and default to the ++ # REFENTRY's lang attribute. ++ my $lang = $_[0]->attribute('LANG')->value; ++ $lang = $manpage_lang unless defined $lang; ++ if (defined($lang) and defined $words{lc($lang)}) { ++ my $ad = $words{lc($lang)}; ++ output("\n.SH $ad\n");} ++ else { output("\n.SH NAME\n");} + }); + + sgml('', \&save_cdata); diff --git a/gnu/packages/patches/docbook-utils-helpers-support.patch b/gnu/packages/patches/docbook-utils-helpers-support.patch new file mode 100644 index 0000000000..ee3510a1d0 --- /dev/null +++ b/gnu/packages/patches/docbook-utils-helpers-support.patch @@ -0,0 +1,29 @@ +Author: Reiner Herrmann +Description: Support SOURCE_DATE_EPOCH for timestamps + To allow generating documents in a reproducible way, + allow overriding the timestamp through the environment. + . + See also: https://reproducible-builds.org/specs/source-date-epoch/ +Bug-Debian: https://bugs.debian.org/800797 + +--- a/helpers/docbook2man-spec.pl ++++ b/helpers/docbook2man-spec.pl +@@ -57,6 +57,7 @@ + use SGMLS; # Use the SGMLS package. + use SGMLS::Output; # Use stack-based output. + use SGMLS::Refs; ++use POSIX qw(strftime setlocale LC_TIME); + + ######################################################################## + # SGMLSPL script produced automatically by the script sgmlspl.pl +@@ -279,6 +280,10 @@ + _END_BANNER + + my $date = `date "+%d %B %Y"`; ++ if ($ENV{SOURCE_DATE_EPOCH}) { ++ setlocale(LC_TIME, "C"); ++ $date = strftime("%d %B %Y", gmtime($ENV{SOURCE_DATE_EPOCH} || time)); ++ } + my $manpage_date = $manpage_date || $date ; + + output '.TH "'; diff --git a/gnu/packages/patches/docbook-utils-helpers-whitespace.patch b/gnu/packages/patches/docbook-utils-helpers-whitespace.patch new file mode 100644 index 0000000000..8b1bba3ff4 --- /dev/null +++ b/gnu/packages/patches/docbook-utils-helpers-whitespace.patch @@ -0,0 +1,30 @@ +Description: incorrectly strips whitespace (patch included) + In the previous upload, docbook2man was patched to escape the special + characters . and ' at the beginning of a line (see #399947). + Unfortunately that patch was incorrect -- as well as escaping the special + characters, it also removes all whitespace from the beginning of + affected lines. As a result, if you are in a block where whitespace + matters (such as ...) then the output is now incorrect. + + This is very easy to fix -- just match the whitespace and preserve it, + instead of tossing it away. The full patch (just two lines) is included + below. +Author: Ben Burton +Forwarded: not-needed +Bug-Debian: http://bugs.debian.org/528334 + +Index: docbook-utils-0.6.14/helpers/docbook2man-spec.pl +=================================================================== +--- docbook-utils-0.6.14.orig/helpers/docbook2man-spec.pl 2012-05-09 18:59:42.584774885 +0200 ++++ docbook-utils-0.6.14/helpers/docbook2man-spec.pl 2012-05-09 19:00:34.788773002 +0200 +@@ -1212,8 +1212,8 @@ + $_[0] =~ s/\\/\\\\/g; + + # Escape dots and single quotes in column 1 +- $_[0] =~ s/^[ \t]*\./\\\&\./; +- $_[0] =~ s/^[ \t]*\'/\\\&\'/; ++ $_[0] =~ s/^([ \t]*)\./$1\\\&\./; ++ $_[0] =~ s/^([ \t]*)\'/$1\\\&\'/; + + # In non-'pre'-type elements: + if(!$nocollapse_whitespace) { diff --git a/gnu/packages/patches/docbook-utils-jade.patch b/gnu/packages/patches/docbook-utils-jade.patch new file mode 100644 index 0000000000..e90989aca4 --- /dev/null +++ b/gnu/packages/patches/docbook-utils-jade.patch @@ -0,0 +1,211 @@ +Description: Change dependencies on jade and sp to openjade and opensp +Author: Neil Roeth +Last-Update: 2016-07-24 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/doc/HTML/Makefile.am ++++ b/doc/HTML/Makefile.am +@@ -1,4 +1,4 @@ +-htmldir = $(docdir)/html/docbook-utils-@VERSION@ ++htmldir = $(docdir)/html + html_DATA = api.html \ + backend-spec.html \ + docbook2man.html \ +@@ -25,6 +25,6 @@ + $(top_srcdir)/doc/refentry/sgmldiff.sgml + SGML_CATALOG_FILES=/etc/sgml/catalog \ + SGML_SEARCH_PATH=$(top_srcdir):$(top_srcdir)/doc:.. \ +- jade -t sgml -i html -d $(top_srcdir)/docbook-utils.dsl\#html \ ++ openjade -t sgml -i html -d $(top_srcdir)/docbook-utils.dsl\#html \ + -V '%use-id-as-filename%' $< + +--- a/doc/man/Makefile.am ++++ b/doc/man/Makefile.am +@@ -12,5 +12,5 @@ + $(top_srcdir)/helpers/docbook2man-spec.pl + SGML_CATALOG_FILES=/etc/sgml/catalog \ + SGML_SEARCH_PATH=$(top_srcdir)/doc:.. \ +- nsgmls $< | \ ++ onsgmls $< | \ + sgmlspl $(top_srcdir)/helpers/docbook2man-spec.pl +--- a/backends/man.in ++++ b/backends/man.in +@@ -7,8 +7,8 @@ + TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \ + { echo >&2 "man backend: could not create secure temporary directory"; exit 1;} + trap 'rm -rf "${TMPDIR}"' EXIT +-nsgmls $SGML_FILE > "${TMPDIR}/nsgmls.tmp" +-sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs" ++onsgmls $SGML_FILE > "${TMPDIR}/onsgmls.tmp" ++sgmlspl $HELPER <"${TMPDIR}/onsgmls.tmp" 2>"${TMPDIR}/errs" + if [ $? -ne 0 ] + then + cat "${TMPDIR}/errs" +@@ -18,7 +18,7 @@ + if grep unresolved "${TMPDIR}/errs" >/dev/null 2>&1 + then + echo "Resolving references.." +- sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" ++ sgmlspl $HELPER <"${TMPDIR}/onsgmls.tmp" + if [ $? -ne 0 ] + then exit 1 + fi +--- a/backends/texi.in ++++ b/backends/texi.in +@@ -3,7 +3,7 @@ + # This program is under GPL license. See LICENSE file for details. + + # Convert to texinfo +-nsgmls $SGML_FILE | sgmlspl docbook2texi-spec.pl >$SGML_FILE_NAME.texi ++onsgmls $SGML_FILE | sgmlspl docbook2texi-spec.pl >$SGML_FILE_NAME.texi + if [ $? -ne 0 ] + then exit 1 + fi +--- a/bin/sgmldiff.in ++++ b/bin/sgmldiff.in +@@ -22,13 +22,13 @@ + + use strict; + use integer; +-use vars qw($nsgmls $errors $errorlog $VERSION); ++use vars qw($onsgmls $errors $errorlog $VERSION); + use Getopt::Long 2.01; + + $VERSION = 1.03; + +-my $nsgmls; +-$nsgmls = "@jade_bindir@/nsgmls"; ++my $onsgmls; ++$onsgmls = "@jade_bindir@/onsgmls"; + + #---------------------------------------------------------------------- + # TODO: +@@ -37,7 +37,7 @@ + # - Wait for suggestions ;-) + # + # Note: the input file need not be valid, nor is it necessary to have +-# the DTDs. nsgmls always returns a structure. ++# the DTDs. onsgmls always returns a structure. + #---------------------------------------------------------------------- + + # Get file name +@@ -141,11 +141,11 @@ + unlink $diff2; + + #--------------------------------------------------------------------- +-# Process nsgmls output: keep all stuff that is important for the ++# Process onsgmls output: keep all stuff that is important for the + # structure comparison. Make two structures: one that is diffed + # (without text) (DIFF) and one that is used to present the + # differences to the user (@full). For more info: see SP +-# documentation, nsgmls output format. ++# documentation, onsgmls output format. + + sub prepare { + my($filename,$todiffname) = @_; +@@ -161,7 +161,7 @@ + my @line_numbered = (); + my $line = 0; + +- open(ESIS, "$nsgmls -l $errors $errorlog -onotation-sysid -oid -oempty $filename | "); #-oentity generates strange output; ? -ononsgml ++ open(ESIS, "$onsgmls -l $errors $errorlog -onotation-sysid -oid -oempty $filename | "); #-oentity generates strange output; ? -ononsgml + open(DIFF, "> $todiffname"); + while () { + chomp $_; +@@ -375,7 +375,7 @@ + }; + + #---------------------------------------------------------------------- +-# Normalise data text from nsgmls (i.e. don't print the escaped text). ++# Normalise data text from onsgmls (i.e. don't print the escaped text). + sub normalise_text { + my($string,$prefix) = @_; + my $result = "$prefix"; +--- a/configure.in ++++ b/configure.in +@@ -21,7 +21,7 @@ + + dnl Checks for programs. + jade_bindirs="/usr/bin /usr/local/bin" +-AC_FIND_PROGRAM(nsgmls, $jade_bindirs, jade_bindir) ++AC_FIND_PROGRAM(onsgmls, $jade_bindirs, jade_bindir) + AC_SUBST(jade_bindir) + + perl_bindirs="/usr/bin /usr/local/bin" +--- a/doc/refentry/docbook2man-spec.pl.sgml ++++ b/doc/refentry/docbook2man-spec.pl.sgml +@@ -19,7 +19,7 @@ + + + +-nsgmls ++onsgmls + sgml document + | sgmlspl + docbook2man-spec.pl +@@ -35,7 +35,7 @@ + + + +-The program reads ESIS produced by nsgmls (or other SGML parsers) from ++The program reads ESIS produced by onsgmls (or other SGML parsers) from + standard input. Markup not found in RefEntry is discarded. + + +--- a/doc/refentry/docbook2texi-spec.pl.sgml ++++ b/doc/refentry/docbook2texi-spec.pl.sgml +@@ -20,7 +20,7 @@ + + + +-nsgmls ++onsgmls + sgml document + | sgmlspl + docbook2texi-spec.pl +@@ -37,7 +37,7 @@ + + + +-The program reads ESIS produced by nsgmls (or other SGML parsers) from ++The program reads ESIS produced by onsgmls (or other SGML parsers) from + standard input. Currently the document element must be Book, + otherwise the results are undefined. + +--- a/doc/refentry/jw.sgml ++++ b/doc/refentry/jw.sgml +@@ -630,7 +630,7 @@ + 1, + install-catalog + 8, +- nsgmls ++ onsgmls + 1, docbook-utils + homepage. +--- a/doc/refentry/sgmldiff.sgml ++++ b/doc/refentry/sgmldiff.sgml +@@ -238,10 +238,10 @@ + + + +- nsgmls 1 ++ onsgmls 1 + + +- a base component of Jade DSSSL engine ++ a base component of OpenJade DSSSL engine + + + +--- a/helpers/docbook2man-spec.pl ++++ b/helpers/docbook2man-spec.pl +@@ -7,7 +7,7 @@ + The SGMLSpm package from CPAN. This contains the sgmlspl script which + is used to grok this file. Use it like this: + +-nsgmls some-docbook-document.sgml | sgmlspl docbook2man-spec.pl ++onsgmls some-docbook-document.sgml | sgmlspl docbook2man-spec.pl + + =head1 DESCRIPTION + diff --git a/gnu/packages/patches/docbook-utils-typo.patch b/gnu/packages/patches/docbook-utils-typo.patch new file mode 100644 index 0000000000..03c0a4abcf --- /dev/null +++ b/gnu/packages/patches/docbook-utils-typo.patch @@ -0,0 +1,100 @@ +Description: Fix some typos in man pages +Author: Mathieu Malaterre + +Index: docbook-utils-0.6.14/doc/man/docbook2man-spec.pl.1 +=================================================================== +--- docbook-utils-0.6.14.orig/doc/man/docbook2man-spec.pl.1 2012-05-09 18:39:17.932819095 +0200 ++++ docbook-utils-0.6.14/doc/man/docbook2man-spec.pl.1 2012-05-09 18:39:24.780818845 +0200 +@@ -17,7 +17,7 @@ + .SH "DESCRIPTION" + .PP + \fBdocbook2man\fR is a sgmlspl spec file that produced man +-pages (using the -man macros) from DocBook RefEntry markup. ++pages (using the \-man macros) from DocBook RefEntry markup. + .PP + The program reads ESIS produced by nsgmls (or other SGML parsers) from + standard input. Markup not found in RefEntry is discarded. +Index: docbook-utils-0.6.14/doc/man/frontend-spec.7 +=================================================================== +--- docbook-utils-0.6.14.orig/doc/man/frontend-spec.7 2012-05-09 18:41:45.172813778 +0200 ++++ docbook-utils-0.6.14/doc/man/frontend-spec.7 2012-05-09 18:42:03.176813129 +0200 +@@ -10,7 +10,7 @@ + .SH "DESCRIPTION" + .PP + \fBjw\fR(1) calls frontends like +-\fIfrontends/docbook\fR to get the informations ++\fIfrontends/docbook\fR to get the information + specific to a given input format. The frontend knows which information + to return from the first command line parameter. It gets all necessary + data via environment variables ready to use. +Index: docbook-utils-0.6.14/doc/man/jw.1 +=================================================================== +--- docbook-utils-0.6.14.orig/doc/man/jw.1 2012-05-09 18:39:35.612818456 +0200 ++++ docbook-utils-0.6.14/doc/man/jw.1 2012-05-09 18:40:51.736815708 +0200 +@@ -142,7 +142,7 @@ + The following options apply to the conversion script: + .TP + \fB -f \fIfrontend\fB | --frontend \fIfrontend\fB \fR +-Allows to specify another frontend than default \fIdocbook\fR\&. ++Allows one to specify another frontend than default \fIdocbook\fR\&. + The list of currently available frontends is: + .RS + .TP +@@ -156,13 +156,13 @@ + .RE + .TP + \fB -b \fIbackend\fB | --backend \fIbackend\fB \fR +-Allows to specify another backend than default ++Allows one to specify another backend than default + \fIHTML\fR\&. The list of currently available + backends is: + .RS + .TP + \fB\fIdvi\fB\fR +-Converts to DVI (DeVice Independant ++Converts to DVI (DeVice Independent + files) by calling \fBJade\fR or + \fBOpenJade\fR\&. + .TP +@@ -210,7 +210,7 @@ + .RE + .TP + \fB -c \fIfile\fB | --cat \fIfile\fB \fR +-Allows to use an extra SGML Open Catalog that will list ++Allows one to use an extra SGML Open Catalog that will list + other files like customization style sheets, adaptations to the + DocBook Document Type Definition, special character entities, + etc. This catalog is added to the list of catalogs determined +@@ -241,7 +241,7 @@ + are specified on the command line. + .TP + \fB -d \fIfile\fB|default|none | --dsl \fIfile\fB|default|none \fR +-Allows to use a customized style sheet instead ++Allows one to use a customized style sheet instead + of the default one. + + A "target" starting with a hash mark "#" can be appended +Index: docbook-utils-0.6.14/doc/man/sgmldiff.1 +=================================================================== +--- docbook-utils-0.6.14.orig/doc/man/sgmldiff.1 2012-05-09 18:41:13.316814927 +0200 ++++ docbook-utils-0.6.14/doc/man/sgmldiff.1 2012-05-09 18:41:38.032814038 +0200 +@@ -17,7 +17,7 @@ + + .SH "DESCRIPTION" + .PP +-This perl script allows to determine the structural differences ++This perl script allows one to determine the structural differences + between two SGML files. It compares the files, regardless of what + is in between the tags, to only focus on the markup. Its output + is similar to \fBdiff\fR(1)\&. +@@ -62,8 +62,8 @@ + Lines 5 to 7 of the first file have been changed + into lines 8 to 10 of the second line. + In addition to those summaries, the lines of the first file are +-shown preceeded by '<' and the lines of the second file are +-shown preceeded by '>". ++shown preceded by '<' and the lines of the second file are ++shown preceded by '>". + .SH "OPTIONS" + .PP + Here is the list of actions that can be requested to -- 2.27.0