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 program=docbook-xsl-nons
22 # Define a category for the output of the package name
25 tarname=${program}-${version}.tar.bz2
28 fetch=http://github.com/docbook/xslt10-stylesheets/releases/download/release/${version}/$tarname
31 The DocBook XSL Stylesheets.
33 The DocBook XSL Stylesheets package contains XSL stylesheets.
34 These are useful for performing transformations on XML DocBook files.
37 homepage=http://www.docbook.org
40 # Source documentation
41 docs="AUTHORS BUGS COPYING NEWS README RELEASE-NOTES.txt TODO VERSION"
42 docsdir="${docdir}/${pkgname}-${version}"
48 unpack "${tardir}/$tarname"
52 # Apply a patch from "Beyond Linux From Scratch"
53 patch -Np1 -i "${worktree}/patches/docbook-xsl/docbook-xsl-nons-1.79.2-stack_fix-1.patch"
55 # Set sane permissions
56 chmod -R u+w,go-w,a+rX-s .
58 mkdir -p "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
59 cp -R VERSION assembly common eclipse epub epub3 extensions fo \
60 highlighting html htmlhelp images javahelp lib manpages params \
61 profiling roundtrip slides template tests tools webhelp website \
62 xhtml xhtml-1_1 xhtml5 \
63 "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
65 cd "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
66 ln -s VERSION VERSION.xsl
70 mkdir -p "${destdir}${docsdir}"
71 cp -p $docs "${destdir}${docsdir}"/
73 # Create config directory
74 mkdir -p "${destdir}/etc/xml"
76 # Insert post-install script manually
78 mkdir -p "${destdir}/var/lib/qi"
79 cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
82 if test ! -e etc/xml/catalog
84 echo "Creating etc/xml/catalog (from docbook-xsl-${version}) ..."
85 xmlcatalog --noout --create etc/xml/catalog
88 echo "Adding XML (XSL) definitions to etc/xml/catalog ..."
89 xmlcatalog --noout --add "rewriteSystem" \\
90 "http://cdn.docbook.org/release/xsl-nons/${version}" \\
91 "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
94 xmlcatalog --noout --add "rewriteURI" \\
95 "http://cdn.docbook.org/release/xsl-nons/${version}" \\
96 "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
99 xmlcatalog --noout --add "rewriteSystem" \\
100 "http://cdn.docbook.org/release/xsl-nons/current" \\
101 "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
104 xmlcatalog --noout --add "rewriteURI" \\
105 "http://cdn.docbook.org/release/xsl-nons/current" \\
106 "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
110 xmlcatalog --noout --add "rewriteSystem" \\
111 "http://docbook.sourceforge.net/release/xsl/current" \\
112 "/usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
115 xmlcatalog --noout --add "rewriteURI" \\
116 "http://docbook.sourceforge.net/release/xsl/current" \\
117 "/usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\