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
24 pkgversion="$(echo $version | tr - .)"
26 # Define a category for the output of the package name
29 tarname=${program}-${version}.tar.gz
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
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}"
53 unpack "${tardir}/$tarname"
57 make -j${jobs} V=1 MACHINE=$arch LIBICONV=-lc \
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"
76 cd "${destdir}/$mandir"
77 find . -type f -exec lzip -9 {} +
78 find . -type l | while read -r file
80 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
87 mkdir -p "${destdir}/$docsdir"
88 cp -p $docs "${destdir}/$docsdir"