1 # Build recipe for docbook-xsl.
3 # Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
20 program=docbook-xsl-nons
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.bz2
31 fetch=https://github.com/docbook/xslt10-stylesheets/releases/download/release/${version}/$tarname
34 The DocBook XSL Stylesheets.
36 The DocBook XSL Stylesheets package contains XSL stylesheets.
37 These are useful for performing transformations on XML DocBook files.
40 homepage=https://www.docbook.org
43 # Source documentation
44 docs="AUTHORS BUGS COPYING NEWS README RELEASE-NOTES.txt TODO VERSION"
45 docsdir="${docdir}/${pkgname}-${version}"
49 unpack "${tardir}/$tarname"
53 # Apply a patch from "Beyond Linux From Scratch"
54 patch -Np1 -i "${worktree}/patches/docbook-xsl/docbook-xsl-nons-1.79.2-stack_fix-1.patch"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
59 mkdir -p "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
60 cp -R VERSION assembly common eclipse epub epub3 extensions fo \
61 highlighting html htmlhelp images javahelp lib manpages params \
62 profiling roundtrip slides template tests tools webhelp website \
63 xhtml xhtml-1_1 xhtml5 \
64 "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
66 cd "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
67 ln -s VERSION VERSION.xsl
71 mkdir -p "${destdir}/$docsdir"
72 cp -p $docs "${destdir}/$docsdir"
74 # Create config directory
75 mkdir -p "${destdir}/etc/xml"
77 # Insert post-install script manually
79 mkdir -p "${destdir}/var/lib/qi"
80 cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
83 if test ! -e etc/xml/catalog
85 echo "Creating etc/xml/catalog (from docbook-xsl-${version}) ..."
86 xmlcatalog --noout --create etc/xml/catalog
89 echo "Adding XML (XSL) definitions to etc/xml/catalog ..."
90 xmlcatalog --noout --add "rewriteSystem" \\
91 "http://cdn.docbook.org/release/xsl-nons/${version}" \\
92 "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
95 xmlcatalog --noout --add "rewriteURI" \\
96 "http://cdn.docbook.org/release/xsl-nons/${version}" \\
97 "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
100 xmlcatalog --noout --add "rewriteSystem" \\
101 "http://cdn.docbook.org/release/xsl-nons/current" \\
102 "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
105 xmlcatalog --noout --add "rewriteURI" \\
106 "http://cdn.docbook.org/release/xsl-nons/current" \\
107 "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
111 xmlcatalog --noout --add "rewriteSystem" \\
112 "http://docbook.sourceforge.net/release/xsl/current" \\
113 "/usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
116 xmlcatalog --noout --add "rewriteURI" \\
117 "http://docbook.sourceforge.net/release/xsl/current" \\
118 "/usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\