diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-06-25 06:09:52 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-06-25 06:09:52 -0500 |
commit | 9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538 (patch) | |
tree | 713006b36e1b03f3b4ea559b59808f0f3f20f001 | |
parent | 41248e0f93acf525137df8b42c0e00a5e4a5c773 (diff) | |
download | packages-9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538.tar.gz packages-9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538.tar.bz2 packages-9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538.tar.xz packages-9ba7cee8a94a9ef8d1e87949bfdbdc4458d6b538.zip |
system/docbook-xsl: pull in for xmlto
-rw-r--r-- | system/docbook-xsl/765567_non-recursive_string_subst.patch | 30 | ||||
-rw-r--r-- | system/docbook-xsl/APKBUILD | 44 | ||||
-rw-r--r-- | system/docbook-xsl/docbook-xsl.install | 47 | ||||
-rw-r--r-- | system/docbook-xsl/docbook-xsl.post-deinstall | 10 | ||||
-rw-r--r-- | system/docbook-xsl/docbook-xsl.post-install | 29 | ||||
-rw-r--r-- | system/docbook-xsl/docbook-xsl.post-upgrade | 33 |
6 files changed, 193 insertions, 0 deletions
diff --git a/system/docbook-xsl/765567_non-recursive_string_subst.patch b/system/docbook-xsl/765567_non-recursive_string_subst.patch new file mode 100644 index 000000000..99ce9960d --- /dev/null +++ b/system/docbook-xsl/765567_non-recursive_string_subst.patch @@ -0,0 +1,30 @@ +Description: use EXSLT "replace" function when available + A recursive implementation of string.subst is problematic, + long strings with many matches will cause stack overflows. +Author: Peter De Wachter <pdewacht@gmail.com> +Bug-Debian: https://bugs.debian.org/750593 + +--- a/lib/lib.xsl ++++ b/lib/lib.xsl +@@ -10,7 +10,10 @@ + This module implements DTD-independent functions + + ******************************************************************** --> +-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> ++<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ++ xmlns:str="http://exslt.org/strings" ++ exclude-result-prefixes="str" ++ version="1.0"> + + <xsl:template name="dot.count"> + <!-- Returns the number of "." characters in a string --> +@@ -56,6 +59,9 @@ + <xsl:param name="replacement"/> + + <xsl:choose> ++ <xsl:when test="function-available('str:replace')"> ++ <xsl:value-of select="str:replace($string, string($target), string($replacement))"/> ++ </xsl:when> + <xsl:when test="contains($string, $target)"> + <xsl:variable name="rest"> + <xsl:call-template name="string.subst"> diff --git a/system/docbook-xsl/APKBUILD b/system/docbook-xsl/APKBUILD new file mode 100644 index 000000000..0482a76ef --- /dev/null +++ b/system/docbook-xsl/APKBUILD @@ -0,0 +1,44 @@ +# Contributor: Natanael Copa <ncopa@alpinelinux.org> +# Maintainer: A. Wilcox <awilfox@adelielinux.org> +pkgname=docbook-xsl +pkgver=1.79.1 +pkgrel=2 +pkgdesc="XML stylesheets for Docbook-xml transformations." +url="http://docbook.sourceforge.net/" +arch="noarch" +options="!check" # Just XML files +license="MIT" +depends="libxml2-utils libxslt docbook-xml" +makedepends="" +install="$pkgname.post-install $pkgname.post-upgrade $pkgname.post-deinstall" +source="http://downloads.sourceforge.net/sourceforge/docbook/$pkgname-$pkgver.tar.bz2 + 765567_non-recursive_string_subst.patch + " + +package() { + cd "$builddir" + local _dest dir f + _dest="$pkgdir"/usr/share/xml/docbook/xsl-stylesheets-$pkgver + + install -dm755 "$_dest" + install -m644 VERSION VERSION.xsl "$_dest"/ + + for dir in assembly common eclipse epub epub3 fo highlighting html \ + htmlhelp javahelp lib manpages params profiling roundtrip \ + template website xhtml xhtml-1_1 xhtml5; do + + install -dm755 $_dest/$dir + for f in $dir/*.xml $dir/*.xsl $dir/*.dtd $dir/*.ent; do + [ -e "$f" ] || continue + install -m644 $f $_dest/$dir + done + done + + install -dm755 "$pkgdir"/etc/xml + + install -m644 -D COPYING \ + "$pkgdir"/usr/share/licenses/$pkgname/COPYING +} + +sha512sums="83325cbaf1545da6b9b8b77f5f0e6fdece26e3c455164b300a1aa3d19e3bd29ae71fd563553a714a5394968d1a65684c6c7987c77524469358d18b8c227025c7 docbook-xsl-1.79.1.tar.bz2 +6a26838078a3ce28273dddfa1af6a378cffc28b6d1ba48a4cfc839addd7bf58ce217d6584b735f9c75381954744ab2386c75fa3c593858b6e27882be55c00d04 765567_non-recursive_string_subst.patch" diff --git a/system/docbook-xsl/docbook-xsl.install b/system/docbook-xsl/docbook-xsl.install new file mode 100644 index 000000000..a8ea3e72b --- /dev/null +++ b/system/docbook-xsl/docbook-xsl.install @@ -0,0 +1,47 @@ +post_install() { + if [ ! -f /etc/xml/catalog ]; then + xmlcatalog --noout --create /etc/xml/catalog + fi + _NEW=`echo $1 | sed 's|\(.*\)\-.*|\1|'` + + xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/${_NEW}" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog + + xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/${_NEW}" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog && + + xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog && + + xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog +} + +post_upgrade() { + post_remove $2 + post_install $1 +} + +post_remove() { + _OLD=`echo $1 | sed 's|\(.*\)\-.*|\1|'` + xmlcatalog --noout --del "/usr/share/xml/docbook/xsl-stylesheets-${_OLD}" etc/xml/catalog + + if [ $(vercmp $1 1.72.0-3) -lt 0 ]; then + xmlcatalog --noout --del "/usr/share/xml/docbook" etc/xml/catalog + xmlcatalog --noout --del "file:///etc/xml/docbook" etc/xml/catalog + fi +} + +op=$1 +shift + +$op $* + diff --git a/system/docbook-xsl/docbook-xsl.post-deinstall b/system/docbook-xsl/docbook-xsl.post-deinstall new file mode 100644 index 000000000..3faecd5a3 --- /dev/null +++ b/system/docbook-xsl/docbook-xsl.post-deinstall @@ -0,0 +1,10 @@ +#!/bin/sh + +_OLD=${1%-r[0-9]*} + +if command -v xmlcatalog > /dev/null; then + xmlcatalog --noout --del \ + "/usr/share/xml/docbook/xsl-stylesheets-${_OLD}" \ + etc/xml/catalog +fi + diff --git a/system/docbook-xsl/docbook-xsl.post-install b/system/docbook-xsl/docbook-xsl.post-install new file mode 100644 index 000000000..6afae6abe --- /dev/null +++ b/system/docbook-xsl/docbook-xsl.post-install @@ -0,0 +1,29 @@ +#!/bin/sh + +if [ ! -f /etc/xml/catalog ]; then + xmlcatalog --noout --create /etc/xml/catalog +fi + + +_NEW=${1%-r[0-9]*} + +xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/${_NEW}" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog + +xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/${_NEW}" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog && + +xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog && + +xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog + diff --git a/system/docbook-xsl/docbook-xsl.post-upgrade b/system/docbook-xsl/docbook-xsl.post-upgrade new file mode 100644 index 000000000..d481480fc --- /dev/null +++ b/system/docbook-xsl/docbook-xsl.post-upgrade @@ -0,0 +1,33 @@ +#!/bin/sh + +if [ ! -f /etc/xml/catalog ]; then + xmlcatalog --noout --create /etc/xml/catalog +fi + +_NEW=${1%-r[0-9]*} +_OLD=${2%-r[0-9]*} + +xmlcatalog --noout --del \ + "/usr/share/xml/docbook/xsl-stylesheets-${_OLD}" \ + etc/xml/catalog + +xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/${_NEW}" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog + +xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/${_NEW}" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog + +xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog + +xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-${_NEW}" \ + etc/xml/catalog + |