recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tools / lm-sensors / recipe
blob3382d24eedd9a9de4857c3871b68371022a130c2
1 # Build recipe for lm-sensors.
3 # Copyright (c) 2018, 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
18 set -e
20 program=lm-sensors
21 version=3-6-0
22 release=1
24 pkgversion="$(echo $version | tr - .)"
26 # Define a category for the output of the package name
27 pkgcategory=tools
29 tarname=${program}-${version}.tar.gz
31 # Remote source(s)
32 fetch=https://github.com/lm-sensors/lm-sensors/archive/V${version}/$tarname
33 #fetch=https://ftp.gwdg.de/pub/linux/misc/lm-sensors/$tarname
35 description="
36 Hardware monitoring support.
38 The lm-sensors package provides support for the hardware monitoring
39 drivers in the Linux Kernel.  This is useful for monitoring the
40 temperature of the CPU and adjusting the performance of some hardware
41 (such as cooling fans).
44 homepage=https://hwmon.wiki.kernel.org/lm_sensors
45 license="GPLv2+, LGPLv2.1"
47 # Source documentation
48 docs="CHANGES CONTRIBUTORS COPYING* README doc/fancontrol.txt"
49 docsdir="${docdir}/${program}-${pkgversion}"
51 build()
53     unpack "${tardir}/$tarname"
55     cd $srcdir
57     make -j${jobs} V=1 MACHINE=$arch LIBICONV=-lc \
58      BUILD_STATIC_LIB=0 \
59      PREFIX=/usr LIBDIR=/usr/lib${libSuffix} MANDIR=$mandir \
60      DESTDIR="$destdir" install
62     # Strip remaining binaries and libraries
63     find "$destdir" -type f | xargs file | \
64      awk '/ELF/ && /executable/ || /shared object/' | \
65       cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
67     #strip --strip-debug "${destdir}/usr/lib${libSuffix}"/*.a
69     # To manage (dot) new config via graft(1)
70     touch "${destdir}/etc/.graft-config"
72     # Compress and link man pages (if needed)
73     if test -d "${destdir}/$mandir"
74     then
75         (
76             cd "${destdir}/$mandir"
77             find . -type f -exec lzip -9 {} +
78             find . -type l | while read -r file
79             do
80                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
81                 rm -- "$file"
82             done
83         )
84     fi
86     # Copy documentation
87     mkdir -p "${destdir}/$docsdir"
88     cp -p $docs "${destdir}/$docsdir"