recipes: tools/qi: bump to version 1.0-rc55
[dragora.git] / recipes / tools / less / recipe
blob043010bce13d555c7a5123534fb887d6a6f47f43
1 # Build recipe for less.
3 # Copyright (c) 2016-2018 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=less
18 version=530
19 release=1
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/tools"
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://ftp.gnu.org/gnu/less/$tarname
29 description="
30 A text file viewer.
32 Less is a pager.  A pager is a program that displays text files.
34 This package also includes the 'lesspipe.sh' script.
37 homepage=http://www.gnu.org/software/less
38 license=GPLv3+
40 # Source documentation
41 docs="COPYING LICENSE NEWS README"
42 docsdir="${docdir}/${program}-${version}"
44 build()
46     set -e
48     unpack "${tardir}/$tarname"
50     cd "$srcdir"
52     # Set sane permissions
53     chmod -R u+w,go-w,a+rX-s .
55     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
56      $configure_args \
57      --mandir=$mandir \
58      --with-regex=pcre \
59      --with-secure \
60      --build="$(cc -dumpmachine)"
62     make -j${jobs} V=1
63     make -j${jobs} DESTDIR="$destdir" install
65     # Include our custom lesspipe.sh version (which has support for lzip)
67     cp -p "${worktree}/archive/less/usr/bin/lesspipe.sh" "${destdir}/usr/bin"
68     chmod 755 "${destdir}/usr/bin/lesspipe.sh"
70     # Include profile file
71     mkdir -p "${destdir}/etc/profile.d"
72     cat "${worktree}/archive/less/etc/profile.d/less.sh" \
73       > "${destdir}/etc/profile.d/less.sh"
75     # To handle config file(s)
76     touch "${destdir}/etc/profile.d/.graft-config"
78     # Compress and link man pages (if needed)
79     if test -d "${destdir}/$mandir"
80     then
81         (
82             cd "${destdir}/$mandir"
83             find . -type f -exec lzip -9 '{}' +
84             find . -type l | while read -r file
85             do
86                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
87                 rm -- "$file"
88             done
89         )
90     fi
92     # Copy documentation
93     mkdir -p "${destdir}${docsdir}"
95     for file in $docs
96     do
97         cp -p $file "${destdir}${docsdir}"
98     done