From b8a4be9e71e9a8768cfa344b64bae186690a5fb1 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 11 Jan 2019 21:03:45 +0000 Subject: user/docbook2x: new package --- user/docbook2x/APKBUILD | 48 +++++++++++++++++++ user/docbook2x/doc-typo.patch | 24 ++++++++++ user/docbook2x/manpage-comments.patch | 81 ++++++++++++++++++++++++++++++++ user/docbook2x/refentry-whitespace.patch | 34 ++++++++++++++ user/docbook2x/sourceforge-url.patch | 19 ++++++++ 5 files changed, 206 insertions(+) create mode 100644 user/docbook2x/APKBUILD create mode 100644 user/docbook2x/doc-typo.patch create mode 100644 user/docbook2x/manpage-comments.patch create mode 100644 user/docbook2x/refentry-whitespace.patch create mode 100644 user/docbook2x/sourceforge-url.patch (limited to 'user') diff --git a/user/docbook2x/APKBUILD b/user/docbook2x/APKBUILD new file mode 100644 index 000000000..edd43eb3c --- /dev/null +++ b/user/docbook2x/APKBUILD @@ -0,0 +1,48 @@ +# Contributor: A. Wilcox +# Maintainer: A. Wilcox +pkgname=docbook2x +pkgver=0.8.8 +pkgrel=0 +pkgdesc="Tool to convert DocBook XML to Unix man pages" +url="http://docbook2x.sourceforge.net/" +arch="all" +license="MIT" +depends="docbook-xml docbook-xsl libxml2-utils libxslt perl-xml-sax" +makedepends="$depends_dev" +subpackages="$pkgname-doc" +source="https://downloads.sourceforge.net/docbook2x/docbook2X-$pkgver.tar.gz + doc-typo.patch + manpage-comments.patch + refentry-whitespace.patch + sourceforge-url.patch + " +builddir="$srcdir/docbook2X-$pkgver" + +build() { + cd "$builddir" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --program-transform-name 's/docbook2/docbook2x-/' + make +} + +check() { + cd "$builddir"/test/refentry + make check +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install +} + +sha512sums="cc336017ad734fc62d96d289105e8ea154c418a03a37f3e21b0b3520063f8b466b4aae5a5aec2e0b83f6324c6c79b5557247a93338d0a9882a94a44112f6b65c docbook2X-0.8.8.tar.gz +a563b46e7eaa8052dc2daea6ad8b0f3b12780ef063fafd37a6345ae663f6229ccb0b52be5e7b1fd6584d31e56de89af391efb856bbabfed164353578b39fb458 doc-typo.patch +f204384bb206324d813b36e4e87e6a96f8b5808bfb3d7396505c84efc6784d4950a87533a3be1c67fce5f7b1d2f76eee8cf57f3ae48e3df43cf0cdc6531fbe14 manpage-comments.patch +10ce7f7da9bb2e05701a38d9e6900e87e62043604736eef5dbb52d8b143c8693463cffacf24453ec3d1e057b0b243d1c53952247f412e6f036c7067ad5840c1f refentry-whitespace.patch +c9dfbc19fc6bd11980c6da264e2683fd3c320f8c5d0d35f6c6d322cf3e7341d2d3fc88498e4a0213d4191f83c238abb0d824630be1360b3ec58e9887e8309aaa sourceforge-url.patch" diff --git a/user/docbook2x/doc-typo.patch b/user/docbook2x/doc-typo.patch new file mode 100644 index 000000000..5be21bdf9 --- /dev/null +++ b/user/docbook2x/doc-typo.patch @@ -0,0 +1,24 @@ +Author: Gianfranco Costamagna + +--- docbook2x-0.8.8.orig/doc/docbook2man.1 ++++ docbook2x-0.8.8/doc/docbook2man.1 +@@ -187,7 +187,7 @@ parameter instead. + + However, inside a custom stylesheet + (\fInot on the command-line\fR) +-this paramter can be set to the XPath expression ++this parameter can be set to the XPath expression + \*(T, + which will cause the custom translations + directly embedded inside the custom stylesheet to be read. +--- docbook2x-0.8.8.orig/doc/docbook2texi.1 ++++ docbook2x-0.8.8/doc/docbook2texi.1 +@@ -230,7 +230,7 @@ parameter instead. + + However, inside a custom stylesheet + (\fInot on the command-line\fR) +-this paramter can be set to the XPath expression ++this parameter can be set to the XPath expression + \*(T, + which will cause the custom translations + directly embedded inside the custom stylesheet to be read. diff --git a/user/docbook2x/manpage-comments.patch b/user/docbook2x/manpage-comments.patch new file mode 100644 index 000000000..c78a95c91 --- /dev/null +++ b/user/docbook2x/manpage-comments.patch @@ -0,0 +1,81 @@ +# Conventionally, preprocessor declarations should start with +# '\" +# rather than +# .\" +# Current man-db only supports the first (and recommended) syntax. + +diff -urNad trunk~/perl/db2x_manxml.pl trunk/perl/db2x_manxml.pl +--- trunk~/perl/db2x_manxml.pl 2006-04-22 17:21:32.000000000 +0200 ++++ trunk/perl/db2x_manxml.pl 2007-11-24 01:27:37.000000000 +0100 +@@ -342,6 +342,25 @@ + $self->{line_start} = 1; + } + ++# ++# Print a comment in the output, without causing a break. ++# Params: comment - the comment text. ++# May use any characters; they need not be escaped. ++# ++sub comment_nobreak ++{ ++ my ($self, $comment) = @_; ++ $self->write("\n") unless $self->{line_start}; ++ ++ foreach my $line (split(/\n/, $comment)) { ++ $self->write('\'\" '); ++ $self->write($line); ++ $self->write("\n"); ++ } ++ ++ $self->{line_start} = 1; ++} ++ + + # + # Use a roff "escape" i.e. commands embedded in text starting with \ +@@ -510,16 +529,20 @@ + + $self->{'adjust-stack'} = [ 'b' ]; + +- $self->{rw}->comment($elem->attr('preprocessors')) +- if($elem->attr('preprocessors') ne ''); +- ++ my $preprocessors = $elem->attr('preprocessors'); + # I've dug through the Internet to see if there was any + # standard way to specify encoding with man pages. + # The following seems to be a reasonable proposal: + # + my $encoding = $self->{options}->{'encoding'}; + $encoding =~ s#//TRANSLIT$##i; +- $self->{rw}->comment("-*- coding: $encoding -*-"); ++ $encoding = "-*- coding: $encoding -*-"; ++ if ($preprocessors eq '') { ++ $preprocessors = $encoding; ++ } else { ++ $preprocessors = "$preprocessors $encoding"; ++ } ++ $self->{rw}->comment_nobreak($preprocessors); + + # Define escapes for switching to and from monospace fonts (groff only) + $self->{rw}->request(qw{ .if \n(.g .ds T< \\\\FC}); +diff -urNad trunk~/xslt/backend/db2x_manxml.xsl trunk/xslt/backend/db2x_manxml.xsl +--- trunk~/xslt/backend/db2x_manxml.xsl 2006-04-23 16:44:52.000000000 +0200 ++++ trunk/xslt/backend/db2x_manxml.xsl 2007-11-24 01:27:37.000000000 +0100 +@@ -528,7 +528,7 @@ + +- .\" -*- coding: ++ '\" -*- coding: + + -*- + +@@ -538,7 +538,7 @@ + +- .\" -*- coding: ++ '\" -*- coding: + + -*- + diff --git a/user/docbook2x/refentry-whitespace.patch b/user/docbook2x/refentry-whitespace.patch new file mode 100644 index 000000000..d80ab18b0 --- /dev/null +++ b/user/docbook2x/refentry-whitespace.patch @@ -0,0 +1,34 @@ +# Peter Eisentraut reported a regression in the whitespace handling of +# refentrytitle content during filename creation: http://bugs.debian.org/420153 +# The problem is docbook2x replaces all spaces with underlines and then tries +# to normalize the result. A linebreak with additional whitespaces results in +# manpage names like 'foo_ ____bar.9'. + +diff -urNad docbook2x-0.8.8~/xslt/man/manpage.xsl docbook2x-0.8.8/xslt/man/manpage.xsl +--- docbook2x-0.8.8~/xslt/man/manpage.xsl 2006-04-20 15:45:55.000000000 +0200 ++++ docbook2x-0.8.8/xslt/man/manpage.xsl 2007-04-20 16:19:28.000000000 +0200 +@@ -30,7 +30,7 @@ + + + +- ++ + + + +diff -urNad docbook2x-0.8.8~/xslt/man/refentry.xsl docbook2x-0.8.8/xslt/man/refentry.xsl +--- docbook2x-0.8.8~/xslt/man/refentry.xsl 2006-04-21 04:39:55.000000000 +0200 ++++ docbook2x-0.8.8/xslt/man/refentry.xsl 2007-04-20 16:21:53.000000000 +0200 +@@ -38,7 +38,11 @@ + + + +- ++ ++ ++ ++ ++ + +