recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / docbook / docbook-xsl / recipe
blob240b99a3a0237dddc3288cbe3ac011ae58fb3e2b
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
18 pkgname=docbook-xsl
19 version=1.79.2
20 release=1
22 # Define a category for the output of the package name
23 pkgcategory=docbook
25 tarname=${program}-${version}.tar.bz2
27 # Remote source(s)
28 fetch=http://github.com/docbook/xslt10-stylesheets/releases/download/release/${version}/$tarname
30 description="
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
38 license=Custom
40 # Source documentation
41 docs="AUTHORS BUGS COPYING NEWS README RELEASE-NOTES.txt TODO VERSION"
42 docsdir="${docdir}/${pkgname}-${version}"
44 build()
46     set -e
48     unpack "${tardir}/$tarname"
50     cd "$srcdir"
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}"
64     (
65         cd "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
66         ln -s VERSION VERSION.xsl
67     )
69     # Copy documentation
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"
81 # XML catalog
82 if test ! -e etc/xml/catalog
83 then
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}" \\
92  etc/xml/catalog
94 xmlcatalog --noout --add "rewriteURI" \\
95  "http://cdn.docbook.org/release/xsl-nons/${version}" \\
96  "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
97  etc/xml/catalog
99 xmlcatalog --noout --add "rewriteSystem" \\
100  "http://cdn.docbook.org/release/xsl-nons/current" \\
101  "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
102  etc/xml/catalog
104 xmlcatalog --noout --add "rewriteURI" \\
105  "http://cdn.docbook.org/release/xsl-nons/current" \\
106  "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
107  etc/xml/catalog
109 # Sourceforge URIs
110 xmlcatalog --noout --add "rewriteSystem" \\
111  "http://docbook.sourceforge.net/release/xsl/current" \\
112  "/usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
113  etc/xml/catalog
115 xmlcatalog --noout --add "rewriteURI" \\
116  "http://docbook.sourceforge.net/release/xsl/current" \\
117  "/usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
118  etc/xml/catalog