1 # Build recipe for sgml-common.
3 # Copyright (c) 2019, 2021 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
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tgz
31 fetch=https://sourceware.org/ftp/docbook-tools/new-trials/SOURCES/$tarname
34 The SGML common package contains install-catalog.
36 This is useful for creating and maintaining centralized SGML catalogs.
39 homepage=https://www.docbook.org/xml/
42 # Source documentation
43 docs="AUTHORS COPYING ChangeLog NEWS README"
44 docsdir="${docdir}/${program}-${version}"
48 unpack "${tardir}/$tarname"
52 # Apply patches and updates from Fedora
53 patch -Np1 -i "${worktree}/patches/sgml-common/sgml-common-quotes.patch"
54 patch -Np1 -i "${worktree}/patches/sgml-common/sgml-common-umask.patch"
55 patch -Np1 -i "${worktree}/patches/sgml-common/sgml-common-xmldir.patch"
57 # Apply patch from Beyond Linux From Scratch
58 patch -Np1 -i "${worktree}/patches/sgml-common/sgml-common-0.6.3-manpage-1.patch"
60 # Replace bogus links with files (Adapted from "Fedora")
61 automakedir="$(ls -1 -d /usr/share/automake-* | head -n 1)"
62 for file in COPYING INSTALL install-sh missing mkinstalldirs
65 cp -L -p "${automakedir}"/$file .
67 unset -v automakedir file
71 # Set sane permissions
72 chmod -R u+w,go-w,a+rX-s .
74 ./configure $configure_args \
75 --libdir=/usr/lib${libSuffix} \
79 --build="$(gcc -dumpmachine)"
81 make -j${jobs} V=1 docdir=$docsdir
82 make -j${jobs} docdir=$docsdir DESTDIR="$destdir" install
84 touch "${destdir}/etc/sgml/.graft-config"
86 mkdir -p "${destdir}/usr/share/sgml/sgml-iso-entities-8879.1986"
88 # Compress and link man pages (if needed)
89 if test -d "${destdir}/$mandir"
92 cd "${destdir}/$mandir"
93 find . -type f -exec lzip -9 {} +
94 find . -type l | while read -r file
96 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
103 mkdir -p "${destdir}/$docsdir"
104 cp -p $docs "${destdir}/$docsdir"