recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tools / htop / recipe
blobb3dde9ac4de59544817e5bdb9453b82e19a5e6aa
1 # Build recipe for htop.
3 # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
4 # Copyright (c) 2018, 2020, 2021-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=htop
22 version=3.1.2
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=tools
28 tarname=${program}-${version}.tar.xz
30 # Remote source(s)
31 fetch="
32   https://github.com/htop-dev/htop/releases/download/${version}/$tarname
33   https://dl.bintray.com/htop/source/$tarname
36 description="
37 An interactive process viewer for Unix systems.
39 Comparison between htop and classic top
40 * In htop you can scroll the list vertically and horizontally
41   to see all processes and full command lines.
42 * In top you are subject to a delay for each unassigned
43   key you press (especially annoying when multi-key escape
44   sequences are triggered by accident).
45 * htop starts faster (top seems to collect data for a while
46   before displaying anything).
47 * In htop you don't need to type the process number to
48   kill a process, in top you do.
49 * In htop you don't need to type the process number or
50   the priority value to renice a process, in top you do.
51 * In htop you can kill multiple processes at once.
52 * top is older, hence, more tested.
55 homepage=https://hisham.hm/htop/
56 license=GPLv2+
58 # Source documentation
59 docs="AUTHORS COPYING ChangeLog README NEWS"
60 docsdir="${docdir}/${program}-${version}"
62 build()
64     unpack "${tardir}/$tarname"
65     
66     cd "$srcdir"
68     ./configure CPPFLAGS="$QICPPFLAGS" \
69     CFLAGS="$QICFLAGS -O3" LDFLAGS="$QILDFLAGS -static" \
70      $configure_args \
71      --libdir=/usr/lib${libSuffix} \
72      --mandir=$mandir \
73      --docdir=$docsdir \
74      --enable-unicode \
75      --with-sensors \
76      --build="$(gcc -dumpmachine)"
78     make -j${jobs} V=1
79     make -j${jobs} DESTDIR="$destdir" install
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"