recipe 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Build recipe for lm-sensors.
  2. #
  3. # Copyright (c) 2018, 2019, 2021 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. # Exit immediately on any error
  17. set -e
  18. program=lm-sensors
  19. version=3-6-0
  20. release=1
  21. pkgversion="$(echo $version | tr - .)"
  22. # Define a category for the output of the package name
  23. pkgcategory=tools
  24. tarname=${program}-${version}.tar.gz
  25. # Remote source(s)
  26. fetch=https://github.com/lm-sensors/lm-sensors/archive/V${version}/$tarname
  27. #fetch=https://ftp.gwdg.de/pub/linux/misc/lm-sensors/$tarname
  28. description="
  29. Hardware monitoring support.
  30. The lm-sensors package provides support for the hardware monitoring
  31. drivers in the Linux Kernel. This is useful for monitoring the
  32. temperature of the CPU and adjusting the performance of some hardware
  33. (such as cooling fans).
  34. "
  35. homepage=https://hwmon.wiki.kernel.org/lm_sensors
  36. license="GPLv2+, LGPLv2.1"
  37. # Source documentation
  38. docs="CHANGES CONTRIBUTORS COPYING* README doc/fancontrol.txt"
  39. docsdir="${docdir}/${program}-${pkgversion}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd $srcdir
  44. make -j${jobs} V=1 MACHINE=$arch LIBICONV=-lc \
  45. BUILD_STATIC_LIB=0 \
  46. PREFIX=/usr LIBDIR=/usr/lib${libSuffix} MANDIR=$mandir \
  47. DESTDIR="$destdir" install
  48. # Strip remaining binaries and libraries
  49. find "$destdir" -type f | xargs file | \
  50. awk '/ELF/ && /executable/ || /shared object/' | \
  51. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  52. #strip --strip-debug "${destdir}/usr/lib${libSuffix}"/*.a
  53. # To manage (dot) new config via graft(1)
  54. touch "${destdir}/etc/.graft-config"
  55. # Compress and link man pages (if needed)
  56. if test -d "${destdir}/$mandir"
  57. then
  58. (
  59. cd "${destdir}/$mandir"
  60. find . -type f -exec lzip -9 {} +
  61. find . -type l | while read -r file
  62. do
  63. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  64. rm -- "$file"
  65. done
  66. )
  67. fi
  68. # Copy documentation
  69. mkdir -p "${destdir}/$docsdir"
  70. cp -p $docs "${destdir}/$docsdir"
  71. }