stages: 2/04-iso: Do not include kernel build/source tree in the LiveCD
[dragora.git] / qi / doc / recipe3
blob62bfb509627b70a87208a810a21d621614a98726
1 # Build recipe for less.
3 # Copyright (c) 2016-2019, 2021 Matias Fonzo, <selk@dragora.org>.
4 # Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=less
22 version=608
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=tools
28 tarname=${program}-${version}.tar.gz
30 # Remote source(s)
31 fetch=https://ftp.gnu.org/gnu/less/$tarname
33 description="
34 A text file viewer.
36 Less is a pager.  A pager is a program that displays text files.
38 This package also includes the 'lesspipe.sh' script.
41 homepage=https://www.gnu.org/software/less
42 license=GPLv3+
44 # Source documentation
45 docs="COPYING LICENSE NEWS README"
46 docsdir="${docdir}/${program}-${version}"
48 build()
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     ./configure CPPFLAGS="$QICPPFLAGS" \
58     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
59      $configure_args \
60      --mandir=$mandir \
61      --with-regex=pcre2 \
62      --with-secure \
63      --build="$(gcc -dumpmachine)"
65     make -j${jobs} V=1
66     make -j${jobs} DESTDIR="$destdir" install
68     # Include our custom lesspipe.sh version (which has support for lzip)
70     cp -p "${worktree}/archive/less/usr/bin/lesspipe.sh" "${destdir}/usr/bin"
71     chmod 755 "${destdir}/usr/bin/lesspipe.sh"
73     # Include profile file
74     mkdir -p "${destdir}/etc/profile.d"
75     cat "${worktree}/archive/less/etc/profile.d/less.sh" \
76       > "${destdir}/etc/profile.d/less.sh"
78     # To handle config file(s)
79     touch "${destdir}/etc/profile.d/.graft-config"
81     # Compress and link man pages (if needed)
82     if test -d "${destdir}/$mandir"
83     then
84         (
85             cd "${destdir}/$mandir"
86             find . -type f -exec lzip -9 {} +
87             find . -type l | while read -r file
88             do
89                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
90                 rm -- "$file"
91             done
92         )
93     fi
95     # Copy documentation
96     mkdir -p "${destdir}/$docsdir"
97     cp -p $docs "${destdir}/$docsdir"