recipes: Replace 'outdir' with package hash tags
[dragora.git] / recipes / tools / man-db / recipe
blobfbde99f11183312384f0bca3387d22ff09a14f85
1 # Build recipe for man-db.
3 # Copyright (c) 2016-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=man-db
18 version=2.8.7
19 release=2
21 # Define hash tag to categorize the package name output
22 pkghashtag=tools
24 tarname=${program}-${version}.tar.xz
26 # Remote source(s)
27 fetch=http://download.savannah.gnu.org/releases/man-db/$tarname
29 description="
30 Programs for finding and viewing man pages.
32 The man-db package contains programs for finding and viewing manual pages.
35 homepage=http://man-db.nongnu.org
36 license=GPLv2+
38 # Source documentation
39 docs="ChangeLog FAQ NEWS README"
40 docsdir="${docdir}/${program}-${version}"
42 build()
44     set -e
46     unpack "${tardir}/$tarname"
48     cd "$srcdir"
50     # Apply a patch from "Adelie Linux" to fix iconv issues
51     patch -Np1 -i "${worktree}/patches/man-db/man-db-2.8.5-iconv.patch"
53     # Set sane permissions
54     chmod -R u+w,go-w,a+rX-s .
56     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
57      $configure_args \
58      --libdir=/usr/lib${libSuffix} \
59      --infodir=$infodir \
60      --mandir=$mandir \
61      --docdir=$docsdir \
62      --disable-setuid \
63      --disable-cache-owner \
64      --enable-static=yes \
65      --enable-shared=no \
66      --with-sections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o 1x 2x 3x 4x 5x 6x 7x 8x" \
67      --with-db=gdbm \
68      --with-systemdtmpfilesdir="" \
69      --build="$(cc -dumpmachine)"
71     make -j${jobs} V=1
72     make -j${jobs} DESTDIR="$destdir" install-strip
74     # Remove generated charset.alias
75     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
77     # Insert our man_db config
78     cp -p "${worktree}/archive/man-db/etc/man_db.conf" \
79           "${destdir}/etc/"
80     chmod 644 "${destdir}/etc/man_db.conf"
82     # To handle .new config file(s)
83     touch "${destdir}/etc/.graft-config"
85     # Include cron job
87     mkdir -p "${destdir}/etc/cron.daily/"
88     cp -p "${worktree}/archive/man-db/etc/cron.daily/man-db" \
89           "${destdir}/etc/cron.daily/"
90     chmod 0755 "${destdir}/etc/cron.daily/man-db"
92     # Compress info documents deleting index file for the package
93     if test -d "${destdir}/$infodir"
94     then
95         rm -f "${destdir}/${infodir}/dir"
96         lzip -9 "${destdir}/${infodir}"/*
97     fi
99     # Compress and link man pages (if needed)
100     if test -d "${destdir}/$mandir"
101     then
102         (
103             cd "${destdir}/$mandir"
104             find . -type f -exec lzip -9 '{}' +
105             find . -type l | while read -r file
106             do
107                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
108                 rm -- "$file"
109             done
110         )
111     fi
113     # Copy documentation
114     mkdir -p "${destdir}${docsdir}"
115     cp -p $docs "${destdir}${docsdir}"